@nicefer/types 3.0.0-alpha.25 → 3.0.0-alpha.27

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.
@@ -3,10 +3,10 @@ import { PaymentInDB } from "./payments";
3
3
  import { CategoryType } from "./product-category";
4
4
  import { ProductVariantInDB } from "./products";
5
5
  export interface Bag {
6
- subtotalPrice: number;
7
- subtotalWithDiscount: number;
8
- totalPrice: number;
9
- shippingPrice: number;
6
+ subtotalPrice: string;
7
+ subtotalWithDiscount: string;
8
+ totalPrice: string;
9
+ shippingPrice: string;
10
10
  discounts?: OrderDiscountApplied[];
11
11
  ccy: PaymentInDB['ccy'];
12
12
  products: {
@@ -30,9 +30,9 @@ export interface ProductWithVariantInBag {
30
30
  warehouseId: string;
31
31
  selectedOptions: ProductVariantInDB['selectedOptions'];
32
32
  variantQty: number;
33
- variantPrice: number;
34
- variantPriceWithDiscount?: number;
35
- createdAt: string;
36
- updatedAt?: string;
33
+ variantPrice: string;
34
+ variantPriceWithDiscount?: string;
35
+ createdAt: Date;
36
+ updatedAt?: Date;
37
37
  }
38
38
  //# sourceMappingURL=bag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bag.d.ts","sourceRoot":"","sources":["../../src/types/bag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,GAAG;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACnC,GAAG,EAAE,WAAW,CAAC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E,MAAM,GAAG,uBAAuB,CAAC;KAC9C,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACnC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAExB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAEvD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -22,10 +22,10 @@ export interface Expense {
22
22
  _id?: string;
23
23
  description: string;
24
24
  categories: ExpenseCategory[];
25
- amountHNL: number;
26
- amountUSD: number;
25
+ amountHNL: string;
26
+ amountUSD: string;
27
27
  ccy: Country['ccy'];
28
- exchangeRate: number;
28
+ exchangeRate: string;
29
29
  expensedAt: Date;
30
30
  paymentMethod: PaymentMethods;
31
31
  supplier?: SupplierFK;
@@ -15,7 +15,7 @@ export interface OrderDiscount {
15
15
  subtitle: string;
16
16
  code: string;
17
17
  automatic?: boolean;
18
- amount: number;
18
+ amount: string;
19
19
  isPercent: boolean;
20
20
  condition: 'first_order' | 'delivery_free' | 'none' | 'student' | 'share_5_friends';
21
21
  conditionDescription: string;
@@ -32,7 +32,7 @@ export interface OrderStatus {
32
32
  createdAt: Date;
33
33
  }
34
34
  export interface OrderDiscountApplied extends OrderDiscount {
35
- amountInCurrentCcy?: number;
35
+ amountInCurrentCcy?: string;
36
36
  }
37
37
  export interface ProductPrepared {
38
38
  productId: string;
@@ -91,12 +91,12 @@ export interface OrderInDB {
91
91
  * Indicará qué productos de {@link products} fueron preparados y cuantas unidades.
92
92
  */
93
93
  productsPrepared?: ProductPrepared[];
94
- subtotalPrice: number;
95
- subtotalWithDiscount: number;
96
- totalPrice: number;
97
- paidAmount: number;
98
- dueAmount: number;
99
- shippingPrice: number;
94
+ subtotalPrice: string;
95
+ subtotalWithDiscount: string;
96
+ totalPrice: string;
97
+ paidAmount: string;
98
+ dueAmount: string;
99
+ shippingPrice: string;
100
100
  discounts?: OrderDiscountApplied[];
101
101
  trackingHistory: OrderStatus[];
102
102
  deliveryAddress: UserAddressInDB;
@@ -144,10 +144,10 @@ export interface OrderReady {
144
144
  msg?: string | null | undefined;
145
145
  };
146
146
  salesChannel?: SalesChannel;
147
- subtotalPrice: number;
148
- shippingPrice: number;
149
- subtotalWithDiscount: number;
150
- totalPrice: number;
147
+ subtotalPrice: string;
148
+ shippingPrice: string;
149
+ subtotalWithDiscount: string;
150
+ totalPrice: string;
151
151
  }
152
152
  /**
153
153
  * Ordenes listas para que el usuario decida pagar
@@ -30,8 +30,8 @@ export interface CashDetails {
30
30
  * pago del cliente realice el pago a Nicefer
31
31
  */
32
32
  cashOnDelivery?: {
33
- feePercent: number;
34
- feeAmount: number;
33
+ feePercent: string;
34
+ feeAmount: string;
35
35
  };
36
36
  }
37
37
  /**
@@ -40,7 +40,7 @@ export interface CashDetails {
40
40
  export interface PaymentInDB {
41
41
  _id?: string;
42
42
  orderId: string;
43
- amount: number;
43
+ amount: string;
44
44
  ccy: string;
45
45
  method: PaymentMethods;
46
46
  /**
@@ -76,7 +76,7 @@ export interface StripePaymentIntentParams {
76
76
  cardHolder: string | string | null | undefined;
77
77
  billingAddressLine1: string | string | null | undefined;
78
78
  billingAddressCity: string | string | null | undefined;
79
- amount: number;
79
+ amount: string;
80
80
  currency: string;
81
81
  metadata: PaymentInStripeMetadata;
82
82
  }
@@ -130,15 +130,15 @@ export interface VariantWarehouseFK {
130
130
  id: string;
131
131
  name: string;
132
132
  stock: number;
133
- price: number;
134
- priceUSD: number;
135
- lastPrice?: number;
136
- lastPriceUSD?: number;
137
- supplierPriceUSD: number;
138
- supplierPriceHNL: number;
139
- profitMarginUSD: number;
140
- profitMarginHNL: number;
141
- profitMarginPercent: number;
133
+ price: string;
134
+ priceUSD: string;
135
+ lastPrice?: string;
136
+ lastPriceUSD?: string;
137
+ supplierPriceUSD: string;
138
+ supplierPriceHNL: string;
139
+ profitMarginUSD: string;
140
+ profitMarginHNL: string;
141
+ profitMarginPercent: string;
142
142
  }
143
143
  /**
144
144
  * Para poder mostrar las variantes agrupadas
@@ -26,34 +26,30 @@ export interface SupplierFK {
26
26
  * Productos de la orden de reabastecimiento realizada al proveedor
27
27
  */
28
28
  export interface RProduct {
29
- id?: string;
29
+ _id?: string;
30
30
  productId: string;
31
31
  variantId: string;
32
- packageId: string;
33
32
  selectedOptions: ProductVariantInDB['selectedOptions'];
34
33
  newStock: number;
35
34
  supplier: Supplier;
36
35
  /**
37
36
  * Precio de compra al proveedor
38
37
  */
39
- supplierPrice: number;
38
+ supplierPrice: string;
40
39
  /** Id's que usa el proveedor para manejar este producto en su sistema */
41
40
  referenceCodes: string[];
42
41
  /**
43
42
  * Fecha de registro de el paquete en el sistema
44
43
  */
45
44
  createdAt?: Date;
46
- /**
47
- * Si no tiene rPackageId se considera un
48
- * producto de la misma orden pero huérfano
49
- */
50
- rPackageId?: string;
45
+ rPackageId: string;
46
+ rOrderId: string;
51
47
  }
52
48
  export interface ROrder {
53
49
  /**
54
50
  * Id único interno
55
51
  */
56
- id?: string;
52
+ _id?: string;
57
53
  /**
58
54
  * Número de orden del proveedor
59
55
  *
@@ -62,7 +58,7 @@ export interface ROrder {
62
58
  */
63
59
  supplierOrderId: string;
64
60
  supplier: Supplier;
65
- totalValue: number;
61
+ totalValue: string;
66
62
  packsQty: number;
67
63
  /**
68
64
  * Almacén final que recibirá la orden.
@@ -79,6 +75,11 @@ export interface ROrder {
79
75
  ccy: 'USD';
80
76
  createdAt?: Date;
81
77
  updatedAt?: Date;
78
+ purchasedAt: Date;
79
+ createdBy: {
80
+ id: string;
81
+ displayName: string;
82
+ };
82
83
  }
83
84
  export interface RPackageHistory {
84
85
  title: string;
@@ -97,14 +98,14 @@ export interface RPackageHistory {
97
98
  /**
98
99
  * Fecha en la que se registró el evento
99
100
  */
100
- createdAt: string;
101
+ createdAt?: Date;
101
102
  }
102
103
  export interface RPackage {
103
104
  _id?: string;
104
105
  /**
105
106
  * Id de {@link ROrder}
106
107
  */
107
- orderId: string;
108
+ rOrderId: string;
108
109
  itemsQty: number;
109
110
  historyTracking: RPackageHistory[];
110
111
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"replenishment.d.ts","sourceRoot":"","sources":["../../src/types/replenishment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD;;GAEG;AACH,MAAM,MAAM,YAAY;AACxB;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,UAAU,CAAC;AAEX,MAAM,WAAW,QAAQ;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AACD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IAE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,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -9,16 +9,16 @@ export interface UserStats {
9
9
  }
10
10
  export type Month = '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12';
11
11
  export interface MonthStats {
12
- sales?: number;
13
- expenses?: number;
12
+ sales?: string;
13
+ expenses?: string;
14
14
  orders?: number;
15
15
  }
16
16
  export interface YearStats {
17
17
  _id?: number;
18
18
  year: number;
19
19
  totals?: {
20
- sales?: number;
21
- expenses?: number;
20
+ sales?: string;
21
+ expenses?: string;
22
22
  orders?: number;
23
23
  };
24
24
  months?: Partial<Record<Month, MonthStats>>;
@@ -32,8 +32,8 @@ export interface DeliveryMethod {
32
32
  id: 'standard' | 'express' | 'weekend';
33
33
  name: string;
34
34
  inBusinessDays: `${number}-${number}`;
35
- deliveryFeeInUSD: number;
36
- deliveryFeeInHNL: number;
35
+ deliveryFeeInUSD: string;
36
+ deliveryFeeInHNL: string;
37
37
  /**
38
38
  * El cargo en {@link deliveryFeeInUSD} y {@link deliveryFeeInHNL}
39
39
  * permitirá un máximo de lo indicado aquí. Si se supera el máximo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicefer/types",
3
- "version": "3.0.0-alpha.25",
3
+ "version": "3.0.0-alpha.27",
4
4
  "description": "Tipos compartidos para Nicefer",
5
5
  "main": "dist/types/index.js",
6
6
  "exports": {