Skip to content

PM-5049 - make release window configurable for engagement payments#183

Merged
vas3a merged 2 commits into
devfrom
PM-5049_engagements-release-window
May 21, 2026
Merged

PM-5049 - make release window configurable for engagement payments#183
vas3a merged 2 commits into
devfrom
PM-5049_engagements-release-window

Conversation

@vas3a

@vas3a vas3a commented May 20, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces support for a configurable release window for engagement payments, ensuring that such payments have a specific delay before being released, as set in the environment configuration.

  • Added ENGAGEMENT_PAYMENT_RELEASE_WINDOW_DAYS to the environment configuration and validated it in ConfigEnv to allow customization of the release window for engagement payments.
  • Updated WinningsService to calculate and set the release_date for engagement payments using the configured window, while keeping the release date null for other payment types.

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

Adds an environment-configurable release window for engagement payments and applies it when creating nested payment records for engagement winnings.

Changes:

  • Introduces ENGAGEMENT_PAYMENT_RELEASE_WINDOW_DAYS in ConfigEnv with validation/defaulting.
  • Updates WinningsService#createWinningWithPayments to set payment.release_date for engagement payments.
  • Adds unit tests covering engagement vs non-engagement release_date behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/config/config.env.ts Adds and validates ENGAGEMENT_PAYMENT_RELEASE_WINDOW_DAYS env config used by the service.
src/api/winnings/winnings.service.ts Computes an engagement-specific release_date and includes it in nested payment creation.
src/api/winnings/winnings.service.spec.ts Adds tests asserting engagement payments get a delayed release_date and non-engagement payments do not.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/api/winnings/winnings.service.ts Outdated
Comment thread src/api/winnings/winnings.service.ts Outdated
Comment thread src/api/winnings/winnings.service.spec.ts Outdated
@vas3a
vas3a merged commit 9d4f7bc into dev May 21, 2026
3 of 4 checks passed
@vas3a
vas3a deleted the PM-5049_engagements-release-window branch May 21, 2026 06:07
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