Repository navigation
Merge pull request #81 from call-0f-code/birthday-feature Add routes for birthday mail service - #82
Merged
Merged
Conversation
Add persist-credentials option to checkout step
Docker workflow to build and push image
…iated configuration files
refactored local dev setup (made it easy)
Add Docker Compose configurations for full stack development
… frontend services
Add Docker Compose configuration for API and platform services
- Write job results with a lease-checked updateMany so a worker whose
lease expired can't overwrite a job another worker has claimed
- Count the lost attempt when reclaiming an expired PROCESSING job and
move it to DEAD at max attempts, so crashing jobs don't retry forever
- Validate sentAt and errorClassification in the controller (400 not 500)
- Controller builds the { success: true, ... } response; service returns data
- Read INTERNAL_SERVICE_SECRET via config, drop BIRTHDAY_SERVICE_SECRET
fallback, hash before timingSafeEqual to hide secret length
- Rename route file to birthdayEmails.ts and add apidoc blocks
- Dedupe lease checks, defaults and retry delays; type errorClassification
- Update and extend tests
- Accept the UNCERTAIN error classification sent by the COC-Members birthday worker (provider timeout after dispatch); retry it like TRANSIENT. The previous commit rejected it with a 400. - Validate providerMessageId as string, null or missing (400 otherwise) - Accept only the x-internal-secret header; the worker already sends it - Match sibling controllers: export const handlers, single service import
- initialize: rely on the unique (memberId, birthdayYear) index with createMany skipDuplicates instead of pre-loading existing jobs; move the email check into the member query - /sent: write first with the lease-guarded updateMany and only read on a miss (404 / already sent / 409). Saves a query per send and makes overlapping /sent calls return alreadySent instead of 409 - stats: replace the status switch with a lookup map - drop controller checks the service already does - derive ClaimedJob from the Prisma model
Add routes for birthday mail service
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Sherin-2711
approved these changes
Oct 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.
No description provided.