You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No actionable comments were generated in the recent review.
Walkthrough
The change adds contract storage, validation, and IPC operations. It replaces static contract screens with data-backed list and detail pages, including create, edit, and delete flows. The detail page shows a contract summary and related-record tabs.
Changes: Contract management
Layer / File(s)
Summary
Contract data and validation apps/desktop/drizzle/*, apps/desktop/src/main/core/database/schema/*, apps/desktop/src/shared/*
Adds the contracts table, migration metadata, shared contract types, status and date helpers, money parsing, and form and input validation schemas.
Contract operations and IPC apps/desktop/src/main/modules/contracts/*, apps/desktop/src/main/modules/index.ts, apps/desktop/src/preload/*
Adds queries and create, update, and delete operations. IPC handlers validate requests, and the preload exposes contract operations through electronApi.
Contract list and editing apps/desktop/src/renderer/src/routes/dashboard/$organizationId/contracts/index.tsx, apps/desktop/src/renderer/src/routes/dashboard/$organizationId/contracts/-components/*, apps/desktop/src/renderer/src/routes/dashboard/$organizationId/index.tsx
Adds a searchable, filterable, paginated contracts table with create/edit and delete flows. The “New contract” link now opens the drawer through a search parameter.
Contract detail and route consolidation apps/desktop/src/renderer/src/routes/dashboard/$organizationId/contracts/$contractId/*, apps/desktop/src/renderer/src/routeTree.gen.ts, apps/desktop/src/renderer/src/routes/dashboard/$organizationId/contracts/new.tsx
Adds a data-backed contract detail page with summary, related-record tabs, and editing. Removes the former detail child routes and dedicated new-contract route.
sequenceDiagram
participant ContractDrawer
participant ContractsPage
participant contractsApi
participant contracts.ipc
participant createContract
participant updateContract
participant Database
ContractDrawer->>ContractsPage: Submit form through onSave
ContractsPage->>contractsApi: Call create or update
contractsApi->>contracts.ipc: Invoke matching IPC channel
contracts.ipc->>createContract: Validate and create
contracts.ipc->>updateContract: Validate and update
createContract->>Database: Insert in immediate transaction
updateContract->>Database: Update in immediate transaction
contracts.ipc-->>contractsApi: Return save result
contractsApi-->>ContractsPage: Return save result
ContractsPage-->>ContractDrawer: Return save result
Loading
Merge Risk: Minimal · up to fa33a
This change adds contract storage and IPC operations, plus list, create, edit, delete, and detail views. No concrete merge-blocking defects were identified in the reviewed code.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "feat: add contracts database schema" matches the main change. The PR adds the contracts table, its SQLite schema, Drizzle migration 0001_add_contracts, and its indexes. The title omits the …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "feat: add contracts database schema" matches the main change. The PR adds the contracts table, its SQLite schema, Drizzle migration 0001_add_contracts, and its indexes. The title omits the wider contract-management work (IPC handlers, renderer screens, and shared schemas). That work is secondary to the schema change for this title, so the title is accurate and specific.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit