Skip to content

Conversation

@andresilva-guardian
Copy link
Contributor

@andresilva-guardian andresilva-guardian commented Dec 5, 2025

What does this change?

This pull request is based on this suggestion from @johnduffell .

Since this is a big change, this approach is now being displayed as a pull request to keep focus on #3176

…productCatalog parameter and improve error handling
…o streamline target rate plan key determination
…ssary whitespace in getTargetRatePlanId function
…ing unused product catalog helper and directly accessing the Annual rate plan
…solidating preview and execution logic, enhancing error handling, and improving code readability
…requirements and integrate into frequency switch process
@andresilva-guardian andresilva-guardian changed the title refactor(eligibility): implement eligibility checker with validation … Implement Shared Eligibility Checker Dec 5, 2025
"@modules/product-catalog/*": ["./modules/product-catalog/src/*"],
"@modules/promotions/*": ["./modules/promotions/src/*"],
"@modules/email/*": ["./modules/email/src/*"],
"@modules/eligibility/*": ["./modules/eligibility/src/*"],
Copy link
Member

Choose a reason for hiding this comment

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

well done for remembering to put it in here, it's easy to forget

catalog:
zod: ^3.23.8
typescript: ^5.6.3
dayjs: ^1.11.13
Copy link
Member

@johnduffell johnduffell Dec 10, 2025

Choose a reason for hiding this comment

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

interesting idea to put it here - I'm not 100% on the benefits of this but it does sound like a good idea.

does that mean we should do a PR to move all the other uses of dayjs over to catalog: as well?

"fix-formatting": "prettier --write **.ts"
},
"dependencies": {
"dayjs": "catalog:"
Copy link
Member

Choose a reason for hiding this comment

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

why is this needed now, as I can't see any obvious change that would need it?

nextInvoiceGreaterThanZero: 'next invoice total must be greater than zero',
mustHaveDiscountDefined: 'subscription must have a discount defined',
};
// Re-exporting from shared module for backward compatibility
Copy link
Member

Choose a reason for hiding this comment

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

good idea to keep the diff clean. It would be nice to have a direct reference in the longer term though.

@@ -0,0 +1,140 @@
import { ValidationError } from '@modules/errors';
Copy link
Member

@johnduffell johnduffell Dec 10, 2025

Choose a reason for hiding this comment

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

I assume this is just a direct copy/move of the existing file? if not please could you flag any notable changes

Copy link
Member

@johnduffell johnduffell left a comment

Choose a reason for hiding this comment

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

great idea, and thanks for splitting it into a separate PR.

I think this PR could probably target main (and be merged first) rather than your branch, which would take some of the pressure off your other branch.

I've approved with a few minor comments/questions (nothing blocking) for you to check

Base automatically changed from afs/product-switch-api/switch-billing-frequency to main January 12, 2026 09:53
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