@merkaly/api 0.2.2-21 → 0.2.2-22
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/modules/store/clients/client.entity.d.ts +24 -0
- package/.output/modules/store/clients/client.entity.js +45 -0
- package/.output/modules/store/clients/client.validator.d.ts +10 -0
- package/.output/modules/store/clients/client.validator.js +54 -0
- package/.output/modules/store/orders/order.entity.d.ts +2 -1
- package/.output/modules/store/orders/order.entity.js +5 -4
- package/.output/modules/store/orders/order.validator.d.ts +4 -0
- package/.output/modules/store/orders/order.validator.js +10 -1
- package/.output/modules/store/orders/status/status.entity.d.ts +1 -1
- package/.output/modules/store/orders/status/status.entity.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { User } from 'auth0';
|
|
2
|
+
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
3
|
+
export declare class ClientEntity extends AbstractEntity implements User {
|
|
4
|
+
static readonly $index = "store_clients";
|
|
5
|
+
readonly user_id: string;
|
|
6
|
+
readonly email?: string | undefined;
|
|
7
|
+
readonly email_verified?: boolean | undefined;
|
|
8
|
+
readonly username?: string | undefined;
|
|
9
|
+
readonly phone_number?: string | undefined;
|
|
10
|
+
readonly phone_verified?: boolean | undefined;
|
|
11
|
+
readonly created_at?: string | undefined;
|
|
12
|
+
readonly updated_at?: string | undefined;
|
|
13
|
+
readonly picture?: string | undefined;
|
|
14
|
+
readonly name?: string | undefined;
|
|
15
|
+
readonly nickname?: string | undefined;
|
|
16
|
+
readonly multifactor?: string[] | undefined;
|
|
17
|
+
readonly last_ip?: string | undefined;
|
|
18
|
+
readonly last_login?: string | undefined;
|
|
19
|
+
readonly last_password_reset?: string | undefined;
|
|
20
|
+
readonly logins_count?: number | undefined;
|
|
21
|
+
readonly blocked?: boolean | undefined;
|
|
22
|
+
readonly given_name?: string | undefined;
|
|
23
|
+
readonly family_name?: string | undefined;
|
|
24
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ClientEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const abstract_entity_1 = require("../../../abstract/abstract.entity");
|
|
16
|
+
let ClientEntity = class ClientEntity extends abstract_entity_1.AbstractEntity {
|
|
17
|
+
static $index = 'store_clients';
|
|
18
|
+
user_id;
|
|
19
|
+
email;
|
|
20
|
+
email_verified;
|
|
21
|
+
username;
|
|
22
|
+
phone_number;
|
|
23
|
+
phone_verified;
|
|
24
|
+
created_at;
|
|
25
|
+
updated_at;
|
|
26
|
+
picture;
|
|
27
|
+
name;
|
|
28
|
+
nickname;
|
|
29
|
+
multifactor;
|
|
30
|
+
last_ip;
|
|
31
|
+
last_login;
|
|
32
|
+
last_password_reset;
|
|
33
|
+
logins_count;
|
|
34
|
+
blocked;
|
|
35
|
+
given_name;
|
|
36
|
+
family_name;
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], ClientEntity.prototype, "user_id", void 0);
|
|
42
|
+
ClientEntity = __decorate([
|
|
43
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
44
|
+
], ClientEntity);
|
|
45
|
+
exports.ClientEntity = ClientEntity;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UpdateClientValidator = exports.CreateClientValidator = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class CreateClientValidator {
|
|
16
|
+
name;
|
|
17
|
+
email;
|
|
18
|
+
phone;
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], CreateClientValidator.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsEmail)(),
|
|
26
|
+
(0, class_transformer_1.Transform)(({ value }) => String(value).toLowerCase()),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CreateClientValidator.prototype, "email", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreateClientValidator.prototype, "phone", void 0);
|
|
33
|
+
exports.CreateClientValidator = CreateClientValidator;
|
|
34
|
+
class UpdateClientValidator {
|
|
35
|
+
name;
|
|
36
|
+
email;
|
|
37
|
+
phone;
|
|
38
|
+
}
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], UpdateClientValidator.prototype, "name", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsEmail)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], UpdateClientValidator.prototype, "email", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], UpdateClientValidator.prototype, "phone", void 0);
|
|
54
|
+
exports.UpdateClientValidator = UpdateClientValidator;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Types } from 'mongoose';
|
|
2
2
|
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
3
3
|
import { PaymentEntity } from '../../setting/payments/payment.entity';
|
|
4
|
+
import { ClientEntity } from '../clients/client.entity';
|
|
4
5
|
import { ItemEntity } from './item/item.entity';
|
|
5
6
|
import { StatusEntity } from './status/status.entity';
|
|
6
7
|
export declare class OrderEntity extends AbstractEntity {
|
|
@@ -11,6 +12,6 @@ export declare class OrderEntity extends AbstractEntity {
|
|
|
11
12
|
billing: Types.Map<string>;
|
|
12
13
|
shipping: Types.Map<string>;
|
|
13
14
|
payment: PaymentEntity;
|
|
14
|
-
|
|
15
|
+
client: ClientEntity;
|
|
15
16
|
notes: string;
|
|
16
17
|
}
|
|
@@ -14,6 +14,7 @@ const mongoose_1 = require("@nestjs/mongoose");
|
|
|
14
14
|
const mongoose_2 = require("mongoose");
|
|
15
15
|
const abstract_entity_1 = require("../../../abstract/abstract.entity");
|
|
16
16
|
const payment_entity_1 = require("../../setting/payments/payment.entity");
|
|
17
|
+
const client_entity_1 = require("../clients/client.entity");
|
|
17
18
|
const billing_entity_1 = require("./billing/billing.entity");
|
|
18
19
|
const item_schema_1 = require("./item/item.schema");
|
|
19
20
|
const shipping_entity_1 = require("./shipping/shipping.entity");
|
|
@@ -25,7 +26,7 @@ let OrderEntity = class OrderEntity extends abstract_entity_1.AbstractEntity {
|
|
|
25
26
|
billing;
|
|
26
27
|
shipping;
|
|
27
28
|
payment;
|
|
28
|
-
|
|
29
|
+
client;
|
|
29
30
|
notes;
|
|
30
31
|
};
|
|
31
32
|
__decorate([
|
|
@@ -53,9 +54,9 @@ __decorate([
|
|
|
53
54
|
__metadata("design:type", payment_entity_1.PaymentEntity)
|
|
54
55
|
], OrderEntity.prototype, "payment", void 0);
|
|
55
56
|
__decorate([
|
|
56
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.
|
|
57
|
-
__metadata("design:type",
|
|
58
|
-
], OrderEntity.prototype, "
|
|
57
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: client_entity_1.ClientEntity.$index }),
|
|
58
|
+
__metadata("design:type", client_entity_1.ClientEntity)
|
|
59
|
+
], OrderEntity.prototype, "client", void 0);
|
|
59
60
|
__decorate([
|
|
60
61
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
61
62
|
__metadata("design:type", String)
|
|
@@ -2,6 +2,7 @@ import { PaymentType } from '../../setting/payments/payment.validator';
|
|
|
2
2
|
import { CreateBillingValidator } from './billing/billing.validator';
|
|
3
3
|
import { CreateItemValidator } from './item/item.validator';
|
|
4
4
|
import { CreateShippingValidator } from './shipping/shipping.validator';
|
|
5
|
+
import { StatusType } from './status/status.validator';
|
|
5
6
|
export declare class CreateOrderValidator {
|
|
6
7
|
items: CreateItemValidator[];
|
|
7
8
|
billing: CreateBillingValidator;
|
|
@@ -11,3 +12,6 @@ export declare class CreateOrderValidator {
|
|
|
11
12
|
}
|
|
12
13
|
export declare class UpdateOrderValidator {
|
|
13
14
|
}
|
|
15
|
+
export declare class ChangeOrderStatusValidator {
|
|
16
|
+
status: StatusType;
|
|
17
|
+
}
|
|
@@ -9,13 +9,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UpdateOrderValidator = exports.CreateOrderValidator = void 0;
|
|
12
|
+
exports.ChangeOrderStatusValidator = exports.UpdateOrderValidator = exports.CreateOrderValidator = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const payment_validator_1 = require("../../setting/payments/payment.validator");
|
|
16
16
|
const billing_validator_1 = require("./billing/billing.validator");
|
|
17
17
|
const item_validator_1 = require("./item/item.validator");
|
|
18
18
|
const shipping_validator_1 = require("./shipping/shipping.validator");
|
|
19
|
+
const status_validator_1 = require("./status/status.validator");
|
|
19
20
|
class CreateOrderValidator {
|
|
20
21
|
items = [];
|
|
21
22
|
billing;
|
|
@@ -51,3 +52,11 @@ exports.CreateOrderValidator = CreateOrderValidator;
|
|
|
51
52
|
class UpdateOrderValidator {
|
|
52
53
|
}
|
|
53
54
|
exports.UpdateOrderValidator = UpdateOrderValidator;
|
|
55
|
+
class ChangeOrderStatusValidator {
|
|
56
|
+
status;
|
|
57
|
+
}
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsEnum)(status_validator_1.StatusType),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], ChangeOrderStatusValidator.prototype, "status", void 0);
|
|
62
|
+
exports.ChangeOrderStatusValidator = ChangeOrderStatusValidator;
|
|
@@ -17,7 +17,7 @@ const status_validator_1 = require("./status.validator");
|
|
|
17
17
|
let StatusEntity = class StatusEntity {
|
|
18
18
|
name;
|
|
19
19
|
user;
|
|
20
|
-
date
|
|
20
|
+
date;
|
|
21
21
|
};
|
|
22
22
|
__decorate([
|
|
23
23
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, enum: status_validator_1.StatusType, required: true }),
|
|
@@ -28,7 +28,7 @@ __decorate([
|
|
|
28
28
|
__metadata("design:type", String)
|
|
29
29
|
], StatusEntity.prototype, "user", void 0);
|
|
30
30
|
__decorate([
|
|
31
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date
|
|
31
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
32
32
|
__metadata("design:type", Object)
|
|
33
33
|
], StatusEntity.prototype, "date", void 0);
|
|
34
34
|
StatusEntity = __decorate([
|