@merkaly/api 0.36.2 → 0.37.1

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 (58) hide show
  1. package/dist/app.schemas.d.ts +6 -11
  2. package/dist/dashboard/client/client.d.ts +0 -22
  3. package/dist/finance/chargeback/chargeback.entity.d.ts +33 -8
  4. package/dist/finance/payment/index.d.ts +0 -1
  5. package/dist/finance/payment/index.js +0 -1
  6. package/dist/finance/payment/payment.entity.d.ts +24 -21
  7. package/dist/finance/payment/payment.enum.d.ts +0 -5
  8. package/dist/finance/payment/payment.enum.js +0 -6
  9. package/dist/finance/refund/refund.entity.d.ts +5 -14
  10. package/dist/finance/withdrawal/withdrawal.entity.d.ts +46 -7
  11. package/dist/index.d.ts +2 -2
  12. package/dist/integration/payment/charge.d.ts +1 -1
  13. package/dist/integration/payment/index.d.ts +0 -2
  14. package/dist/integration/supplier/connection.d.ts +3 -0
  15. package/dist/integration/supplier/order.d.ts +8 -1
  16. package/dist/integration/supplier/product.d.ts +7 -0
  17. package/dist/inventory/catalog/product/product.entity.d.ts +18 -6
  18. package/dist/inventory/catalog/product/request.validator.js +2 -2
  19. package/dist/inventory/catalog/variant/request.validator.js +2 -2
  20. package/dist/inventory/catalog/variant/variant.entity.d.ts +45 -4
  21. package/dist/inventory/catalog/variant/variant.option.entity.d.ts +14 -2
  22. package/dist/logistics/shipment/shipment.d.ts +1 -1
  23. package/dist/logistics/shipment/shipment.entity.d.ts +18 -9
  24. package/dist/logistics/shipment/shipment.enum.d.ts +0 -4
  25. package/dist/logistics/shipment/shipment.enum.js +0 -5
  26. package/dist/order/purchase/purchase.entity.d.ts +3 -3
  27. package/dist/order/sale/attention.d.ts +1 -1
  28. package/dist/order/sale/attention.enum.d.ts +1 -0
  29. package/dist/order/sale/attention.enum.js +2 -0
  30. package/dist/order/sale/delivery.request.validator.d.ts +1 -1
  31. package/dist/order/sale/delivery.request.validator.js +2 -2
  32. package/dist/order/sale/delivery.update.request.validator.d.ts +1 -1
  33. package/dist/order/sale/delivery.update.request.validator.js +2 -2
  34. package/dist/order/sale/fulfillment.d.ts +1 -1
  35. package/dist/order/sale/fulfillment.enum.js +5 -1
  36. package/dist/order/sale/procurement.d.ts +3 -3
  37. package/dist/order/sale/quote.request.validator.d.ts +1 -1
  38. package/dist/order/sale/quote.request.validator.js +2 -2
  39. package/dist/order/sale/sale.entity.d.ts +2 -18
  40. package/dist/order/sale/sale.enum.d.ts +2 -1
  41. package/dist/order/sale/sale.enum.js +6 -3
  42. package/dist/order/sale/sale.transition.js +2 -1
  43. package/dist/settings/organization/index.d.ts +2 -1
  44. package/dist/settings/organization/index.js +1 -0
  45. package/dist/settings/organization/organization.contract.d.ts +38 -9
  46. package/dist/settings/organization/organization.enum.d.ts +0 -10
  47. package/dist/settings/organization/organization.enum.js +0 -11
  48. package/dist/settings/organization/{organization.entity.d.ts → settings.entity.d.ts} +1 -1
  49. package/dist/settings/organization/settings.enum.d.ts +11 -0
  50. package/dist/settings/organization/settings.enum.js +12 -0
  51. package/dist/transaction.entity.d.ts +2 -3
  52. package/package.json +1 -1
  53. package/dist/finance/payment/request.validator.d.ts +0 -14
  54. package/dist/finance/payment/request.validator.js +0 -61
  55. package/dist/integration/payment/payment.account.entity.d.ts +0 -52
  56. package/dist/integration/payment/payment.entity.d.ts +0 -8
  57. /package/dist/{query.interface.d.ts → query.types.d.ts} +0 -0
  58. /package/dist/{transitionable.interface.d.ts → transitionable.types.d.ts} +0 -0
@@ -21,13 +21,11 @@ export declare abstract class AppSchemas {
21
21
  taxes: string;
22
22
  withdrawals: string;
23
23
  };
24
- static get inventory(): {
25
- catalog: {
26
- brands: string;
27
- categories: string;
28
- products: string;
29
- variants: string;
30
- };
24
+ static get catalog(): {
25
+ brands: string;
26
+ categories: string;
27
+ products: string;
28
+ variants: string;
31
29
  };
32
30
  static get logistics(): {
33
31
  shipments: string;
@@ -39,10 +37,7 @@ export declare abstract class AppSchemas {
39
37
  sales: string;
40
38
  };
41
39
  static get integration(): {
42
- payments: string;
43
40
  suppliers: string;
44
41
  };
45
- static get settings(): {
46
- organizations: string;
47
- };
42
+ static get settings(): string;
48
43
  }
@@ -12,25 +12,3 @@ export interface DashboardClientRole {
12
12
  id: string;
13
13
  name: string;
14
14
  }
15
- export interface DashboardClientBillingPlan {
16
- amount: number | null;
17
- currency: string | null;
18
- interval: string | null;
19
- name: string | null;
20
- }
21
- export interface DashboardClientBillingSubscription {
22
- cancelAtPeriodEnd: boolean;
23
- currentPeriodEnd: number | null;
24
- id: string;
25
- plan: DashboardClientBillingPlan;
26
- status: string;
27
- }
28
- export interface DashboardClientBilling {
29
- customer: {
30
- email: string | null;
31
- id: string;
32
- name: string | null;
33
- } | null;
34
- linked: boolean;
35
- subscriptions: DashboardClientBillingSubscription[];
36
- }
@@ -1,17 +1,42 @@
1
+ import { Schema as MongoSchema } from 'mongoose';
1
2
  import { AbstractEntity } from '../../abstract.entity.js';
2
3
  import { FinanceChargebackReasonEnum, FinanceChargebackStatusEnum } from './chargeback.enum.js';
3
4
  import { FinancePaymentEntity } from '../payment';
5
+ export declare class FinanceChargebackHistoryEntity {
6
+ date: Date;
7
+ status: FinanceChargebackStatusEnum;
8
+ }
9
+ export declare const FinanceChargebackHistorySchema: MongoSchema<FinanceChargebackHistoryEntity, import("mongoose").Model<FinanceChargebackHistoryEntity, any, any, any, import("mongoose").Document<unknown, any, FinanceChargebackHistoryEntity, any, {}> & FinanceChargebackHistoryEntity & {
10
+ _id: import("mongoose").Types.ObjectId;
11
+ } & {
12
+ __v: number;
13
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FinanceChargebackHistoryEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FinanceChargebackHistoryEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<FinanceChargebackHistoryEntity> & {
14
+ _id: import("mongoose").Types.ObjectId;
15
+ } & {
16
+ __v: number;
17
+ }>;
18
+ export declare class FinanceChargebackGatewayEntity {
19
+ provider: string;
20
+ reference?: string | null;
21
+ id?: string | null;
22
+ status: string;
23
+ reason?: string | null;
24
+ }
25
+ export declare const FinanceChargebackGatewaySchema: MongoSchema<FinanceChargebackGatewayEntity, import("mongoose").Model<FinanceChargebackGatewayEntity, any, any, any, import("mongoose").Document<unknown, any, FinanceChargebackGatewayEntity, any, {}> & FinanceChargebackGatewayEntity & {
26
+ _id: import("mongoose").Types.ObjectId;
27
+ } & {
28
+ __v: number;
29
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FinanceChargebackGatewayEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FinanceChargebackGatewayEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<FinanceChargebackGatewayEntity> & {
30
+ _id: import("mongoose").Types.ObjectId;
31
+ } & {
32
+ __v: number;
33
+ }>;
4
34
  export declare class FinanceChargebackEntity extends AbstractEntity {
5
35
  payment: FinancePaymentEntity | string;
36
+ amount: number;
6
37
  status: FinanceChargebackStatusEnum;
38
+ history: FinanceChargebackHistoryEntity[];
7
39
  reason?: FinanceChargebackReasonEnum | null;
8
- rawReason?: string | null;
9
- openedAt: Date;
10
40
  respondBy?: Date | null;
11
- resolvedAt?: Date | null;
12
- amount: number;
13
- provider: string;
14
- reference?: string | null;
15
- chargebackId?: string | null;
16
- rawStatus: string;
41
+ gateway: FinanceChargebackGatewayEntity;
17
42
  }
@@ -1,6 +1,5 @@
1
1
  export * from './payment.entity';
2
2
  export * from './payment.enum';
3
- export * from './request.validator';
4
3
  export * from './payment.transition';
5
4
  export * from './report';
6
5
  export * from './report.request.validator';
@@ -1,4 +1,3 @@
1
1
  export * from './payment.enum.js';
2
- export * from './request.validator.js';
3
2
  export * from './payment.transition.js';
4
3
  export * from './report.request.validator.js';
@@ -1,26 +1,16 @@
1
1
  import { Schema as MongoSchema } from 'mongoose';
2
2
  import { PaymentChargeAccountEnum } from '../../integration/payment';
3
- import { OrderPurchaseEntity } from '../../order/purchase';
4
3
  import { OrderSaleEntity } from '../../order/sale';
5
4
  import { AbstractEntity } from '../../abstract.entity.js';
6
5
  import { StatusEntity } from '../../status.plugin.js';
7
- import { ITransitionable } from '../../transitionable.interface.js';
8
- import { FinancePaymentMethodEnum, FinancePaymentStatusEnum, FinancePaymentTypeEnum } from './payment.enum.js';
6
+ import { ITransitionable } from '../../transitionable.types.js';
7
+ import { FinancePaymentMethodEnum, FinancePaymentStatusEnum } from './payment.enum.js';
9
8
  import type { PaymentChargeStatusEnum } from '../../integration/payment';
10
- export type OrderEntity = OrderSaleEntity | OrderPurchaseEntity;
11
- export declare class FinancePaymentGatewayPixEntity {
12
- qrCode?: string | null;
13
- qrCodeImage?: string | null;
9
+ export interface FinancePaymentPixDetails {
10
+ qrCode: string | null;
11
+ qrImage: string | null;
14
12
  }
15
- export declare const FinancePaymentGatewayPixSchema: MongoSchema<FinancePaymentGatewayPixEntity, import("mongoose").Model<FinancePaymentGatewayPixEntity, any, any, any, import("mongoose").Document<unknown, any, FinancePaymentGatewayPixEntity, any, {}> & FinancePaymentGatewayPixEntity & {
16
- _id: import("mongoose").Types.ObjectId;
17
- } & {
18
- __v: number;
19
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FinancePaymentGatewayPixEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FinancePaymentGatewayPixEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<FinancePaymentGatewayPixEntity> & {
20
- _id: import("mongoose").Types.ObjectId;
21
- } & {
22
- __v: number;
23
- }>;
13
+ export type FinancePaymentGatewayDetails = FinancePaymentPixDetails | Record<string, unknown>;
24
14
  export declare class FinancePaymentGatewayEntity {
25
15
  provider: string;
26
16
  reference?: string | null;
@@ -29,7 +19,7 @@ export declare class FinancePaymentGatewayEntity {
29
19
  status: string;
30
20
  attempt: number;
31
21
  amount: number;
32
- pix?: FinancePaymentGatewayPixEntity | null;
22
+ details?: FinancePaymentGatewayDetails | null;
33
23
  expiresAt?: Date | null;
34
24
  syncedAt: Date;
35
25
  }
@@ -62,16 +52,29 @@ export declare const FinancePaymentAttemptSchema: MongoSchema<FinancePaymentAtte
62
52
  } & {
63
53
  __v: number;
64
54
  }>;
55
+ export declare class FinancePaymentSplitEntity {
56
+ percentage: number;
57
+ debts: number;
58
+ status?: string | null;
59
+ error?: string | null;
60
+ }
61
+ export declare const FinancePaymentSplitSchema: MongoSchema<FinancePaymentSplitEntity, import("mongoose").Model<FinancePaymentSplitEntity, any, any, any, import("mongoose").Document<unknown, any, FinancePaymentSplitEntity, any, {}> & FinancePaymentSplitEntity & {
62
+ _id: import("mongoose").Types.ObjectId;
63
+ } & {
64
+ __v: number;
65
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FinancePaymentSplitEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FinancePaymentSplitEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<FinancePaymentSplitEntity> & {
66
+ _id: import("mongoose").Types.ObjectId;
67
+ } & {
68
+ __v: number;
69
+ }>;
65
70
  export declare class FinancePaymentEntity extends AbstractEntity implements ITransitionable<FinancePaymentStatusEnum> {
66
- type: FinancePaymentTypeEnum;
67
- target: string;
68
- order: OrderEntity;
71
+ order: OrderSaleEntity;
69
72
  amount: number;
70
73
  fee: number;
71
74
  method?: FinancePaymentMethodEnum | null;
72
75
  gateway?: FinancePaymentGatewayEntity | null;
73
76
  attempts?: FinancePaymentAttemptEntity[];
74
- splitProblem?: string | null;
77
+ split?: FinancePaymentSplitEntity | null;
75
78
  status: FinancePaymentStatusEnum;
76
79
  history: StatusEntity<FinancePaymentStatusEnum>[];
77
80
  readonly number: string;
@@ -15,8 +15,3 @@ export declare enum FinancePaymentMethodEnum {
15
15
  CASH = "CASH",
16
16
  CRYPTO = "CRYPTO"
17
17
  }
18
- export declare enum FinancePaymentTypeEnum {
19
- SALE = "SALE",
20
- PURCHASE = "PURCHASE",
21
- SERVICE = "SERVICE"
22
- }
@@ -20,9 +20,3 @@ export var FinancePaymentMethodEnum;
20
20
  FinancePaymentMethodEnum["CASH"] = "CASH";
21
21
  FinancePaymentMethodEnum["CRYPTO"] = "CRYPTO";
22
22
  })(FinancePaymentMethodEnum || (FinancePaymentMethodEnum = {}));
23
- export var FinancePaymentTypeEnum;
24
- (function (FinancePaymentTypeEnum) {
25
- FinancePaymentTypeEnum["SALE"] = "SALE";
26
- FinancePaymentTypeEnum["PURCHASE"] = "PURCHASE";
27
- FinancePaymentTypeEnum["SERVICE"] = "SERVICE";
28
- })(FinancePaymentTypeEnum || (FinancePaymentTypeEnum = {}));
@@ -2,24 +2,16 @@ import { Schema as MongoSchema } from 'mongoose';
2
2
  import { AbstractEntity } from '../../abstract.entity.js';
3
3
  import { FinanceRefundOriginEnum, FinanceRefundStatusEnum } from './refund.enum.js';
4
4
  import { FinancePaymentEntity } from '../payment';
5
- export declare class FinanceRefundGatewayPixEntity {
6
- endToEndId?: string | null;
5
+ export interface FinanceRefundPixDetails {
6
+ bankReference: string | null;
7
7
  }
8
- export declare const FinanceRefundGatewayPixSchema: MongoSchema<FinanceRefundGatewayPixEntity, import("mongoose").Model<FinanceRefundGatewayPixEntity, any, any, any, import("mongoose").Document<unknown, any, FinanceRefundGatewayPixEntity, any, {}> & FinanceRefundGatewayPixEntity & {
9
- _id: import("mongoose").Types.ObjectId;
10
- } & {
11
- __v: number;
12
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FinanceRefundGatewayPixEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FinanceRefundGatewayPixEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<FinanceRefundGatewayPixEntity> & {
13
- _id: import("mongoose").Types.ObjectId;
14
- } & {
15
- __v: number;
16
- }>;
8
+ export type FinanceRefundGatewayDetails = FinanceRefundPixDetails | Record<string, unknown>;
17
9
  export declare class FinanceRefundGatewayEntity {
18
10
  provider: string;
19
11
  reference?: string | null;
20
12
  status?: string | null;
21
13
  receiptUrl?: string | null;
22
- pix?: FinanceRefundGatewayPixEntity | null;
14
+ details?: FinanceRefundGatewayDetails | null;
23
15
  }
24
16
  export declare const FinanceRefundGatewaySchema: MongoSchema<FinanceRefundGatewayEntity, import("mongoose").Model<FinanceRefundGatewayEntity, any, any, any, import("mongoose").Document<unknown, any, FinanceRefundGatewayEntity, any, {}> & FinanceRefundGatewayEntity & {
25
17
  _id: import("mongoose").Types.ObjectId;
@@ -33,11 +25,10 @@ export declare const FinanceRefundGatewaySchema: MongoSchema<FinanceRefundGatewa
33
25
  export declare class FinanceRefundEntity extends AbstractEntity {
34
26
  payment: FinancePaymentEntity | string;
35
27
  amount: number;
36
- partial: boolean;
28
+ isPartial: boolean;
37
29
  origin: FinanceRefundOriginEnum;
38
30
  status: FinanceRefundStatusEnum;
39
31
  gateway?: FinanceRefundGatewayEntity | null;
40
32
  refundedAt?: Date | null;
41
33
  error?: string | null;
42
- at: Date;
43
34
  }
@@ -1,18 +1,57 @@
1
+ import { Schema as MongoSchema } from 'mongoose';
1
2
  import { AccountUserEntity } from '../../account/user';
2
3
  import { PaymentPixKeyTypeEnum } from '../../integration/payment';
3
4
  import { AbstractEntity } from '../../abstract.entity.js';
4
5
  import { FinanceWithdrawalStatusEnum } from './withdrawal.enum.js';
6
+ export declare class FinanceWithdrawalHistoryEntity {
7
+ date: Date;
8
+ status: FinanceWithdrawalStatusEnum;
9
+ }
10
+ export declare const FinanceWithdrawalHistorySchema: MongoSchema<FinanceWithdrawalHistoryEntity, import("mongoose").Model<FinanceWithdrawalHistoryEntity, any, any, any, import("mongoose").Document<unknown, any, FinanceWithdrawalHistoryEntity, any, {}> & FinanceWithdrawalHistoryEntity & {
11
+ _id: import("mongoose").Types.ObjectId;
12
+ } & {
13
+ __v: number;
14
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FinanceWithdrawalHistoryEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FinanceWithdrawalHistoryEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<FinanceWithdrawalHistoryEntity> & {
15
+ _id: import("mongoose").Types.ObjectId;
16
+ } & {
17
+ __v: number;
18
+ }>;
19
+ export declare class FinanceWithdrawalPixKeyEntity {
20
+ type?: PaymentPixKeyTypeEnum | null;
21
+ masked?: string | null;
22
+ }
23
+ export declare const FinanceWithdrawalPixKeySchema: MongoSchema<FinanceWithdrawalPixKeyEntity, import("mongoose").Model<FinanceWithdrawalPixKeyEntity, any, any, any, import("mongoose").Document<unknown, any, FinanceWithdrawalPixKeyEntity, any, {}> & FinanceWithdrawalPixKeyEntity & {
24
+ _id: import("mongoose").Types.ObjectId;
25
+ } & {
26
+ __v: number;
27
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FinanceWithdrawalPixKeyEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FinanceWithdrawalPixKeyEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<FinanceWithdrawalPixKeyEntity> & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ } & {
30
+ __v: number;
31
+ }>;
32
+ export declare class FinanceWithdrawalGatewayEntity {
33
+ provider: string;
34
+ reference?: string | null;
35
+ status: string;
36
+ receiptUrl?: string | null;
37
+ }
38
+ export declare const FinanceWithdrawalGatewaySchema: MongoSchema<FinanceWithdrawalGatewayEntity, import("mongoose").Model<FinanceWithdrawalGatewayEntity, any, any, any, import("mongoose").Document<unknown, any, FinanceWithdrawalGatewayEntity, any, {}> & FinanceWithdrawalGatewayEntity & {
39
+ _id: import("mongoose").Types.ObjectId;
40
+ } & {
41
+ __v: number;
42
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FinanceWithdrawalGatewayEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FinanceWithdrawalGatewayEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<FinanceWithdrawalGatewayEntity> & {
43
+ _id: import("mongoose").Types.ObjectId;
44
+ } & {
45
+ __v: number;
46
+ }>;
5
47
  export declare class FinanceWithdrawalEntity extends AbstractEntity {
6
48
  amount: number;
7
49
  fee: number;
8
50
  readonly netAmount: number;
9
- keyType?: PaymentPixKeyTypeEnum | null;
10
- keyMasked?: string | null;
11
51
  status: FinanceWithdrawalStatusEnum;
12
- rawStatus: string;
13
- failReason?: string | null;
52
+ history: FinanceWithdrawalHistoryEntity[];
53
+ error?: string | null;
14
54
  requestedBy?: AccountUserEntity | string | null;
15
- completedAt?: Date | null;
16
- transferId: string;
17
- receiptUrl?: string | null;
55
+ pixKey?: FinanceWithdrawalPixKeyEntity | null;
56
+ gateway: FinanceWithdrawalGatewayEntity;
18
57
  }
package/dist/index.d.ts CHANGED
@@ -8,8 +8,8 @@ export * from './transform.validator';
8
8
  export * from './address.entity';
9
9
  export * from './transaction.entity';
10
10
  export * from './contact.entity';
11
- export * from './transitionable.interface';
12
- export * from './query.interface';
11
+ export * from './transitionable.types';
12
+ export * from './query.types';
13
13
  export * from './abstract.entity';
14
14
  export * from './abstract.transition';
15
15
  export * from './abstract.validator';
@@ -14,7 +14,7 @@ export interface PaymentCharge {
14
14
  method: StorePaymentMethod;
15
15
  paid: boolean;
16
16
  qrCode: string | null;
17
- qrCodeImage: string | null;
17
+ qrImage: string | null;
18
18
  status: PaymentChargeStatusEnum;
19
19
  statusDetail: string | null;
20
20
  }
@@ -1,5 +1,3 @@
1
- export * from './payment.entity';
2
- export * from './payment.account.entity';
3
1
  export * from './provider.enum';
4
2
  export * from './account.enum';
5
3
  export * from './charge.enum';
@@ -9,3 +9,6 @@ export interface SupplierConnectionStatus {
9
9
  reconnectBy: Date | null;
10
10
  source: SupplierConnectionSource | null;
11
11
  }
12
+ export interface SupplierConnectionCreateRequest {
13
+ code: string;
14
+ }
@@ -14,7 +14,7 @@ export interface SupplierOrderRecipient {
14
14
  birthday?: string;
15
15
  }
16
16
  export interface SupplierOrderAddress {
17
- postalCode: string;
17
+ zipCode: string;
18
18
  street: string;
19
19
  number: string;
20
20
  complement?: string;
@@ -34,11 +34,18 @@ export interface SupplierOrderPlacement {
34
34
  status: OrderPurchaseStatusEnum;
35
35
  warning?: string;
36
36
  }
37
+ export interface SupplierOrderChargedLine {
38
+ externalVariantId: string;
39
+ quantity: number;
40
+ paid: number;
41
+ shipping: number;
42
+ }
37
43
  export interface SupplierOrderSnapshot {
38
44
  status?: OrderPurchaseStatusEnum;
39
45
  received: boolean;
40
46
  rawStatus: string;
41
47
  parcels: LogisticsParcelInput[];
48
+ charged?: SupplierOrderChargedLine[];
42
49
  }
43
50
  export interface SupplierOrderImportLine {
44
51
  externalProductId: string;
@@ -62,3 +62,10 @@ export interface SupplierProductSource {
62
62
  product: SupplierProduct;
63
63
  offers: SupplierProductVariant[];
64
64
  }
65
+ export interface SupplierProductImportRequest {
66
+ url: string;
67
+ markup?: number;
68
+ }
69
+ export interface SupplierProductSyncRequest {
70
+ product: string;
71
+ }
@@ -19,19 +19,31 @@ export declare const CatalogProductPropertySchema: MongoSchema<CatalogProductPro
19
19
  } & {
20
20
  __v: number;
21
21
  }>;
22
+ export declare class CatalogProductSupplierEntity {
23
+ productId?: string | null;
24
+ handlingDays?: number | null;
25
+ rating?: number | null;
26
+ ratingCount?: number | null;
27
+ soldCount?: number | null;
28
+ }
29
+ export declare const CatalogProductSupplierSchema: MongoSchema<CatalogProductSupplierEntity, import("mongoose").Model<CatalogProductSupplierEntity, any, any, any, import("mongoose").Document<unknown, any, CatalogProductSupplierEntity, any, {}> & CatalogProductSupplierEntity & {
30
+ _id: Types.ObjectId;
31
+ } & {
32
+ __v: number;
33
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CatalogProductSupplierEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CatalogProductSupplierEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<CatalogProductSupplierEntity> & {
34
+ _id: Types.ObjectId;
35
+ } & {
36
+ __v: number;
37
+ }>;
22
38
  export declare class CatalogProductEntity extends AbstractEntity {
23
39
  sku?: string;
24
40
  name: string;
25
41
  description?: string;
26
42
  active: boolean;
27
43
  vendor?: ContactVendorEntity;
28
- externalProductId?: string;
29
- handlingDays?: number | null;
44
+ supplier?: CatalogProductSupplierEntity | null;
30
45
  properties?: CatalogProductPropertyEntity[];
31
- ratingValue?: number | null;
32
- ratingCount?: number | null;
33
- soldCount?: number | null;
34
- variant: CatalogVariantEntity;
46
+ defaultVariant: CatalogVariantEntity;
35
47
  readonly supplierPrice: number;
36
48
  readonly retailPrice: number;
37
49
  category?: CatalogCategoryEntity;
@@ -80,8 +80,8 @@ export class UpdateProductRequestValidator extends ProductMetadataRequestValidat
80
80
  this.active = product.active;
81
81
  if (product)
82
82
  this.posterId = product.posterId ? String(product.posterId) : null;
83
- if (product?.variant)
84
- this.variant = new UpdateProductVariantRequestValidator(product.variant);
83
+ if (product?.defaultVariant)
84
+ this.variant = new UpdateProductVariantRequestValidator(product.defaultVariant);
85
85
  }
86
86
  }
87
87
  __decorate([
@@ -17,7 +17,7 @@ export class UpdateVariantRequestValidator extends abstract_validator_1.Abstract
17
17
  super();
18
18
  if (!variant)
19
19
  return;
20
- this.retailPrice = variant.retailPrice;
20
+ this.retailPrice = variant.price.retail;
21
21
  this.active = variant.active;
22
22
  }
23
23
  }
@@ -38,7 +38,7 @@ export class CreateVariantRequestValidator extends UpdateVariantRequestValidator
38
38
  constructor(variant) {
39
39
  super(variant);
40
40
  if (variant)
41
- this.supplierPrice = variant.supplierPrice;
41
+ this.supplierPrice = variant.price.cost;
42
42
  }
43
43
  }
44
44
  __decorate([
@@ -1,15 +1,56 @@
1
+ import { Schema as MongoSchema } from 'mongoose';
1
2
  import { AssetEntity } from '../../../assets/asset';
2
3
  import { AbstractEntity } from '../../../abstract.entity.js';
3
4
  import { CatalogVariantOptionEntity } from './variant.option.entity.js';
4
5
  import type { CatalogProductEntity } from '../product';
6
+ export declare class CatalogVariantPriceEntity {
7
+ cost: number;
8
+ retail: number;
9
+ }
10
+ export declare const CatalogVariantPriceSchema: MongoSchema<CatalogVariantPriceEntity, import("mongoose").Model<CatalogVariantPriceEntity, any, any, any, import("mongoose").Document<unknown, any, CatalogVariantPriceEntity, any, {}> & CatalogVariantPriceEntity & {
11
+ _id: import("mongoose").Types.ObjectId;
12
+ } & {
13
+ __v: number;
14
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CatalogVariantPriceEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CatalogVariantPriceEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<CatalogVariantPriceEntity> & {
15
+ _id: import("mongoose").Types.ObjectId;
16
+ } & {
17
+ __v: number;
18
+ }>;
19
+ export declare class CatalogVariantShipsFromEntity {
20
+ nameText: string;
21
+ valueText: string;
22
+ label?: string | null;
23
+ nameId?: string | null;
24
+ valueId?: string | null;
25
+ }
26
+ export declare const CatalogVariantShipsFromSchema: MongoSchema<CatalogVariantShipsFromEntity, import("mongoose").Model<CatalogVariantShipsFromEntity, any, any, any, import("mongoose").Document<unknown, any, CatalogVariantShipsFromEntity, any, {}> & CatalogVariantShipsFromEntity & {
27
+ _id: import("mongoose").Types.ObjectId;
28
+ } & {
29
+ __v: number;
30
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CatalogVariantShipsFromEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CatalogVariantShipsFromEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<CatalogVariantShipsFromEntity> & {
31
+ _id: import("mongoose").Types.ObjectId;
32
+ } & {
33
+ __v: number;
34
+ }>;
35
+ export declare class CatalogVariantSourcingEntity {
36
+ variantId?: string | null;
37
+ shipsFrom?: CatalogVariantShipsFromEntity | null;
38
+ }
39
+ export declare const CatalogVariantSourcingSchema: MongoSchema<CatalogVariantSourcingEntity, import("mongoose").Model<CatalogVariantSourcingEntity, any, any, any, import("mongoose").Document<unknown, any, CatalogVariantSourcingEntity, any, {}> & CatalogVariantSourcingEntity & {
40
+ _id: import("mongoose").Types.ObjectId;
41
+ } & {
42
+ __v: number;
43
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CatalogVariantSourcingEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CatalogVariantSourcingEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<CatalogVariantSourcingEntity> & {
44
+ _id: import("mongoose").Types.ObjectId;
45
+ } & {
46
+ __v: number;
47
+ }>;
5
48
  export declare class CatalogVariantEntity extends AbstractEntity {
6
49
  product: CatalogProductEntity;
7
- supplierPrice: number;
8
- retailPrice: number;
50
+ price: CatalogVariantPriceEntity;
9
51
  active: boolean;
10
52
  picture?: AssetEntity;
11
53
  assets: AssetEntity[];
12
54
  options: CatalogVariantOptionEntity[];
13
- shipsFrom?: CatalogVariantOptionEntity;
14
- externalVariantId?: string;
55
+ sourcing?: CatalogVariantSourcingEntity | null;
15
56
  }
@@ -1,9 +1,21 @@
1
+ export declare class CatalogVariantOptionSourcingEntity {
2
+ nameId?: string | null;
3
+ valueId?: string | null;
4
+ }
5
+ export declare const CatalogVariantOptionSourcingSchema: import("mongoose").Schema<CatalogVariantOptionSourcingEntity, import("mongoose").Model<CatalogVariantOptionSourcingEntity, any, any, any, import("mongoose").Document<unknown, any, CatalogVariantOptionSourcingEntity, any, {}> & CatalogVariantOptionSourcingEntity & {
6
+ _id: import("mongoose").Types.ObjectId;
7
+ } & {
8
+ __v: number;
9
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CatalogVariantOptionSourcingEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CatalogVariantOptionSourcingEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<CatalogVariantOptionSourcingEntity> & {
10
+ _id: import("mongoose").Types.ObjectId;
11
+ } & {
12
+ __v: number;
13
+ }>;
1
14
  export declare class CatalogVariantOptionEntity {
2
15
  name: string;
3
16
  value: string;
4
17
  label?: string;
5
- externalNameId?: string;
6
- externalValueId?: string;
18
+ sourcing?: CatalogVariantOptionSourcingEntity | null;
7
19
  }
8
20
  export declare const CatalogVariantOptionSchema: import("mongoose").Schema<CatalogVariantOptionEntity, import("mongoose").Model<CatalogVariantOptionEntity, any, any, any, import("mongoose").Document<unknown, any, CatalogVariantOptionEntity, any, {}> & CatalogVariantOptionEntity & {
9
21
  _id: import("mongoose").Types.ObjectId;
@@ -1,6 +1,6 @@
1
1
  import type { LogisticsShipmentStatusEnum, LogisticsTrackingEventCodeEnum } from './shipment.enum.js';
2
2
  export interface LogisticsTrackingInput {
3
- at: Date;
3
+ date: Date;
4
4
  description: string;
5
5
  location?: string;
6
6
  }
@@ -1,11 +1,10 @@
1
1
  import { Schema as MongoSchema } from 'mongoose';
2
2
  import { AbstractEntity } from '../../abstract.entity.js';
3
- import { LogisticsShipmentDirectionEnum, LogisticsShipmentSourceEnum, LogisticsShipmentStatusEnum, LogisticsTrackingEventCodeEnum } from './shipment.enum.js';
3
+ import { LogisticsShipmentSourceEnum, LogisticsShipmentStatusEnum, LogisticsTrackingEventCodeEnum } from './shipment.enum.js';
4
4
  import type { OrderPurchaseEntity } from '../../order/purchase';
5
5
  import type { OrderSaleEntity } from '../../order/sale';
6
- import type { StatusEntity } from '../../status.plugin.js';
7
6
  export declare class LogisticsShipmentEventEntity {
8
- at: Date;
7
+ date: Date;
9
8
  code: LogisticsTrackingEventCodeEnum;
10
9
  description: string;
11
10
  location?: string | null;
@@ -19,18 +18,28 @@ export declare const LogisticsShipmentEventSchema: MongoSchema<LogisticsShipment
19
18
  } & {
20
19
  __v: number;
21
20
  }>;
21
+ export declare class LogisticsShipmentTrackingEntity {
22
+ number?: string | null;
23
+ carrier?: string | null;
24
+ url?: string | null;
25
+ }
26
+ export declare const LogisticsShipmentTrackingSchema: MongoSchema<LogisticsShipmentTrackingEntity, import("mongoose").Model<LogisticsShipmentTrackingEntity, any, any, any, import("mongoose").Document<unknown, any, LogisticsShipmentTrackingEntity, any, {}> & LogisticsShipmentTrackingEntity & {
27
+ _id: import("mongoose").Types.ObjectId;
28
+ } & {
29
+ __v: number;
30
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LogisticsShipmentTrackingEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<LogisticsShipmentTrackingEntity>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<LogisticsShipmentTrackingEntity> & {
31
+ _id: import("mongoose").Types.ObjectId;
32
+ } & {
33
+ __v: number;
34
+ }>;
22
35
  export declare class LogisticsShipmentEntity extends AbstractEntity {
23
- order: OrderSaleEntity;
36
+ sale: OrderSaleEntity;
24
37
  purchase?: OrderPurchaseEntity | null;
25
- direction: LogisticsShipmentDirectionEnum;
26
38
  source: LogisticsShipmentSourceEnum;
27
- trackingNumber?: string | null;
28
- carrier?: string | null;
29
- trackingUrl?: string | null;
39
+ tracking?: LogisticsShipmentTrackingEntity | null;
30
40
  shippedAt?: Date | null;
31
41
  deliveredAt?: Date | null;
32
42
  receivedBy?: LogisticsShipmentSourceEnum | null;
33
43
  events: LogisticsShipmentEventEntity[];
34
44
  status: LogisticsShipmentStatusEnum;
35
- history: StatusEntity<LogisticsShipmentStatusEnum>[];
36
45
  }
@@ -4,10 +4,6 @@ export declare enum LogisticsShipmentStatusEnum {
4
4
  DELIVERED = "DELIVERED",
5
5
  EXCEPTION = "EXCEPTION"
6
6
  }
7
- export declare enum LogisticsShipmentDirectionEnum {
8
- OUTBOUND = "OUTBOUND",
9
- RETURN = "RETURN"
10
- }
11
7
  export declare enum LogisticsShipmentSourceEnum {
12
8
  SUPPLIER = "SUPPLIER",
13
9
  MERCHANT = "MERCHANT",
@@ -5,11 +5,6 @@ export var LogisticsShipmentStatusEnum;
5
5
  LogisticsShipmentStatusEnum["DELIVERED"] = "DELIVERED";
6
6
  LogisticsShipmentStatusEnum["EXCEPTION"] = "EXCEPTION";
7
7
  })(LogisticsShipmentStatusEnum || (LogisticsShipmentStatusEnum = {}));
8
- export var LogisticsShipmentDirectionEnum;
9
- (function (LogisticsShipmentDirectionEnum) {
10
- LogisticsShipmentDirectionEnum["OUTBOUND"] = "OUTBOUND";
11
- LogisticsShipmentDirectionEnum["RETURN"] = "RETURN";
12
- })(LogisticsShipmentDirectionEnum || (LogisticsShipmentDirectionEnum = {}));
13
8
  export var LogisticsShipmentSourceEnum;
14
9
  (function (LogisticsShipmentSourceEnum) {
15
10
  LogisticsShipmentSourceEnum["SUPPLIER"] = "SUPPLIER";