Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/heavy-dolls-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@epilot/pricing': patch
---

Include cashback name in cashback breakdown
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
"dinero.js": "^1.9.1"
},
"peerDependencies": {
"@epilot/pricing-client": "^3.51.0",
"@epilot/pricing-client": "^3.53.8",
"i18next": "^25.1.2"
},
"devDependencies": {
"@changesets/cli": "^2.30.0",
"@epilot/eslint-config": "^3.0.5",
"@epilot/pricing-client": "^3.53.5",
"@epilot/pricing-client": "^3.53.8",
"@types/dinero.js": "^1.9.4",
"@vitest/coverage-v8": "^1.6.1",
"concurrently": "^9.1.2",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/__tests__/fixtures/pricing.results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8103,6 +8103,7 @@ export const computedPriceWithFixedAmountCashbackCoupon = {
{
amount_total: 1000,
cashback_period: '12',
cashback_name: 'Summer Cashback',
},
],
},
Expand Down Expand Up @@ -8251,6 +8252,7 @@ export const computedPriceWithFixedAmountCashbackCouponAndPriceMappings = {
{
cashback_period: '12',
amount_total: 2000,
cashback_name: 'Summer Cashback',
},
],
},
Expand Down Expand Up @@ -8405,6 +8407,7 @@ export const computedPriceWithPercentageCashbackCoupon = {
{
amount_total: 1000,
cashback_period: '12',
cashback_name: 'Summer Cashback',
},
],
},
Expand Down Expand Up @@ -8553,6 +8556,7 @@ export const computedRecurringPriceWithFixedAmountCashbackCoupon = {
{
amount_total: 1000,
cashback_period: '12',
cashback_name: 'Summer Cashback',
},
],
},
Expand Down Expand Up @@ -9369,10 +9373,12 @@ export const computedCompositePriceWithComponentsWithCashbacks = {
{
cashback_period: '12',
amount_total: 1000,
cashback_name: 'Summer Cashback',
},
{
cashback_period: '12',
amount_total: 1000,
cashback_name: 'Summer Cashback',
},
],
},
Expand Down Expand Up @@ -9776,10 +9782,12 @@ export const computedCompositePriceWithComponentsWithCashbacks = {
{
cashback_period: '12',
amount_total: 1000,
cashback_name: 'Summer Cashback',
},
{
cashback_period: '12',
amount_total: 1000,
cashback_name: 'Summer Cashback',
},
],
},
Expand Down
1 change: 1 addition & 0 deletions src/computations/compute-composite-price-cashbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const computeCompositePriceCashbacks = (
cashbacks.push({
cashback_period: cashbackPeriod,
amount_total: cashback_amount,
...(cashbackCoupon.name && { cashback_name: cashbackCoupon.name }),
});
}

Expand Down
1 change: 1 addition & 0 deletions src/computations/compute-totals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ describe('computeAggregatedAndPriceTotals', () => {
{
amount_total: 10000,
cashback_period: '12',
cashback_name: 'Summer Cashback',
},
]);
});
Expand Down
1 change: 1 addition & 0 deletions src/computations/compute-totals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ const recomputeDetailTotals = (
cashbacks.push({
cashback_period: cashbackPeriod,
amount_total: priceCashBackAmount.getAmount(),
...(coupon?.name && { cashback_name: coupon.name }),
});
}

Expand Down
Loading