@artisan-commerce/types 0.13.0-canary.8 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/build/index.d.ts +8 -6
  3. package/build/index.js +8 -6
  4. package/build/index.js.map +1 -1
  5. package/build/types/account.types.d.ts +5 -5
  6. package/build/types/app.types.d.ts +46 -29
  7. package/build/types/app.types.js +1 -0
  8. package/build/types/app.types.js.map +1 -1
  9. package/build/types/artisanDB.types.d.ts +24 -0
  10. package/build/types/artisanDB.types.js +1 -0
  11. package/build/types/artisanDB.types.js.map +1 -1
  12. package/build/types/banner.types.d.ts +97 -0
  13. package/build/types/{coupons.types.js → banner.types.js} +2 -1
  14. package/build/types/banner.types.js.map +1 -0
  15. package/build/types/billingData.types.d.ts +23 -0
  16. package/build/types/billingData.types.js +1 -0
  17. package/build/types/billingData.types.js.map +1 -1
  18. package/build/types/catalogue.types.d.ts +16 -0
  19. package/build/types/catalogue.types.js +4 -0
  20. package/build/types/catalogue.types.js.map +1 -0
  21. package/build/types/category.types.d.ts +21 -2
  22. package/build/types/category.types.js +1 -0
  23. package/build/types/category.types.js.map +1 -1
  24. package/build/types/common.types.d.ts +28 -0
  25. package/build/types/common.types.js +1 -1
  26. package/build/types/common.types.js.map +1 -1
  27. package/build/types/country.types.d.ts +34 -1
  28. package/build/types/coupon.types.d.ts +112 -0
  29. package/build/types/{channel.types.js → coupon.types.js} +2 -2
  30. package/build/types/coupon.types.js.map +1 -0
  31. package/build/types/http.types.d.ts +45 -0
  32. package/build/types/image.types.d.ts +54 -2
  33. package/build/types/livingPlace.types.d.ts +65 -4
  34. package/build/types/livingPlace.types.js +1 -0
  35. package/build/types/livingPlace.types.js.map +1 -1
  36. package/build/types/payment.types.d.ts +81 -0
  37. package/build/types/payment.types.js +4 -0
  38. package/build/types/payment.types.js.map +1 -0
  39. package/build/types/product.types.d.ts +178 -52
  40. package/build/types/product.types.js +1 -25
  41. package/build/types/product.types.js.map +1 -1
  42. package/build/types/shippingAddress.types.d.ts +48 -0
  43. package/build/types/shippingAddress.types.js +1 -0
  44. package/build/types/shippingAddress.types.js.map +1 -1
  45. package/build/types/shippingCost.types.d.ts +31 -0
  46. package/build/types/shoppingCart.types.d.ts +75 -21
  47. package/build/types/shoppingCart.types.js +1 -0
  48. package/build/types/shoppingCart.types.js.map +1 -1
  49. package/build/types/store.types.d.ts +154 -25
  50. package/build/types/store.types.js +1 -21
  51. package/build/types/store.types.js.map +1 -1
  52. package/build/types/user.types.d.ts +77 -9
  53. package/build/types/user.types.js +1 -12
  54. package/build/types/user.types.js.map +1 -1
  55. package/build/types/vendor.types.d.ts +16 -0
  56. package/package.json +2 -2
  57. package/build/types/channel.types.d.ts +0 -5
  58. package/build/types/channel.types.js.map +0 -1
  59. package/build/types/coupons.types.d.ts +0 -90
  60. package/build/types/coupons.types.js.map +0 -1
@@ -1,49 +1,55 @@
1
+ import { BaseWeekDay } from "./common.types";
1
2
  import { Image } from "./image.types";
2
3
  import { Alert } from "./shoppingCart.types";
4
+ /**
5
+ * Representation of a Commerce Product.
6
+ *
7
+ * @typedef Product
8
+ * @since 0.5.14
9
+ */
3
10
  export declare type Product = BaseProduct | ProductDetails | CartProduct;
4
11
  /**
5
12
  * Base product attributes.
6
13
  *
7
14
  * @interface BaseProduct
8
15
  * @since 0.5.14
9
- * @property {string} productId The product id
10
- * @property {string} name The name of the product
11
- * @property {string} description The description of the product
12
- * @property {ProductType} type The type of the product
13
- * @property {string} coverUrl The cover url of the product
14
- * @property {ProductPrices} prices The prices object of the product
15
- * @property {boolean} addDirectlyToCart Indicates if a product can be added directly to cart
16
- * @property {boolean} outOfService Inidicates if a product is out of service
17
- * @property {boolean} outOfStock Inidicates if a product is out of stock
18
- * @property {number} outOfStock The stock of the product
19
- * @property {string} measure The measure of the product
20
- * @property {ProductAttributes} attributes The attributes of the product
21
- * @property {string} suggestedPrice The suggested price of the product
22
- * @property {boolean} available Indicates if a product is available
23
- * @property {Image[]} images The images of the product
24
- * @property {string} standardTime The standard time of the product
25
- * @property {boolean} sponsored Indicates if a product is sponsored
26
- * @property {ProductStatus} status The status of the product
27
- *
28
16
  */
29
17
  export interface BaseProduct {
18
+ /** Product unique identifier */
30
19
  productId: string;
20
+ /** The name of the product */
31
21
  name: string;
22
+ /** The description of the product */
32
23
  description: string;
24
+ /** The type of the product, see {@link ProductType} */
33
25
  type: ProductType;
26
+ /** The cover url of the product */
34
27
  coverUrl: string;
28
+ /** Product prices, see {@link ProductPrices} */
35
29
  prices: ProductPrices;
30
+ /** Indicates if a product can be added directly to cart */
36
31
  addDirectlyToCart: boolean;
32
+ /** Indicates if a product is out of service */
37
33
  outOfService: boolean;
34
+ /** Indicates if a product is out of stock */
38
35
  outOfStock: boolean;
36
+ /** The stock of the product */
39
37
  stock: number;
38
+ /** The measure of the product */
40
39
  measure: string;
40
+ /** Product attributes, see {@link ProductAttributes} */
41
41
  attributes: ProductAttributes;
42
+ /** The suggested price of the product */
42
43
  suggestedPrice: string;
44
+ /** Indicates if a product is available */
43
45
  available: boolean;
46
+ /** Array of product images, see {@link Image} */
44
47
  images: Image[];
48
+ /** The standard time of the product */
45
49
  standardTime: string;
50
+ /** Indicates if a product is sponsored */
46
51
  sponsored: boolean;
52
+ /** The status of the product, see {@link ProductStatus} */
47
53
  status: ProductStatus;
48
54
  }
49
55
  /**
@@ -51,123 +57,243 @@ export interface BaseProduct {
51
57
  *
52
58
  * @interface ProductPrices
53
59
  * @since 0.5.14
54
- * @property {PriceCategory} NORMAL Normal price cotegory
55
- * @property {PriceCategory} POINTS Points price category
56
- *
57
60
  */
58
61
  export interface ProductPrices {
62
+ /** Normal price category, see {@link PriceCategory} */
59
63
  NORMAL: PriceCategory;
64
+ /** Points price category, see {@link PriceCategory} */
60
65
  POINTS: PriceCategory;
61
66
  }
67
+ /**
68
+ * Price category attributes.
69
+ *
70
+ * @interface PriceCategory
71
+ * @since 0.5.14
72
+ */
62
73
  export interface PriceCategory {
74
+ /** Price category type, see {@link PriceCategoryType} */
63
75
  category: PriceCategoryType;
76
+ /** Price category without taxes */
64
77
  grossPrice: number;
78
+ /** Price category with taxes */
65
79
  netPrice: number;
80
+ /** Currency' symbol */
66
81
  symbol: string;
82
+ /** Array of price category' taxes, see {@link PriceCategoryTax} */
67
83
  taxes: PriceCategoryTax[];
84
+ /** Array of discounts applied to the price category */
68
85
  discounts: any[];
86
+ /** Total discounts without taxes */
69
87
  discountGrossPrice: number;
88
+ /** Total discounts with taxes */
70
89
  discountNetPrice: number;
90
+ /** Total discounts applied to the price category */
71
91
  discount: number;
72
92
  }
93
+ /**
94
+ * Price category tax attributes.
95
+ *
96
+ * @interface PriceCategoryTax
97
+ * @since 0.5.14
98
+ */
73
99
  export interface PriceCategoryTax {
100
+ /** Price category' tax percentage */
74
101
  percentage: number;
102
+ /** Price category' tax name, see {@link TaxType} */
75
103
  name: TaxType;
104
+ /** Price category' value added tax rate */
76
105
  vatRateCode: number;
106
+ /** Price category' tax code */
77
107
  code: number;
108
+ /** Price category' value added tax */
78
109
  vatRate: string;
79
110
  }
111
+ /**
112
+ * Additional product attributes.
113
+ *
114
+ * @interface ProductAttributes
115
+ * @since 0.5.14
116
+ */
80
117
  export interface ProductAttributes {
118
+ /** Product's quantity, the attribute is not in camel case purposefully */
81
119
  Cantidad: string;
120
+ /** Product external id */
82
121
  externalId: string;
122
+ /** Whether or not to show product in menu */
83
123
  showInMenu: boolean;
84
124
  }
85
125
  /**
86
- * The product status
126
+ * The product status.
87
127
  *
128
+ * @typedef ProductStatus
88
129
  * @since 0.5.14
89
- * @type ProductStatus
90
130
  **/
91
131
  export declare type ProductStatus = "ACTIVE" | "INACTIVE";
92
- export declare enum ProductType {
93
- PRODUCT = "PRODUCT",
94
- MODIFIER = "MODIFIER"
95
- }
96
- export declare enum PriceCategoryType {
97
- NORMAL = "NORMAL",
98
- POINTS = "POINTS"
99
- }
100
- export declare enum TaxType {
101
- IVA = "IVA"
102
- }
132
+ /**
133
+ * Product type's possible values.
134
+ *
135
+ * @typedef ProductType
136
+ * @since 0.5.14
137
+ **/
138
+ export declare type ProductType = "PRODUCT" | "MODIFIER";
139
+ /**
140
+ * Price category's possible values.
141
+ *
142
+ * @typedef PriceCategoryType
143
+ * @since 0.5.14
144
+ **/
145
+ export declare type PriceCategoryType = "NORMAL" | "POINTS";
146
+ /**
147
+ * Tax's possible values.
148
+ *
149
+ * @typedef TaxType
150
+ * @since 0.5.14
151
+ **/
152
+ export declare type TaxType = "IVA";
153
+ /**
154
+ * Weekday product's schedule.
155
+ *
156
+ * @interface DayOfWeek
157
+ * @since 0.5.14
158
+ */
103
159
  export interface DayOfWeek {
104
- day: DayOfWeekName;
160
+ /** Week day in uppercase, see {@link BaseWeekDay} */
161
+ day: BaseWeekDay;
162
+ /**
163
+ * `Date` value representing the start time in which
164
+ * the product is available */
105
165
  from: number;
166
+ /**
167
+ * `Date` value representing the end time in which
168
+ * the product is available */
106
169
  to: number;
107
170
  }
108
- export declare enum DayOfWeekName {
109
- MONDAY = "MONDAY",
110
- TUESDAY = "TUESDAY",
111
- WEDNESDAY = "WEDNESDAY",
112
- THURSDAY = "THURSDAY",
113
- FRIDAY = "FRIDAY",
114
- SATURDAY = "SATURDAY",
115
- SUNDAY = "SUNDAY"
116
- }
171
+ /**
172
+ * The representation of a product question.
173
+ *
174
+ * @interface ProductQuestion
175
+ * @since 0.5.14
176
+ */
117
177
  export interface ProductQuestion {
178
+ /** Product question id */
118
179
  questionId: string;
180
+ /** Product question name */
119
181
  name: string;
182
+ /** Product question description */
120
183
  description: string | null;
184
+ /** Product question minimum number of allowed answers */
121
185
  min: number;
186
+ /** Product question maximum number of allowed answers */
122
187
  max: number;
188
+ /** Product question type */
123
189
  type: string | null;
190
+ /**
191
+ * Array of possible answers to a product question,
192
+ * see {@link ProductAnswer}
193
+ */
124
194
  answers: ProductAnswer[];
195
+ /** Array of product question images to display, see {@link Image} */
125
196
  images: Image[] | undefined;
126
197
  }
198
+ /**
199
+ * Common props for products and answers.
200
+ *
201
+ * @typedef CommonProductAndAnswersProps
202
+ * @since 0.5.14
203
+ */
127
204
  declare type CommonProductAndAnswersProps = "name" | "prices" | "attributes" | "productId" | "type" | "images";
128
205
  /**
129
206
  * Product details attributes.
130
207
  *
131
208
  * @interface ProductDetails
132
209
  * @since 0.5.14
133
- * @property {boolean} isPriceVip Indicates if a product has a price vip
134
- * @property {string[]} manufacturer The manufacturer of the product
135
- * @property {number} maxAmountForSale The mas amount for sale of the product
136
- * @property {DayOfWeek[]} schedule The schedule of the product
137
- * @property {ProductQuestion[]} questions The questions of the product
138
- * @property {number} benefitId The benefit id of the product
139
- *
210
+ * @extends {{@link BaseProduct}
140
211
  */
141
212
  export interface ProductDetails extends BaseProduct {
213
+ /** Indicates if a product has a price vip */
142
214
  isPriceVip: boolean;
215
+ /** Manufacturer The manufacturer of the product */
143
216
  manufacturer: string[];
217
+ /** The max amount for sale of the product */
144
218
  maxAmountForSale: number;
219
+ /** Array of product schedules, see {@link DayOfWeek} */
145
220
  schedule: DayOfWeek[];
221
+ /** Array of product questions, see {@link ProductQuestion} */
146
222
  questions: ProductQuestion[];
223
+ /** The benefit id of the product */
147
224
  benefitId?: number;
148
225
  }
226
+ /**
227
+ * Representation of a Commerce Product Answer.
228
+ *
229
+ * @interface ProductAnswer
230
+ * @since 0.5.14
231
+ * @extends Pick<Product,CommonProductAndAnswersProps>, see
232
+ * {@link Product} and {@link CommonProductAndAnswersProps}
233
+ * for further information
234
+ */
149
235
  export interface ProductAnswer extends Pick<Product, CommonProductAndAnswersProps> {
236
+ /**
237
+ * Array of questions associated with the answer,
238
+ * see {@link ProductDetails}
239
+ */
150
240
  questions: ProductDetails["questions"];
241
+ /** Type of question to render */
151
242
  renderType: string | null;
152
243
  }
244
+ /**
245
+ * Representation of a Commerce Cart Product Question.
246
+ *
247
+ * @interface CartProductQuestion
248
+ * @since 0.5.14
249
+ * @extends {{@link ProductQuestion}
250
+ */
153
251
  export interface CartProductQuestion extends ProductQuestion {
252
+ /** Array of possible answers to the question */
154
253
  answers: CartProductAnswer[];
155
254
  }
255
+ /**
256
+ * Representation of a Commerce Cart Product Answer.
257
+ *
258
+ * @interface CartProductAnswer
259
+ * @since 0.5.14
260
+ * @extends {{@link ProductAnswer}
261
+ */
156
262
  export interface CartProductAnswer extends ProductAnswer {
263
+ /** Question unique identifier */
157
264
  questionId: string;
265
+ /** Quantity of allowed cart product answers */
158
266
  amount: number;
267
+ /** Price category value of a product answer */
159
268
  priceCategory: PriceCategoryType;
269
+ /** Comment associated with the product answer */
160
270
  comment: string;
271
+ /** Array of possible questions and answers */
161
272
  questionsAndAnswers: CartProductQuestion[];
162
273
  }
274
+ /**
275
+ * Representation of a Commerce Cart Product.
276
+ *
277
+ * @interface CartProduct
278
+ * @since 0.5.14
279
+ * @extends {{@link ProductDetails}
280
+ */
163
281
  export interface CartProduct extends ProductDetails {
282
+ /** Quantity of allowed cart products */
164
283
  amount: number;
284
+ /** Cart product price category */
165
285
  priceCategory: PriceCategoryType;
286
+ /** Comment associated with the cart product */
166
287
  comment: string;
288
+ /** Array of possible questions and answers associated with the product*/
167
289
  questionsAndAnswers: CartProductQuestion[];
290
+ /** Cart product unique identifier */
168
291
  hash: string;
292
+ /** Cart product creation date */
169
293
  createdAt: string;
294
+ /** Cart product updating date */
170
295
  updatedAt: string;
296
+ /** Array of alerts associated with the cart product */
171
297
  alerts: Alert[];
172
298
  }
173
299
  export {};
@@ -1,28 +1,4 @@
1
1
  "use strict";
2
+ // Product and product details types and interfaces
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DayOfWeekName = exports.TaxType = exports.PriceCategoryType = exports.ProductType = void 0;
4
- var ProductType;
5
- (function (ProductType) {
6
- ProductType["PRODUCT"] = "PRODUCT";
7
- ProductType["MODIFIER"] = "MODIFIER";
8
- })(ProductType = exports.ProductType || (exports.ProductType = {}));
9
- var PriceCategoryType;
10
- (function (PriceCategoryType) {
11
- PriceCategoryType["NORMAL"] = "NORMAL";
12
- PriceCategoryType["POINTS"] = "POINTS";
13
- })(PriceCategoryType = exports.PriceCategoryType || (exports.PriceCategoryType = {}));
14
- var TaxType;
15
- (function (TaxType) {
16
- TaxType["IVA"] = "IVA";
17
- })(TaxType = exports.TaxType || (exports.TaxType = {}));
18
- var DayOfWeekName;
19
- (function (DayOfWeekName) {
20
- DayOfWeekName["MONDAY"] = "MONDAY";
21
- DayOfWeekName["TUESDAY"] = "TUESDAY";
22
- DayOfWeekName["WEDNESDAY"] = "WEDNESDAY";
23
- DayOfWeekName["THURSDAY"] = "THURSDAY";
24
- DayOfWeekName["FRIDAY"] = "FRIDAY";
25
- DayOfWeekName["SATURDAY"] = "SATURDAY";
26
- DayOfWeekName["SUNDAY"] = "SUNDAY";
27
- })(DayOfWeekName = exports.DayOfWeekName || (exports.DayOfWeekName = {}));
28
4
  //# sourceMappingURL=product.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product.types.js","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":";;;AAoGA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;AACvB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AACD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,sCAAiB,CAAA;AACnB,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AACD,IAAY,OAEX;AAFD,WAAY,OAAO;IACjB,sBAAW,CAAA;AACb,CAAC,EAFW,OAAO,GAAP,eAAO,KAAP,eAAO,QAElB;AAQD,IAAY,aAQX;AARD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;IACjB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACnB,CAAC,EARW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAQxB"}
1
+ {"version":3,"file":"product.types.js","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":";AAAA,mDAAmD"}
@@ -1,25 +1,73 @@
1
1
  import { CountrySummary } from "./common.types";
2
2
  import { LivingPlace, LivingPlaceToSave } from "./livingPlace.types";
3
+ /**
4
+ * Representation of a basic Shipping Address.
5
+ *
6
+ * @interface BaseShippingAddress
7
+ * @since 0.5.14
8
+ */
3
9
  export interface BaseShippingAddress {
10
+ /** Whether or not the shipping address is default */
4
11
  default: boolean;
12
+ /** Shipping address' latitude */
5
13
  lat: number;
14
+ /** Shipping address' longitude */
6
15
  lng: number;
16
+ /** Shipping address' reference */
7
17
  reference: string;
18
+ /** Shipping address' main street */
8
19
  mainStreet: string;
20
+ /** Shipping address' living place number */
9
21
  number: string;
22
+ /** Shipping address' secondary street */
10
23
  secondaryStreet: string;
24
+ /** Shipping address' reference */
11
25
  addressReference: string;
26
+ /** It contains country id and country name, see {@link CountrySummary} */
12
27
  country: CountrySummary;
13
28
  }
29
+ /**
30
+ * Representation of a Commerce Shipping Address.
31
+ *
32
+ * @interface ShippingAddress
33
+ * @since 0.5.14
34
+ * @extends {{@link BaseShippingAddress}
35
+ */
14
36
  export interface ShippingAddress extends BaseShippingAddress {
37
+ /** Shipping address unique identifier */
15
38
  id: number;
39
+ /** Object which contains the living place, see {@link LivingPlace} */
16
40
  livingPlace: LivingPlace;
17
41
  }
42
+ /**
43
+ * A shipping address object used when it needs to be created.
44
+ *
45
+ * @interface NewShippingAddress
46
+ * @since 0.5.14
47
+ * @extends {{@link BaseShippingAddress}
48
+ */
18
49
  export interface NewShippingAddress extends BaseShippingAddress {
50
+ /** Shipping address unique identifier */
19
51
  id?: number;
52
+ /**
53
+ * Object which contains the living place to save,
54
+ * see {@link LivingPlaceToSave}
55
+ */
20
56
  livingPlace: LivingPlaceToSave;
21
57
  }
58
+ /**
59
+ * A shipping address object used when it needs to be updated.
60
+ *
61
+ * @interface UpdatedShippingAddress
62
+ * @since 0.5.14
63
+ * @extends {{@link BaseShippingAddress}
64
+ */
22
65
  export interface UpdatedShippingAddress extends BaseShippingAddress {
66
+ /** Shipping address unique identifier */
23
67
  id: number;
68
+ /**
69
+ * Object which contains the living place to update,
70
+ * see {@link LivingPlaceToSave}
71
+ */
24
72
  livingPlace: LivingPlaceToSave;
25
73
  }
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
+ // Shipping address types and interfaces
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  //# sourceMappingURL=shippingAddress.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shippingAddress.types.js","sourceRoot":"","sources":["../../src/types/shippingAddress.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"shippingAddress.types.js","sourceRoot":"","sources":["../../src/types/shippingAddress.types.ts"],"names":[],"mappings":";AAAA,wCAAwC"}
@@ -1,23 +1,54 @@
1
+ /**
2
+ * Representation of a Commerce Shipping Cost.
3
+ *
4
+ * @interface ShippingCost
5
+ * @since 0.5.14
6
+ */
1
7
  export interface ShippingCost {
8
+ /** Shipping cost product's id */
2
9
  productId: number;
10
+ /** Shipping cost's name */
3
11
  name: string;
12
+ /** Shipping cost's amount */
4
13
  amount: number;
14
+ /** Currency's symbol */
5
15
  symbol: string;
16
+ /** Array of shipping cost's taxes, see {@link ShippingCostTax} */
6
17
  taxes: ShippingCostTax[];
18
+ /** Shipping cost's price without taxes */
7
19
  grossPrice: number;
20
+ /** Shipping cost's price */
8
21
  netPrice: number;
22
+ /** Shipping cost's subtotal without taxes */
9
23
  subtotalBeforeTaxes: number;
24
+ /** Shipping cost's tax total */
10
25
  taxTotal: number;
26
+ /** Shipping cost's discount */
11
27
  discounts: any[];
28
+ /** Shipping cost's discount total amount */
12
29
  discountTotal: number;
30
+ /** Shipping cost's total */
13
31
  total: number;
14
32
  }
33
+ /**
34
+ * Representation of a shipping cost tax.
35
+ *
36
+ * @interface ShippingCostTax
37
+ * @since 0.5.14
38
+ */
15
39
  export interface ShippingCostTax {
40
+ /** Tax percentage to be applied */
16
41
  percentage: number;
42
+ /** Tax name */
17
43
  name: string;
44
+ /** Value added tax rate code */
18
45
  vatRateCode: number;
46
+ /** Tax code */
19
47
  code: number;
48
+ /** Value added tax rate */
20
49
  vatRate: string;
50
+ /** Tax base value */
21
51
  taxBase: number;
52
+ /** Tax value */
22
53
  value: string;
23
54
  }
@@ -1,70 +1,124 @@
1
+ import { Store } from "./store.types";
2
+ import { Objectify } from "./common.types";
1
3
  import { CartProduct } from "./product.types";
2
4
  import { PriceCategoryType } from "./product.types";
3
- import { Objectify } from "./common.types";
4
- import { Store } from "./store.types";
5
5
  import { ShippingCost } from "./shippingCost.types";
6
- import { ShoppingCartBenefits } from "./coupons.types";
6
+ import { ShoppingCartBenefits } from "./coupon.types";
7
+ import { ArtisanDBDocumentData } from "./artisanDB.types";
7
8
  import { ArtisanDBCollectionReference } from "./artisanDB.types";
8
9
  import { ArtisanDBQueryDocumentSnapshot } from "./artisanDB.types";
9
- import { ArtisanDBDocumentData } from "./artisanDB.types";
10
10
  /**
11
- * ShoppingCart attributes.
11
+ * Representation of a Commerce Shopping Cart.
12
12
  *
13
13
  * @interface ShoppingCart
14
14
  * @since 0.5.14
15
- * @property {string} id The id of the shopping cart
16
- * @property {string} name The name of the shopping cart
17
- * @property {number} latitude The latitude of the shopping cart
18
- * @property {number} longitude The longitude of the shopping cart
19
- * @property {PriceCategoryType} priceCategory The priceCategory of the shopping cart
20
- * @property {string} createdAt Shopping cart creation date
21
- * @property {string} updatedAt Shopping cart update date
22
- * @property {number} channelId The channel id of he shopping cart
23
- * @property {Objectify<CartStore>} stores The stores of the shopping cart
24
- * @property {ShippingCost} shippingCost The shipping cost of the shopping cart
25
- * @property {Record<string, any>} additional_info The additional info of the shopping cart
26
- * @property {BillTotal} billTotal The bill total of the shopping cart
27
- * @property {ShoppingCartBenefits} benefits The applied benefits of the shopping cart
28
- * @property {string} benefitsHash The user wallet id of the shopping cart
29
- *
30
15
  */
31
16
  export interface ShoppingCart {
17
+ /** Shopping cart unique identifier */
32
18
  id: string;
19
+ /** Shopping cart name */
33
20
  name: string;
21
+ /** Shopping cart latitude */
34
22
  latitude: number;
23
+ /** Shopping cart longitude */
35
24
  longitude: number;
25
+ /** Shopping cart price category, see {@link PriceCategoryType}*/
36
26
  priceCategory?: PriceCategoryType;
27
+ /** Shopping cart creation date */
37
28
  createdAt: string;
29
+ /** Shopping cart update date */
38
30
  updatedAt: string;
31
+ /** Shopping cart channel unique identifier */
39
32
  channelId: number;
33
+ /** Shopping cart stores, see Objectify<{@link CartStore}> */
40
34
  stores: Objectify<CartStore>;
41
- shippingCost?: ShippingCost;
35
+ /** Shopping cart shipping cost */
36
+ shippingCost: ShippingCost | null;
37
+ /** Shopping cart additional info */
42
38
  additional_info?: Record<string, any>;
39
+ /** Shopping cart bill total */
43
40
  billTotal: BillTotal;
41
+ /** Shopping cart applied benefits */
44
42
  benefits?: ShoppingCartBenefits;
43
+ /** Shopping cart user wallet id */
45
44
  benefitsHash?: string;
46
45
  }
46
+ /**
47
+ * Representation of a Alert.
48
+ *
49
+ * @interface Alert
50
+ * @since 0.5.14
51
+ */
47
52
  export interface Alert {
53
+ /** Alert error level */
48
54
  errorLevel: number;
55
+ /** Alert message */
49
56
  message: string;
57
+ /** Alert type */
50
58
  type: string;
51
59
  }
60
+ /**
61
+ * Representation of a Cart Store.
62
+ *
63
+ * @interface CartStore
64
+ * @since 0.5.14
65
+ * @extends {{@link Store}
66
+ */
52
67
  export interface CartStore extends Store {
68
+ /** The products that belong to the store, see {@link CartProduct} */
53
69
  products: Objectify<CartProduct>;
70
+ /** Cart store's alerts */
54
71
  alerts: [];
55
72
  }
73
+ /**
74
+ * The possible values of a Bill Total.
75
+ *
76
+ * @typedef BillTotal
77
+ * @since 0.5.14
78
+ */
56
79
  export declare type BillTotal = {
80
+ /** Normal bill total category */
57
81
  NORMAL?: BillTotalCategory;
82
+ /** Points bill total category */
58
83
  POINTS?: BillTotalCategory;
59
84
  };
85
+ /**
86
+ * Representation of a Bill Total Category.
87
+ *
88
+ * @interface BillTotalCategory
89
+ * @since 0.5.14
90
+ */
60
91
  export interface BillTotalCategory {
92
+ /** Bill total category subtotal without taxes */
61
93
  subtotalBeforeTaxes: number;
94
+ /** Bill total category total taxes */
62
95
  taxTotal: number;
96
+ /** Bill total category total */
63
97
  total: number;
64
98
  }
99
+ /**
100
+ * Representation of a Cart Totals.
101
+ *
102
+ * @interface CartTotals
103
+ * @since 0.5.14
104
+ */
65
105
  export interface CartTotals {
106
+ /** Cart totals subtotal */
66
107
  subtotal: number;
108
+ /** Cart totals shipping cost */
67
109
  shippingCost: number;
68
110
  }
111
+ /**
112
+ * A shopping cart DB node from a user.
113
+ *
114
+ * @typedef ShoppingCartNode
115
+ * @since 0.5.14
116
+ */
69
117
  export declare type ShoppingCartNode = ArtisanDBQueryDocumentSnapshot<ArtisanDBDocumentData>;
118
+ /**
119
+ * The complete collection of shopping carts DB nodes from a user.
120
+ *
121
+ * @typedef ShoppingCartNodes
122
+ * @since 0.5.14
123
+ */
70
124
  export declare type ShoppingCartNodes = ArtisanDBCollectionReference<ArtisanDBDocumentData>;
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
+ // ShoppingCart types and interfaces
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  //# sourceMappingURL=shoppingCart.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shoppingCart.types.js","sourceRoot":"","sources":["../../src/types/shoppingCart.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"shoppingCart.types.js","sourceRoot":"","sources":["../../src/types/shoppingCart.types.ts"],"names":[],"mappings":";AAAA,oCAAoC"}