@merkaly/api 0.2.3-0 → 0.2.3-2
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/.output/abstract/abstract.document.d.ts +1 -1
- package/.output/abstract/abstract.document.js +1 -1
- package/.output/abstract/abstract.entity.d.ts +1 -1
- package/.output/abstract/abstract.entity.js +0 -1
- package/.output/modules/sales/clients/client.document.d.ts +9 -0
- package/.output/modules/sales/clients/client.document.js +33 -0
- package/.output/modules/sales/clients/client.entity.d.ts +4 -5
- package/.output/modules/sales/clients/client.entity.js +8 -17
- package/.output/modules/sales/clients/client.validator.d.ts +5 -3
- package/.output/modules/sales/clients/client.validator.js +33 -8
- package/.output/modules/sales/orders/order.entity.d.ts +3 -2
- package/.output/modules/sales/orders/order.entity.js +9 -4
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ var AbstractDocument = (function () {
|
|
|
6
6
|
var _id = _a._id, createdAt = _a.createdAt, updatedAt = _a.updatedAt;
|
|
7
7
|
this.id = _id;
|
|
8
8
|
this.createdAt = createdAt || new Date();
|
|
9
|
-
this.updatedAt = updatedAt ||
|
|
9
|
+
this.updatedAt = updatedAt || null;
|
|
10
10
|
}
|
|
11
11
|
return AbstractDocument;
|
|
12
12
|
}());
|
|
@@ -32,7 +32,6 @@ var AbstractEntity = (function (_super) {
|
|
|
32
32
|
function AbstractEntity() {
|
|
33
33
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
34
34
|
_this._id = String();
|
|
35
|
-
_this.createdAt = null;
|
|
36
35
|
_this.updatedAt = null;
|
|
37
36
|
_this.deletedAt = null;
|
|
38
37
|
return _this;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractDocument } from '../../../abstract/abstract.document';
|
|
2
|
+
import type { MetaAddress } from "../../../types";
|
|
3
|
+
export declare class ClientDocument extends AbstractDocument {
|
|
4
|
+
name: string;
|
|
5
|
+
identificationNumber: string;
|
|
6
|
+
email: string;
|
|
7
|
+
phone?: string;
|
|
8
|
+
addresses: MetaAddress[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ClientDocument = void 0;
|
|
19
|
+
var abstract_document_1 = require("../../../abstract/abstract.document");
|
|
20
|
+
var ClientDocument = (function (_super) {
|
|
21
|
+
__extends(ClientDocument, _super);
|
|
22
|
+
function ClientDocument() {
|
|
23
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
_this.name = String();
|
|
25
|
+
_this.identificationNumber = String();
|
|
26
|
+
_this.email = String();
|
|
27
|
+
_this.phone = String();
|
|
28
|
+
_this.addresses = [];
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
return ClientDocument;
|
|
32
|
+
}(abstract_document_1.AbstractDocument));
|
|
33
|
+
exports.ClientDocument = ClientDocument;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { User } from 'auth0';
|
|
2
2
|
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
3
|
+
import { MetaAddress } from "../../../types";
|
|
3
4
|
export declare class ClientEntity extends AbstractEntity implements User {
|
|
4
5
|
static readonly $index = "store_clients";
|
|
5
|
-
readonly
|
|
6
|
+
readonly name: string;
|
|
6
7
|
readonly email: string;
|
|
7
|
-
readonly email_verified: boolean;
|
|
8
8
|
readonly phone?: string;
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly name?: string;
|
|
9
|
+
readonly identificationNumber: string;
|
|
10
|
+
readonly addresses: MetaAddress[];
|
|
12
11
|
}
|
|
@@ -32,39 +32,30 @@ var ClientEntity = (function (_super) {
|
|
|
32
32
|
__extends(ClientEntity, _super);
|
|
33
33
|
function ClientEntity() {
|
|
34
34
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
-
_this.
|
|
36
|
-
_this.phone_verified = false;
|
|
35
|
+
_this.addresses = [];
|
|
37
36
|
return _this;
|
|
38
37
|
}
|
|
39
38
|
ClientEntity.$index = 'store_clients';
|
|
40
39
|
__decorate([
|
|
41
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true
|
|
40
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
42
41
|
__metadata("design:type", String)
|
|
43
|
-
], ClientEntity.prototype, "
|
|
42
|
+
], ClientEntity.prototype, "name", void 0);
|
|
44
43
|
__decorate([
|
|
45
44
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, unique: true, required: true }),
|
|
46
45
|
__metadata("design:type", String)
|
|
47
46
|
], ClientEntity.prototype, "email", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: false }),
|
|
50
|
-
__metadata("design:type", Boolean)
|
|
51
|
-
], ClientEntity.prototype, "email_verified", void 0);
|
|
52
47
|
__decorate([
|
|
53
48
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
|
|
54
49
|
__metadata("design:type", String)
|
|
55
50
|
], ClientEntity.prototype, "phone", void 0);
|
|
56
51
|
__decorate([
|
|
57
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.
|
|
58
|
-
__metadata("design:type", Boolean)
|
|
59
|
-
], ClientEntity.prototype, "phone_verified", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
|
|
52
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, unique: true }),
|
|
62
53
|
__metadata("design:type", String)
|
|
63
|
-
], ClientEntity.prototype, "
|
|
54
|
+
], ClientEntity.prototype, "identificationNumber", void 0);
|
|
64
55
|
__decorate([
|
|
65
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.
|
|
66
|
-
__metadata("design:type",
|
|
67
|
-
], ClientEntity.prototype, "
|
|
56
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Array, default: [] }),
|
|
57
|
+
__metadata("design:type", Array)
|
|
58
|
+
], ClientEntity.prototype, "addresses", void 0);
|
|
68
59
|
ClientEntity = __decorate([
|
|
69
60
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
70
61
|
], ClientEntity);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { MetaAddress } from "../../../types";
|
|
1
2
|
export declare class CreateClientValidator {
|
|
2
3
|
name: string;
|
|
3
4
|
email: string;
|
|
4
5
|
phone?: string;
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
identificationNumber: string;
|
|
7
|
+
addresses: MetaAddress[];
|
|
7
8
|
}
|
|
8
|
-
export declare class UpdateClientValidator {
|
|
9
|
+
export declare class UpdateClientValidator extends CreateClientValidator {
|
|
9
10
|
name: string;
|
|
10
11
|
email: string;
|
|
11
12
|
phone: string;
|
|
13
|
+
identificationNumber: string;
|
|
12
14
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -28,24 +43,25 @@ var CreateClientValidator = (function () {
|
|
|
28
43
|
__metadata("design:type", String)
|
|
29
44
|
], CreateClientValidator.prototype, "email", void 0);
|
|
30
45
|
__decorate([
|
|
31
|
-
(0, class_validator_1.
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
32
47
|
(0, class_validator_1.IsOptional)(),
|
|
33
48
|
__metadata("design:type", String)
|
|
34
49
|
], CreateClientValidator.prototype, "phone", void 0);
|
|
35
50
|
__decorate([
|
|
36
51
|
(0, class_validator_1.IsString)(),
|
|
37
52
|
__metadata("design:type", String)
|
|
38
|
-
], CreateClientValidator.prototype, "
|
|
53
|
+
], CreateClientValidator.prototype, "identificationNumber", void 0);
|
|
39
54
|
__decorate([
|
|
40
|
-
(0, class_validator_1.
|
|
41
|
-
(
|
|
42
|
-
|
|
43
|
-
], CreateClientValidator.prototype, "picture", void 0);
|
|
55
|
+
(0, class_validator_1.IsArray)(),
|
|
56
|
+
__metadata("design:type", Array)
|
|
57
|
+
], CreateClientValidator.prototype, "addresses", void 0);
|
|
44
58
|
return CreateClientValidator;
|
|
45
59
|
}());
|
|
46
60
|
exports.CreateClientValidator = CreateClientValidator;
|
|
47
|
-
var UpdateClientValidator = (function () {
|
|
61
|
+
var UpdateClientValidator = (function (_super) {
|
|
62
|
+
__extends(UpdateClientValidator, _super);
|
|
48
63
|
function UpdateClientValidator() {
|
|
64
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
49
65
|
}
|
|
50
66
|
__decorate([
|
|
51
67
|
(0, class_validator_1.IsString)(),
|
|
@@ -54,6 +70,10 @@ var UpdateClientValidator = (function () {
|
|
|
54
70
|
], UpdateClientValidator.prototype, "name", void 0);
|
|
55
71
|
__decorate([
|
|
56
72
|
(0, class_validator_1.IsEmail)(),
|
|
73
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
|
74
|
+
var value = _a.value;
|
|
75
|
+
return String(value).toLowerCase();
|
|
76
|
+
}),
|
|
57
77
|
(0, class_validator_1.IsOptional)(),
|
|
58
78
|
__metadata("design:type", String)
|
|
59
79
|
], UpdateClientValidator.prototype, "email", void 0);
|
|
@@ -62,6 +82,11 @@ var UpdateClientValidator = (function () {
|
|
|
62
82
|
(0, class_validator_1.IsOptional)(),
|
|
63
83
|
__metadata("design:type", String)
|
|
64
84
|
], UpdateClientValidator.prototype, "phone", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, class_validator_1.IsString)(),
|
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], UpdateClientValidator.prototype, "identificationNumber", void 0);
|
|
65
90
|
return UpdateClientValidator;
|
|
66
|
-
}());
|
|
91
|
+
}(CreateClientValidator));
|
|
67
92
|
exports.UpdateClientValidator = UpdateClientValidator;
|
|
@@ -3,6 +3,7 @@ import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
|
3
3
|
import { ItemEntity } from './item/item.entity';
|
|
4
4
|
import { PaymentEntity } from './payment/payment.entity';
|
|
5
5
|
import { StatusEntity } from './status/status.entity';
|
|
6
|
+
import { ClientEntity } from "../clients/client.entity";
|
|
6
7
|
export declare class OrderEntity extends AbstractEntity {
|
|
7
8
|
static readonly $index = "store_orders";
|
|
8
9
|
number: number;
|
|
@@ -11,10 +12,10 @@ export declare class OrderEntity extends AbstractEntity {
|
|
|
11
12
|
billing?: Types.Map<any>;
|
|
12
13
|
shipping?: Types.Map<any>;
|
|
13
14
|
payment: PaymentEntity;
|
|
14
|
-
|
|
15
|
+
createdBy: string;
|
|
16
|
+
client: ClientEntity;
|
|
15
17
|
notes: string;
|
|
16
18
|
readonly fullNumber: string;
|
|
17
19
|
readonly total: number;
|
|
18
|
-
readonly client: any;
|
|
19
20
|
readonly currentStatus: StatusEntity;
|
|
20
21
|
}
|
|
@@ -33,6 +33,7 @@ var item_schema_1 = require("./item/item.schema");
|
|
|
33
33
|
var payment_entity_1 = require("./payment/payment.entity");
|
|
34
34
|
var payment_schema_1 = require("./payment/payment.schema");
|
|
35
35
|
var shipping_entity_1 = require("./shipping/shipping.entity");
|
|
36
|
+
var client_entity_1 = require("../clients/client.entity");
|
|
36
37
|
var OrderEntity = (function (_super) {
|
|
37
38
|
__extends(OrderEntity, _super);
|
|
38
39
|
function OrderEntity() {
|
|
@@ -55,11 +56,11 @@ var OrderEntity = (function (_super) {
|
|
|
55
56
|
__metadata("design:type", Array)
|
|
56
57
|
], OrderEntity.prototype, "items", void 0);
|
|
57
58
|
__decorate([
|
|
58
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return billing_entity_1.BillingEntity; } }),
|
|
59
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return billing_entity_1.BillingEntity; }, default: null }),
|
|
59
60
|
__metadata("design:type", mongoose_2.Types.Map)
|
|
60
61
|
], OrderEntity.prototype, "billing", void 0);
|
|
61
62
|
__decorate([
|
|
62
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return shipping_entity_1.ShippingEntity; } }),
|
|
63
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return shipping_entity_1.ShippingEntity; }, default: null }),
|
|
63
64
|
__metadata("design:type", mongoose_2.Types.Map)
|
|
64
65
|
], OrderEntity.prototype, "shipping", void 0);
|
|
65
66
|
__decorate([
|
|
@@ -69,9 +70,13 @@ var OrderEntity = (function (_super) {
|
|
|
69
70
|
__decorate([
|
|
70
71
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
71
72
|
__metadata("design:type", String)
|
|
72
|
-
], OrderEntity.prototype, "
|
|
73
|
+
], OrderEntity.prototype, "createdBy", void 0);
|
|
73
74
|
__decorate([
|
|
74
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.
|
|
75
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: client_entity_1.ClientEntity.$index }),
|
|
76
|
+
__metadata("design:type", client_entity_1.ClientEntity)
|
|
77
|
+
], OrderEntity.prototype, "client", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
|
|
75
80
|
__metadata("design:type", String)
|
|
76
81
|
], OrderEntity.prototype, "notes", void 0);
|
|
77
82
|
OrderEntity = __decorate([
|