@@ -18,6 +18,7 @@ export const mockPlansAllEligible: EligibilityPlan[] = [
1818 } ,
1919 ] ,
2020 purchase_amount : 45000 ,
21+ transaction_country : 'FR' ,
2122 } ,
2223 {
2324 customer_total_cost_amount : 0 ,
@@ -36,6 +37,7 @@ export const mockPlansAllEligible: EligibilityPlan[] = [
3637 } ,
3738 ] ,
3839 purchase_amount : 45000 ,
40+ transaction_country : 'FR' ,
3941 } ,
4042 {
4143 customer_total_cost_amount : 0 ,
@@ -61,6 +63,7 @@ export const mockPlansAllEligible: EligibilityPlan[] = [
6163 } ,
6264 ] ,
6365 purchase_amount : 45000 ,
66+ transaction_country : 'FR' ,
6467 } ,
6568 {
6669 customer_total_cost_amount : 135 ,
@@ -93,6 +96,7 @@ export const mockPlansAllEligible: EligibilityPlan[] = [
9396 } ,
9497 ] ,
9598 purchase_amount : 45000 ,
99+ transaction_country : 'FR' ,
96100 } ,
97101 {
98102 customer_total_cost_amount : 1062 ,
@@ -132,6 +136,7 @@ export const mockPlansAllEligible: EligibilityPlan[] = [
132136 } ,
133137 ] ,
134138 purchase_amount : 45000 ,
139+ transaction_country : 'FR' ,
135140 } ,
136141 {
137142 annual_interest_rate : 1720 ,
@@ -224,6 +229,7 @@ export const mockPlansAllEligible: EligibilityPlan[] = [
224229 } ,
225230 ] ,
226231 purchase_amount : 45000 ,
232+ transaction_country : 'FR' ,
227233 } ,
228234]
229235
@@ -245,6 +251,7 @@ export const mockButtonPlans = [
245251 } ,
246252 ] ,
247253 purchase_amount : 45000 ,
254+ transaction_country : 'FR' ,
248255 } ,
249256 {
250257 customer_total_cost_amount : 0 ,
@@ -263,6 +270,7 @@ export const mockButtonPlans = [
263270 } ,
264271 ] ,
265272 purchase_amount : 45000 ,
273+ transaction_country : 'FR' ,
266274 } ,
267275 {
268276 customer_total_cost_amount : 0 ,
@@ -288,6 +296,7 @@ export const mockButtonPlans = [
288296 } ,
289297 ] ,
290298 purchase_amount : 45000 ,
299+ transaction_country : 'FR' ,
291300 } ,
292301 {
293302 customer_total_cost_amount : 135 ,
@@ -320,6 +329,7 @@ export const mockButtonPlans = [
320329 } ,
321330 ] ,
322331 purchase_amount : 45000 ,
332+ transaction_country : 'FR' ,
323333 } ,
324334 {
325335 customer_total_cost_amount : 1202 ,
@@ -359,6 +369,7 @@ export const mockButtonPlans = [
359369 } ,
360370 ] ,
361371 purchase_amount : 45000 ,
372+ transaction_country : 'FR' ,
362373 } ,
363374 {
364375 annual_interest_rate : 1719 ,
@@ -451,6 +462,7 @@ export const mockButtonPlans = [
451462 } ,
452463 ] ,
453464 purchase_amount : 45000 ,
465+ transaction_country : 'FR' ,
454466 } ,
455467]
456468
@@ -474,6 +486,7 @@ export const mockEligibilityPaymentPlanWithIneligiblePlan = [
474486 } ,
475487 ] ,
476488 purchase_amount : 45000 ,
489+ transaction_country : 'FR' ,
477490 } ,
478491 {
479492 customer_fee : 0 ,
@@ -501,6 +514,7 @@ export const mockEligibilityPaymentPlanWithIneligiblePlan = [
501514 } ,
502515 ] ,
503516 purchase_amount : 45000 ,
517+ transaction_country : 'FR' ,
504518 } ,
505519 {
506520 constraints : { purchase_amount : { maximum : 20000 , minimum : 9000 } } ,
@@ -509,6 +523,7 @@ export const mockEligibilityPaymentPlanWithIneligiblePlan = [
509523 eligible : false ,
510524 installments_count : 4 ,
511525 purchase_amount : 45000 ,
526+ transaction_country : 'FR' ,
512527 reasons : { purchase_amount : 'invalid_value' } ,
513528 } ,
514529 {
@@ -518,6 +533,7 @@ export const mockEligibilityPaymentPlanWithIneligiblePlan = [
518533 eligible : false ,
519534 installments_count : 10 ,
520535 purchase_amount : 45000 ,
536+ transaction_country : 'FR' ,
521537 reasons : { purchase_amount : 'invalid_value' } ,
522538 } ,
523539]
@@ -533,6 +549,7 @@ export const mockEligibilityWithHiddenPlan = [
533549 eligible : false ,
534550 installments_count : 4 ,
535551 purchase_amount : 45000 ,
552+ transaction_country : 'FR' ,
536553 reasons : { installments_count : 'not_allowed' } ,
537554 // No constraints.purchase_amount → plan is hidden, not grayed out
538555 } ,
@@ -549,6 +566,7 @@ export const mockEligibilityWithGrayedOutPlan = [
549566 eligible : false ,
550567 installments_count : 4 ,
551568 purchase_amount : 45000 ,
569+ transaction_country : 'FR' ,
552570 reasons : { purchase_amount : 'invalid_value' } ,
553571 // constraints.purchase_amount present → plan is grayed out, not hidden
554572 } ,
@@ -569,3 +587,103 @@ export const configPlans: ConfigPlan[] = mockPlansAllEligible.map((plan) => ({
569587 minAmount : 90_00 ,
570588 maxAmount : 3350_00 ,
571589} ) )
590+
591+ // Deferred (30 days) 3x plan, without customer fees.
592+ export const mockDeferredMultiInstallmentPlanWithoutFees : EligibilityPlan = {
593+ customer_total_cost_amount : 0 ,
594+ customer_total_cost_bps : 0 ,
595+ deferred_days : 30 ,
596+ deferred_months : 0 ,
597+ eligible : true ,
598+ installments_count : 3 ,
599+ payment_plan : [
600+ {
601+ customer_fee : 0 ,
602+ customer_interest : 0 ,
603+ due_date : 1640942762 ,
604+ purchase_amount : 15000 ,
605+ total_amount : 15000 ,
606+ } ,
607+ {
608+ customer_fee : 0 ,
609+ customer_interest : 0 ,
610+ due_date : 1643621162 ,
611+ purchase_amount : 15000 ,
612+ total_amount : 15000 ,
613+ } ,
614+ {
615+ customer_fee : 0 ,
616+ customer_interest : 0 ,
617+ due_date : 1646299562 ,
618+ purchase_amount : 15000 ,
619+ total_amount : 15000 ,
620+ } ,
621+ ] ,
622+ purchase_amount : 45000 ,
623+ transaction_country : 'FR' ,
624+ }
625+
626+ // Same plan as above, with customer fees charged on the first installment.
627+ export const mockDeferredMultiInstallmentPlanWithFees : EligibilityPlan = {
628+ customer_total_cost_amount : 135 ,
629+ customer_total_cost_bps : 30 ,
630+ deferred_days : 30 ,
631+ deferred_months : 0 ,
632+ eligible : true ,
633+ installments_count : 3 ,
634+ payment_plan : [
635+ {
636+ customer_fee : 135 ,
637+ customer_interest : 0 ,
638+ due_date : 1640942762 ,
639+ purchase_amount : 15000 ,
640+ total_amount : 15135 ,
641+ } ,
642+ {
643+ customer_fee : 0 ,
644+ customer_interest : 0 ,
645+ due_date : 1643621162 ,
646+ purchase_amount : 15000 ,
647+ total_amount : 15000 ,
648+ } ,
649+ {
650+ customer_fee : 0 ,
651+ customer_interest : 0 ,
652+ due_date : 1646299562 ,
653+ purchase_amount : 15000 ,
654+ total_amount : 15000 ,
655+ } ,
656+ ] ,
657+ purchase_amount : 45000 ,
658+ transaction_country : 'FR' ,
659+ }
660+
661+ // Deferred P1X: a single installment paid 30 days later (pay later).
662+ export const mockDeferredP1XPlan : EligibilityPlan = {
663+ customer_total_cost_amount : 0 ,
664+ customer_total_cost_bps : 0 ,
665+ deferred_days : 30 ,
666+ deferred_months : 0 ,
667+ eligible : true ,
668+ installments_count : 1 ,
669+ payment_plan : [
670+ {
671+ customer_fee : 0 ,
672+ customer_interest : 0 ,
673+ due_date : 1640942762 ,
674+ purchase_amount : 45000 ,
675+ total_amount : 45000 ,
676+ } ,
677+ ] ,
678+ purchase_amount : 45000 ,
679+ transaction_country : 'FR' ,
680+ }
681+
682+ /**
683+ * Returns a copy of `plan` with its `transaction_country` overridden.
684+ * The input plan is never mutated, so shared fixtures stay reusable across tests.
685+ */
686+ export const withCountry = ( plan : EligibilityPlan , countryCode : string ) : EligibilityPlan => ( {
687+ ...plan ,
688+ transaction_country : countryCode ,
689+ } )
0 commit comments