@merkaly/api 0.26.4 → 0.28.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/app.schemas.d.ts +3 -0
- package/dist/finance/payment/index.d.ts +0 -2
- package/dist/finance/payment/payment.entity.d.ts +75 -2
- package/dist/finance/payment/report.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/integration/payment/charge.request.validator.js +8 -8
- package/dist/integration/payment/request.validator.js +16 -16
- package/dist/integration/supplier/order.d.ts +6 -6
- package/dist/logistics/shipment/index.d.ts +3 -0
- package/dist/logistics/shipment/index.js +1 -0
- package/dist/logistics/shipment/shipment.d.ts +26 -0
- package/dist/logistics/shipment/shipment.entity.d.ts +36 -0
- package/dist/logistics/shipment/shipment.enum.d.ts +24 -0
- package/dist/logistics/shipment/shipment.enum.js +28 -0
- package/dist/order/purchase/index.d.ts +0 -4
- package/dist/order/purchase/index.js +0 -3
- package/dist/order/purchase/purchase.entity.d.ts +20 -1
- package/dist/order/purchase/purchase.enum.d.ts +9 -5
- package/dist/order/purchase/purchase.enum.js +20 -8
- package/dist/order/purchase/purchase.transition.js +8 -5
- package/dist/order/purchase/supplier.order.request.validator.js +2 -2
- package/dist/order/sale/attention.d.ts +2 -2
- package/dist/order/sale/attention.enum.d.ts +1 -0
- package/dist/order/sale/attention.enum.js +1 -0
- package/dist/order/sale/checkout.request.validator.d.ts +2 -2
- package/dist/order/sale/checkout.request.validator.js +4 -4
- package/dist/order/sale/{shipping.request.validator.d.ts → delivery.request.validator.d.ts} +7 -7
- package/dist/order/sale/{shipping.request.validator.js → delivery.request.validator.js} +26 -26
- package/dist/order/sale/{shipping.update.request.validator.d.ts → delivery.update.request.validator.d.ts} +5 -5
- package/dist/order/sale/{shipping.update.request.validator.js → delivery.update.request.validator.js} +36 -36
- package/dist/order/sale/fulfillment.d.ts +11 -10
- package/dist/order/sale/fulfillment.enum.d.ts +6 -14
- package/dist/order/sale/fulfillment.enum.js +9 -21
- package/dist/order/sale/index.d.ts +2 -6
- package/dist/order/sale/index.js +2 -4
- package/dist/order/sale/sale.entity.d.ts +84 -5
- package/dist/order/sale/sale.enum.d.ts +11 -6
- package/dist/order/sale/sale.enum.js +15 -9
- package/dist/order/sale/sale.import.d.ts +3 -2
- package/dist/order/sale/sale.transition.js +7 -6
- package/package.json +1 -1
- package/dist/finance/payment/payment.attempt.entity.d.ts +0 -26
- package/dist/finance/payment/payment.gateway.entity.d.ts +0 -53
- package/dist/order/purchase/item.request.validator.d.ts +0 -12
- package/dist/order/purchase/item.request.validator.js +0 -69
- package/dist/order/purchase/purchase.supplier.order.entity.d.ts +0 -24
- package/dist/order/purchase/request.validator.d.ts +0 -23
- package/dist/order/purchase/request.validator.js +0 -97
- package/dist/order/purchase/supplier.order.enum.d.ts +0 -11
- package/dist/order/purchase/supplier.order.enum.js +0 -23
- package/dist/order/sale/item.request.validator.d.ts +0 -12
- package/dist/order/sale/item.request.validator.js +0 -62
- package/dist/order/sale/request.validator.d.ts +0 -24
- package/dist/order/sale/request.validator.js +0 -97
- package/dist/order/sale/sale.import.entity.d.ts +0 -15
- package/dist/order/sale/sale.shipping.entity.d.ts +0 -80
|
@@ -1,97 +0,0 @@
|
|
|
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_transformer_1 from "class-transformer";
|
|
12
|
-
import * as class_validator_1 from "class-validator";
|
|
13
|
-
import * as payment_enum_1 from '../../finance/payment/index.js';
|
|
14
|
-
import * as sale_enum_1 from './sale.enum.js';
|
|
15
|
-
import * as abstract_validator_1 from '../../abstract.validator.js';
|
|
16
|
-
import * as item_request_validator_1 from './item.request.validator.js';
|
|
17
|
-
export class CreateSaleRequestValidator extends abstract_validator_1.AbstractRequestValidator {
|
|
18
|
-
items = [];
|
|
19
|
-
method;
|
|
20
|
-
notes;
|
|
21
|
-
customer;
|
|
22
|
-
payment = payment_enum_1.FinancePaymentStatusEnum.PENDING;
|
|
23
|
-
status = sale_enum_1.OrderSaleStatusEnum.OPEN;
|
|
24
|
-
constructor(order) {
|
|
25
|
-
super();
|
|
26
|
-
if (!order) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
this.notes = order.notes;
|
|
30
|
-
this.method = order.payment?.method;
|
|
31
|
-
this.customer = (order.customer?._id || order.customer);
|
|
32
|
-
if (order.status !== undefined) {
|
|
33
|
-
this.status = order.status;
|
|
34
|
-
}
|
|
35
|
-
if (order.payment?.status !== undefined) {
|
|
36
|
-
this.payment = order.payment.status;
|
|
37
|
-
}
|
|
38
|
-
this.items = order.items?.map((it) => new item_request_validator_1.SaleItemRequestValidator(it)) ?? this.items;
|
|
39
|
-
}
|
|
40
|
-
get total() {
|
|
41
|
-
return this.items.reduce((acc, item) => {
|
|
42
|
-
acc.units += item.quantity;
|
|
43
|
-
acc.price += item.quantity * item.price;
|
|
44
|
-
return acc;
|
|
45
|
-
}, { units: 0, price: 0 });
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, class_validator_1.IsArray)(),
|
|
50
|
-
(0, class_transformer_1.Type)(() => item_request_validator_1.SaleItemRequestValidator),
|
|
51
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
52
|
-
__metadata("design:type", Array)
|
|
53
|
-
], CreateSaleRequestValidator.prototype, "items", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, class_validator_1.IsEnum)(payment_enum_1.FinancePaymentMethodEnum),
|
|
56
|
-
__metadata("design:type", String)
|
|
57
|
-
], CreateSaleRequestValidator.prototype, "method", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, class_validator_1.IsString)(),
|
|
60
|
-
(0, class_validator_1.Length)(0, 500),
|
|
61
|
-
(0, class_validator_1.IsOptional)(),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], CreateSaleRequestValidator.prototype, "notes", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, class_validator_1.IsMongoId)(),
|
|
66
|
-
(0, class_validator_1.IsOptional)(),
|
|
67
|
-
__metadata("design:type", String)
|
|
68
|
-
], CreateSaleRequestValidator.prototype, "customer", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
(0, class_validator_1.IsEnum)(payment_enum_1.FinancePaymentStatusEnum),
|
|
71
|
-
(0, class_validator_1.IsDefined)(),
|
|
72
|
-
(0, class_validator_1.IsOptional)(),
|
|
73
|
-
__metadata("design:type", String)
|
|
74
|
-
], CreateSaleRequestValidator.prototype, "payment", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, class_validator_1.IsEnum)(sale_enum_1.OrderSaleStatusEnum),
|
|
77
|
-
(0, class_validator_1.IsDefined)(),
|
|
78
|
-
(0, class_validator_1.IsOptional)(),
|
|
79
|
-
__metadata("design:type", Object)
|
|
80
|
-
], CreateSaleRequestValidator.prototype, "status", void 0);
|
|
81
|
-
export class UpdateSaleRequestValidator extends CreateSaleRequestValidator {
|
|
82
|
-
payment = undefined;
|
|
83
|
-
status = undefined;
|
|
84
|
-
}
|
|
85
|
-
__decorate([
|
|
86
|
-
(0, class_validator_1.IsOptional)(),
|
|
87
|
-
__metadata("design:type", Array)
|
|
88
|
-
], UpdateSaleRequestValidator.prototype, "items", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
(0, class_validator_1.ValidateIf)(() => false),
|
|
91
|
-
(0, class_transformer_1.Transform)(() => undefined),
|
|
92
|
-
__metadata("design:type", Object)
|
|
93
|
-
], UpdateSaleRequestValidator.prototype, "payment", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, class_validator_1.IsOptional)(),
|
|
96
|
-
__metadata("design:type", String)
|
|
97
|
-
], UpdateSaleRequestValidator.prototype, "method", void 0);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SupplierProviderEnum } from '../../integration/supplier';
|
|
2
|
-
export declare class OrderSaleImportEntity {
|
|
3
|
-
provider: SupplierProviderEnum;
|
|
4
|
-
externalOrderId: string;
|
|
5
|
-
importedAt: Date;
|
|
6
|
-
}
|
|
7
|
-
export declare const OrderSaleImportSchema: import("mongoose").Schema<OrderSaleImportEntity, import("mongoose").Model<OrderSaleImportEntity, any, any, any, import("mongoose").Document<unknown, any, OrderSaleImportEntity, any, {}> & OrderSaleImportEntity & {
|
|
8
|
-
_id: import("mongoose").Types.ObjectId;
|
|
9
|
-
} & {
|
|
10
|
-
__v: number;
|
|
11
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, OrderSaleImportEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<OrderSaleImportEntity>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<OrderSaleImportEntity> & {
|
|
12
|
-
_id: import("mongoose").Types.ObjectId;
|
|
13
|
-
} & {
|
|
14
|
-
__v: number;
|
|
15
|
-
}>;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Schema as MongoSchema } from 'mongoose';
|
|
2
|
-
export declare class OrderSaleShippingRecipientEntity {
|
|
3
|
-
name: string;
|
|
4
|
-
email: string;
|
|
5
|
-
phone: string;
|
|
6
|
-
document: string;
|
|
7
|
-
birthday?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const OrderSaleShippingRecipientSchema: MongoSchema<OrderSaleShippingRecipientEntity, import("mongoose").Model<OrderSaleShippingRecipientEntity, any, any, any, import("mongoose").Document<unknown, any, OrderSaleShippingRecipientEntity, any, {}> & OrderSaleShippingRecipientEntity & {
|
|
10
|
-
_id: import("mongoose").Types.ObjectId;
|
|
11
|
-
} & {
|
|
12
|
-
__v: number;
|
|
13
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, OrderSaleShippingRecipientEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<OrderSaleShippingRecipientEntity>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<OrderSaleShippingRecipientEntity> & {
|
|
14
|
-
_id: import("mongoose").Types.ObjectId;
|
|
15
|
-
} & {
|
|
16
|
-
__v: number;
|
|
17
|
-
}>;
|
|
18
|
-
export declare class OrderSaleShippingAddressEntity {
|
|
19
|
-
postalCode: string;
|
|
20
|
-
street: string;
|
|
21
|
-
number: string;
|
|
22
|
-
complement?: string;
|
|
23
|
-
district: string;
|
|
24
|
-
city: string;
|
|
25
|
-
state: string;
|
|
26
|
-
country: string;
|
|
27
|
-
}
|
|
28
|
-
export declare const OrderSaleShippingAddressSchema: MongoSchema<OrderSaleShippingAddressEntity, import("mongoose").Model<OrderSaleShippingAddressEntity, any, any, any, import("mongoose").Document<unknown, any, OrderSaleShippingAddressEntity, any, {}> & OrderSaleShippingAddressEntity & {
|
|
29
|
-
_id: import("mongoose").Types.ObjectId;
|
|
30
|
-
} & {
|
|
31
|
-
__v: number;
|
|
32
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, OrderSaleShippingAddressEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<OrderSaleShippingAddressEntity>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<OrderSaleShippingAddressEntity> & {
|
|
33
|
-
_id: import("mongoose").Types.ObjectId;
|
|
34
|
-
} & {
|
|
35
|
-
__v: number;
|
|
36
|
-
}>;
|
|
37
|
-
export declare class OrderSaleShippingDaysEntity {
|
|
38
|
-
min?: number;
|
|
39
|
-
max?: number;
|
|
40
|
-
}
|
|
41
|
-
export declare const OrderSaleShippingDaysSchema: MongoSchema<OrderSaleShippingDaysEntity, import("mongoose").Model<OrderSaleShippingDaysEntity, any, any, any, import("mongoose").Document<unknown, any, OrderSaleShippingDaysEntity, any, {}> & OrderSaleShippingDaysEntity & {
|
|
42
|
-
_id: import("mongoose").Types.ObjectId;
|
|
43
|
-
} & {
|
|
44
|
-
__v: number;
|
|
45
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, OrderSaleShippingDaysEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<OrderSaleShippingDaysEntity>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<OrderSaleShippingDaysEntity> & {
|
|
46
|
-
_id: import("mongoose").Types.ObjectId;
|
|
47
|
-
} & {
|
|
48
|
-
__v: number;
|
|
49
|
-
}>;
|
|
50
|
-
export declare class OrderSaleShippingLineEntity {
|
|
51
|
-
variant: string;
|
|
52
|
-
amount: number;
|
|
53
|
-
method?: string;
|
|
54
|
-
deliveryDays?: OrderSaleShippingDaysEntity;
|
|
55
|
-
}
|
|
56
|
-
export declare const OrderSaleShippingLineSchema: MongoSchema<OrderSaleShippingLineEntity, import("mongoose").Model<OrderSaleShippingLineEntity, any, any, any, import("mongoose").Document<unknown, any, OrderSaleShippingLineEntity, any, {}> & OrderSaleShippingLineEntity & {
|
|
57
|
-
_id: import("mongoose").Types.ObjectId;
|
|
58
|
-
} & {
|
|
59
|
-
__v: number;
|
|
60
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, OrderSaleShippingLineEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<OrderSaleShippingLineEntity>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<OrderSaleShippingLineEntity> & {
|
|
61
|
-
_id: import("mongoose").Types.ObjectId;
|
|
62
|
-
} & {
|
|
63
|
-
__v: number;
|
|
64
|
-
}>;
|
|
65
|
-
export declare class OrderSaleShippingEntity {
|
|
66
|
-
recipient: OrderSaleShippingRecipientEntity;
|
|
67
|
-
address: OrderSaleShippingAddressEntity;
|
|
68
|
-
fee?: number;
|
|
69
|
-
quotedAt?: Date;
|
|
70
|
-
lines?: OrderSaleShippingLineEntity[];
|
|
71
|
-
}
|
|
72
|
-
export declare const OrderSaleShippingSchema: MongoSchema<OrderSaleShippingEntity, import("mongoose").Model<OrderSaleShippingEntity, any, any, any, import("mongoose").Document<unknown, any, OrderSaleShippingEntity, any, {}> & OrderSaleShippingEntity & {
|
|
73
|
-
_id: import("mongoose").Types.ObjectId;
|
|
74
|
-
} & {
|
|
75
|
-
__v: number;
|
|
76
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, OrderSaleShippingEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<OrderSaleShippingEntity>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<OrderSaleShippingEntity> & {
|
|
77
|
-
_id: import("mongoose").Types.ObjectId;
|
|
78
|
-
} & {
|
|
79
|
-
__v: number;
|
|
80
|
-
}>;
|