Skip to content

Commit 365468d

Browse files
authored
chore: fix TSDocs of total fields to be accurate (medusajs#14367)
1 parent 1c89acc commit 365468d

File tree

2 files changed

+81
-81
lines changed

2 files changed

+81
-81
lines changed

packages/core/types/src/http/cart/common.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -91,72 +91,72 @@ export interface BaseCart {
9191
updated_at?: string | Date
9292

9393
/**
94-
* The original item total of the cart.
94+
* The sum of all line items' original totals before discounts, including taxes.
9595
*/
9696
original_item_total: number
9797

9898
/**
99-
* The original item subtotal of the cart.
99+
* The sum of all line items' original subtotals before discounts, excluding taxes.
100100
*/
101101
original_item_subtotal: number
102102

103103
/**
104-
* The original item tax total of the cart.
104+
* The sum of all line items' original tax totals before discounts.
105105
*/
106106
original_item_tax_total: number
107107

108108
/**
109-
* The item total of the cart.
109+
* The sum of all line items' totals after discounts, including taxes.
110110
*/
111111
item_total: number
112112

113113
/**
114-
* The item subtotal of the cart.
114+
* The sum of all line items' subtotals before discounts, excluding taxes.
115115
*/
116116
item_subtotal: number
117117

118118
/**
119-
* The item tax total of the cart.
119+
* The sum of all line items' tax totals after discounts.
120120
*/
121121
item_tax_total: number
122122

123123
/**
124-
* The original total of the cart.
124+
* The cart's total before discounts, including taxes. Calculated as the sum of `original_item_total` and `original_shipping_total`.
125125
*/
126126
original_total: number
127127

128128
/**
129-
* The original subtotal of the cart.
129+
* The cart's subtotal before discounts, excluding taxes. Calculated as the sum of `original_item_subtotal` and `original_shipping_subtotal`.
130130
*/
131131
original_subtotal: number
132132

133133
/**
134-
* The original tax total of the cart.
134+
* The cart's tax total before discounts. Calculated as the sum of `original_item_tax_total` and `original_shipping_tax_total`.
135135
*/
136136
original_tax_total: number
137137

138138
/**
139-
* The total of the cart.
139+
* The cart's final total after discounts and credit lines, including taxes.
140140
*/
141141
total: number
142142

143143
/**
144-
* The subtotal of the cart. (Excluding taxes)
144+
* The cart's subtotal before discounts, excluding taxes. Calculated as the sum of `item_subtotal` and `shipping_subtotal`.
145145
*/
146146
subtotal: number
147147

148148
/**
149-
* The tax total of the cart.
149+
* The cart's tax total after discounts. Calculated as the sum of `item_tax_total` and `shipping_tax_total`.
150150
*/
151151
tax_total: number
152152

153153
/**
154-
* The discount total of the cart.
154+
* The total amount of discounts applied to the cart, including the tax portion of discounts.
155155
*/
156156
discount_total: number
157157

158158
/**
159-
* The discount tax total of the cart.
159+
* The total amount of discounts applied to the cart's tax. Represents the tax portion of discounts.
160160
*/
161161
discount_tax_total: number
162162

@@ -171,32 +171,32 @@ export interface BaseCart {
171171
gift_card_tax_total: number
172172

173173
/**
174-
* The shipping total of the cart.
174+
* The sum of all shipping methods' totals after discounts, including taxes.
175175
*/
176176
shipping_total: number
177177

178178
/**
179-
* The shipping subtotal of the cart.
179+
* The sum of all shipping methods' subtotals before discounts, excluding taxes.
180180
*/
181181
shipping_subtotal: number
182182

183183
/**
184-
* The shipping tax total of the cart.
184+
* The sum of all shipping methods' tax totals after discounts.
185185
*/
186186
shipping_tax_total: number
187187

188188
/**
189-
* The original shipping total of the cart.
189+
* The sum of all shipping methods' original totals before discounts, including taxes.
190190
*/
191191
original_shipping_total: number
192192

193193
/**
194-
* The original shipping subtotal of the cart.
194+
* The sum of all shipping methods' original subtotals before discounts, excluding taxes.
195195
*/
196196
original_shipping_subtotal: number
197197

198198
/**
199-
* The original shipping tax total of the cart.
199+
* The sum of all shipping methods' original tax totals before discounts.
200200
*/
201201
original_shipping_tax_total: number
202202
}
@@ -352,56 +352,56 @@ export interface BaseCartShippingMethod {
352352
updated_at: Date | string
353353

354354
/**
355-
* The original total of the cart shipping method.
355+
* The shipping method's original total before discounts, including taxes.
356356
* This field is only available if you expand the `shipping_methods.*` relation. Learn more in the
357357
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide.
358358
*/
359359
original_total?: number
360360

361361
/**
362-
* The original subtotal of the cart shipping method.
362+
* The shipping method's original subtotal before discounts, excluding taxes.
363363
* This field is only available if you expand the `shipping_methods.*` relation. Learn more in the
364364
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide.
365365
*/
366366
original_subtotal?: number
367367

368368
/**
369-
* The original tax total of the cart shipping method.
369+
* The shipping method's original tax total before discounts.
370370
* This field is only available if you expand the `shipping_methods.*` relation. Learn more in the
371371
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide.
372372
*/
373373
original_tax_total?: number
374374

375375
/**
376-
* The total of the cart shipping method.
376+
* The shipping method's total after discounts, including taxes.
377377
* This field is only available if you expand the `shipping_methods.*` relation. Learn more in the
378378
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide.
379379
*/
380380
total?: number
381381

382382
/**
383-
* The subtotal of the cart shipping method.
383+
* The shipping method's subtotal before discounts, excluding taxes.
384384
* This field is only available if you expand the `shipping_methods.*` relation. Learn more in the
385385
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide.
386386
*/
387387
subtotal?: number
388388

389389
/**
390-
* The tax total of the cart shipping method.
390+
* The shipping method's tax total after discounts.
391391
* This field is only available if you expand the `shipping_methods.*` relation. Learn more in the
392392
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide.
393393
*/
394394
tax_total?: number
395395

396396
/**
397-
* The discount total of the cart shipping method.
397+
* The total amount of discounts applied to the shipping method, including the tax portion of discounts.
398398
* This field is only available if you expand the `shipping_methods.*` relation. Learn more in the
399399
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide.
400400
*/
401401
discount_total?: number
402402

403403
/**
404-
* The discount tax total of the cart shipping method.
404+
* The total amount of discounts applied to the shipping method's tax. Represents the tax portion of discounts.
405405
* This field is only available if you expand the `shipping_methods.*` relation. Learn more in the
406406
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide.
407407
*/
@@ -588,77 +588,77 @@ export interface BaseCartLineItem extends BaseCartLineItemTotals {
588588
*/
589589
export interface BaseCartLineItemTotals {
590590
/**
591-
* The original total of the cart line item.
591+
* The line item's original total before discounts, including taxes.
592592
* This field is only available if you expand the `items.*` relation. Learn more in the
593593
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
594594
*/
595595
original_total?: number
596596

597597
/**
598-
* The original subtotal of the cart line item.
598+
* The line item's original subtotal before discounts, excluding taxes.
599599
* This field is only available if you expand the `items.*` relation. Learn more in the
600600
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
601601
*/
602602
original_subtotal?: number
603603

604604
/**
605-
* The original tax total of the cart line item.
605+
* The line item's original tax total before discounts.
606606
* This field is only available if you expand the `items.*` relation. Learn more in the
607607
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
608608
*/
609609
original_tax_total?: number
610610

611611
/**
612-
* The item total of the cart line item.
612+
* The line item's total after discounts, including taxes.
613613
* This field is only available if you expand the `items.*` relation. Learn more in the
614614
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
615615
*/
616616
item_total?: number
617617

618618
/**
619-
* The item subtotal of the cart line item.
619+
* The line item's subtotal before discounts, excluding taxes.
620620
* This field is only available if you expand the `items.*` relation. Learn more in the
621621
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
622622
*/
623623
item_subtotal?: number
624624

625625
/**
626-
* The item tax total of the cart line item.
626+
* The line item's tax total after discounts.
627627
* This field is only available if you expand the `items.*` relation. Learn more in the
628628
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
629629
*/
630630
item_tax_total?: number
631631

632632
/**
633-
* The total of the cart line item.
633+
* The line item's total after discounts, including taxes.
634634
* This field is only available if you expand the `items.*` relation. Learn more in the
635635
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
636636
*/
637637
total?: number
638638

639639
/**
640-
* The subtotal of the cart line item.
640+
* The line item's subtotal before discounts, excluding taxes.
641641
* This field is only available if you expand the `items.*` relation. Learn more in the
642642
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
643643
*/
644644
subtotal?: number
645645

646646
/**
647-
* The tax total of the cart line item.
647+
* The line item's tax total after discounts.
648648
* This field is only available if you expand the `items.*` relation. Learn more in the
649649
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
650650
*/
651651
tax_total?: number
652652

653653
/**
654-
* The discount total of the cart line item.
654+
* The total amount of discounts applied to the line item, including the tax portion of discounts.
655655
* This field is only available if you expand the `items.*` relation. Learn more in the
656656
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
657657
*/
658658
discount_total?: number
659659

660660
/**
661-
* The discount tax total of the cart line item.
661+
* The total amount of discounts applied to the line item's tax. Represents the tax portion of discounts.
662662
* This field is only available if you expand the `items.*` relation. Learn more in the
663663
* [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide.
664664
*/

0 commit comments

Comments
 (0)