PM-4669 payment cycles#20
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for assignment payment cadence and daily standard hours, updating service logic, DTOs, Prisma schema/migrations, and generated Prisma client artifacts.
Changes:
- Introduced
PaymentCycleenum and addedpaymentCycle+standardHoursPerDayto engagement assignments (schema, migration, generated client). - Updated engagement/application services and DTOs to accept/emit the new fields and compute weekly agreement rates from daily hours.
- Updated email payloads and unit tests to reflect the new fields.
Reviewed changes
Copilot reviewed 21 out of 31 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/integrations/assignment-offer-email.service.ts | Adds paymentCycle/standardHoursPerDay to email payload and derives weekly hours from daily hours. |
| src/integrations/assignment-offer-email.service.spec.ts | Updates email service tests for paymentCycle and standardHoursPerDay. |
| src/engagements/engagements.service.ts | Persists/returns new assignment fields and recalculates agreement rate using daily hours. |
| src/engagements/engagements.service.spec.ts | Updates engagement service tests for daily-hours inputs and agreement-rate calculation. |
| src/engagements/dto/create-engagement.dto.ts | Adds request DTO fields/validation/docs for paymentCycle and standardHoursPerDay. |
| src/engagements/dto/create-engagement.dto.spec.ts | Adds DTO validation tests for paymentCycle and decimal precision on standardHoursPerDay. |
| src/engagements/dto/assignment-response.dto.ts | Adds response DTO fields for paymentCycle and standardHoursPerDay. |
| src/engagements/dto/assignment-context-response.dto.ts | Adds context response DTO fields for paymentCycle and standardHoursPerDay. |
| src/applications/dto/approve-application.dto.ts | Adds approval DTO fields/validation/docs for paymentCycle and standardHoursPerDay. |
| src/applications/applications.service.ts | Normalizes/persists new assignment fields and updates agreement rate calculation for daily hours. |
| src/applications/applications.service.spec.ts | Updates tests for daily-hours agreement rate and adds coverage for updating paymentCycle. |
| prisma/schema.prisma | Adds PaymentCycle enum and new assignment fields with defaults + deprecates weekly-hours field. |
| prisma/migrations/20260518143000_add_payment_cycle_and_standard_hours_per_day/migration.sql | Creates enum type, new columns, and backfills standardHoursPerDay from legacy weekly field. |
| packages/engagements-prisma-client/wasm.js | Removes generated WASM client artifact. |
| packages/engagements-prisma-client/wasm.d.ts | Removes generated WASM typings entrypoint. |
| packages/engagements-prisma-client/runtime/library.d.ts | Removes generated runtime typings file. |
| packages/engagements-prisma-client/query_engine_bg.js | Removes generated WASM query engine JS glue. |
| packages/engagements-prisma-client/schema.prisma | Mirrors schema changes in packaged prisma schema. |
| packages/engagements-prisma-client/package.json | Updates generated client package name hash. |
| packages/engagements-prisma-client/index.js | Updates generated client exports/runtime model for new enum/fields. |
| packages/engagements-prisma-client/index.d.ts | Updates generated client typings for new enum/fields. |
| packages/engagements-prisma-client/index-browser.js | Updates browser bundle exports for new enum/fields. |
| packages/engagements-prisma-client/edge.js | Updates edge bundle exports/runtime model for new enum/fields. |
| .circleci/config.yml | Updates workflow branch filters to include feature branch. |
Comments suppressed due to low confidence (1)
src/integrations/assignment-offer-email.service.ts:1
- The conversion factor
* 5(workdays per week) is a business rule that’s now duplicated (also in services calculating agreement rates). Consider centralizing it (e.g., a shared constant likeWORK_DAYS_PER_WEEK) to avoid future drift if the rule changes or becomes configurable.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kkartunov
approved these changes
May 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces support for payment cycles and standard hours per day in engagement assignments.
paymentCycleandstandardHoursPerDayto theEngagementAssignmentmodel in the Prisma client, allowing assignments to specify how often payments occur and the standard number of hours per day.PaymentCycleenum with valuesWEEKLY,FORTNIGHTLY, andMONTHLY, and updated the Prisma schema and client exports to support this.