qeai-sdk 2.0.1 → 2.0.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/dist/dtos/auth/register-user.dto.js +4 -1
- package/dist/dtos/categories/create-category.dto.js +6 -3
- package/dist/dtos/categories/delete-category.dto.d.ts +1 -1
- package/dist/dtos/categories/delete-category.dto.js +5 -3
- package/dist/dtos/categories/update-category.dto.d.ts +12 -10
- package/dist/dtos/categories/update-category.dto.js +15 -13
- package/dist/dtos/chain/create-chain.dto.d.ts +11 -12
- package/dist/dtos/chain/create-chain.dto.js +15 -14
- package/dist/dtos/chain/delete-chain.dto.d.ts +6 -6
- package/dist/dtos/chain/delete-chain.dto.js +11 -9
- package/dist/dtos/chain/update-chain.dto.d.ts +26 -16
- package/dist/dtos/chain/update-chain.dto.js +32 -21
- package/dist/dtos/common/search-by-name.dto.d.ts +23 -0
- package/dist/dtos/common/search-by-name.dto.js +24 -1
- package/dist/dtos/ingredients/create-ingredient.dto.d.ts +5 -5
- package/dist/dtos/ingredients/create-ingredient.dto.js +9 -8
- package/dist/dtos/ingredients/delete-ingredient.dto.d.ts +14 -7
- package/dist/dtos/ingredients/delete-ingredient.dto.js +18 -9
- package/dist/dtos/ingredients/index.d.ts +0 -1
- package/dist/dtos/ingredients/index.js +0 -1
- package/dist/dtos/ingredients/update-ingredient.dto.d.ts +20 -11
- package/dist/dtos/ingredients/update-ingredient.dto.js +28 -19
- package/dist/dtos/orders/change-order-status.dto.d.ts +19 -10
- package/dist/dtos/orders/change-order-status.dto.js +27 -14
- package/dist/dtos/orders/create-order.dto.d.ts +33 -23
- package/dist/dtos/orders/create-order.dto.js +43 -31
- package/dist/dtos/orders/order-item.dto.d.ts +35 -18
- package/dist/dtos/orders/order-item.dto.js +54 -32
- package/dist/dtos/orders/order-pagination.dto.d.ts +1 -1
- package/dist/dtos/orders/order-pagination.dto.js +3 -3
- package/dist/dtos/orders/paid-order.dto.d.ts +16 -8
- package/dist/dtos/orders/paid-order.dto.js +25 -14
- package/dist/dtos/payments/create-payment-audit-dynamo.dto.d.ts +81 -0
- package/dist/dtos/payments/create-payment-audit-dynamo.dto.js +81 -0
- package/dist/dtos/payments/create-payment-audit-s3.dto.d.ts +81 -0
- package/dist/dtos/payments/create-payment-audit-s3.dto.js +81 -0
- package/dist/dtos/payments/index.d.ts +2 -0
- package/dist/dtos/payments/index.js +2 -0
- package/dist/dtos/payments/payment-session-item.dto.d.ts +4 -4
- package/dist/dtos/payments/payment-session-item.dto.js +7 -4
- package/dist/dtos/payments/webhook-data.dto.d.ts +1 -1
- package/dist/dtos/payments/webhook-data.dto.js +1 -0
- package/dist/dtos/products/create-product.dto.d.ts +1 -1
- package/dist/dtos/products/create-product.dto.js +2 -1
- package/dist/dtos/products/delete-product.dto.d.ts +1 -1
- package/dist/dtos/products/delete-product.dto.js +5 -3
- package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.d.ts +3 -3
- package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.js +5 -5
- package/dist/dtos/products/submodules/product-image/create-product-image.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-image/create-product-image.dto.js +4 -4
- package/dist/dtos/products/submodules/product-image/update-product-image.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-image/update-product-image.dto.js +4 -4
- package/dist/dtos/products/submodules/product-question/create-product-question.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-question/create-product-question.dto.js +8 -8
- package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-question/update-product-question.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-question/update-product-question.dto.js +4 -4
- package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.js +2 -2
- package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.js +5 -5
- package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.d.ts +1 -8
- package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.js +3 -16
- package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.js +2 -2
- package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.js +4 -4
- package/dist/dtos/products/submodules/product-size/create-product-size.dto.js +1 -1
- package/dist/dtos/products/submodules/product-size/product-size-data.dto.js +1 -1
- package/dist/dtos/products/submodules/product-size/update-product-size.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-size/update-product-size.dto.js +2 -2
- package/dist/dtos/products/submodules/product-tag/index.d.ts +1 -3
- package/dist/dtos/products/submodules/product-tag/index.js +1 -3
- package/dist/dtos/products/submodules/product-tag/{remove-product-tag.dto.d.ts → product-tag.dto.d.ts} +1 -1
- package/dist/dtos/products/submodules/product-tag/{remove-product-tag.dto.js → product-tag.dto.js} +3 -3
- package/dist/dtos/products/update-product.dto.d.ts +4 -4
- package/dist/dtos/products/update-product.dto.js +5 -4
- package/dist/dtos/questions/create-question.dto.d.ts +1 -1
- package/dist/dtos/questions/create-question.dto.js +2 -1
- package/dist/dtos/questions/delete-question.dto.d.ts +1 -1
- package/dist/dtos/questions/delete-question.dto.js +5 -3
- package/dist/dtos/questions/index.d.ts +0 -1
- package/dist/dtos/questions/index.js +0 -1
- package/dist/dtos/questions/update-question.dto.d.ts +4 -4
- package/dist/dtos/questions/update-question.dto.js +5 -5
- package/dist/dtos/restaurants/create-restaurant.dto.d.ts +15 -1
- package/dist/dtos/restaurants/create-restaurant.dto.js +38 -2
- package/dist/dtos/restaurants/delete-restaurant.dto.d.ts +1 -1
- package/dist/dtos/restaurants/delete-restaurant.dto.js +5 -3
- package/dist/dtos/restaurants/update-restaurant.dto.d.ts +17 -10
- package/dist/dtos/restaurants/update-restaurant.dto.js +32 -16
- package/dist/dtos/tags/create-tag.dto.d.ts +1 -1
- package/dist/dtos/tags/create-tag.dto.js +5 -4
- package/dist/dtos/tags/delete-tag.dto.d.ts +1 -1
- package/dist/dtos/tags/delete-tag.dto.js +5 -3
- package/dist/dtos/tags/index.d.ts +0 -1
- package/dist/dtos/tags/index.js +0 -1
- package/dist/dtos/tags/update-tag.dto.d.ts +3 -3
- package/dist/dtos/tags/update-tag.dto.js +6 -5
- package/dist/dtos/translations/create-translation.dto.js +6 -1
- package/dist/dtos/translations/delete-translation.dto.d.ts +1 -1
- package/dist/dtos/translations/delete-translation.dto.js +4 -3
- package/dist/dtos/translations/update-translation.dto.d.ts +3 -3
- package/dist/dtos/translations/update-translation.dto.js +7 -4
- package/dist/enums/index.d.ts +0 -2
- package/dist/enums/index.js +0 -2
- package/dist/interfaces/orders/order-item.interface.d.ts +4 -4
- package/dist/interfaces/orders/order.interface.d.ts +9 -9
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/order-mode.type.d.ts +12 -3
- package/dist/types/order-mode.type.js +20 -1
- package/dist/types/order-status.type.d.ts +22 -0
- package/dist/{enums/order-status.enum.d.ts → types/order-status.type.js} +25 -26
- package/package.json +1 -1
- package/dist/dtos/ingredients/search-by-name.dto.d.ts +0 -18
- package/dist/dtos/ingredients/search-by-name.dto.js +0 -33
- package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.d.ts +0 -24
- package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.js +0 -46
- package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.d.ts +0 -24
- package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.js +0 -46
- package/dist/dtos/questions/search-by-name.dto.d.ts +0 -18
- package/dist/dtos/questions/search-by-name.dto.js +0 -33
- package/dist/dtos/tags/search-by-name.dto.d.ts +0 -18
- package/dist/dtos/tags/search-by-name.dto.js +0 -33
- package/dist/enums/order-status.enum.js +0 -69
- package/dist/enums/order-type.enum.d.ts +0 -45
- package/dist/enums/order-type.enum.js +0 -46
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsMongoId, IsUUID } from
|
|
10
|
+
import { IsString, IsMongoId, IsUUID, IsNotEmpty } from "class-validator";
|
|
11
11
|
/**
|
|
12
12
|
* DTO for deleting a restaurant.
|
|
13
13
|
*
|
|
@@ -23,7 +23,7 @@ export class DeleteRestaurantDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
restaurantId;
|
|
27
27
|
/**
|
|
28
28
|
* User who deleted the restaurant.
|
|
29
29
|
* Must be a valid MongoDB ObjectId.
|
|
@@ -35,10 +35,12 @@ export class DeleteRestaurantDto {
|
|
|
35
35
|
__decorate([
|
|
36
36
|
IsString(),
|
|
37
37
|
IsUUID(),
|
|
38
|
+
IsNotEmpty(),
|
|
38
39
|
__metadata("design:type", String)
|
|
39
|
-
], DeleteRestaurantDto.prototype, "
|
|
40
|
+
], DeleteRestaurantDto.prototype, "restaurantId", void 0);
|
|
40
41
|
__decorate([
|
|
41
42
|
IsString(),
|
|
43
|
+
IsNotEmpty(),
|
|
42
44
|
IsMongoId(),
|
|
43
45
|
__metadata("design:type", String)
|
|
44
46
|
], DeleteRestaurantDto.prototype, "deletedBy", void 0);
|
|
@@ -7,26 +7,33 @@
|
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
9
|
export declare class UpdateRestaurantDto {
|
|
10
|
-
/**
|
|
11
|
-
* Chain ID that owns this restaurant.
|
|
12
|
-
* Must not be empty.
|
|
13
|
-
*
|
|
14
|
-
* @example "chain-uuid-123"
|
|
15
|
-
*/
|
|
16
|
-
chainId: string;
|
|
17
10
|
/**
|
|
18
11
|
* Restaurant name.
|
|
19
12
|
* Must not be empty.
|
|
20
13
|
*
|
|
21
14
|
* @example "McDonald's Downtown"
|
|
22
15
|
*/
|
|
23
|
-
name
|
|
16
|
+
name?: string;
|
|
24
17
|
/**
|
|
25
18
|
* Optional restaurant address.
|
|
26
19
|
*
|
|
27
20
|
* @example "123 Main St, Downtown"
|
|
28
21
|
*/
|
|
29
22
|
address?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Latitude of the restaurant.
|
|
25
|
+
* Must be a valid number between -90 and 90.
|
|
26
|
+
*
|
|
27
|
+
* @example -12.04318
|
|
28
|
+
*/
|
|
29
|
+
latitude?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Longitude of the restaurant.
|
|
32
|
+
* Must be a valid number between -180 and 180.
|
|
33
|
+
*
|
|
34
|
+
* @example -77.02824
|
|
35
|
+
*/
|
|
36
|
+
longitude?: string;
|
|
30
37
|
/**
|
|
31
38
|
* Optional restaurant phone number.
|
|
32
39
|
*
|
|
@@ -53,12 +60,12 @@ export declare class UpdateRestaurantDto {
|
|
|
53
60
|
*
|
|
54
61
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
55
62
|
*/
|
|
56
|
-
|
|
63
|
+
restaurantId: string;
|
|
57
64
|
/**
|
|
58
65
|
* User who updated the restaurant.
|
|
59
66
|
* Must be a valid MongoDB ObjectId if provided.
|
|
60
67
|
*
|
|
61
68
|
* @example "507f1f77bcf86cd799439011"
|
|
62
69
|
*/
|
|
63
|
-
updatedBy
|
|
70
|
+
updatedBy: string;
|
|
64
71
|
}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsOptional, IsMongoId, IsUUID, IsBoolean } from
|
|
10
|
+
import { IsString, IsOptional, IsMongoId, IsUUID, IsBoolean, IsLatitude, IsLongitude, IsPhoneNumber, IsTimeZone, IsNotEmpty, } from "class-validator";
|
|
11
11
|
/**
|
|
12
12
|
* DTO for updating an existing restaurant.
|
|
13
13
|
*
|
|
@@ -17,13 +17,6 @@ import { IsString, IsOptional, IsMongoId, IsUUID, IsBoolean } from 'class-valida
|
|
|
17
17
|
* @since 2.0.0
|
|
18
18
|
*/
|
|
19
19
|
export class UpdateRestaurantDto {
|
|
20
|
-
/**
|
|
21
|
-
* Chain ID that owns this restaurant.
|
|
22
|
-
* Must not be empty.
|
|
23
|
-
*
|
|
24
|
-
* @example "chain-uuid-123"
|
|
25
|
-
*/
|
|
26
|
-
chainId;
|
|
27
20
|
/**
|
|
28
21
|
* Restaurant name.
|
|
29
22
|
* Must not be empty.
|
|
@@ -37,6 +30,20 @@ export class UpdateRestaurantDto {
|
|
|
37
30
|
* @example "123 Main St, Downtown"
|
|
38
31
|
*/
|
|
39
32
|
address;
|
|
33
|
+
/**
|
|
34
|
+
* Latitude of the restaurant.
|
|
35
|
+
* Must be a valid number between -90 and 90.
|
|
36
|
+
*
|
|
37
|
+
* @example -12.04318
|
|
38
|
+
*/
|
|
39
|
+
latitude;
|
|
40
|
+
/**
|
|
41
|
+
* Longitude of the restaurant.
|
|
42
|
+
* Must be a valid number between -180 and 180.
|
|
43
|
+
*
|
|
44
|
+
* @example -77.02824
|
|
45
|
+
*/
|
|
46
|
+
longitude;
|
|
40
47
|
/**
|
|
41
48
|
* Optional restaurant phone number.
|
|
42
49
|
*
|
|
@@ -63,7 +70,7 @@ export class UpdateRestaurantDto {
|
|
|
63
70
|
*
|
|
64
71
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
65
72
|
*/
|
|
66
|
-
|
|
73
|
+
restaurantId;
|
|
67
74
|
/**
|
|
68
75
|
* User who updated the restaurant.
|
|
69
76
|
* Must be a valid MongoDB ObjectId if provided.
|
|
@@ -76,25 +83,34 @@ __decorate([
|
|
|
76
83
|
IsOptional(),
|
|
77
84
|
IsString(),
|
|
78
85
|
__metadata("design:type", String)
|
|
79
|
-
], UpdateRestaurantDto.prototype, "
|
|
86
|
+
], UpdateRestaurantDto.prototype, "name", void 0);
|
|
80
87
|
__decorate([
|
|
81
88
|
IsOptional(),
|
|
82
89
|
IsString(),
|
|
83
90
|
__metadata("design:type", String)
|
|
84
|
-
], UpdateRestaurantDto.prototype, "
|
|
91
|
+
], UpdateRestaurantDto.prototype, "address", void 0);
|
|
85
92
|
__decorate([
|
|
86
93
|
IsOptional(),
|
|
87
|
-
IsString(),
|
|
94
|
+
IsString({ message: "Latitude must be a string" }),
|
|
95
|
+
IsLatitude(),
|
|
88
96
|
__metadata("design:type", String)
|
|
89
|
-
], UpdateRestaurantDto.prototype, "
|
|
97
|
+
], UpdateRestaurantDto.prototype, "latitude", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
IsOptional(),
|
|
100
|
+
IsString({ message: "Longitude must be a string" }),
|
|
101
|
+
IsLongitude(),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], UpdateRestaurantDto.prototype, "longitude", void 0);
|
|
90
104
|
__decorate([
|
|
91
105
|
IsOptional(),
|
|
92
106
|
IsString(),
|
|
107
|
+
IsPhoneNumber('PE'),
|
|
93
108
|
__metadata("design:type", String)
|
|
94
109
|
], UpdateRestaurantDto.prototype, "phone", void 0);
|
|
95
110
|
__decorate([
|
|
96
111
|
IsOptional(),
|
|
97
112
|
IsString(),
|
|
113
|
+
IsTimeZone(),
|
|
98
114
|
__metadata("design:type", String)
|
|
99
115
|
], UpdateRestaurantDto.prototype, "timezone", void 0);
|
|
100
116
|
__decorate([
|
|
@@ -105,12 +121,12 @@ __decorate([
|
|
|
105
121
|
__decorate([
|
|
106
122
|
IsString(),
|
|
107
123
|
IsUUID(),
|
|
108
|
-
|
|
124
|
+
IsNotEmpty(),
|
|
109
125
|
__metadata("design:type", String)
|
|
110
|
-
], UpdateRestaurantDto.prototype, "
|
|
126
|
+
], UpdateRestaurantDto.prototype, "restaurantId", void 0);
|
|
111
127
|
__decorate([
|
|
112
128
|
IsString(),
|
|
113
129
|
IsMongoId(),
|
|
114
|
-
|
|
130
|
+
IsNotEmpty(),
|
|
115
131
|
__metadata("design:type", String)
|
|
116
132
|
], UpdateRestaurantDto.prototype, "updatedBy", void 0);
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsNotEmpty,
|
|
10
|
+
import { IsString, IsNotEmpty, MaxLength, IsMongoId, MinLength, } from "class-validator";
|
|
11
11
|
/**
|
|
12
12
|
* DTO for creating a new tag.
|
|
13
13
|
*
|
|
@@ -34,12 +34,13 @@ export class CreateTagDto {
|
|
|
34
34
|
}
|
|
35
35
|
__decorate([
|
|
36
36
|
IsString(),
|
|
37
|
-
IsNotEmpty({ message:
|
|
38
|
-
MaxLength(50, { message:
|
|
37
|
+
IsNotEmpty({ message: "Tag name is required" }),
|
|
38
|
+
MaxLength(50, { message: "Tag name must be at most 50 characters" }),
|
|
39
|
+
MinLength(3),
|
|
39
40
|
__metadata("design:type", String)
|
|
40
41
|
], CreateTagDto.prototype, "name", void 0);
|
|
41
42
|
__decorate([
|
|
42
|
-
|
|
43
|
+
IsNotEmpty(),
|
|
43
44
|
IsString(),
|
|
44
45
|
IsMongoId(),
|
|
45
46
|
__metadata("design:type", String)
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsMongoId, IsUUID } from 'class-validator';
|
|
10
|
+
import { IsString, IsMongoId, IsUUID, IsNotEmpty } from 'class-validator';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for deleting a tag.
|
|
13
13
|
*
|
|
@@ -23,7 +23,7 @@ export class DeleteTagDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
tagId;
|
|
27
27
|
/**
|
|
28
28
|
* User who deleted the tag.
|
|
29
29
|
* Must be a valid MongoDB ObjectId.
|
|
@@ -35,10 +35,12 @@ export class DeleteTagDto {
|
|
|
35
35
|
__decorate([
|
|
36
36
|
IsString(),
|
|
37
37
|
IsUUID(),
|
|
38
|
+
IsNotEmpty(),
|
|
38
39
|
__metadata("design:type", String)
|
|
39
|
-
], DeleteTagDto.prototype, "
|
|
40
|
+
], DeleteTagDto.prototype, "tagId", void 0);
|
|
40
41
|
__decorate([
|
|
41
42
|
IsString(),
|
|
42
43
|
IsMongoId(),
|
|
44
|
+
IsNotEmpty(),
|
|
43
45
|
__metadata("design:type", String)
|
|
44
46
|
], DeleteTagDto.prototype, "deletedBy", void 0);
|
package/dist/dtos/tags/index.js
CHANGED
|
@@ -13,19 +13,19 @@ export declare class UpdateTagDto {
|
|
|
13
13
|
*
|
|
14
14
|
* @example "vegetarian"
|
|
15
15
|
*/
|
|
16
|
-
name
|
|
16
|
+
name?: string;
|
|
17
17
|
/**
|
|
18
18
|
* Tag ID to update.
|
|
19
19
|
* Must be a valid UUID.
|
|
20
20
|
*
|
|
21
21
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
tagId: string;
|
|
24
24
|
/**
|
|
25
25
|
* User who updated the tag.
|
|
26
26
|
* Must be a valid MongoDB ObjectId if provided.
|
|
27
27
|
*
|
|
28
28
|
* @example "507f1f77bcf86cd799439011"
|
|
29
29
|
*/
|
|
30
|
-
updatedBy
|
|
30
|
+
updatedBy: string;
|
|
31
31
|
}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsOptional, IsMongoId, IsUUID, MaxLength } from 'class-validator';
|
|
10
|
+
import { IsString, IsOptional, IsMongoId, IsUUID, MaxLength, MinLength, IsNotEmpty } from 'class-validator';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for updating an existing tag.
|
|
13
13
|
*
|
|
@@ -30,7 +30,7 @@ export class UpdateTagDto {
|
|
|
30
30
|
*
|
|
31
31
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
tagId;
|
|
34
34
|
/**
|
|
35
35
|
* User who updated the tag.
|
|
36
36
|
* Must be a valid MongoDB ObjectId if provided.
|
|
@@ -43,16 +43,17 @@ __decorate([
|
|
|
43
43
|
IsOptional(),
|
|
44
44
|
IsString(),
|
|
45
45
|
MaxLength(50, { message: 'Tag name must be at most 50 characters' }),
|
|
46
|
+
MinLength(3),
|
|
46
47
|
__metadata("design:type", String)
|
|
47
48
|
], UpdateTagDto.prototype, "name", void 0);
|
|
48
49
|
__decorate([
|
|
49
|
-
|
|
50
|
+
IsNotEmpty(),
|
|
50
51
|
IsString(),
|
|
51
52
|
IsUUID(),
|
|
52
53
|
__metadata("design:type", String)
|
|
53
|
-
], UpdateTagDto.prototype, "
|
|
54
|
+
], UpdateTagDto.prototype, "tagId", void 0);
|
|
54
55
|
__decorate([
|
|
55
|
-
|
|
56
|
+
IsNotEmpty(),
|
|
56
57
|
IsString(),
|
|
57
58
|
IsMongoId(),
|
|
58
59
|
__metadata("design:type", String)
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsOptional, IsEnum, IsUUID } from 'class-validator';
|
|
10
|
+
import { IsString, IsOptional, IsEnum, IsUUID, IsNotEmpty, MinLength } from 'class-validator';
|
|
11
11
|
import { LanguageCode } from '../../enums/language-code.enum.js';
|
|
12
12
|
/**
|
|
13
13
|
* DTO for creating a translation
|
|
@@ -46,15 +46,20 @@ export class CreateTranslationDto {
|
|
|
46
46
|
}
|
|
47
47
|
__decorate([
|
|
48
48
|
IsEnum(LanguageCode),
|
|
49
|
+
IsNotEmpty(),
|
|
50
|
+
IsString(),
|
|
49
51
|
__metadata("design:type", String)
|
|
50
52
|
], CreateTranslationDto.prototype, "languageCode", void 0);
|
|
51
53
|
__decorate([
|
|
52
54
|
IsString(),
|
|
55
|
+
IsNotEmpty(),
|
|
56
|
+
MinLength(3),
|
|
53
57
|
__metadata("design:type", String)
|
|
54
58
|
], CreateTranslationDto.prototype, "name", void 0);
|
|
55
59
|
__decorate([
|
|
56
60
|
IsOptional(),
|
|
57
61
|
IsString(),
|
|
62
|
+
MinLength(3),
|
|
58
63
|
__metadata("design:type", String)
|
|
59
64
|
], CreateTranslationDto.prototype, "description", void 0);
|
|
60
65
|
__decorate([
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsUUID } from 'class-validator';
|
|
10
|
+
import { IsNotEmpty, IsString, IsUUID } from 'class-validator';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for deleting a translation
|
|
13
13
|
*/
|
|
@@ -16,10 +16,11 @@ export class DeleteTranslationDto {
|
|
|
16
16
|
* Translation ID to delete
|
|
17
17
|
* @example "translation-uuid-123"
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
translationId;
|
|
20
20
|
}
|
|
21
21
|
__decorate([
|
|
22
22
|
IsString(),
|
|
23
|
+
IsNotEmpty(),
|
|
23
24
|
IsUUID(),
|
|
24
25
|
__metadata("design:type", String)
|
|
25
|
-
], DeleteTranslationDto.prototype, "
|
|
26
|
+
], DeleteTranslationDto.prototype, "translationId", void 0);
|
|
@@ -7,12 +7,12 @@ export declare class UpdateTranslationDto {
|
|
|
7
7
|
* Language code for the translation
|
|
8
8
|
* @example "es"
|
|
9
9
|
*/
|
|
10
|
-
languageCode
|
|
10
|
+
languageCode?: LanguageCode;
|
|
11
11
|
/**
|
|
12
12
|
* Name in the specified language
|
|
13
13
|
* @example "Bebidas"
|
|
14
14
|
*/
|
|
15
|
-
name
|
|
15
|
+
name?: string;
|
|
16
16
|
/**
|
|
17
17
|
* Description in the specified language
|
|
18
18
|
* @example "Todo tipo de bebidas"
|
|
@@ -37,5 +37,5 @@ export declare class UpdateTranslationDto {
|
|
|
37
37
|
* Translation ID to update
|
|
38
38
|
* @example "translation-uuid-123"
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
translationId: string;
|
|
41
41
|
}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsEnum, IsOptional, IsString, IsUUID } from "class-validator";
|
|
10
|
+
import { IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID, MinLength } from "class-validator";
|
|
11
11
|
import { LanguageCode } from "../../enums/language-code.enum.js";
|
|
12
12
|
/**
|
|
13
13
|
* DTO for updating a translation
|
|
@@ -47,21 +47,24 @@ export class UpdateTranslationDto {
|
|
|
47
47
|
* Translation ID to update
|
|
48
48
|
* @example "translation-uuid-123"
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
translationId;
|
|
51
51
|
}
|
|
52
52
|
__decorate([
|
|
53
53
|
IsOptional(),
|
|
54
54
|
IsEnum(LanguageCode),
|
|
55
|
+
IsString(),
|
|
55
56
|
__metadata("design:type", String)
|
|
56
57
|
], UpdateTranslationDto.prototype, "languageCode", void 0);
|
|
57
58
|
__decorate([
|
|
58
59
|
IsOptional(),
|
|
59
60
|
IsString(),
|
|
61
|
+
MinLength(3),
|
|
60
62
|
__metadata("design:type", String)
|
|
61
63
|
], UpdateTranslationDto.prototype, "name", void 0);
|
|
62
64
|
__decorate([
|
|
63
65
|
IsOptional(),
|
|
64
66
|
IsString(),
|
|
67
|
+
MinLength(3),
|
|
65
68
|
__metadata("design:type", String)
|
|
66
69
|
], UpdateTranslationDto.prototype, "description", void 0);
|
|
67
70
|
__decorate([
|
|
@@ -80,8 +83,8 @@ __decorate([
|
|
|
80
83
|
__metadata("design:type", String)
|
|
81
84
|
], UpdateTranslationDto.prototype, "questionId", void 0);
|
|
82
85
|
__decorate([
|
|
83
|
-
|
|
86
|
+
IsNotEmpty(),
|
|
84
87
|
IsString(),
|
|
85
88
|
IsUUID(),
|
|
86
89
|
__metadata("design:type", String)
|
|
87
|
-
], UpdateTranslationDto.prototype, "
|
|
90
|
+
], UpdateTranslationDto.prototype, "translationId", void 0);
|
package/dist/enums/index.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ export * from "./http-status-code.enum.js";
|
|
|
2
2
|
export * from "./http-status-text.enum.js";
|
|
3
3
|
export * from "./currency.enum.js";
|
|
4
4
|
export * from "./language-code.enum.js";
|
|
5
|
-
export * from "./order-type.enum.js";
|
|
6
|
-
export * from "./order-status.enum.js";
|
|
7
5
|
export * from "./question-type.enum.js";
|
|
8
6
|
export * from "./question-product-type.enum.js";
|
|
9
7
|
export * from "./translation-entity-type.enum.js";
|
package/dist/enums/index.js
CHANGED
|
@@ -2,8 +2,6 @@ export * from "./http-status-code.enum.js";
|
|
|
2
2
|
export * from "./http-status-text.enum.js";
|
|
3
3
|
export * from "./currency.enum.js";
|
|
4
4
|
export * from "./language-code.enum.js";
|
|
5
|
-
export * from "./order-type.enum.js";
|
|
6
|
-
export * from "./order-status.enum.js";
|
|
7
5
|
export * from "./question-type.enum.js";
|
|
8
6
|
export * from "./question-product-type.enum.js";
|
|
9
7
|
export * from "./translation-entity-type.enum.js";
|
|
@@ -19,13 +19,13 @@ export interface OrderItem {
|
|
|
19
19
|
* @example "Large"
|
|
20
20
|
* @example "Medium"
|
|
21
21
|
*/
|
|
22
|
-
sizeName?: string;
|
|
22
|
+
sizeName?: string | null;
|
|
23
23
|
/**
|
|
24
24
|
* Optional price for the size variant.
|
|
25
25
|
*
|
|
26
26
|
* @example 12.99
|
|
27
27
|
*/
|
|
28
|
-
sizePrice?: number;
|
|
28
|
+
sizePrice?: number | null;
|
|
29
29
|
/**
|
|
30
30
|
* Current status of the order item.
|
|
31
31
|
*
|
|
@@ -39,7 +39,7 @@ export interface OrderItem {
|
|
|
39
39
|
*
|
|
40
40
|
* @example "No onions, extra cheese"
|
|
41
41
|
*/
|
|
42
|
-
notes?: string;
|
|
42
|
+
notes?: string | null;
|
|
43
43
|
/**
|
|
44
44
|
* Unit price for this item.
|
|
45
45
|
*
|
|
@@ -66,5 +66,5 @@ export interface OrderItem {
|
|
|
66
66
|
* @default []
|
|
67
67
|
* @example [ { name: "Coke", quantity: 1, ... }, { name: "Fries", quantity: 1, ... } ]
|
|
68
68
|
*/
|
|
69
|
-
childItems
|
|
69
|
+
childItems?: OrderItem[] | null;
|
|
70
70
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OrderStatus } from
|
|
2
|
-
import { OrderMode } from
|
|
1
|
+
import { OrderStatus } from "../../types/index.js";
|
|
2
|
+
import { OrderMode } from "../../types/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Represents a restaurant order within the QeHay system.
|
|
5
5
|
* Each order includes its metadata, payment information, state, and fulfillment mode.
|
|
@@ -53,7 +53,7 @@ export interface Order {
|
|
|
53
53
|
* @example "2024-01-15T18:30:00Z"
|
|
54
54
|
* @example null
|
|
55
55
|
*/
|
|
56
|
-
paidAt?: Date;
|
|
56
|
+
paidAt?: Date | null;
|
|
57
57
|
/**
|
|
58
58
|
* Payment transaction or charge identifier from the payment provider (if paid).
|
|
59
59
|
* May be null if the order is unpaid or if the payment method does not provide an external reference.
|
|
@@ -61,7 +61,7 @@ export interface Order {
|
|
|
61
61
|
* @example "ch_1234567890abcdef"
|
|
62
62
|
* @example null
|
|
63
63
|
*/
|
|
64
|
-
paymentChargeId?: string;
|
|
64
|
+
paymentChargeId?: string | null;
|
|
65
65
|
/**
|
|
66
66
|
* For dine-in orders, this indicates the table number assigned.
|
|
67
67
|
* For pickup or delivery orders, this will be null.
|
|
@@ -69,7 +69,7 @@ export interface Order {
|
|
|
69
69
|
* @example "Table 5"
|
|
70
70
|
* @example null
|
|
71
71
|
*/
|
|
72
|
-
tableNumber?: string;
|
|
72
|
+
tableNumber?: string | null;
|
|
73
73
|
/**
|
|
74
74
|
* For pickup orders, this indicates the scheduled pick-up time.
|
|
75
75
|
* For dine-in or delivery orders, this field will be null.
|
|
@@ -77,7 +77,7 @@ export interface Order {
|
|
|
77
77
|
* @example "2024-01-15T18:30:00Z"
|
|
78
78
|
* @example null
|
|
79
79
|
*/
|
|
80
|
-
pickupTime?: Date;
|
|
80
|
+
pickupTime?: Date | null;
|
|
81
81
|
/**
|
|
82
82
|
* For delivery orders, this contains the delivery address.
|
|
83
83
|
* For dine-in or pickup, this will be null.
|
|
@@ -85,20 +85,20 @@ export interface Order {
|
|
|
85
85
|
* @example "123 Main St, Downtown"
|
|
86
86
|
* @example null
|
|
87
87
|
*/
|
|
88
|
-
deliveryAddress?: string;
|
|
88
|
+
deliveryAddress?: string | null;
|
|
89
89
|
/**
|
|
90
90
|
* Unique identifier of the customer who placed the order.
|
|
91
91
|
*
|
|
92
92
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
93
93
|
*/
|
|
94
|
-
customerId
|
|
94
|
+
customerId?: string | null;
|
|
95
95
|
/**
|
|
96
96
|
* Identifier for the selected payment method.
|
|
97
97
|
* Can reference either a saved method or a one-time use token depending on the payment provider.
|
|
98
98
|
*
|
|
99
99
|
* @example "payment-method-uuid-123"
|
|
100
100
|
*/
|
|
101
|
-
paymentMethodId
|
|
101
|
+
paymentMethodId?: string | null;
|
|
102
102
|
/**
|
|
103
103
|
* Timestamp for when the order was created in the system.
|
|
104
104
|
*
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Order mode constants for the QeHay platform.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This array contains all possible order modes for order creation in QeHay.
|
|
5
|
+
* Acts as the single source of truth for order mode values across client, waiter,
|
|
6
|
+
* kitchen, and admin modules.
|
|
5
7
|
*
|
|
6
8
|
* - DINE_IN: The order is placed within the restaurant. The order is created in a "CREATED" state,
|
|
7
9
|
* and a QR code is generated for the waiter to scan and confirm the order.
|
|
@@ -11,4 +13,11 @@
|
|
|
11
13
|
*
|
|
12
14
|
* @since 2.0.0
|
|
13
15
|
*/
|
|
14
|
-
export
|
|
16
|
+
export declare const ORDER_MODES: readonly ["DINE_IN", "DELIVERY", "PICKUP"];
|
|
17
|
+
/**
|
|
18
|
+
* Type representing all possible modes for an order within the QeHay platform.
|
|
19
|
+
* @see ORDER_MODES
|
|
20
|
+
*
|
|
21
|
+
* @example OrderMode.DINE_IN
|
|
22
|
+
*/
|
|
23
|
+
export type OrderMode = typeof ORDER_MODES[number];
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Order mode constants for the QeHay platform.
|
|
3
|
+
*
|
|
4
|
+
* This array contains all possible order modes for order creation in QeHay.
|
|
5
|
+
* Acts as the single source of truth for order mode values across client, waiter,
|
|
6
|
+
* kitchen, and admin modules.
|
|
7
|
+
*
|
|
8
|
+
* - DINE_IN: The order is placed within the restaurant. The order is created in a "CREATED" state,
|
|
9
|
+
* and a QR code is generated for the waiter to scan and confirm the order.
|
|
10
|
+
* - DELIVERY: The order is placed for home delivery. The order is created in a "CREATED" state,
|
|
11
|
+
* payment is processed, and the order transitions to "CONFIRMED".
|
|
12
|
+
* - PICKUP: The order is placed for pickup at the restaurant. Follows the DELIVERY flow regarding state and payment.
|
|
13
|
+
*
|
|
14
|
+
* @since 2.0.0
|
|
15
|
+
*/
|
|
16
|
+
export const ORDER_MODES = [
|
|
17
|
+
'DINE_IN',
|
|
18
|
+
'DELIVERY',
|
|
19
|
+
'PICKUP',
|
|
20
|
+
];
|