Skip to content

feat: add typed API modules for all backend domains#27

Merged
helseaCat merged 1 commit into
mainfrom
feat/frontend-api-modules
May 29, 2026
Merged

feat: add typed API modules for all backend domains#27
helseaCat merged 1 commit into
mainfrom
feat/frontend-api-modules

Conversation

@helseaCat
Copy link
Copy Markdown
Owner

@helseaCat helseaCat commented May 28, 2026

Description

Add typed API modules for all four backend domains — contracts, expectations, tasks, and payloads/deviations.

Changes

  • src/api/contracts.ts — list, getById, create, update, publish, listPublished
  • src/api/expectations.ts — list, listByContract, getById, create, update, activate, deactivate
  • src/api/tasks.ts — list (with status filter), getById, create, transitionStatus
  • src/api/payloads.ts — list by contract, getById, submit, getDeviations, listDeviationsByContract

Testing done

  • npx tsc --noEmit passes
  • All API functions are fully typed with request/response generics

Checklist

  • No new warnings
  • Self-reviewed

Summary by CodeRabbit

  • New Features
    • Integrated backend API support for contracts, expectations, payloads, and task management
    • Enables full lifecycle operations including creation, updates, publishing, and retrieval
    • Supports activation/deactivation controls, status transitions, and deviation tracking across all modules

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5524fb4a-3f02-438a-8c14-b85ba019a1cb

📥 Commits

Reviewing files that changed from the base of the PR and between c092801 and 1c273b3.

📒 Files selected for processing (4)
  • nexus-frontend/src/api/contracts.ts
  • nexus-frontend/src/api/expectations.ts
  • nexus-frontend/src/api/payloads.ts
  • nexus-frontend/src/api/tasks.ts

📝 Walkthrough

Walkthrough

Introduces four independent frontend API wrapper modules for contracts, expectations, payloads, and tasks. Each module exports a typed object with methods that wrap apiClient calls to REST endpoints and return parsed response data, following consistent patterns across all domains.

Changes

Frontend API Wrappers

Layer / File(s) Summary
Contracts and Expectations API wrappers
nexus-frontend/src/api/contracts.ts, nexus-frontend/src/api/expectations.ts
contractsApi provides CRUD operations plus publish for contracts. expectationsApi provides CRUD, listByContract, and activate/deactivate for expectation state transitions, all calling typed REST endpoints.
Payloads and Tasks API wrappers
nexus-frontend/src/api/payloads.ts, nexus-frontend/src/api/tasks.ts
payloadsApi wraps list, get, and submit operations for payloads and their deviations. tasksApi defines TaskListParams with optional status filtering and provides list, get, create, and transitionStatus methods for tasks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • helseaCat/Project-Nexus#25: Introduces domain and request/response TypeScript types that these new API wrapper methods consume and reference.
  • helseaCat/Project-Nexus#26: Implements the shared apiClient foundation that all these new API wrappers call and depend upon.

Poem

🐰 Four APIs hopping in to play,
Contracts and tasks are here to stay,
Each wrapper method calls the REST,
Type-safe queries—the very best!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding multiple typed API wrapper modules for different backend domains (contracts, expectations, tasks, payloads).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/frontend-api-modules

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@helseaCat helseaCat merged commit accc518 into main May 29, 2026
1 check passed
@helseaCat helseaCat deleted the feat/frontend-api-modules branch May 29, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant