qeai-sdk 2.1.7 → 2.1.9
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/products/submodules/product-image/bulk-create-product-image.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.js +2 -2
- package/dist/dtos/products/submodules/product-image/create-product-image.dto.d.ts +2 -16
- package/dist/dtos/products/submodules/product-image/create-product-image.dto.js +3 -28
- package/dist/dtos/products/submodules/product-image/index.d.ts +5 -4
- package/dist/dtos/products/submodules/product-image/index.js +5 -4
- package/dist/dtos/products/submodules/product-image/product-image-item.dto.d.ts +17 -0
- package/dist/dtos/products/submodules/product-image/product-image-item.dto.js +38 -0
- package/dist/dtos/products/submodules/product-question/create-product-question.dto.d.ts +2 -24
- package/dist/dtos/products/submodules/product-question/create-product-question.dto.js +3 -45
- package/dist/dtos/products/submodules/product-question/index.d.ts +5 -4
- package/dist/dtos/products/submodules/product-question/index.js +5 -4
- package/dist/dtos/products/submodules/product-question/product-question-item.dto.d.ts +25 -0
- package/dist/dtos/products/submodules/product-question/product-question-item.dto.js +55 -0
- package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.js +6 -6
- package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.d.ts +2 -22
- package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.js +3 -39
- package/dist/dtos/products/submodules/product-recipe/index.d.ts +4 -3
- package/dist/dtos/products/submodules/product-recipe/index.js +4 -3
- package/dist/dtos/products/submodules/product-recipe/product-recipe-item.dto.d.ts +23 -0
- package/dist/dtos/products/submodules/product-recipe/product-recipe-item.dto.js +49 -0
- 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 +2 -2
- package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.d.ts +2 -22
- package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.js +3 -47
- package/dist/dtos/products/submodules/product-schedule/index.d.ts +5 -4
- package/dist/dtos/products/submodules/product-schedule/index.js +5 -4
- package/dist/dtos/products/submodules/product-schedule/product-schedule-item.dto.d.ts +23 -0
- package/dist/dtos/products/submodules/product-schedule/product-schedule-item.dto.js +57 -0
- package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.js +6 -6
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductImageItemDto } from "./product-image-item.dto.js";
|
|
2
2
|
/**
|
|
3
3
|
* DTO for bulk creating product images.
|
|
4
4
|
*
|
|
@@ -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:
|
|
25
|
+
images: ProductImageItemDto[];
|
|
26
26
|
}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { IsString, IsNotEmpty, IsArray, ValidateNested, ArrayMinSize, IsUUID, } from "class-validator";
|
|
11
11
|
import { Type } from "class-transformer";
|
|
12
|
-
import {
|
|
12
|
+
import { ProductImageItemDto } from "./product-image-item.dto.js";
|
|
13
13
|
/**
|
|
14
14
|
* DTO for bulk creating product images.
|
|
15
15
|
*
|
|
@@ -45,6 +45,6 @@ __decorate([
|
|
|
45
45
|
IsArray(),
|
|
46
46
|
ArrayMinSize(1, { message: "At least one image is required" }),
|
|
47
47
|
ValidateNested({ each: true }),
|
|
48
|
-
Type(() =>
|
|
48
|
+
Type(() => ProductImageItemDto),
|
|
49
49
|
__metadata("design:type", Array)
|
|
50
50
|
], BulkCreateProductImageDto.prototype, "images", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ProductImageItemDto } from "./product-image-item.dto.js";
|
|
1
2
|
/**
|
|
2
3
|
* DTO for creating a new product image.
|
|
3
4
|
*
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
*
|
|
7
8
|
* @since 2.0.0
|
|
8
9
|
*/
|
|
9
|
-
export declare class CreateProductImageDto {
|
|
10
|
+
export declare class CreateProductImageDto extends ProductImageItemDto {
|
|
10
11
|
/**
|
|
11
12
|
* Optional unique identifier of the product.
|
|
12
13
|
* Must be a valid UUID if provided.
|
|
@@ -14,19 +15,4 @@ export declare class CreateProductImageDto {
|
|
|
14
15
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
15
16
|
*/
|
|
16
17
|
productId: string;
|
|
17
|
-
/**
|
|
18
|
-
* Image URL.
|
|
19
|
-
* Must be a valid URL format and not be empty.
|
|
20
|
-
*
|
|
21
|
-
* @example "https://example.com/images/product-123.jpg"
|
|
22
|
-
*/
|
|
23
|
-
url: string;
|
|
24
|
-
/**
|
|
25
|
-
* Whether this is the primary image for the product.
|
|
26
|
-
* Defaults to false if not provided.
|
|
27
|
-
*
|
|
28
|
-
* @example true
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
isPrimary?: boolean;
|
|
32
18
|
}
|
|
@@ -7,7 +7,8 @@ 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, IsUUID } from "class-validator";
|
|
11
|
+
import { ProductImageItemDto } from "./product-image-item.dto.js";
|
|
11
12
|
/**
|
|
12
13
|
* DTO for creating a new product image.
|
|
13
14
|
*
|
|
@@ -16,7 +17,7 @@ import { IsString, IsNotEmpty, IsOptional, IsBoolean, IsUrl, IsUUID, } from "cla
|
|
|
16
17
|
*
|
|
17
18
|
* @since 2.0.0
|
|
18
19
|
*/
|
|
19
|
-
export class CreateProductImageDto {
|
|
20
|
+
export class CreateProductImageDto extends ProductImageItemDto {
|
|
20
21
|
/**
|
|
21
22
|
* Optional unique identifier of the product.
|
|
22
23
|
* Must be a valid UUID if provided.
|
|
@@ -24,21 +25,6 @@ export class CreateProductImageDto {
|
|
|
24
25
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
25
26
|
*/
|
|
26
27
|
productId;
|
|
27
|
-
/**
|
|
28
|
-
* Image URL.
|
|
29
|
-
* Must be a valid URL format and not be empty.
|
|
30
|
-
*
|
|
31
|
-
* @example "https://example.com/images/product-123.jpg"
|
|
32
|
-
*/
|
|
33
|
-
url;
|
|
34
|
-
/**
|
|
35
|
-
* Whether this is the primary image for the product.
|
|
36
|
-
* Defaults to false if not provided.
|
|
37
|
-
*
|
|
38
|
-
* @example true
|
|
39
|
-
* @default false
|
|
40
|
-
*/
|
|
41
|
-
isPrimary;
|
|
42
28
|
}
|
|
43
29
|
__decorate([
|
|
44
30
|
IsString(),
|
|
@@ -46,14 +32,3 @@ __decorate([
|
|
|
46
32
|
IsUUID(),
|
|
47
33
|
__metadata("design:type", String)
|
|
48
34
|
], CreateProductImageDto.prototype, "productId", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
IsString(),
|
|
51
|
-
IsNotEmpty({ message: "Image URL is required" }),
|
|
52
|
-
IsUrl({}, { message: "Image URL must be a valid URL" }),
|
|
53
|
-
__metadata("design:type", String)
|
|
54
|
-
], CreateProductImageDto.prototype, "url", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
IsOptional(),
|
|
57
|
-
IsBoolean(),
|
|
58
|
-
__metadata("design:type", Boolean)
|
|
59
|
-
], CreateProductImageDto.prototype, "isPrimary", void 0);
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
9
|
+
export * from "./create-product-image.dto.js";
|
|
10
|
+
export * from "./update-product-image.dto.js";
|
|
11
|
+
export * from "./bulk-create-product-image.dto.js";
|
|
12
|
+
export * from "./set-primary-image.dto.js";
|
|
13
|
+
export * from "./product-image-item.dto.js";
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
9
|
+
export * from "./create-product-image.dto.js";
|
|
10
|
+
export * from "./update-product-image.dto.js";
|
|
11
|
+
export * from "./bulk-create-product-image.dto.js";
|
|
12
|
+
export * from "./set-primary-image.dto.js";
|
|
13
|
+
export * from "./product-image-item.dto.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class ProductImageItemDto {
|
|
2
|
+
/**
|
|
3
|
+
* Image URL.
|
|
4
|
+
* Must be a valid URL format and not be empty.
|
|
5
|
+
*
|
|
6
|
+
* @example "https://example.com/images/product-123.jpg"
|
|
7
|
+
*/
|
|
8
|
+
url: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether this is the primary image for the product.
|
|
11
|
+
* Defaults to false if not provided.
|
|
12
|
+
*
|
|
13
|
+
* @example true
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
isPrimary?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsUrl, } from "class-validator";
|
|
11
|
+
export class ProductImageItemDto {
|
|
12
|
+
/**
|
|
13
|
+
* Image URL.
|
|
14
|
+
* Must be a valid URL format and not be empty.
|
|
15
|
+
*
|
|
16
|
+
* @example "https://example.com/images/product-123.jpg"
|
|
17
|
+
*/
|
|
18
|
+
url;
|
|
19
|
+
/**
|
|
20
|
+
* Whether this is the primary image for the product.
|
|
21
|
+
* Defaults to false if not provided.
|
|
22
|
+
*
|
|
23
|
+
* @example true
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
isPrimary;
|
|
27
|
+
}
|
|
28
|
+
__decorate([
|
|
29
|
+
IsString(),
|
|
30
|
+
IsNotEmpty({ message: "Image URL is required" }),
|
|
31
|
+
IsUrl({}, { message: "Image URL must be a valid URL" }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], ProductImageItemDto.prototype, "url", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
IsOptional(),
|
|
36
|
+
IsBoolean(),
|
|
37
|
+
__metadata("design:type", Boolean)
|
|
38
|
+
], ProductImageItemDto.prototype, "isPrimary", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductQuestionItemDto } from "./product-question-item.dto.js";
|
|
2
2
|
/**
|
|
3
3
|
* DTO for creating a new product-question relationship.
|
|
4
4
|
*
|
|
@@ -7,7 +7,7 @@ import { QuestionProductType } from "../../../../enums/question-product-type.enu
|
|
|
7
7
|
*
|
|
8
8
|
* @since 2.0.0
|
|
9
9
|
*/
|
|
10
|
-
export declare class CreateProductQuestionDto {
|
|
10
|
+
export declare class CreateProductQuestionDto extends ProductQuestionItemDto {
|
|
11
11
|
/**
|
|
12
12
|
* Optional unique identifier of the product.
|
|
13
13
|
* Must be a valid UUID if provided.
|
|
@@ -15,26 +15,4 @@ export declare class CreateProductQuestionDto {
|
|
|
15
15
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
16
16
|
*/
|
|
17
17
|
productId: string;
|
|
18
|
-
/**
|
|
19
|
-
* Unique identifier of the question.
|
|
20
|
-
* Must be a valid UUID and not be empty.
|
|
21
|
-
*
|
|
22
|
-
* @example "770e8400-e29b-41d4-a716-446655440003"
|
|
23
|
-
*/
|
|
24
|
-
questionId: string;
|
|
25
|
-
/**
|
|
26
|
-
* Optional position/order of the question.
|
|
27
|
-
* Used to control the display order. Must be a non-negative integer if provided.
|
|
28
|
-
*
|
|
29
|
-
* @example 1
|
|
30
|
-
* @default 0
|
|
31
|
-
*/
|
|
32
|
-
position?: number;
|
|
33
|
-
/**
|
|
34
|
-
* Type of the question-product relationship.
|
|
35
|
-
* Must be a valid QuestionProductType enum value.
|
|
36
|
-
*
|
|
37
|
-
* @example QuestionProductType.QUESTION
|
|
38
|
-
*/
|
|
39
|
-
itemType: QuestionProductType;
|
|
40
18
|
}
|
|
@@ -7,9 +7,8 @@ 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,
|
|
11
|
-
import {
|
|
12
|
-
import { QuestionProductType } from "../../../../enums/question-product-type.enum.js";
|
|
10
|
+
import { IsString, IsNotEmpty, IsUUID } from "class-validator";
|
|
11
|
+
import { ProductQuestionItemDto } from "./product-question-item.dto.js";
|
|
13
12
|
/**
|
|
14
13
|
* DTO for creating a new product-question relationship.
|
|
15
14
|
*
|
|
@@ -18,7 +17,7 @@ import { QuestionProductType } from "../../../../enums/question-product-type.enu
|
|
|
18
17
|
*
|
|
19
18
|
* @since 2.0.0
|
|
20
19
|
*/
|
|
21
|
-
export class CreateProductQuestionDto {
|
|
20
|
+
export class CreateProductQuestionDto extends ProductQuestionItemDto {
|
|
22
21
|
/**
|
|
23
22
|
* Optional unique identifier of the product.
|
|
24
23
|
* Must be a valid UUID if provided.
|
|
@@ -26,28 +25,6 @@ export class CreateProductQuestionDto {
|
|
|
26
25
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
27
26
|
*/
|
|
28
27
|
productId;
|
|
29
|
-
/**
|
|
30
|
-
* Unique identifier of the question.
|
|
31
|
-
* Must be a valid UUID and not be empty.
|
|
32
|
-
*
|
|
33
|
-
* @example "770e8400-e29b-41d4-a716-446655440003"
|
|
34
|
-
*/
|
|
35
|
-
questionId;
|
|
36
|
-
/**
|
|
37
|
-
* Optional position/order of the question.
|
|
38
|
-
* Used to control the display order. Must be a non-negative integer if provided.
|
|
39
|
-
*
|
|
40
|
-
* @example 1
|
|
41
|
-
* @default 0
|
|
42
|
-
*/
|
|
43
|
-
position;
|
|
44
|
-
/**
|
|
45
|
-
* Type of the question-product relationship.
|
|
46
|
-
* Must be a valid QuestionProductType enum value.
|
|
47
|
-
*
|
|
48
|
-
* @example QuestionProductType.QUESTION
|
|
49
|
-
*/
|
|
50
|
-
itemType;
|
|
51
28
|
}
|
|
52
29
|
__decorate([
|
|
53
30
|
IsUUID(),
|
|
@@ -55,22 +32,3 @@ __decorate([
|
|
|
55
32
|
IsNotEmpty(),
|
|
56
33
|
__metadata("design:type", String)
|
|
57
34
|
], CreateProductQuestionDto.prototype, "productId", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
IsUUID(),
|
|
60
|
-
IsString(),
|
|
61
|
-
IsNotEmpty({ message: "Question ID is required" }),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], CreateProductQuestionDto.prototype, "questionId", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
IsOptional(),
|
|
66
|
-
IsInt({ message: "Position must be an integer" }),
|
|
67
|
-
Min(0, { message: "Position must be at least 0" }),
|
|
68
|
-
Type(() => Number),
|
|
69
|
-
__metadata("design:type", Number)
|
|
70
|
-
], CreateProductQuestionDto.prototype, "position", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
IsEnum(QuestionProductType, {
|
|
73
|
-
message: "Item type must be either QUESTION or ANSWER",
|
|
74
|
-
}),
|
|
75
|
-
__metadata("design:type", String)
|
|
76
|
-
], CreateProductQuestionDto.prototype, "itemType", void 0);
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
9
|
+
export * from "./create-product-question.dto.js";
|
|
10
|
+
export * from "./update-product-question.dto.js";
|
|
11
|
+
export * from "./replace-by-product-id.dto.js";
|
|
12
|
+
export * from "./find-by-product-id-and-type.dto.js";
|
|
13
|
+
export * from "./product-question-item.dto.js";
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
9
|
+
export * from "./create-product-question.dto.js";
|
|
10
|
+
export * from "./update-product-question.dto.js";
|
|
11
|
+
export * from "./replace-by-product-id.dto.js";
|
|
12
|
+
export * from "./find-by-product-id-and-type.dto.js";
|
|
13
|
+
export * from "./product-question-item.dto.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { QuestionProductType } from "../../../../enums";
|
|
2
|
+
export declare class ProductQuestionItemDto {
|
|
3
|
+
/**
|
|
4
|
+
* Unique identifier of the question.
|
|
5
|
+
* Must be a valid UUID and not be empty.
|
|
6
|
+
*
|
|
7
|
+
* @example "770e8400-e29b-41d4-a716-446655440003"
|
|
8
|
+
*/
|
|
9
|
+
questionId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional position/order of the question.
|
|
12
|
+
* Used to control the display order. Must be a non-negative integer if provided.
|
|
13
|
+
*
|
|
14
|
+
* @example 1
|
|
15
|
+
* @default 0
|
|
16
|
+
*/
|
|
17
|
+
position?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Type of the question-product relationship.
|
|
20
|
+
* Must be a valid QuestionProductType enum value.
|
|
21
|
+
*
|
|
22
|
+
* @example QuestionProductType.QUESTION
|
|
23
|
+
*/
|
|
24
|
+
itemType: QuestionProductType;
|
|
25
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { IsEnum, IsInt, IsNotEmpty, IsOptional, IsString, IsUUID, Min, } from "class-validator";
|
|
11
|
+
import { QuestionProductType } from "../../../../enums";
|
|
12
|
+
import { Type } from "class-transformer";
|
|
13
|
+
export class ProductQuestionItemDto {
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier of the question.
|
|
16
|
+
* Must be a valid UUID and not be empty.
|
|
17
|
+
*
|
|
18
|
+
* @example "770e8400-e29b-41d4-a716-446655440003"
|
|
19
|
+
*/
|
|
20
|
+
questionId;
|
|
21
|
+
/**
|
|
22
|
+
* Optional position/order of the question.
|
|
23
|
+
* Used to control the display order. Must be a non-negative integer if provided.
|
|
24
|
+
*
|
|
25
|
+
* @example 1
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
28
|
+
position;
|
|
29
|
+
/**
|
|
30
|
+
* Type of the question-product relationship.
|
|
31
|
+
* Must be a valid QuestionProductType enum value.
|
|
32
|
+
*
|
|
33
|
+
* @example QuestionProductType.QUESTION
|
|
34
|
+
*/
|
|
35
|
+
itemType;
|
|
36
|
+
}
|
|
37
|
+
__decorate([
|
|
38
|
+
IsUUID(),
|
|
39
|
+
IsString(),
|
|
40
|
+
IsNotEmpty({ message: "Question ID is required" }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], ProductQuestionItemDto.prototype, "questionId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
IsOptional(),
|
|
45
|
+
IsInt({ message: "Position must be an integer" }),
|
|
46
|
+
Min(0, { message: "Position must be at least 0" }),
|
|
47
|
+
Type(() => Number),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], ProductQuestionItemDto.prototype, "position", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
IsEnum(QuestionProductType, {
|
|
52
|
+
message: "Item type must be either QUESTION or ANSWER",
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], ProductQuestionItemDto.prototype, "itemType", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductQuestionItemDto } from "./product-question-item.dto.js";
|
|
2
2
|
/**
|
|
3
3
|
* DTO for replacing all product-question relationships.
|
|
4
4
|
*
|
|
@@ -23,5 +23,5 @@ export declare class ReplaceProductQuestionsByProductIdDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example [{ questionId: "...", position: 1, itemType: QuestionProductType.QUESTION }]
|
|
25
25
|
*/
|
|
26
|
-
questions:
|
|
26
|
+
questions: ProductQuestionItemDto[];
|
|
27
27
|
}
|
|
@@ -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, IsUUID, IsArray, ValidateNested, ArrayMinSize, } from
|
|
11
|
-
import { Type } from
|
|
12
|
-
import {
|
|
10
|
+
import { IsString, IsNotEmpty, IsUUID, IsArray, ValidateNested, ArrayMinSize, } from "class-validator";
|
|
11
|
+
import { Type } from "class-transformer";
|
|
12
|
+
import { ProductQuestionItemDto } from "./product-question-item.dto.js";
|
|
13
13
|
/**
|
|
14
14
|
* DTO for replacing all product-question relationships.
|
|
15
15
|
*
|
|
@@ -38,14 +38,14 @@ export class ReplaceProductQuestionsByProductIdDto {
|
|
|
38
38
|
}
|
|
39
39
|
__decorate([
|
|
40
40
|
IsString(),
|
|
41
|
-
IsNotEmpty({ message:
|
|
41
|
+
IsNotEmpty({ message: "Product ID is required" }),
|
|
42
42
|
IsUUID(),
|
|
43
43
|
__metadata("design:type", String)
|
|
44
44
|
], ReplaceProductQuestionsByProductIdDto.prototype, "productId", void 0);
|
|
45
45
|
__decorate([
|
|
46
46
|
IsArray(),
|
|
47
|
-
ArrayMinSize(0, { message:
|
|
47
|
+
ArrayMinSize(0, { message: "Questions array can be empty" }),
|
|
48
48
|
ValidateNested({ each: true }),
|
|
49
|
-
Type(() =>
|
|
49
|
+
Type(() => ProductQuestionItemDto),
|
|
50
50
|
__metadata("design:type", Array)
|
|
51
51
|
], ReplaceProductQuestionsByProductIdDto.prototype, "questions", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ProductRecipeItemDto } from "./product-recipe-item.dto.js";
|
|
1
2
|
/**
|
|
2
3
|
* DTO for creating a new product recipe entry.
|
|
3
4
|
*
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
*
|
|
7
8
|
* @since 2.0.0
|
|
8
9
|
*/
|
|
9
|
-
export declare class CreateProductRecipeDto {
|
|
10
|
+
export declare class CreateProductRecipeDto extends ProductRecipeItemDto {
|
|
10
11
|
/**
|
|
11
12
|
* Optional unique identifier of the product.
|
|
12
13
|
* Must be a valid UUID if provided.
|
|
@@ -14,25 +15,4 @@ export declare class CreateProductRecipeDto {
|
|
|
14
15
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
15
16
|
*/
|
|
16
17
|
productId: string;
|
|
17
|
-
/**
|
|
18
|
-
* Unique identifier of the ingredient.
|
|
19
|
-
* Must be a valid UUID and not be empty.
|
|
20
|
-
*
|
|
21
|
-
* @example "660e8400-e29b-41d4-a716-446655440001"
|
|
22
|
-
*/
|
|
23
|
-
ingredientId: string;
|
|
24
|
-
/**
|
|
25
|
-
* Quantity of the ingredient needed.
|
|
26
|
-
* Must be a positive number.
|
|
27
|
-
*
|
|
28
|
-
* @example 200
|
|
29
|
-
*/
|
|
30
|
-
quantity: number;
|
|
31
|
-
/**
|
|
32
|
-
* Unit of measurement for the ingredient quantity.
|
|
33
|
-
* Must not be empty.
|
|
34
|
-
*
|
|
35
|
-
* @example "grams"
|
|
36
|
-
*/
|
|
37
|
-
unit: string;
|
|
38
18
|
}
|
|
@@ -7,7 +7,8 @@ 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, IsUUID } from "class-validator";
|
|
11
|
+
import { ProductRecipeItemDto } from "./product-recipe-item.dto.js";
|
|
11
12
|
/**
|
|
12
13
|
* DTO for creating a new product recipe entry.
|
|
13
14
|
*
|
|
@@ -16,7 +17,7 @@ import { IsString, IsNotEmpty, IsNumber, IsPositive, IsUUID } from 'class-valida
|
|
|
16
17
|
*
|
|
17
18
|
* @since 2.0.0
|
|
18
19
|
*/
|
|
19
|
-
export class CreateProductRecipeDto {
|
|
20
|
+
export class CreateProductRecipeDto extends ProductRecipeItemDto {
|
|
20
21
|
/**
|
|
21
22
|
* Optional unique identifier of the product.
|
|
22
23
|
* Must be a valid UUID if provided.
|
|
@@ -24,27 +25,6 @@ export class CreateProductRecipeDto {
|
|
|
24
25
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
25
26
|
*/
|
|
26
27
|
productId;
|
|
27
|
-
/**
|
|
28
|
-
* Unique identifier of the ingredient.
|
|
29
|
-
* Must be a valid UUID and not be empty.
|
|
30
|
-
*
|
|
31
|
-
* @example "660e8400-e29b-41d4-a716-446655440001"
|
|
32
|
-
*/
|
|
33
|
-
ingredientId;
|
|
34
|
-
/**
|
|
35
|
-
* Quantity of the ingredient needed.
|
|
36
|
-
* Must be a positive number.
|
|
37
|
-
*
|
|
38
|
-
* @example 200
|
|
39
|
-
*/
|
|
40
|
-
quantity;
|
|
41
|
-
/**
|
|
42
|
-
* Unit of measurement for the ingredient quantity.
|
|
43
|
-
* Must not be empty.
|
|
44
|
-
*
|
|
45
|
-
* @example "grams"
|
|
46
|
-
*/
|
|
47
|
-
unit;
|
|
48
28
|
}
|
|
49
29
|
__decorate([
|
|
50
30
|
IsString(),
|
|
@@ -52,19 +32,3 @@ __decorate([
|
|
|
52
32
|
IsUUID(),
|
|
53
33
|
__metadata("design:type", String)
|
|
54
34
|
], CreateProductRecipeDto.prototype, "productId", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
IsString(),
|
|
57
|
-
IsNotEmpty({ message: 'Ingredient ID is required' }),
|
|
58
|
-
IsUUID(),
|
|
59
|
-
__metadata("design:type", String)
|
|
60
|
-
], CreateProductRecipeDto.prototype, "ingredientId", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
IsNumber({}, { message: 'Quantity must be a number' }),
|
|
63
|
-
IsPositive({ message: 'Quantity must be a positive number' }),
|
|
64
|
-
__metadata("design:type", Number)
|
|
65
|
-
], CreateProductRecipeDto.prototype, "quantity", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
IsString(),
|
|
68
|
-
IsNotEmpty({ message: 'Unit is required' }),
|
|
69
|
-
__metadata("design:type", String)
|
|
70
|
-
], CreateProductRecipeDto.prototype, "unit", void 0);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
9
|
+
export * from "./create-product-recipe.dto.js";
|
|
10
|
+
export * from "./update-product-recipe.dto.js";
|
|
11
|
+
export * from "./replace-by-product-id.dto.js";
|
|
12
|
+
export * from "./product-recipe-item.dto.js";
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
9
|
+
export * from "./create-product-recipe.dto.js";
|
|
10
|
+
export * from "./update-product-recipe.dto.js";
|
|
11
|
+
export * from "./replace-by-product-id.dto.js";
|
|
12
|
+
export * from "./product-recipe-item.dto.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class ProductRecipeItemDto {
|
|
2
|
+
/**
|
|
3
|
+
* Unique identifier of the ingredient.
|
|
4
|
+
* Must be a valid UUID and not be empty.
|
|
5
|
+
*
|
|
6
|
+
* @example "660e8400-e29b-41d4-a716-446655440001"
|
|
7
|
+
*/
|
|
8
|
+
ingredientId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Quantity of the ingredient needed.
|
|
11
|
+
* Must be a positive number.
|
|
12
|
+
*
|
|
13
|
+
* @example 200
|
|
14
|
+
*/
|
|
15
|
+
quantity: number;
|
|
16
|
+
/**
|
|
17
|
+
* Unit of measurement for the ingredient quantity.
|
|
18
|
+
* Must not be empty.
|
|
19
|
+
*
|
|
20
|
+
* @example "grams"
|
|
21
|
+
*/
|
|
22
|
+
unit: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { IsNotEmpty, IsNumber, IsPositive, IsString, IsUUID, } from "class-validator";
|
|
11
|
+
export class ProductRecipeItemDto {
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier of the ingredient.
|
|
14
|
+
* Must be a valid UUID and not be empty.
|
|
15
|
+
*
|
|
16
|
+
* @example "660e8400-e29b-41d4-a716-446655440001"
|
|
17
|
+
*/
|
|
18
|
+
ingredientId;
|
|
19
|
+
/**
|
|
20
|
+
* Quantity of the ingredient needed.
|
|
21
|
+
* Must be a positive number.
|
|
22
|
+
*
|
|
23
|
+
* @example 200
|
|
24
|
+
*/
|
|
25
|
+
quantity;
|
|
26
|
+
/**
|
|
27
|
+
* Unit of measurement for the ingredient quantity.
|
|
28
|
+
* Must not be empty.
|
|
29
|
+
*
|
|
30
|
+
* @example "grams"
|
|
31
|
+
*/
|
|
32
|
+
unit;
|
|
33
|
+
}
|
|
34
|
+
__decorate([
|
|
35
|
+
IsString(),
|
|
36
|
+
IsNotEmpty({ message: "Ingredient ID is required" }),
|
|
37
|
+
IsUUID(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], ProductRecipeItemDto.prototype, "ingredientId", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
IsNumber({}, { message: "Quantity must be a number" }),
|
|
42
|
+
IsPositive({ message: "Quantity must be a positive number" }),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], ProductRecipeItemDto.prototype, "quantity", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
IsString(),
|
|
47
|
+
IsNotEmpty({ message: "Unit is required" }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], ProductRecipeItemDto.prototype, "unit", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductRecipeItemDto } from "./product-recipe-item.dto.js";
|
|
2
2
|
/**
|
|
3
3
|
* DTO for replacing all product-recipe relationships.
|
|
4
4
|
*
|
|
@@ -23,5 +23,5 @@ export declare class ReplaceProductRecipesByProductIdDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example [{ ingredientId: "...", quantity: 200, unit: "grams" }]
|
|
25
25
|
*/
|
|
26
|
-
recipes:
|
|
26
|
+
recipes: ProductRecipeItemDto[];
|
|
27
27
|
}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { IsString, IsNotEmpty, IsUUID, IsArray, ValidateNested, ArrayMinSize, } from "class-validator";
|
|
11
11
|
import { Type } from "class-transformer";
|
|
12
|
-
import {
|
|
12
|
+
import { ProductRecipeItemDto } from "./product-recipe-item.dto.js";
|
|
13
13
|
/**
|
|
14
14
|
* DTO for replacing all product-recipe relationships.
|
|
15
15
|
*
|
|
@@ -46,6 +46,6 @@ __decorate([
|
|
|
46
46
|
IsArray(),
|
|
47
47
|
ArrayMinSize(0, { message: "Recipes array can be empty" }),
|
|
48
48
|
ValidateNested({ each: true }),
|
|
49
|
-
Type(() =>
|
|
49
|
+
Type(() => ProductRecipeItemDto),
|
|
50
50
|
__metadata("design:type", Array)
|
|
51
51
|
], ReplaceProductRecipesByProductIdDto.prototype, "recipes", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ProductScheduleItemDto } from "./product-schedule-item.dto.js";
|
|
1
2
|
/**
|
|
2
3
|
* DTO for creating a new product schedule.
|
|
3
4
|
*
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
*
|
|
7
8
|
* @since 2.0.0
|
|
8
9
|
*/
|
|
9
|
-
export declare class CreateProductScheduleDto {
|
|
10
|
+
export declare class CreateProductScheduleDto extends ProductScheduleItemDto {
|
|
10
11
|
/**
|
|
11
12
|
* Optional unique identifier of the product.
|
|
12
13
|
* Must be a valid UUID if provided.
|
|
@@ -14,25 +15,4 @@ export declare class CreateProductScheduleDto {
|
|
|
14
15
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
15
16
|
*/
|
|
16
17
|
productId: string;
|
|
17
|
-
/**
|
|
18
|
-
* Day of week (0-6, where 0 is Sunday and 6 is Saturday).
|
|
19
|
-
* Must be an integer between 0 and 6.
|
|
20
|
-
*
|
|
21
|
-
* @example 1 (Monday)
|
|
22
|
-
*/
|
|
23
|
-
dayOfWeek: number;
|
|
24
|
-
/**
|
|
25
|
-
* Start time in HH:MM format (24-hour format).
|
|
26
|
-
* Must match the pattern HH:MM where HH is 00-23 and MM is 00-59.
|
|
27
|
-
*
|
|
28
|
-
* @example "09:00"
|
|
29
|
-
*/
|
|
30
|
-
startTime: string;
|
|
31
|
-
/**
|
|
32
|
-
* End time in HH:MM format (24-hour format).
|
|
33
|
-
* Must match the pattern HH:MM where HH is 00-23 and MM is 00-59.
|
|
34
|
-
*
|
|
35
|
-
* @example "22:00"
|
|
36
|
-
*/
|
|
37
|
-
endTime: string;
|
|
38
18
|
}
|
|
@@ -7,8 +7,8 @@ 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,
|
|
11
|
-
import {
|
|
10
|
+
import { IsString, IsNotEmpty, IsUUID } from "class-validator";
|
|
11
|
+
import { ProductScheduleItemDto } from "./product-schedule-item.dto.js";
|
|
12
12
|
/**
|
|
13
13
|
* DTO for creating a new product schedule.
|
|
14
14
|
*
|
|
@@ -17,7 +17,7 @@ import { Type } from 'class-transformer';
|
|
|
17
17
|
*
|
|
18
18
|
* @since 2.0.0
|
|
19
19
|
*/
|
|
20
|
-
export class CreateProductScheduleDto {
|
|
20
|
+
export class CreateProductScheduleDto extends ProductScheduleItemDto {
|
|
21
21
|
/**
|
|
22
22
|
* Optional unique identifier of the product.
|
|
23
23
|
* Must be a valid UUID if provided.
|
|
@@ -25,27 +25,6 @@ export class CreateProductScheduleDto {
|
|
|
25
25
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
26
26
|
*/
|
|
27
27
|
productId;
|
|
28
|
-
/**
|
|
29
|
-
* Day of week (0-6, where 0 is Sunday and 6 is Saturday).
|
|
30
|
-
* Must be an integer between 0 and 6.
|
|
31
|
-
*
|
|
32
|
-
* @example 1 (Monday)
|
|
33
|
-
*/
|
|
34
|
-
dayOfWeek;
|
|
35
|
-
/**
|
|
36
|
-
* Start time in HH:MM format (24-hour format).
|
|
37
|
-
* Must match the pattern HH:MM where HH is 00-23 and MM is 00-59.
|
|
38
|
-
*
|
|
39
|
-
* @example "09:00"
|
|
40
|
-
*/
|
|
41
|
-
startTime;
|
|
42
|
-
/**
|
|
43
|
-
* End time in HH:MM format (24-hour format).
|
|
44
|
-
* Must match the pattern HH:MM where HH is 00-23 and MM is 00-59.
|
|
45
|
-
*
|
|
46
|
-
* @example "22:00"
|
|
47
|
-
*/
|
|
48
|
-
endTime;
|
|
49
28
|
}
|
|
50
29
|
__decorate([
|
|
51
30
|
IsString(),
|
|
@@ -53,26 +32,3 @@ __decorate([
|
|
|
53
32
|
IsUUID(),
|
|
54
33
|
__metadata("design:type", String)
|
|
55
34
|
], CreateProductScheduleDto.prototype, "productId", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
IsInt({ message: 'Day of week must be an integer' }),
|
|
58
|
-
Min(0, { message: 'Day of week must be at least 0 (Sunday)' }),
|
|
59
|
-
Max(6, { message: 'Day of week must be at most 6 (Saturday)' }),
|
|
60
|
-
Type(() => Number),
|
|
61
|
-
__metadata("design:type", Number)
|
|
62
|
-
], CreateProductScheduleDto.prototype, "dayOfWeek", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
IsString(),
|
|
65
|
-
IsNotEmpty({ message: 'Start time is required' }),
|
|
66
|
-
Matches(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/, {
|
|
67
|
-
message: 'Start time must be in HH:MM format (e.g., 09:00 or 18:30)',
|
|
68
|
-
}),
|
|
69
|
-
__metadata("design:type", String)
|
|
70
|
-
], CreateProductScheduleDto.prototype, "startTime", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
IsString(),
|
|
73
|
-
IsNotEmpty({ message: 'End time is required' }),
|
|
74
|
-
Matches(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/, {
|
|
75
|
-
message: 'End time must be in HH:MM format (e.g., 09:00 or 18:30)',
|
|
76
|
-
}),
|
|
77
|
-
__metadata("design:type", String)
|
|
78
|
-
], CreateProductScheduleDto.prototype, "endTime", void 0);
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
9
|
+
export * from "./create-product-schedule.dto.js";
|
|
10
|
+
export * from "./update-product-schedule.dto.js";
|
|
11
|
+
export * from "./replace-by-product-id.dto.js";
|
|
12
|
+
export * from "./is-available-at-time.dto.js";
|
|
13
|
+
export * from "./product-schedule-item.dto.js";
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
9
|
+
export * from "./create-product-schedule.dto.js";
|
|
10
|
+
export * from "./update-product-schedule.dto.js";
|
|
11
|
+
export * from "./replace-by-product-id.dto.js";
|
|
12
|
+
export * from "./is-available-at-time.dto.js";
|
|
13
|
+
export * from "./product-schedule-item.dto.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class ProductScheduleItemDto {
|
|
2
|
+
/**
|
|
3
|
+
* Day of week (0-6, where 0 is Sunday and 6 is Saturday).
|
|
4
|
+
* Must be an integer between 0 and 6.
|
|
5
|
+
*
|
|
6
|
+
* @example 1 (Monday)
|
|
7
|
+
*/
|
|
8
|
+
dayOfWeek: number;
|
|
9
|
+
/**
|
|
10
|
+
* Start time in HH:MM format (24-hour format).
|
|
11
|
+
* Must match the pattern HH:MM where HH is 00-23 and MM is 00-59.
|
|
12
|
+
*
|
|
13
|
+
* @example "09:00"
|
|
14
|
+
*/
|
|
15
|
+
startTime: string;
|
|
16
|
+
/**
|
|
17
|
+
* End time in HH:MM format (24-hour format).
|
|
18
|
+
* Must match the pattern HH:MM where HH is 00-23 and MM is 00-59.
|
|
19
|
+
*
|
|
20
|
+
* @example "22:00"
|
|
21
|
+
*/
|
|
22
|
+
endTime: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Type } from "class-transformer";
|
|
11
|
+
import { IsInt, IsNotEmpty, IsString, Matches, Max, Min, } from "class-validator";
|
|
12
|
+
export class ProductScheduleItemDto {
|
|
13
|
+
/**
|
|
14
|
+
* Day of week (0-6, where 0 is Sunday and 6 is Saturday).
|
|
15
|
+
* Must be an integer between 0 and 6.
|
|
16
|
+
*
|
|
17
|
+
* @example 1 (Monday)
|
|
18
|
+
*/
|
|
19
|
+
dayOfWeek;
|
|
20
|
+
/**
|
|
21
|
+
* Start time in HH:MM format (24-hour format).
|
|
22
|
+
* Must match the pattern HH:MM where HH is 00-23 and MM is 00-59.
|
|
23
|
+
*
|
|
24
|
+
* @example "09:00"
|
|
25
|
+
*/
|
|
26
|
+
startTime;
|
|
27
|
+
/**
|
|
28
|
+
* End time in HH:MM format (24-hour format).
|
|
29
|
+
* Must match the pattern HH:MM where HH is 00-23 and MM is 00-59.
|
|
30
|
+
*
|
|
31
|
+
* @example "22:00"
|
|
32
|
+
*/
|
|
33
|
+
endTime;
|
|
34
|
+
}
|
|
35
|
+
__decorate([
|
|
36
|
+
IsInt({ message: "Day of week must be an integer" }),
|
|
37
|
+
Min(0, { message: "Day of week must be at least 0 (Sunday)" }),
|
|
38
|
+
Max(6, { message: "Day of week must be at most 6 (Saturday)" }),
|
|
39
|
+
Type(() => Number),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], ProductScheduleItemDto.prototype, "dayOfWeek", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
IsString(),
|
|
44
|
+
IsNotEmpty({ message: "Start time is required" }),
|
|
45
|
+
Matches(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/, {
|
|
46
|
+
message: "Start time must be in HH:MM format (e.g., 09:00 or 18:30)",
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], ProductScheduleItemDto.prototype, "startTime", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
IsString(),
|
|
52
|
+
IsNotEmpty({ message: "End time is required" }),
|
|
53
|
+
Matches(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/, {
|
|
54
|
+
message: "End time must be in HH:MM format (e.g., 09:00 or 18:30)",
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], ProductScheduleItemDto.prototype, "endTime", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductScheduleItemDto } from "./product-schedule-item.dto.js";
|
|
2
2
|
/**
|
|
3
3
|
* DTO for replacing all product schedules.
|
|
4
4
|
*
|
|
@@ -23,5 +23,5 @@ export declare class ReplaceProductSchedulesByProductIdDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example [{ dayOfWeek: 1, startTime: "09:00", endTime: "18:00" }]
|
|
25
25
|
*/
|
|
26
|
-
schedules:
|
|
26
|
+
schedules: ProductScheduleItemDto[];
|
|
27
27
|
}
|
|
@@ -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, IsArray, ValidateNested, ArrayMinSize, IsUUID } from
|
|
11
|
-
import { Type } from
|
|
12
|
-
import {
|
|
10
|
+
import { IsString, IsNotEmpty, IsArray, ValidateNested, ArrayMinSize, IsUUID, } from "class-validator";
|
|
11
|
+
import { Type } from "class-transformer";
|
|
12
|
+
import { ProductScheduleItemDto } from "./product-schedule-item.dto.js";
|
|
13
13
|
/**
|
|
14
14
|
* DTO for replacing all product schedules.
|
|
15
15
|
*
|
|
@@ -38,14 +38,14 @@ export class ReplaceProductSchedulesByProductIdDto {
|
|
|
38
38
|
}
|
|
39
39
|
__decorate([
|
|
40
40
|
IsString(),
|
|
41
|
-
IsNotEmpty({ message:
|
|
41
|
+
IsNotEmpty({ message: "Product ID is required" }),
|
|
42
42
|
IsUUID(),
|
|
43
43
|
__metadata("design:type", String)
|
|
44
44
|
], ReplaceProductSchedulesByProductIdDto.prototype, "productId", void 0);
|
|
45
45
|
__decorate([
|
|
46
46
|
IsArray(),
|
|
47
|
-
ArrayMinSize(0, { message:
|
|
47
|
+
ArrayMinSize(0, { message: "Schedules array can be empty" }),
|
|
48
48
|
ValidateNested({ each: true }),
|
|
49
|
-
Type(() =>
|
|
49
|
+
Type(() => ProductScheduleItemDto),
|
|
50
50
|
__metadata("design:type", Array)
|
|
51
51
|
], ReplaceProductSchedulesByProductIdDto.prototype, "schedules", void 0);
|