@merkaly/api 0.15.0 → 0.17.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.
- package/dist/integration/supplier/index.d.ts +1 -0
- package/dist/integration/supplier/product.d.ts +13 -0
- package/dist/integration/supplier/sync.d.ts +24 -0
- package/dist/inventory/catalog/product/product.entity.d.ts +20 -0
- package/dist/order/sale/fulfillment.enum.d.ts +8 -0
- package/dist/order/sale/fulfillment.enum.js +18 -0
- package/dist/order/sale/index.d.ts +1 -0
- package/dist/order/sale/index.js +1 -0
- package/dist/order/sale/search.request.validator.d.ts +6 -0
- package/dist/order/sale/search.request.validator.js +21 -0
- package/package.json +1 -1
|
@@ -11,6 +11,11 @@ export interface SupplierProductOption {
|
|
|
11
11
|
externalNameId: string;
|
|
12
12
|
externalValueId: string;
|
|
13
13
|
}
|
|
14
|
+
export interface SupplierProductProperty {
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
unit?: string;
|
|
18
|
+
}
|
|
14
19
|
export interface SupplierProductVariant {
|
|
15
20
|
externalVariantId: string;
|
|
16
21
|
name: string;
|
|
@@ -29,6 +34,10 @@ export interface SupplierProduct {
|
|
|
29
34
|
currency: string;
|
|
30
35
|
handlingDays?: number | null;
|
|
31
36
|
deliveryDays?: number | null;
|
|
37
|
+
properties: SupplierProductProperty[];
|
|
38
|
+
ratingValue: number | null;
|
|
39
|
+
ratingCount: number | null;
|
|
40
|
+
soldCount: number | null;
|
|
32
41
|
store?: {
|
|
33
42
|
externalId: string;
|
|
34
43
|
name: string;
|
|
@@ -38,3 +47,7 @@ export interface SupplierProduct {
|
|
|
38
47
|
importedProduct?: string;
|
|
39
48
|
defaultMarkup?: number;
|
|
40
49
|
}
|
|
50
|
+
export interface SupplierProductSource {
|
|
51
|
+
product: SupplierProduct;
|
|
52
|
+
offers: SupplierProductVariant[];
|
|
53
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SupplierProductVariant } from './product.js';
|
|
2
|
+
import type { CatalogProductEntity } from '../../inventory/catalog/product';
|
|
3
|
+
import type { CatalogVariantOptionEntity } from '../../inventory/catalog/variant';
|
|
4
|
+
export interface SupplierProductSyncCostChange {
|
|
5
|
+
variant: string;
|
|
6
|
+
externalVariantId: string;
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SupplierProductSyncMissingVariant {
|
|
11
|
+
variant: string;
|
|
12
|
+
externalVariantId: string;
|
|
13
|
+
options: CatalogVariantOptionEntity[];
|
|
14
|
+
}
|
|
15
|
+
export interface SupplierProductSyncChanges {
|
|
16
|
+
costChanged: SupplierProductSyncCostChange[];
|
|
17
|
+
missingVariants: SupplierProductSyncMissingVariant[];
|
|
18
|
+
newVariants: SupplierProductVariant[];
|
|
19
|
+
fields: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface SupplierProductSyncResult {
|
|
22
|
+
product: CatalogProductEntity;
|
|
23
|
+
changes: SupplierProductSyncChanges;
|
|
24
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Schema as MongoSchema, Types } from 'mongoose';
|
|
1
2
|
import { AssetEntity } from '../../../assets/asset';
|
|
2
3
|
import { AbstractEntity } from '../../../abstract.entity.js';
|
|
3
4
|
import type { CatalogBrandEntity } from '../brand';
|
|
@@ -5,6 +6,20 @@ import type { CatalogCategoryEntity } from '../category';
|
|
|
5
6
|
import type { CatalogVariantEntity } from '../variant';
|
|
6
7
|
import type { ContactVendorEntity } from '../../../contact/vendor';
|
|
7
8
|
import type { IntegrationSupplierEntity } from '../../../integration/supplier';
|
|
9
|
+
export declare class CatalogProductPropertyEntity {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
unit?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export declare const CatalogProductPropertySchema: MongoSchema<CatalogProductPropertyEntity, import("mongoose").Model<CatalogProductPropertyEntity, any, any, any, import("mongoose").Document<unknown, any, CatalogProductPropertyEntity, any, {}> & CatalogProductPropertyEntity & {
|
|
15
|
+
_id: Types.ObjectId;
|
|
16
|
+
} & {
|
|
17
|
+
__v: number;
|
|
18
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CatalogProductPropertyEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CatalogProductPropertyEntity>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CatalogProductPropertyEntity> & {
|
|
19
|
+
_id: Types.ObjectId;
|
|
20
|
+
} & {
|
|
21
|
+
__v: number;
|
|
22
|
+
}>;
|
|
8
23
|
export declare class CatalogProductEntity extends AbstractEntity {
|
|
9
24
|
sku?: string;
|
|
10
25
|
name: string;
|
|
@@ -14,6 +29,11 @@ export declare class CatalogProductEntity extends AbstractEntity {
|
|
|
14
29
|
vendor?: ContactVendorEntity;
|
|
15
30
|
externalProductId?: string;
|
|
16
31
|
handlingDays?: number | null;
|
|
32
|
+
properties?: CatalogProductPropertyEntity[];
|
|
33
|
+
ratingValue?: number | null;
|
|
34
|
+
ratingCount?: number | null;
|
|
35
|
+
soldCount?: number | null;
|
|
36
|
+
reviewCount?: number | null;
|
|
17
37
|
variant: CatalogVariantEntity;
|
|
18
38
|
readonly supplierPrice: number;
|
|
19
39
|
readonly retailPrice: number;
|
|
@@ -6,6 +6,14 @@ export declare enum OrderFulfillmentStageEnum {
|
|
|
6
6
|
DELIVERED = "DELIVERED",
|
|
7
7
|
CANCELLED = "CANCELLED"
|
|
8
8
|
}
|
|
9
|
+
export declare enum OrderBuyerStageEnum {
|
|
10
|
+
AWAITING_PAYMENT = "AWAITING_PAYMENT",
|
|
11
|
+
IN_PREPARATION = "IN_PREPARATION",
|
|
12
|
+
SHIPPED = "SHIPPED",
|
|
13
|
+
DELIVERED = "DELIVERED",
|
|
14
|
+
CANCELLED = "CANCELLED"
|
|
15
|
+
}
|
|
16
|
+
export declare const BUYER_STAGE_GROUPS: Readonly<Record<OrderBuyerStageEnum, readonly OrderFulfillmentStageEnum[]>>;
|
|
9
17
|
export declare enum OrderFulfillmentActionEnum {
|
|
10
18
|
CONFIRM_PAYMENT = "CONFIRM_PAYMENT",
|
|
11
19
|
PROCURE = "PROCURE",
|
|
@@ -7,6 +7,24 @@ export var OrderFulfillmentStageEnum;
|
|
|
7
7
|
OrderFulfillmentStageEnum["DELIVERED"] = "DELIVERED";
|
|
8
8
|
OrderFulfillmentStageEnum["CANCELLED"] = "CANCELLED";
|
|
9
9
|
})(OrderFulfillmentStageEnum || (OrderFulfillmentStageEnum = {}));
|
|
10
|
+
export var OrderBuyerStageEnum;
|
|
11
|
+
(function (OrderBuyerStageEnum) {
|
|
12
|
+
OrderBuyerStageEnum["AWAITING_PAYMENT"] = "AWAITING_PAYMENT";
|
|
13
|
+
OrderBuyerStageEnum["IN_PREPARATION"] = "IN_PREPARATION";
|
|
14
|
+
OrderBuyerStageEnum["SHIPPED"] = "SHIPPED";
|
|
15
|
+
OrderBuyerStageEnum["DELIVERED"] = "DELIVERED";
|
|
16
|
+
OrderBuyerStageEnum["CANCELLED"] = "CANCELLED";
|
|
17
|
+
})(OrderBuyerStageEnum || (OrderBuyerStageEnum = {}));
|
|
18
|
+
export const BUYER_STAGE_GROUPS = {
|
|
19
|
+
[OrderBuyerStageEnum.AWAITING_PAYMENT]: [OrderFulfillmentStageEnum.AWAITING_PAYMENT],
|
|
20
|
+
[OrderBuyerStageEnum.IN_PREPARATION]: [
|
|
21
|
+
OrderFulfillmentStageEnum.TO_ORDER,
|
|
22
|
+
OrderFulfillmentStageEnum.ORDERED,
|
|
23
|
+
],
|
|
24
|
+
[OrderBuyerStageEnum.SHIPPED]: [OrderFulfillmentStageEnum.SHIPPED],
|
|
25
|
+
[OrderBuyerStageEnum.DELIVERED]: [OrderFulfillmentStageEnum.DELIVERED],
|
|
26
|
+
[OrderBuyerStageEnum.CANCELLED]: [OrderFulfillmentStageEnum.CANCELLED],
|
|
27
|
+
};
|
|
10
28
|
export var OrderFulfillmentActionEnum;
|
|
11
29
|
(function (OrderFulfillmentActionEnum) {
|
|
12
30
|
OrderFulfillmentActionEnum["CONFIRM_PAYMENT"] = "CONFIRM_PAYMENT";
|
|
@@ -9,6 +9,7 @@ export * from './procurement.request.validator';
|
|
|
9
9
|
export * from './shipping.request.validator';
|
|
10
10
|
export * from './shipping.update.request.validator';
|
|
11
11
|
export * from './checkout.request.validator';
|
|
12
|
+
export * from './search.request.validator';
|
|
12
13
|
export * from './payment.confirm.request.validator';
|
|
13
14
|
export * from './fulfillment.enum';
|
|
14
15
|
export * from './fulfillment';
|
package/dist/order/sale/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from './procurement.request.validator.js';
|
|
|
6
6
|
export * from './shipping.request.validator.js';
|
|
7
7
|
export * from './shipping.update.request.validator.js';
|
|
8
8
|
export * from './checkout.request.validator.js';
|
|
9
|
+
export * from './search.request.validator.js';
|
|
9
10
|
export * from './payment.confirm.request.validator.js';
|
|
10
11
|
export * from './fulfillment.enum.js';
|
|
11
12
|
export * from './quote.request.validator.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OrderBuyerStageEnum } from './fulfillment.enum.js';
|
|
2
|
+
import { SearchValidator } from '../../abstract.validator.js';
|
|
3
|
+
import type { OrderSaleEntity } from './sale.entity.js';
|
|
4
|
+
export declare class SearchBuyerOrdersRequestValidator extends SearchValidator<OrderSaleEntity> {
|
|
5
|
+
stage?: OrderBuyerStageEnum;
|
|
6
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
import * as class_validator_1 from "class-validator";
|
|
12
|
+
import * as fulfillment_enum_1 from './fulfillment.enum.js';
|
|
13
|
+
import * as abstract_validator_1 from '../../abstract.validator.js';
|
|
14
|
+
export class SearchBuyerOrdersRequestValidator extends abstract_validator_1.SearchValidator {
|
|
15
|
+
stage;
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsEnum)(fulfillment_enum_1.OrderBuyerStageEnum),
|
|
19
|
+
(0, class_validator_1.IsOptional)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], SearchBuyerOrdersRequestValidator.prototype, "stage", void 0);
|