PM-4669 - add weekly, fortnightly, monthly payment cycles#19
Closed
vas3a wants to merge 1 commit into
Closed
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 payment cycle support and introduces a per-day standard hours field for engagement assignments, including a DB migration to add/backfill the new columns.
Changes:
- Added
PaymentCycleenum (WEEKLY,FORTNIGHTLY,MONTHLY) to both Prisma schemas. - Extended
EngagementAssignmentwithpaymentCycle(required, defaultWEEKLY) andstandardHoursPerDay; markedstandardHoursPerWeekas deprecated. - Added SQL migration to create the enum type, add columns, and backfill
standardHoursPerDayfromstandardHoursPerWeek.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| prisma/schema.prisma | Adds PaymentCycle enum and new EngagementAssignment fields for cycle + daily hours. |
| prisma/migrations/20260518143000_add_payment_cycle_and_standard_hours_per_day/migration.sql | Creates DB enum/type, adds columns, and backfills daily hours from weekly hours. |
| packages/engagements-prisma-client/schema.prisma | Mirrors schema updates for the generated Prisma client package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5
to
+12
| ADD COLUMN "paymentCycle" "PaymentCycle" NOT NULL DEFAULT 'WEEKLY', | ||
| ADD COLUMN "standardHoursPerDay" DOUBLE PRECISION; | ||
|
|
||
| UPDATE "EngagementAssignment" | ||
| SET "standardHoursPerDay" = ROUND(("standardHoursPerWeek" / 5.0)::numeric, 2) | ||
| WHERE "standardHoursPerDay" IS NULL | ||
| AND "standardHoursPerWeek" IS NOT NULL | ||
| AND "standardHoursPerWeek" > 0; |
Comment on lines
+1
to
+7
| -- Add payment-cycle support and daily-hours storage for engagement assignments. | ||
| CREATE TYPE "PaymentCycle" AS ENUM ('WEEKLY', 'FORTNIGHTLY', 'MONTHLY'); | ||
|
|
||
| ALTER TABLE "EngagementAssignment" | ||
| ADD COLUMN "paymentCycle" "PaymentCycle" NOT NULL DEFAULT 'WEEKLY', | ||
| ADD COLUMN "standardHoursPerDay" DOUBLE PRECISION; | ||
|
|
Comment on lines
+39
to
+43
| enum PaymentCycle { | ||
| WEEKLY | ||
| FORTNIGHTLY | ||
| MONTHLY | ||
| } |
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 specifying a payment cycle and storing daily standard hours for engagement assignments. The changes add a new
PaymentCycleenum, update theEngagementAssignmentmodel to include new fields, and provide a migration to update the database schema and backfill data.PaymentCycleenum with valuesWEEKLY,FORTNIGHTLY, andMONTHLYto both Prisma schemas (prisma/schema.prisma,packages/engagements-prisma-client/schema.prisma).EngagementAssignmentmodel to include a requiredpaymentCyclefield (defaulting toWEEKLY) and a newstandardHoursPerDayfield. MarkedstandardHoursPerWeekas deprecated in favor of the new field.PaymentCycleenum type in the database, add the new columns to theEngagementAssignmenttable, and backfillstandardHoursPerDaybased on the existingstandardHoursPerWeekvalue (divided by 5, rounded to two decimal places).