@merkaly/api 0.10.0 → 0.11.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/connection.d.ts +9 -0
- package/dist/integration/supplier/index.d.ts +3 -0
- package/dist/integration/supplier/quote.d.ts +18 -0
- package/dist/integration/supplier/supplier.connection.entity.d.ts +18 -0
- package/dist/integration/supplier/supplier.entity.d.ts +2 -0
- package/dist/order/sale/index.d.ts +2 -0
- package/dist/order/sale/index.js +1 -0
- package/dist/order/sale/procurement.d.ts +45 -0
- package/dist/order/sale/procurement.request.validator.d.ts +4 -0
- package/dist/order/sale/procurement.request.validator.js +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SupplierConnectionSource = 'merchant' | 'platform';
|
|
2
|
+
export interface SupplierConnectionStatus {
|
|
3
|
+
account: string | null;
|
|
4
|
+
appKey: string | null;
|
|
5
|
+
connected: boolean;
|
|
6
|
+
connectedAt: Date | null;
|
|
7
|
+
expiresAt: Date | null;
|
|
8
|
+
source: SupplierConnectionSource | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface SupplierQuoteRequest {
|
|
2
|
+
externalProductId: string;
|
|
3
|
+
externalVariantId: string;
|
|
4
|
+
quantity: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SupplierQuote extends SupplierQuoteRequest {
|
|
7
|
+
available: boolean;
|
|
8
|
+
currency: string;
|
|
9
|
+
issue?: string;
|
|
10
|
+
stock?: number;
|
|
11
|
+
unitCost?: number;
|
|
12
|
+
freight?: number;
|
|
13
|
+
freightService?: string;
|
|
14
|
+
deliveryDays?: {
|
|
15
|
+
max?: number;
|
|
16
|
+
min?: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Schema as MongoSchema } from 'mongoose';
|
|
2
|
+
export declare class IntegrationSupplierConnectionEntity {
|
|
3
|
+
account?: string;
|
|
4
|
+
accessToken: string;
|
|
5
|
+
refreshToken?: string;
|
|
6
|
+
expiresAt: Date;
|
|
7
|
+
refreshExpiresAt?: Date;
|
|
8
|
+
connectedAt: Date;
|
|
9
|
+
}
|
|
10
|
+
export declare const IntegrationSupplierConnectionSchema: MongoSchema<IntegrationSupplierConnectionEntity, import("mongoose").Model<IntegrationSupplierConnectionEntity, any, any, any, import("mongoose").Document<unknown, any, IntegrationSupplierConnectionEntity, any, {}> & IntegrationSupplierConnectionEntity & {
|
|
11
|
+
_id: import("mongoose").Types.ObjectId;
|
|
12
|
+
} & {
|
|
13
|
+
__v: number;
|
|
14
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IntegrationSupplierConnectionEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IntegrationSupplierConnectionEntity>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<IntegrationSupplierConnectionEntity> & {
|
|
15
|
+
_id: import("mongoose").Types.ObjectId;
|
|
16
|
+
} & {
|
|
17
|
+
__v: number;
|
|
18
|
+
}>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AbstractEntity } from '../../abstract.entity.js';
|
|
2
2
|
import { SupplierProviderEnum } from './provider.enum.js';
|
|
3
|
+
import { IntegrationSupplierConnectionEntity } from './supplier.connection.entity.js';
|
|
3
4
|
export declare class IntegrationSupplierEntity extends AbstractEntity {
|
|
4
5
|
provider: SupplierProviderEnum;
|
|
6
|
+
connection?: IntegrationSupplierConnectionEntity;
|
|
5
7
|
}
|
package/dist/order/sale/index.js
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SupplierProviderEnum } from '../../integration/supplier';
|
|
2
|
+
import type { SupplierQuote } from '../../integration/supplier';
|
|
3
|
+
export interface ProcurementLine {
|
|
4
|
+
item: string;
|
|
5
|
+
product: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
variant: string;
|
|
10
|
+
quantity: number;
|
|
11
|
+
retailUnit: number;
|
|
12
|
+
storedUnitCost: number;
|
|
13
|
+
quotedUnitCost?: number;
|
|
14
|
+
freight?: number;
|
|
15
|
+
quote?: SupplierQuote;
|
|
16
|
+
}
|
|
17
|
+
export interface ProcurementGroup {
|
|
18
|
+
supplier: {
|
|
19
|
+
id: string;
|
|
20
|
+
provider: SupplierProviderEnum;
|
|
21
|
+
};
|
|
22
|
+
vendor: {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
} | null;
|
|
26
|
+
items: ProcurementLine[];
|
|
27
|
+
totals: {
|
|
28
|
+
retail: number;
|
|
29
|
+
cost: number;
|
|
30
|
+
freight: number;
|
|
31
|
+
margin: number;
|
|
32
|
+
};
|
|
33
|
+
available: boolean;
|
|
34
|
+
marginOk: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ProcurementQuote {
|
|
37
|
+
sale: string;
|
|
38
|
+
currency: string;
|
|
39
|
+
destination: {
|
|
40
|
+
country: string;
|
|
41
|
+
source: 'market';
|
|
42
|
+
};
|
|
43
|
+
groups: ProcurementGroup[];
|
|
44
|
+
manual: ProcurementLine[];
|
|
45
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 abstract_validator_1 from '../../abstract.validator.js';
|
|
13
|
+
export class ProcureSaleRequestValidator extends abstract_validator_1.AbstractRequestValidator {
|
|
14
|
+
force = false;
|
|
15
|
+
}
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, class_validator_1.IsBoolean)(),
|
|
18
|
+
(0, class_validator_1.IsOptional)(),
|
|
19
|
+
__metadata("design:type", Object)
|
|
20
|
+
], ProcureSaleRequestValidator.prototype, "force", void 0);
|