Skip to content

PM-4669 - add weekly, fortnightly, monthly payment cycles#19

Closed
vas3a wants to merge 1 commit into
developfrom
PM-4669_payment-cycles
Closed

PM-4669 - add weekly, fortnightly, monthly payment cycles#19
vas3a wants to merge 1 commit into
developfrom
PM-4669_payment-cycles

Conversation

@vas3a

@vas3a vas3a commented May 18, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces support for specifying a payment cycle and storing daily standard hours for engagement assignments. The changes add a new PaymentCycle enum, update the EngagementAssignment model to include new fields, and provide a migration to update the database schema and backfill data.

  • Added a new PaymentCycle enum with values WEEKLY, FORTNIGHTLY, and MONTHLY to both Prisma schemas (prisma/schema.prisma, packages/engagements-prisma-client/schema.prisma).
  • Updated the EngagementAssignment model to include a required paymentCycle field (defaulting to WEEKLY) and a new standardHoursPerDay field. Marked standardHoursPerWeek as deprecated in favor of the new field.
  • Added a migration script to create the PaymentCycle enum type in the database, add the new columns to the EngagementAssignment table, and backfill standardHoursPerDay based on the existing standardHoursPerWeek value (divided by 5, rounded to two decimal places).

@vas3a vas3a requested review from Copilot, jmgasper and kkartunov May 18, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PaymentCycle enum (WEEKLY, FORTNIGHTLY, MONTHLY) to both Prisma schemas.
  • Extended EngagementAssignment with paymentCycle (required, default WEEKLY) and standardHoursPerDay; marked standardHoursPerWeek as deprecated.
  • Added SQL migration to create the enum type, add columns, and backfill standardHoursPerDay from standardHoursPerWeek.

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
}
@vas3a vas3a closed this May 18, 2026
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.

2 participants