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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export class CreatePaymentAuditDynamoDto {
|
|
2
|
+
/**
|
|
3
|
+
* Unique identifier for the audited transaction.
|
|
4
|
+
* Should be globally unique per transaction.
|
|
5
|
+
*
|
|
6
|
+
* @example "txn_123abc456"
|
|
7
|
+
*/
|
|
8
|
+
transactionId;
|
|
9
|
+
/**
|
|
10
|
+
* ISO 8601 timestamp indicating when the payment event occurred.
|
|
11
|
+
*
|
|
12
|
+
* @example "2024-06-01T12:00:00.000Z"
|
|
13
|
+
*/
|
|
14
|
+
timestamp;
|
|
15
|
+
/**
|
|
16
|
+
* Unique identifier of the related order.
|
|
17
|
+
*
|
|
18
|
+
* @example "order_789xyz"
|
|
19
|
+
*/
|
|
20
|
+
orderId;
|
|
21
|
+
/**
|
|
22
|
+
* Name of the payment provider (e.g., "stripe", "culqi").
|
|
23
|
+
*
|
|
24
|
+
* @example "stripe"
|
|
25
|
+
*/
|
|
26
|
+
provider;
|
|
27
|
+
/**
|
|
28
|
+
* Name or path of the API endpoint called (e.g., "/charges").
|
|
29
|
+
*
|
|
30
|
+
* @example "/charges"
|
|
31
|
+
*/
|
|
32
|
+
endpoint;
|
|
33
|
+
/**
|
|
34
|
+
* HTTP method used for the audited request.
|
|
35
|
+
*
|
|
36
|
+
* @example "POST"
|
|
37
|
+
*/
|
|
38
|
+
method;
|
|
39
|
+
/**
|
|
40
|
+
* HTTP response status code from the provider (e.g., 200, 500).
|
|
41
|
+
*
|
|
42
|
+
* @example 200
|
|
43
|
+
*/
|
|
44
|
+
statusCode;
|
|
45
|
+
/**
|
|
46
|
+
* Status of the operation/audit (e.g., "success", "error").
|
|
47
|
+
*
|
|
48
|
+
* @example "success"
|
|
49
|
+
*/
|
|
50
|
+
status;
|
|
51
|
+
/**
|
|
52
|
+
* Processing time for the audited action, in milliseconds.
|
|
53
|
+
*
|
|
54
|
+
* @example 845
|
|
55
|
+
*/
|
|
56
|
+
durationMs;
|
|
57
|
+
/**
|
|
58
|
+
* (Optional) IP address from which the request originated.
|
|
59
|
+
*
|
|
60
|
+
* @example "192.168.0.1"
|
|
61
|
+
*/
|
|
62
|
+
ipAddress;
|
|
63
|
+
/**
|
|
64
|
+
* URL of the external log or audit file, if available (e.g., S3 presigned url).
|
|
65
|
+
*
|
|
66
|
+
* @example "https://s3.amazonaws.com/bucket/audit/txn_123.json"
|
|
67
|
+
*/
|
|
68
|
+
logUrl;
|
|
69
|
+
/**
|
|
70
|
+
* ISO 8601 timestamp indicating when the audit record was created.
|
|
71
|
+
*
|
|
72
|
+
* @example "2024-06-01T12:01:00.000Z"
|
|
73
|
+
*/
|
|
74
|
+
createdAt;
|
|
75
|
+
/**
|
|
76
|
+
* ISO 8601 timestamp indicating the last update to the audit record.
|
|
77
|
+
*
|
|
78
|
+
* @example "2024-06-01T12:05:30.000Z"
|
|
79
|
+
*/
|
|
80
|
+
updatedAt;
|
|
81
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DTO for storing payment audit records in S3.
|
|
3
|
+
*
|
|
4
|
+
* Encapsulates all relevant information of a payment transaction
|
|
5
|
+
* to be stored in S3 for logging, compliance, and traceability.
|
|
6
|
+
*
|
|
7
|
+
* Follows Clean Code, SOLID, and best practices for maintainability and extensibility.
|
|
8
|
+
*
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*/
|
|
11
|
+
export declare class CreatePaymentAudiS3tDto {
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier for the audited transaction.
|
|
14
|
+
* Should be globally unique per transaction.
|
|
15
|
+
*
|
|
16
|
+
* @example "txn_123abc456"
|
|
17
|
+
*/
|
|
18
|
+
transactionId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Unique identifier of the associated order.
|
|
21
|
+
*
|
|
22
|
+
* @example "order_789xyz"
|
|
23
|
+
*/
|
|
24
|
+
orderId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Name of the payment provider (e.g., "stripe", "culqi").
|
|
27
|
+
*
|
|
28
|
+
* @example "stripe"
|
|
29
|
+
*/
|
|
30
|
+
provider: string;
|
|
31
|
+
/**
|
|
32
|
+
* API endpoint called during the payment operation (e.g., "/charges").
|
|
33
|
+
*
|
|
34
|
+
* @example "/charges"
|
|
35
|
+
*/
|
|
36
|
+
endpoint: string;
|
|
37
|
+
/**
|
|
38
|
+
* HTTP method used (e.g., "POST", "GET").
|
|
39
|
+
*
|
|
40
|
+
* @example "POST"
|
|
41
|
+
*/
|
|
42
|
+
method: string;
|
|
43
|
+
/**
|
|
44
|
+
* HTTP response status code from the provider (e.g., 200, 500).
|
|
45
|
+
*
|
|
46
|
+
* @example 200
|
|
47
|
+
*/
|
|
48
|
+
statusCode: number;
|
|
49
|
+
/**
|
|
50
|
+
* Status of the audited operation (e.g., "success", "error").
|
|
51
|
+
*
|
|
52
|
+
* @example "success"
|
|
53
|
+
*/
|
|
54
|
+
status: string;
|
|
55
|
+
/**
|
|
56
|
+
* Total execution time of the audited operation, in milliseconds.
|
|
57
|
+
*
|
|
58
|
+
* @example 523
|
|
59
|
+
*/
|
|
60
|
+
durationMs: number;
|
|
61
|
+
/**
|
|
62
|
+
* (Optional) IP address from which the request originated.
|
|
63
|
+
*
|
|
64
|
+
* @example "192.168.1.10"
|
|
65
|
+
*/
|
|
66
|
+
ipAddress?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Payload sent in the audited request.
|
|
69
|
+
* Must be a serializable object.
|
|
70
|
+
*
|
|
71
|
+
* @example { amount: 19.99, currency: "PEN" }
|
|
72
|
+
*/
|
|
73
|
+
requestBody: Record<string, any>;
|
|
74
|
+
/**
|
|
75
|
+
* Payload received in the audited response.
|
|
76
|
+
* Must be a serializable object.
|
|
77
|
+
*
|
|
78
|
+
* @example { providerResponse: ..., result: ... }
|
|
79
|
+
*/
|
|
80
|
+
responseBody: Record<string, any>;
|
|
81
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DTO for storing payment audit records in S3.
|
|
3
|
+
*
|
|
4
|
+
* Encapsulates all relevant information of a payment transaction
|
|
5
|
+
* to be stored in S3 for logging, compliance, and traceability.
|
|
6
|
+
*
|
|
7
|
+
* Follows Clean Code, SOLID, and best practices for maintainability and extensibility.
|
|
8
|
+
*
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*/
|
|
11
|
+
export class CreatePaymentAudiS3tDto {
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier for the audited transaction.
|
|
14
|
+
* Should be globally unique per transaction.
|
|
15
|
+
*
|
|
16
|
+
* @example "txn_123abc456"
|
|
17
|
+
*/
|
|
18
|
+
transactionId;
|
|
19
|
+
/**
|
|
20
|
+
* Unique identifier of the associated order.
|
|
21
|
+
*
|
|
22
|
+
* @example "order_789xyz"
|
|
23
|
+
*/
|
|
24
|
+
orderId;
|
|
25
|
+
/**
|
|
26
|
+
* Name of the payment provider (e.g., "stripe", "culqi").
|
|
27
|
+
*
|
|
28
|
+
* @example "stripe"
|
|
29
|
+
*/
|
|
30
|
+
provider;
|
|
31
|
+
/**
|
|
32
|
+
* API endpoint called during the payment operation (e.g., "/charges").
|
|
33
|
+
*
|
|
34
|
+
* @example "/charges"
|
|
35
|
+
*/
|
|
36
|
+
endpoint;
|
|
37
|
+
/**
|
|
38
|
+
* HTTP method used (e.g., "POST", "GET").
|
|
39
|
+
*
|
|
40
|
+
* @example "POST"
|
|
41
|
+
*/
|
|
42
|
+
method;
|
|
43
|
+
/**
|
|
44
|
+
* HTTP response status code from the provider (e.g., 200, 500).
|
|
45
|
+
*
|
|
46
|
+
* @example 200
|
|
47
|
+
*/
|
|
48
|
+
statusCode;
|
|
49
|
+
/**
|
|
50
|
+
* Status of the audited operation (e.g., "success", "error").
|
|
51
|
+
*
|
|
52
|
+
* @example "success"
|
|
53
|
+
*/
|
|
54
|
+
status;
|
|
55
|
+
/**
|
|
56
|
+
* Total execution time of the audited operation, in milliseconds.
|
|
57
|
+
*
|
|
58
|
+
* @example 523
|
|
59
|
+
*/
|
|
60
|
+
durationMs;
|
|
61
|
+
/**
|
|
62
|
+
* (Optional) IP address from which the request originated.
|
|
63
|
+
*
|
|
64
|
+
* @example "192.168.1.10"
|
|
65
|
+
*/
|
|
66
|
+
ipAddress;
|
|
67
|
+
/**
|
|
68
|
+
* Payload sent in the audited request.
|
|
69
|
+
* Must be a serializable object.
|
|
70
|
+
*
|
|
71
|
+
* @example { amount: 19.99, currency: "PEN" }
|
|
72
|
+
*/
|
|
73
|
+
requestBody;
|
|
74
|
+
/**
|
|
75
|
+
* Payload received in the audited response.
|
|
76
|
+
* Must be a serializable object.
|
|
77
|
+
*
|
|
78
|
+
* @example { providerResponse: ..., result: ... }
|
|
79
|
+
*/
|
|
80
|
+
responseBody;
|
|
81
|
+
}
|
|
@@ -20,14 +20,14 @@ export declare class PaymentSessionItemDto {
|
|
|
20
20
|
*
|
|
21
21
|
* @example "Large"
|
|
22
22
|
*/
|
|
23
|
-
sizeName?: string;
|
|
23
|
+
sizeName?: string | null;
|
|
24
24
|
/**
|
|
25
25
|
* Optional price for the size variant.
|
|
26
26
|
* Must be a positive number if provided.
|
|
27
27
|
*
|
|
28
28
|
* @example 12.99
|
|
29
29
|
*/
|
|
30
|
-
sizePrice?: number;
|
|
30
|
+
sizePrice?: number | null;
|
|
31
31
|
/**
|
|
32
32
|
* Name of the product/item.
|
|
33
33
|
*
|
|
@@ -53,13 +53,13 @@ export declare class PaymentSessionItemDto {
|
|
|
53
53
|
*
|
|
54
54
|
* @example "No onions, extra cheese"
|
|
55
55
|
*/
|
|
56
|
-
notes?: string;
|
|
56
|
+
notes?: string | null;
|
|
57
57
|
/**
|
|
58
58
|
* Optional status of this item.
|
|
59
59
|
*
|
|
60
60
|
* @example "pending"
|
|
61
61
|
*/
|
|
62
|
-
itemStatus?: string;
|
|
62
|
+
itemStatus?: string | null;
|
|
63
63
|
/**
|
|
64
64
|
* Optional array of child items (for nested structures like combo meals).
|
|
65
65
|
* Each child item is validated as a PaymentSessionItemDto.
|
|
@@ -80,6 +80,7 @@ export class PaymentSessionItemDto {
|
|
|
80
80
|
childItems;
|
|
81
81
|
}
|
|
82
82
|
__decorate([
|
|
83
|
+
IsNotEmpty(),
|
|
83
84
|
IsString(),
|
|
84
85
|
IsUUID(),
|
|
85
86
|
__metadata("design:type", String)
|
|
@@ -87,13 +88,13 @@ __decorate([
|
|
|
87
88
|
__decorate([
|
|
88
89
|
IsOptional(),
|
|
89
90
|
IsString(),
|
|
90
|
-
__metadata("design:type",
|
|
91
|
+
__metadata("design:type", Object)
|
|
91
92
|
], PaymentSessionItemDto.prototype, "sizeName", void 0);
|
|
92
93
|
__decorate([
|
|
93
94
|
IsOptional(),
|
|
94
95
|
IsNumber(),
|
|
95
96
|
IsPositive(),
|
|
96
|
-
__metadata("design:type",
|
|
97
|
+
__metadata("design:type", Object)
|
|
97
98
|
], PaymentSessionItemDto.prototype, "sizePrice", void 0);
|
|
98
99
|
__decorate([
|
|
99
100
|
IsString(),
|
|
@@ -103,22 +104,24 @@ __decorate([
|
|
|
103
104
|
__decorate([
|
|
104
105
|
IsNumber(),
|
|
105
106
|
IsPositive(),
|
|
107
|
+
IsNotEmpty(),
|
|
106
108
|
__metadata("design:type", Number)
|
|
107
109
|
], PaymentSessionItemDto.prototype, "quantity", void 0);
|
|
108
110
|
__decorate([
|
|
109
111
|
IsNumber(),
|
|
110
112
|
IsPositive(),
|
|
113
|
+
IsNotEmpty(),
|
|
111
114
|
__metadata("design:type", Number)
|
|
112
115
|
], PaymentSessionItemDto.prototype, "price", void 0);
|
|
113
116
|
__decorate([
|
|
114
117
|
IsOptional(),
|
|
115
118
|
IsString(),
|
|
116
|
-
__metadata("design:type",
|
|
119
|
+
__metadata("design:type", Object)
|
|
117
120
|
], PaymentSessionItemDto.prototype, "notes", void 0);
|
|
118
121
|
__decorate([
|
|
119
122
|
IsOptional(),
|
|
120
123
|
IsString(),
|
|
121
|
-
__metadata("design:type",
|
|
124
|
+
__metadata("design:type", Object)
|
|
122
125
|
], PaymentSessionItemDto.prototype, "itemStatus", void 0);
|
|
123
126
|
__decorate([
|
|
124
127
|
IsOptional(),
|
|
@@ -79,6 +79,7 @@ __decorate([
|
|
|
79
79
|
__metadata("design:type", String)
|
|
80
80
|
], CreateProductDto.prototype, "description", void 0);
|
|
81
81
|
__decorate([
|
|
82
|
+
IsNotEmpty(),
|
|
82
83
|
IsNumber({
|
|
83
84
|
maxDecimalPlaces: 4,
|
|
84
85
|
}, { message: 'Base price must be a number with maximum 4 decimal places' }),
|
|
@@ -94,6 +95,6 @@ __decorate([
|
|
|
94
95
|
__decorate([
|
|
95
96
|
IsString(),
|
|
96
97
|
IsMongoId(),
|
|
97
|
-
|
|
98
|
+
IsNotEmpty(),
|
|
98
99
|
__metadata("design:type", String)
|
|
99
100
|
], CreateProductDto.prototype, "createdBy", 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 { IsMongoId, IsString, IsUUID } from 'class-validator';
|
|
10
|
+
import { IsMongoId, IsNotEmpty, IsString, IsUUID } from 'class-validator';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for deleting a product.
|
|
13
13
|
*
|
|
@@ -23,7 +23,7 @@ export class DeleteProductDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
productId;
|
|
27
27
|
/**
|
|
28
28
|
* User who deleted the product.
|
|
29
29
|
* Must be a valid MongoDB ObjectId.
|
|
@@ -35,10 +35,12 @@ export class DeleteProductDto {
|
|
|
35
35
|
__decorate([
|
|
36
36
|
IsString(),
|
|
37
37
|
IsUUID(),
|
|
38
|
+
IsNotEmpty(),
|
|
38
39
|
__metadata("design:type", String)
|
|
39
|
-
], DeleteProductDto.prototype, "
|
|
40
|
+
], DeleteProductDto.prototype, "productId", void 0);
|
|
40
41
|
__decorate([
|
|
41
42
|
IsString(),
|
|
42
43
|
IsMongoId(),
|
|
44
|
+
IsNotEmpty(),
|
|
43
45
|
__metadata("design:type", String)
|
|
44
46
|
], DeleteProductDto.prototype, "deletedBy", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateProductImageDto } from
|
|
1
|
+
import { CreateProductImageDto } from "./create-product-image.dto.js";
|
|
2
2
|
/**
|
|
3
3
|
* DTO for bulk creating product images.
|
|
4
4
|
*
|
|
@@ -14,7 +14,7 @@ export declare class BulkCreateProductImageDto {
|
|
|
14
14
|
*
|
|
15
15
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
16
16
|
*/
|
|
17
|
-
productId
|
|
17
|
+
productId: string;
|
|
18
18
|
/**
|
|
19
19
|
* Array of images to create.
|
|
20
20
|
* Must contain at least one image.
|
|
@@ -22,5 +22,5 @@ export declare class BulkCreateProductImageDto {
|
|
|
22
22
|
*
|
|
23
23
|
* @example [{ url: "https://example.com/image1.jpg", isPrimary: true }]
|
|
24
24
|
*/
|
|
25
|
-
images: CreateProductImageDto[];
|
|
25
|
+
images: Omit<CreateProductImageDto, "productId">[];
|
|
26
26
|
}
|
|
@@ -7,9 +7,9 @@ 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, IsArray, ValidateNested, ArrayMinSize,
|
|
11
|
-
import { Type } from
|
|
12
|
-
import { CreateProductImageDto } from
|
|
10
|
+
import { IsString, IsNotEmpty, IsArray, ValidateNested, ArrayMinSize, IsUUID, } from "class-validator";
|
|
11
|
+
import { Type } from "class-transformer";
|
|
12
|
+
import { CreateProductImageDto } from "./create-product-image.dto.js";
|
|
13
13
|
/**
|
|
14
14
|
* DTO for bulk creating product images.
|
|
15
15
|
*
|
|
@@ -37,13 +37,13 @@ export class BulkCreateProductImageDto {
|
|
|
37
37
|
}
|
|
38
38
|
__decorate([
|
|
39
39
|
IsString(),
|
|
40
|
-
|
|
40
|
+
IsNotEmpty(),
|
|
41
41
|
IsUUID(),
|
|
42
42
|
__metadata("design:type", String)
|
|
43
43
|
], BulkCreateProductImageDto.prototype, "productId", void 0);
|
|
44
44
|
__decorate([
|
|
45
45
|
IsArray(),
|
|
46
|
-
ArrayMinSize(1, { message:
|
|
46
|
+
ArrayMinSize(1, { message: "At least one image is required" }),
|
|
47
47
|
ValidateNested({ each: true }),
|
|
48
48
|
Type(() => CreateProductImageDto),
|
|
49
49
|
__metadata("design:type", Array)
|
|
@@ -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, IsOptional, IsBoolean, IsUrl, IsUUID } from
|
|
10
|
+
import { IsString, IsNotEmpty, IsOptional, IsBoolean, IsUrl, IsUUID, } from "class-validator";
|
|
11
11
|
/**
|
|
12
12
|
* DTO for creating a new product image.
|
|
13
13
|
*
|
|
@@ -42,14 +42,14 @@ export class CreateProductImageDto {
|
|
|
42
42
|
}
|
|
43
43
|
__decorate([
|
|
44
44
|
IsString(),
|
|
45
|
-
|
|
45
|
+
IsNotEmpty(),
|
|
46
46
|
IsUUID(),
|
|
47
47
|
__metadata("design:type", String)
|
|
48
48
|
], CreateProductImageDto.prototype, "productId", void 0);
|
|
49
49
|
__decorate([
|
|
50
50
|
IsString(),
|
|
51
|
-
IsNotEmpty({ message:
|
|
52
|
-
IsUrl({}, { message:
|
|
51
|
+
IsNotEmpty({ message: "Image URL is required" }),
|
|
52
|
+
IsUrl({}, { message: "Image URL must be a valid URL" }),
|
|
53
53
|
__metadata("design:type", String)
|
|
54
54
|
], CreateProductImageDto.prototype, "url", void 0);
|
|
55
55
|
__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, IsOptional, IsBoolean, IsUrl, IsUUID } from 'class-validator';
|
|
10
|
+
import { IsString, IsOptional, IsBoolean, IsUrl, IsUUID, IsNotEmpty } from 'class-validator';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for updating an existing product image.
|
|
13
13
|
*
|
|
@@ -23,7 +23,7 @@ export class UpdateProductImageDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example "770e8400-e29b-41d4-a716-446655440003"
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
productImageId;
|
|
27
27
|
/**
|
|
28
28
|
* Optional image URL.
|
|
29
29
|
* Must be a valid URL format if provided.
|
|
@@ -39,11 +39,11 @@ export class UpdateProductImageDto {
|
|
|
39
39
|
isPrimary;
|
|
40
40
|
}
|
|
41
41
|
__decorate([
|
|
42
|
+
IsNotEmpty(),
|
|
42
43
|
IsString(),
|
|
43
|
-
IsOptional(),
|
|
44
44
|
IsUUID(),
|
|
45
45
|
__metadata("design:type", String)
|
|
46
|
-
], UpdateProductImageDto.prototype, "
|
|
46
|
+
], UpdateProductImageDto.prototype, "productImageId", void 0);
|
|
47
47
|
__decorate([
|
|
48
48
|
IsOptional(),
|
|
49
49
|
IsString(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QuestionProductType } from
|
|
1
|
+
import { QuestionProductType } from "../../../../enums/question-product-type.enum.js";
|
|
2
2
|
/**
|
|
3
3
|
* DTO for creating a new product-question relationship.
|
|
4
4
|
*
|
|
@@ -14,7 +14,7 @@ export declare class CreateProductQuestionDto {
|
|
|
14
14
|
*
|
|
15
15
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
16
16
|
*/
|
|
17
|
-
productId
|
|
17
|
+
productId: string;
|
|
18
18
|
/**
|
|
19
19
|
* Unique identifier of the question.
|
|
20
20
|
* Must be a valid UUID and not be empty.
|
|
@@ -7,9 +7,9 @@ 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, IsOptional, IsInt, IsEnum, Min, IsUUID } from
|
|
11
|
-
import { Type } from
|
|
12
|
-
import { QuestionProductType } from
|
|
10
|
+
import { IsString, IsNotEmpty, IsOptional, IsInt, IsEnum, Min, IsUUID, } from "class-validator";
|
|
11
|
+
import { Type } from "class-transformer";
|
|
12
|
+
import { QuestionProductType } from "../../../../enums/question-product-type.enum.js";
|
|
13
13
|
/**
|
|
14
14
|
* DTO for creating a new product-question relationship.
|
|
15
15
|
*
|
|
@@ -52,25 +52,25 @@ export class CreateProductQuestionDto {
|
|
|
52
52
|
__decorate([
|
|
53
53
|
IsUUID(),
|
|
54
54
|
IsString(),
|
|
55
|
-
|
|
55
|
+
IsNotEmpty(),
|
|
56
56
|
__metadata("design:type", String)
|
|
57
57
|
], CreateProductQuestionDto.prototype, "productId", void 0);
|
|
58
58
|
__decorate([
|
|
59
59
|
IsUUID(),
|
|
60
60
|
IsString(),
|
|
61
|
-
IsNotEmpty({ message:
|
|
61
|
+
IsNotEmpty({ message: "Question ID is required" }),
|
|
62
62
|
__metadata("design:type", String)
|
|
63
63
|
], CreateProductQuestionDto.prototype, "questionId", void 0);
|
|
64
64
|
__decorate([
|
|
65
65
|
IsOptional(),
|
|
66
|
-
IsInt({ message:
|
|
67
|
-
Min(0, { message:
|
|
66
|
+
IsInt({ message: "Position must be an integer" }),
|
|
67
|
+
Min(0, { message: "Position must be at least 0" }),
|
|
68
68
|
Type(() => Number),
|
|
69
69
|
__metadata("design:type", Number)
|
|
70
70
|
], CreateProductQuestionDto.prototype, "position", void 0);
|
|
71
71
|
__decorate([
|
|
72
72
|
IsEnum(QuestionProductType, {
|
|
73
|
-
message:
|
|
73
|
+
message: "Item type must be either QUESTION or ANSWER",
|
|
74
74
|
}),
|
|
75
75
|
__metadata("design:type", String)
|
|
76
76
|
], CreateProductQuestionDto.prototype, "itemType", void 0);
|
|
@@ -23,5 +23,5 @@ export declare class ReplaceProductQuestionsByProductIdDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example [{ questionId: "...", position: 1, itemType: QuestionProductType.QUESTION }]
|
|
25
25
|
*/
|
|
26
|
-
questions: CreateProductQuestionDto[];
|
|
26
|
+
questions: Omit<CreateProductQuestionDto, 'productId'>[];
|
|
27
27
|
}
|
|
@@ -14,7 +14,7 @@ export declare class UpdateProductQuestionDto {
|
|
|
14
14
|
*
|
|
15
15
|
* @example "aa0e8400-e29b-41d4-a716-446655440006"
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
productQuestionId: string;
|
|
18
18
|
/**
|
|
19
19
|
* Optional position/order of the question.
|
|
20
20
|
* Used to control the display order. Must be a non-negative integer if provided.
|
|
@@ -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, IsInt, IsEnum, Min, IsUUID } from 'class-validator';
|
|
10
|
+
import { IsString, IsOptional, IsInt, IsEnum, Min, IsUUID, IsNotEmpty } from 'class-validator';
|
|
11
11
|
import { Type } from 'class-transformer';
|
|
12
12
|
import { QuestionProductType } from '../../../../enums/question-product-type.enum.js';
|
|
13
13
|
/**
|
|
@@ -25,7 +25,7 @@ export class UpdateProductQuestionDto {
|
|
|
25
25
|
*
|
|
26
26
|
* @example "aa0e8400-e29b-41d4-a716-446655440006"
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
productQuestionId;
|
|
29
29
|
/**
|
|
30
30
|
* Optional position/order of the question.
|
|
31
31
|
* Used to control the display order. Must be a non-negative integer if provided.
|
|
@@ -43,10 +43,10 @@ export class UpdateProductQuestionDto {
|
|
|
43
43
|
}
|
|
44
44
|
__decorate([
|
|
45
45
|
IsString(),
|
|
46
|
-
|
|
46
|
+
IsNotEmpty(),
|
|
47
47
|
IsUUID(),
|
|
48
48
|
__metadata("design:type", String)
|
|
49
|
-
], UpdateProductQuestionDto.prototype, "
|
|
49
|
+
], UpdateProductQuestionDto.prototype, "productQuestionId", void 0);
|
|
50
50
|
__decorate([
|
|
51
51
|
IsOptional(),
|
|
52
52
|
IsInt({ message: 'Position must be an integer' }),
|