@artisan-commerce/types 0.13.0-canary.0 → 0.13.0-canary.10

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,95 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.13.0-canary.10](https://bitbucket.org/tradesystem/artisan_sdk/compare/@artisan-commerce/types@0.13.0-canary.9...@artisan-commerce/types@0.13.0-canary.10) (2021-07-26)
7
+
8
+
9
+ ### Features
10
+
11
+ * **global:** anonymous shopping cart ([99762c1](https://bitbucket.org/tradesystem/artisan_sdk/commit/99762c1ee8e2bce47eb936b3f76a280048579916))
12
+
13
+
14
+
15
+ ## [0.13.0-canary.9](https://bitbucket.org/tradesystem/artisan_sdk/compare/@artisan-commerce/types@0.13.0-canary.8...@artisan-commerce/types@0.13.0-canary.9) (2021-06-18)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **global:** fix remove benefit method ([a6cb684](https://bitbucket.org/tradesystem/artisan_sdk/commit/a6cb68453250ca855d8609b9f3c8de8c0d5d9b90))
21
+
22
+
23
+
24
+ ## [0.13.0-canary.8](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.13.0-canary.7...@artisan-commerce/types@0.13.0-canary.8) (2021-06-10)
25
+
26
+
27
+ ### Features
28
+
29
+ * **global:** coupons functionality ([6a538c4](https://bitbucket.org/tradesystem/artisan_monorepo/commit/6a538c40d7e0eb380c6bbb274bd640b591787bc8))
30
+ * **global:** coupons functionality ([33117c2](https://bitbucket.org/tradesystem/artisan_monorepo/commit/33117c27c0e9f2d5e28705934abd1597fc92092e))
31
+ * **global:** coupons functionality ([2202f0d](https://bitbucket.org/tradesystem/artisan_monorepo/commit/2202f0dd41a393eca7697d056df6f75f80748bb1))
32
+
33
+
34
+
35
+ ## [0.13.0-canary.7](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.13.0-canary.6...@artisan-commerce/types@0.13.0-canary.7) (2021-04-22)
36
+
37
+
38
+ ### Features
39
+
40
+ * **types:** add country types and interfaces ([f73fabd](https://bitbucket.org/tradesystem/artisan_monorepo/commit/f73fabd5615ae1bb39c9ca59a8b79a5437eca9d1))
41
+
42
+
43
+
44
+ ## [0.13.0-canary.6](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.13.0-canary.5...@artisan-commerce/types@0.13.0-canary.6) (2021-04-21)
45
+
46
+
47
+ ### Features
48
+
49
+ * **global:** update account types and add account builders ([4a6fecd](https://bitbucket.org/tradesystem/artisan_monorepo/commit/4a6fecdc45b363f068a6089eccbf36483f517288))
50
+
51
+
52
+
53
+ ## [0.13.0-canary.5](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.13.0-canary.4...@artisan-commerce/types@0.13.0-canary.5) (2021-04-16)
54
+
55
+ **Note:** Version bump only for package @artisan-commerce/types
56
+
57
+
58
+
59
+
60
+
61
+ ## [0.13.0-canary.4](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.13.0-canary.3...@artisan-commerce/types@0.13.0-canary.4) (2021-04-06)
62
+
63
+
64
+ ### Performance Improvements
65
+
66
+ * **global:** move typescript to be a global dependency ([32370e1](https://bitbucket.org/tradesystem/artisan_monorepo/commit/32370e134f1bcc4f79c55e2bae0ee22fee193e77))
67
+
68
+
69
+
70
+ ## [0.13.0-canary.3](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.13.0-canary.2...@artisan-commerce/types@0.13.0-canary.3) (2021-04-01)
71
+
72
+ **Note:** Version bump only for package @artisan-commerce/types
73
+
74
+
75
+
76
+
77
+
78
+ ## [0.13.0-canary.2](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.13.0-canary.1...@artisan-commerce/types@0.13.0-canary.2) (2021-03-19)
79
+
80
+ **Note:** Version bump only for package @artisan-commerce/types
81
+
82
+
83
+
84
+
85
+
86
+ ## [0.13.0-canary.1](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.13.0-canary.0...@artisan-commerce/types@0.13.0-canary.1) (2021-03-19)
87
+
88
+
89
+ ### Features
90
+
91
+ * **types:** add init-rn types ([e4f44c4](https://bitbucket.org/tradesystem/artisan_monorepo/commit/e4f44c484e8d223a1716daf4cf0ec098dfde620a))
92
+
93
+
94
+
6
95
  ## [0.13.0-canary.0](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/types@0.12.2-canary.2...@artisan-commerce/types@0.13.0-canary.0) (2021-03-18)
7
96
 
8
97
 
package/build/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export * from "./types/category.types";
5
5
  export * from "./types/channel.types";
6
6
  export * from "./types/common.types";
7
7
  export * from "./types/coupons.types";
8
+ export * from "./types/country.types";
9
+ export * from "./types/currency.types";
8
10
  export * from "./types/image.types";
9
11
  export * from "./types/product.types";
10
12
  export * from "./types/shippingCost.types";
package/build/index.js CHANGED
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
7
7
  o[k2] = m[k];
8
8
  }));
9
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  // Main
@@ -18,6 +18,8 @@ __exportStar(require("./types/category.types"), exports);
18
18
  __exportStar(require("./types/channel.types"), exports);
19
19
  __exportStar(require("./types/common.types"), exports);
20
20
  __exportStar(require("./types/coupons.types"), exports);
21
+ __exportStar(require("./types/country.types"), exports);
22
+ __exportStar(require("./types/currency.types"), exports);
21
23
  __exportStar(require("./types/image.types"), exports);
22
24
  __exportStar(require("./types/product.types"), exports);
23
25
  __exportStar(require("./types/shippingCost.types"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO;AACP,oDAAkC;AAClC,wDAAsC;AACtC,0DAAwC;AACxC,yDAAuC;AACvC,wDAAsC;AACtC,uDAAqC;AACrC,wDAAsC;AACtC,sDAAoC;AACpC,wDAAsC;AACtC,6DAA2C;AAC3C,6DAA2C;AAC3C,sDAAoC;AACpC,uDAAqC;AACrC,qDAAmC;AACnC,qDAAmC;AACnC,4DAA0C;AAC1C,4DAA0C;AAC1C,gEAA8C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO;AACP,oDAAkC;AAClC,wDAAsC;AACtC,0DAAwC;AACxC,yDAAuC;AACvC,wDAAsC;AACtC,uDAAqC;AACrC,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,sDAAoC;AACpC,wDAAsC;AACtC,6DAA2C;AAC3C,6DAA2C;AAC3C,sDAAoC;AACpC,uDAAqC;AACrC,qDAAmC;AACnC,qDAAmC;AACnC,4DAA0C;AAC1C,4DAA0C;AAC1C,gEAA8C"}
@@ -1,13 +1,17 @@
1
+ import { Image } from "./image.types";
1
2
  /**
2
- * Representation of a Customer Account
3
+ * Representation of a Commerce Account
3
4
  *
4
5
  * @interface Account
5
- * @author Luis Eduardo Andrade
6
6
  * @since 0.5.14
7
7
  * @property {number} accountId artisan's account unique identifier.
8
8
  * @property {string} name account's name.
9
+ * @property {string} description account's description.
10
+ * @property {string} images account's images.
9
11
  */
10
12
  export interface Account {
11
13
  accountId: number;
12
14
  name: string;
15
+ description?: string;
16
+ images: Image[];
13
17
  }
@@ -1,26 +1,54 @@
1
1
  import firebase from "firebase";
2
+ export declare type ArtisanApp = ArtisanAppWeb | ArtisanAppRN;
2
3
  /**
3
- * The ArtisanApp orchestrate the connections of the app with the DB, server and its settings.
4
+ * The ArtisanAppWeb orchestrate the connections of the app with the DB, server and its settings.
4
5
  *
5
- * @interface ArtisanApp
6
- * @author Luis Eduardo Andrade
6
+ * @interface ArtisanAppWeb
7
7
  * @since 0.5.14
8
8
  * @property {string} name app's name
9
9
  * @property {string} apiURL artisan's account API URL
10
10
  * @property {ArtisanSettings} settings artisan app settings configuration
11
11
  */
12
- export interface ArtisanApp {
12
+ export interface ArtisanAppWeb {
13
13
  name: firebase.app.App["name"];
14
14
  apiURL: string;
15
15
  settings: ArtisanSettings;
16
16
  __internals__: firebase.app.App;
17
17
  __instance__: typeof firebase;
18
18
  }
19
+ /**
20
+ * The ArtisanAppRN orchestrate the connections of the app with the DB, server and its settings.
21
+ *
22
+ * @interface ArtisanAppRN
23
+ * @since 0.5.14
24
+ * @property {string} name app's name
25
+ * @property {string} apiURL artisan's account API URL
26
+ * @property {ArtisanSettings} settings artisan app settings configuration
27
+ */
28
+ export interface ArtisanAppRN {
29
+ apiURL: string;
30
+ __internals__: RNFirebaseInstance;
31
+ __instance__: RNFirebaseInstance;
32
+ settings: ArtisanSettings;
33
+ name: string;
34
+ }
35
+ /**
36
+ * Settings to configure the Firabse Instance.
37
+ *
38
+ * @interface RNFirebaseInstance
39
+ * @since 0.5.14
40
+ * @property {aut} auth auth package from react-native-auth
41
+ * @property {firestore} firestore firestore package from react-native-auth
42
+ * @property {ArtisanSettings} settings artisan app settings configuration
43
+ */
44
+ export interface RNFirebaseInstance {
45
+ auth: any;
46
+ firestore: any;
47
+ }
19
48
  /**
20
49
  * Settings to configure the Artisan app.
21
50
  *
22
51
  * @interface ArtisanSettings
23
- * @author Luis Eduardo Andrade
24
52
  * @since 0.5.14
25
53
  * @property {number} accountId artisan's account unique identifier
26
54
  * @property {ArtisanPlatform} platform app's running on platform
@@ -37,27 +65,28 @@ export interface ArtisanSettings {
37
65
  appId?: string;
38
66
  authDomain: string;
39
67
  }
68
+ export interface ArtisanSettingsRN {
69
+ platform: ArtisanPlatform;
70
+ accountId?: number;
71
+ }
40
72
  /**
41
73
  * Artisan app's allowed platforms to run on.
42
74
  *
43
- * @type ArtisanPlatform
44
- * @author Luis Eduardo Andrade
75
+ * @typedef ArtisanPlatform
45
76
  * @since 0.5.14
46
77
  */
47
78
  export declare type ArtisanPlatform = "web" | "ios" | "android" | "windows" | "macos" | "call center";
48
79
  /**
49
80
  * Artisan's auth instance is the intance of the internal auth object.
50
81
  *
51
- * @type AritsanInstanceAuth
52
- * @author Luis Eduardo Andrade
82
+ * @typedef AritsanInstanceAuth
53
83
  * @since 0.5.14
54
84
  */
55
85
  export declare type AritsanInstanceAuth = typeof firebase.auth;
56
86
  /**
57
87
  * Artisan's auth object to handle providers authentication.
58
88
  *
59
- * @type ArtisanAuth
60
- * @author Luis Eduardo Andrade
89
+ * @typedef ArtisanAuth
61
90
  * @since 0.5.14
62
91
  */
63
92
  export interface ArtisanAuth extends firebase.auth.Auth {
@@ -66,7 +95,6 @@ export interface ArtisanAuth extends firebase.auth.Auth {
66
95
  * Main artisan commerce filters.
67
96
  *
68
97
  * @interface ArtisanHints
69
- * @author Luis Eduardo Andrade
70
98
  * @since 0.5.14
71
99
  * @property {string|number} accountId artisan's account unique identifier
72
100
  * @property {string|number} vendorId vendor's id
@@ -87,7 +115,6 @@ export interface ArtisanHints {
87
115
  * Unrestricted allowed Artisan SDK rest api headers.
88
116
  *
89
117
  * @interface ArtisanHeaders
90
- * @author Luis Eduardo Andrade
91
118
  * @since 0.5.14
92
119
  * @property {ArtisanPlatform} Platform app's running on platform
93
120
  * @property {string|number} account account's id
@@ -101,7 +128,6 @@ export interface ArtisanHeaders {
101
128
  *
102
129
  * @interface ArtisanRestrictedHeaders
103
130
  * @extends ArtisanHeaders
104
- * @author Luis Eduardo Andrade
105
131
  * @since 0.5.14
106
132
  * @property {ArtisanPlatform} Authorization app's authentication token
107
133
  */
@@ -1,4 +1,4 @@
1
- import { Country } from "./common.types";
1
+ import { CountrySummary } from "./common.types";
2
2
  import { DocumentType } from "./common.types";
3
3
  export interface BaseBillingData {
4
4
  nickname: string;
@@ -9,7 +9,7 @@ export interface BaseBillingData {
9
9
  phone: string;
10
10
  email: string;
11
11
  default: boolean;
12
- country: Country;
12
+ country: CountrySummary;
13
13
  }
14
14
  export interface BillingData extends BaseBillingData {
15
15
  id: number;
@@ -2,7 +2,7 @@ export interface Objectify<T> {
2
2
  [key: string]: T;
3
3
  }
4
4
  export declare type DocumentType = "CI" | "RUC" | "PASSPORT";
5
- export interface Country {
5
+ export interface CountrySummary {
6
6
  id: number;
7
7
  name: string;
8
8
  }
@@ -0,0 +1,18 @@
1
+ export interface Country {
2
+ countryId: string;
3
+ name: string;
4
+ code: string;
5
+ active: boolean;
6
+ currency: CountryCurrency;
7
+ taxes: CountryTax[];
8
+ }
9
+ export interface CountryCurrency {
10
+ currencyId: string;
11
+ name: string;
12
+ sign: string;
13
+ }
14
+ export interface CountryTax {
15
+ tax: string;
16
+ vatRate: string;
17
+ percentage: string;
18
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Country types and interfaces
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=country.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country.types.js","sourceRoot":"","sources":["../../src/types/country.types.ts"],"names":[],"mappings":";AAAA,+BAA+B"}
@@ -2,14 +2,50 @@ import { ArtisanDBCollectionReference } from "./artisanDB.types";
2
2
  import { ArtisanDBQueryDocumentSnapshot } from "./artisanDB.types";
3
3
  import { ArtisanDBDocumentData } from "./artisanDB.types";
4
4
  import { Image } from "./image.types";
5
+ /**
6
+ * Walllet user information.
7
+ *
8
+ * @interface Wallet
9
+ * @since 0.5.14
10
+ * @property {Benefit[]} benefits Benefit's array from firestore user wallet
11
+ *
12
+ */
5
13
  export interface Wallet {
6
14
  benefits: Benefit[];
7
- usedBenefits: Benefit[];
8
- unusedBenefits: Benefit[];
9
15
  }
16
+ /**
17
+ * Benefit information.
18
+ *
19
+ * @interface Benefit
20
+ * @since 0.5.14
21
+ * @property {string} hash The user wallet id
22
+ * @property {Award} award The benefit awards
23
+ * @property {number} benefitId Benefit id
24
+ * @property {number} benefitWalletId Benefit wallet id
25
+ * @property {null} code Benefit code in back-end
26
+ * @property {string} combined Combined
27
+ * @property {string} createdAt Benefit creation date
28
+ * @property {string} description Benefit description
29
+ * @property {number} discountPercentage Benefit discount percentage
30
+ * @property {string} expirationDate Benefit expiration date
31
+ * @property {null} externalId External benefit id
32
+ * @property {Image[]} image Benefit images
33
+ * @property {null} limitAward The award limit
34
+ * @property {number} limitBenefit The benefit limit
35
+ * @property {string} logicOperator The logic operator of the benefit
36
+ * @property {number} quantity Benefit stock
37
+ * @property {any[]} rules The rules of the benefit
38
+ * @property {string} title The benefit title
39
+ * @property {BenefitTypes} type Benefit type
40
+ * @property {string} updatedAt Benefit update date
41
+ * @property {number} channelId The channel id of the benefit
42
+ * @property {number} vendorId The vendor id of the benefit
43
+ * @property {number} accountId The account id of the benefit
44
+ *
45
+ */
10
46
  export interface Benefit {
11
47
  hash: string;
12
- award: Award[];
48
+ award: Award;
13
49
  benefitId: number;
14
50
  benefitWalletId: number;
15
51
  code: null;
@@ -26,18 +62,35 @@ export interface Benefit {
26
62
  quantity: number;
27
63
  rules: any[];
28
64
  title: string;
29
- type: string;
65
+ type: BenefitTypes;
30
66
  updatedAt: string;
67
+ channelId: number;
68
+ vendorId: number;
69
+ accountId: number;
31
70
  }
71
+ /**
72
+ * Award information.
73
+ *
74
+ * @interface Award
75
+ * @since 0.5.14
76
+ * @property {number} id The id of the award
77
+ * @property {number} benefitId The id of the benefit
78
+ * @property {number} discountPercentage Benefit discount percentage
79
+ * @property {null} discountValue Benefit discount value
80
+ *
81
+ */
32
82
  export interface Award {
33
83
  id: number;
34
84
  benefitId: number;
35
85
  discountPercentage: number;
36
86
  discountValue: null;
37
87
  }
38
- export interface ShoppingCartBenefits {
39
- [key: string]: Benefit;
40
- }
88
+ /**
89
+ * Applied benefit array in shopping cart
90
+ *
91
+ * @type ShoppingCartBenefits
92
+ **/
93
+ export declare type ShoppingCartBenefits = Benefit[];
41
94
  export declare type BenefitsByUserNode = ArtisanDBQueryDocumentSnapshot<ArtisanDBDocumentData>;
42
95
  export declare type BenefitsByUserNodes = ArtisanDBCollectionReference<ArtisanDBDocumentData>;
43
96
  export declare type BenefitTypes = "ALTER_DELIVERY" | "PRODUCT" | "DISCOUNT";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Artisan's supported currency codes.
3
+ *
4
+ * @typedef CurrencyCodes
5
+ * @since 0.5.14
6
+ */
7
+ export declare type CurrencyCodes = "USD" | "ARS" | "COP" | "CLP" | "VES";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Currency types and interfaces
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=currency.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.types.js","sourceRoot":"","sources":["../../src/types/currency.types.ts"],"names":[],"mappings":";AAAA,gCAAgC"}
@@ -1,16 +1,38 @@
1
1
  import { Image } from "./image.types";
2
2
  import { Alert } from "./shoppingCart.types";
3
3
  export declare type Product = BaseProduct | ProductDetails | CartProduct;
4
+ /**
5
+ * Base product attributes.
6
+ *
7
+ * @interface BaseProduct
8
+ * @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
+ */
4
29
  export interface BaseProduct {
5
30
  productId: string;
6
31
  name: string;
7
32
  description: string;
8
33
  type: ProductType;
9
34
  coverUrl: string;
10
- prices: {
11
- NORMAL: PriceCategory;
12
- POINTS: PriceCategory;
13
- };
35
+ prices: ProductPrices;
14
36
  addDirectlyToCart: boolean;
15
37
  outOfService: boolean;
16
38
  outOfStock: boolean;
@@ -22,7 +44,20 @@ export interface BaseProduct {
22
44
  images: Image[];
23
45
  standardTime: string;
24
46
  sponsored: boolean;
25
- status: "ACTIVE" | "INACTIVE";
47
+ status: ProductStatus;
48
+ }
49
+ /**
50
+ * Product prices attributes.
51
+ *
52
+ * @interface ProductPrices
53
+ * @since 0.5.14
54
+ * @property {PriceCategory} NORMAL Normal price cotegory
55
+ * @property {PriceCategory} POINTS Points price category
56
+ *
57
+ */
58
+ export interface ProductPrices {
59
+ NORMAL: PriceCategory;
60
+ POINTS: PriceCategory;
26
61
  }
27
62
  export interface PriceCategory {
28
63
  category: PriceCategoryType;
@@ -47,6 +82,13 @@ export interface ProductAttributes {
47
82
  externalId: string;
48
83
  showInMenu: boolean;
49
84
  }
85
+ /**
86
+ * The product status
87
+ *
88
+ * @since 0.5.14
89
+ * @type ProductStatus
90
+ **/
91
+ export declare type ProductStatus = "ACTIVE" | "INACTIVE";
50
92
  export declare enum ProductType {
51
93
  PRODUCT = "PRODUCT",
52
94
  MODIFIER = "MODIFIER"
@@ -83,12 +125,26 @@ export interface ProductQuestion {
83
125
  images: Image[] | undefined;
84
126
  }
85
127
  declare type CommonProductAndAnswersProps = "name" | "prices" | "attributes" | "productId" | "type" | "images";
128
+ /**
129
+ * Product details attributes.
130
+ *
131
+ * @interface ProductDetails
132
+ * @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
+ *
140
+ */
86
141
  export interface ProductDetails extends BaseProduct {
87
142
  isPriceVip: boolean;
88
143
  manufacturer: string[];
89
144
  maxAmountForSale: number;
90
145
  schedule: DayOfWeek[];
91
146
  questions: ProductQuestion[];
147
+ benefitId?: number;
92
148
  }
93
149
  export interface ProductAnswer extends Pick<Product, CommonProductAndAnswersProps> {
94
150
  questions: ProductDetails["questions"];
@@ -1 +1 @@
1
- {"version":3,"file":"product.types.js","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":";;;AAwDA,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":";;;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,4 +1,4 @@
1
- import { Country } from "./common.types";
1
+ import { CountrySummary } from "./common.types";
2
2
  import { LivingPlace, LivingPlaceToSave } from "./livingPlace.types";
3
3
  export interface BaseShippingAddress {
4
4
  default: boolean;
@@ -9,7 +9,7 @@ export interface BaseShippingAddress {
9
9
  number: string;
10
10
  secondaryStreet: string;
11
11
  addressReference: string;
12
- country: Country;
12
+ country: CountrySummary;
13
13
  }
14
14
  export interface ShippingAddress extends BaseShippingAddress {
15
15
  id: number;
@@ -7,6 +7,27 @@ import { ShoppingCartBenefits } from "./coupons.types";
7
7
  import { ArtisanDBCollectionReference } from "./artisanDB.types";
8
8
  import { ArtisanDBQueryDocumentSnapshot } from "./artisanDB.types";
9
9
  import { ArtisanDBDocumentData } from "./artisanDB.types";
10
+ /**
11
+ * ShoppingCart attributes.
12
+ *
13
+ * @interface ShoppingCart
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
+ */
10
31
  export interface ShoppingCart {
11
32
  id: string;
12
33
  name: string;
@@ -21,7 +42,7 @@ export interface ShoppingCart {
21
42
  additional_info?: Record<string, any>;
22
43
  billTotal: BillTotal;
23
44
  benefits?: ShoppingCartBenefits;
24
- benefitHash?: string;
45
+ benefitsHash?: string;
25
46
  }
26
47
  export interface Alert {
27
48
  errorLevel: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@artisan-commerce/types",
3
3
  "description": "Artisan's types and interfaces library",
4
- "version": "0.13.0-canary.0",
4
+ "version": "0.13.0-canary.10",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
7
7
  "files": [
@@ -26,7 +26,6 @@
26
26
  "@types/node": "^14.0.24",
27
27
  "@typescript-eslint/eslint-plugin": "^3.7.0",
28
28
  "@typescript-eslint/parser": "^3.7.0",
29
- "cross-env": "^7.0.2",
30
29
  "eslint": "^7.5.0",
31
30
  "eslint-config-prettier": "^6.11.0",
32
31
  "eslint-config-react-app": "^5.2.1",
@@ -41,8 +40,7 @@
41
40
  "jest-extended": "^0.11.5",
42
41
  "npm-run-all": "^4.1.5",
43
42
  "prettier": "^2.1.2",
44
- "typescript": "^3.9.7",
45
43
  "webpack-bundle-analyzer": "^3.9.0"
46
44
  },
47
- "gitHead": "68827d9ca402ce4d599f8e626f8d94a15dde6086"
45
+ "gitHead": "d40676dbade0365a3d0fb195a095e65965e08162"
48
46
  }