feat(core-flows,types,cart): add credit lines to cart (#11419)

* feat(core-flows,types,cart): add credit lines to cart

* chore: fix specs

* chore: credit lines hook

* chore: update types

* chore: added credit line totals

* chore: add totals fields to query config

* chore: add complete cart hook

* chore: add credit lines creation to order

* chore: pr ready for review

* chore: fix tests

* Apply suggestions from code review

* chore: fix types

* chore: adjust summary calculations with new totals
This commit is contained in:
Riqwan Thamir authored and GitHub committed 2025-02-24 14:34:36 +01:00
1 parent be566ca6fb
commit fb2e86484a
27 files changed
+802 -58

No files matched your search

@@ -17,6 +17,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
expect(Object.keys(linkable)).toEqual([
"cart",
"creditLine",
"address",
"lineItem",
"lineItemAdjustment",
@@ -40,6 +41,15 @@ moduleIntegrationTestRunner<ICartModuleService>({
field: "cart",
},
},
creditLine: {
id: {
entity: "CreditLine",
field: "creditLine",
linkable: "credit_line_id",
primaryKey: "id",
serviceName: "cart",
},
},
address: {
id: {
linkable: "address_id",
@@ -2764,6 +2774,22 @@ moduleIntegrationTestRunner<ICartModuleService>({
},
},
],
credit_lines: [],
credit_lines_subtotal: 0,
credit_lines_tax_total: 0,
credit_lines_total: 0,
raw_credit_lines_subtotal: {
precision: 20,
value: "0",
},
raw_credit_lines_tax_total: {
precision: 20,
value: "0",
},
raw_credit_lines_total: {
precision: 20,
value: "0",
},
total: 210,
subtotal: 510,
tax_total: 0,