Skip to content

Feature branch : dcc2 adaptation (do NOT merge) - #275

Draft
CamilleFljt wants to merge 4 commits into
masterfrom
feature/DCC2-adaptation
Draft

Feature branch : dcc2 adaptation (do NOT merge)#275
CamilleFljt wants to merge 4 commits into
masterfrom
feature/DCC2-adaptation

Conversation

@CamilleFljt

Copy link
Copy Markdown
Contributor

Feature branch for DCC2 adaptation feature regrouping every ticket from the project

greg-olivier and others added 2 commits September 1, 2026 11:13
* feat(dcc2): add regulatory figure getters

Centralize the plan-amount/rate math (total purchase amount, initial
deposit, financed amount, credit duration, TAEG) that DCC2 disclosure
needs, instead of recomputing it inline per component.

* feat(dcc2): add legal-disclosure predicates

isDeferred, isPayLater, isPNX and requiresLegalDisclosure are the
single source of truth for which plans need DCC2 disclosure and which
legal-mentions template applies (standard vs. Pay Later), so every
consumer branches on the same predicate instead of re-deriving it.

* refactor(dcc2): use regulatoryFigures in TotalBlock

Replace TotalBlock's inline TAEG/total/deposit/duration math with
calls to the new regulatoryFigures module. No behavioral change,
variable names and translations untouched.

* refactor(dcc2): rename TotalBlock variables and message placeholders

Rename TAEG/firstInstallmentAmount/totalWithoutFirstInstallment/
durationInMonths to annualPercentageRate/initialDeposit/
financedAmount/creditDurationInMonths, and extract purchaseAmount
(total - creditCost) as its own value, to match the regulatoryFigures
naming introduced in the previous commit.

Translations re-synced via npm run translations:extract, which also
drops two accessibility keys no longer referenced anywhere in source.

* refactor(dcc2): remove redundant customerFees variable in TotalBlock

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(dcc2): reuse regulatoryFigures predicates in EligibilityModal and paymentPlanStrings

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(utils): reuse isP1X in filterEligibility and paymentPlanStrings

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
* feat(dcc2): complete eligibility fixtures

* feat(dcc2): clean code
@CamilleFljt CamilleFljt changed the title Feature/dcc2 adaptation Feature branch : dcc2 adaptation (do NOT merge) Sep 2, 2026
greg-olivier and others added 2 commits September 7, 2026 14:24
* refactor(types): structure EligibilityPlan as discriminated union matching backend contract

* feat(regulatoryFigures): add isCredit predicate for plans with >4 installments

* feat(regulatoryFigures): add getCustomerFees to expose the customer fee amount

* feat(installments): add LegalMentions component for credit/PNX/PayLater disclosure text

* feat: add translations
* feat: create legal mentions component (#277)

* refactor(types): structure EligibilityPlan as discriminated union matching backend contract

* feat(regulatoryFigures): add isCredit predicate for plans with >4 installments

* feat(regulatoryFigures): add getCustomerFees to expose the customer fee amount

* feat(installments): add LegalMentions component for credit/PNX/PayLater disclosure text

* feat: add translations

* feat(dcc2): add WarningMessage component

* fixup! feat(dcc2): add WarningMessage component

Use the existing --font-x-small (12px) and --dark-gray tokens for the
warning sentence instead of introducing --font-warning, which is
removed again. --dark-gray is the value main.css flags as the one
recommended for contrast.

* feat(dcc2): clean code

---------

Co-authored-by: Gregoire OLIVIER <35299257+greg-olivier@users.noreply.github.com>
(cherry picked from commit 4e5e725)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants