qeai-sdk 2.0.2 → 2.0.4

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.
Files changed (37) hide show
  1. package/dist/dtos/chain/create-chain.dto.d.ts +6 -7
  2. package/dist/dtos/chain/create-chain.dto.js +16 -15
  3. package/dist/dtos/chain/update-chain.dto.d.ts +5 -5
  4. package/dist/dtos/chain/update-chain.dto.js +13 -11
  5. package/dist/dtos/products/create-product.dto.d.ts +1 -1
  6. package/dist/dtos/products/create-product.dto.js +10 -8
  7. package/dist/dtos/products/update-product.dto.d.ts +1 -1
  8. package/dist/dtos/products/update-product.dto.js +6 -4
  9. package/dist/enums/index.d.ts +0 -2
  10. package/dist/enums/index.js +0 -2
  11. package/dist/interfaces/auth/account.interface.d.ts +4 -4
  12. package/dist/interfaces/auth/user.interface.d.ts +1 -1
  13. package/dist/interfaces/categories/category.interface.d.ts +5 -5
  14. package/dist/interfaces/chains/chain.interface.d.ts +2 -2
  15. package/dist/interfaces/ingredients/ingredient.interface.d.ts +4 -4
  16. package/dist/interfaces/orders/order-item.interface.d.ts +1 -1
  17. package/dist/interfaces/products/product.interface.d.ts +11 -8
  18. package/dist/interfaces/products/response/sub-resources/create-tag-response.interface.d.ts +1 -1
  19. package/dist/interfaces/products/response/sub-resources/recipe-relationship.interface.d.ts +0 -2
  20. package/dist/interfaces/questions/question.interface.d.ts +8 -6
  21. package/dist/interfaces/restaurants/restaurant.interface.d.ts +7 -7
  22. package/dist/interfaces/translations/translation.interface.d.ts +4 -4
  23. package/dist/types/currency.type.d.ts +26 -0
  24. package/dist/types/currency.type.js +18 -0
  25. package/dist/types/index.d.ts +2 -0
  26. package/dist/types/index.js +2 -0
  27. package/dist/types/order-mode.type.d.ts +1 -1
  28. package/dist/types/order-mode.type.js +1 -5
  29. package/dist/types/order-status.type.d.ts +1 -1
  30. package/dist/types/order-status.type.js +12 -12
  31. package/dist/types/product-status.type.d.ts +25 -0
  32. package/dist/types/product-status.type.js +17 -0
  33. package/package.json +1 -1
  34. package/dist/enums/currency.enum.d.ts +0 -21
  35. package/dist/enums/currency.enum.js +0 -22
  36. package/dist/enums/product-status.enum.d.ts +0 -55
  37. package/dist/enums/product-status.enum.js +0 -56
@@ -1,4 +1,4 @@
1
- import { Currency } from '../../enums/currency.enum.js';
1
+ import { type CurrencyCode } from "../../types/currency.type.js";
2
2
  /**
3
3
  * DTO for creating a new chain.
4
4
  *
@@ -16,14 +16,13 @@ export declare class CreateChainDto {
16
16
  */
17
17
  name: string;
18
18
  /**
19
- * Currency to be used by the entire chain.
20
- * Optional. If provided, must be a valid currency code defined in the Currency enum.
21
- * Defaults to PEN.
19
+ * The currency code for the chain.
20
+ * Optional. If provided, must be one of the supported currency codes (see CurrencyCode type).
22
21
  *
23
- * @example Currency.PEN
24
- * @default Currency.PEN
22
+ * @example "PEN"
23
+ * @default "PEN"
25
24
  */
26
- currency?: Currency;
25
+ currency?: CurrencyCode;
27
26
  /**
28
27
  * Global tax percentage to apply across the whole chain.
29
28
  * Optional. Must be a number between 0 and 100. Defaults to 0.0 (no tax).
@@ -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, IsOptional, IsNumber, Min, Max, IsEnum, IsMongoId, IsNotEmpty, MinLength } from 'class-validator';
11
- import { Currency } from '../../enums/currency.enum.js';
10
+ import { IsString, IsOptional, IsNumber, Min, Max, IsMongoId, IsNotEmpty, MinLength, IsIn, } from "class-validator";
11
+ import { CURRENCIES } from "../../types/currency.type.js";
12
12
  /**
13
13
  * DTO for creating a new chain.
14
14
  *
@@ -26,14 +26,13 @@ export class CreateChainDto {
26
26
  */
27
27
  name;
28
28
  /**
29
- * Currency to be used by the entire chain.
30
- * Optional. If provided, must be a valid currency code defined in the Currency enum.
31
- * Defaults to PEN.
29
+ * The currency code for the chain.
30
+ * Optional. If provided, must be one of the supported currency codes (see CurrencyCode type).
32
31
  *
33
- * @example Currency.PEN
34
- * @default Currency.PEN
32
+ * @example "PEN"
33
+ * @default "PEN"
35
34
  */
36
- currency = Currency.PEN;
35
+ currency = "PEN";
37
36
  /**
38
37
  * Global tax percentage to apply across the whole chain.
39
38
  * Optional. Must be a number between 0 and 100. Defaults to 0.0 (no tax).
@@ -52,25 +51,27 @@ export class CreateChainDto {
52
51
  }
53
52
  __decorate([
54
53
  IsString(),
55
- IsNotEmpty({ message: 'Chain name is required' }),
54
+ IsNotEmpty({ message: "Chain name is required" }),
56
55
  MinLength(3),
57
56
  __metadata("design:type", String)
58
57
  ], CreateChainDto.prototype, "name", void 0);
59
58
  __decorate([
60
59
  IsOptional(),
61
- IsEnum(Currency, { message: 'Currency must be a valid currency code' }),
60
+ IsIn(CURRENCIES, { message: "Currency must be a valid currency code" }),
62
61
  __metadata("design:type", String)
63
62
  ], CreateChainDto.prototype, "currency", void 0);
64
63
  __decorate([
65
64
  IsOptional(),
66
- IsNumber({}, { message: 'Tax percentage must be a number' }),
67
- Min(0, { message: 'Tax percentage must be at least 0' }),
68
- Max(100, { message: 'Tax percentage must be at most 100' }),
65
+ IsNumber({}, { message: "Tax percentage must be a number" }),
66
+ Min(0, { message: "Tax percentage must be at least 0" }),
67
+ Max(100, { message: "Tax percentage must be at most 100" }),
69
68
  __metadata("design:type", Number)
70
69
  ], CreateChainDto.prototype, "taxPercent", void 0);
71
70
  __decorate([
72
71
  IsString(),
73
- IsMongoId({ message: 'createdBy must be a valid MongoDB ObjectId' }),
74
- IsNotEmpty({ message: 'createdBy is required and must be a valid MongoDB ObjectId' }),
72
+ IsMongoId({ message: "createdBy must be a valid MongoDB ObjectId" }),
73
+ IsNotEmpty({
74
+ message: "createdBy is required and must be a valid MongoDB ObjectId",
75
+ }),
75
76
  __metadata("design:type", String)
76
77
  ], CreateChainDto.prototype, "createdBy", void 0);
@@ -1,4 +1,4 @@
1
- import { Currency } from "../../enums/currency.enum.js";
1
+ import { type CurrencyCode } from "../../types/currency.type.js";
2
2
  /**
3
3
  * DTO for updating an existing chain.
4
4
  *
@@ -29,12 +29,12 @@ export declare class UpdateChainDto {
29
29
  name?: string;
30
30
  /**
31
31
  * The currency code for the chain.
32
- * Optional. Must be a value from the Currency enum if provided.
32
+ * Optional. If provided, must be one of the supported currency codes (see CurrencyCode type).
33
33
  *
34
- * @example Currency.PEN
35
- * @default Currency.PEN
34
+ * @example "PEN"
35
+ * @default "PEN"
36
36
  */
37
- currency?: Currency;
37
+ currency?: CurrencyCode;
38
38
  /**
39
39
  * Global tax percentage applied across the chain.
40
40
  * Optional. Must be a number between 0 and 100 if provided.
@@ -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, IsOptional, IsMongoId, IsUUID, IsNumber, Max, Min, IsEnum, MinLength, IsNotEmpty, } from "class-validator";
11
- import { Currency } from "../../enums/currency.enum.js";
10
+ import { IsString, IsOptional, IsMongoId, IsUUID, IsNumber, Max, Min, MinLength, IsNotEmpty, IsIn, } from "class-validator";
11
+ import { CURRENCIES } from "../../types/currency.type.js";
12
12
  /**
13
13
  * DTO for updating an existing chain.
14
14
  *
@@ -39,12 +39,12 @@ export class UpdateChainDto {
39
39
  name;
40
40
  /**
41
41
  * The currency code for the chain.
42
- * Optional. Must be a value from the Currency enum if provided.
42
+ * Optional. If provided, must be one of the supported currency codes (see CurrencyCode type).
43
43
  *
44
- * @example Currency.PEN
45
- * @default Currency.PEN
44
+ * @example "PEN"
45
+ * @default "PEN"
46
46
  */
47
- currency = Currency.PEN;
47
+ currency = "PEN";
48
48
  /**
49
49
  * Global tax percentage applied across the chain.
50
50
  * Optional. Must be a number between 0 and 100 if provided.
@@ -71,12 +71,12 @@ export class UpdateChainDto {
71
71
  __decorate([
72
72
  IsOptional(),
73
73
  IsString(),
74
- MinLength(3, { message: 'Chain name must be at least 3 characters' }),
74
+ MinLength(3, { message: "Chain name must be at least 3 characters" }),
75
75
  __metadata("design:type", String)
76
76
  ], UpdateChainDto.prototype, "name", void 0);
77
77
  __decorate([
78
78
  IsOptional(),
79
- IsEnum(Currency, { message: "Currency must be a valid currency code" }),
79
+ IsIn(CURRENCIES, { message: "Currency must be a valid currency code" }),
80
80
  __metadata("design:type", String)
81
81
  ], UpdateChainDto.prototype, "currency", void 0);
82
82
  __decorate([
@@ -89,12 +89,14 @@ __decorate([
89
89
  __decorate([
90
90
  IsString(),
91
91
  IsUUID(),
92
- IsNotEmpty({ message: 'chainId is required and must be a valid UUID.' }),
92
+ IsNotEmpty({ message: "chainId is required and must be a valid UUID." }),
93
93
  __metadata("design:type", String)
94
94
  ], UpdateChainDto.prototype, "chainId", void 0);
95
95
  __decorate([
96
96
  IsString(),
97
- IsMongoId({ message: 'updatedBy must be a valid MongoDB ObjectId.' }),
98
- IsNotEmpty({ message: 'updatedBy is required and must be a valid MongoDB ObjectId.' }),
97
+ IsMongoId({ message: "updatedBy must be a valid MongoDB ObjectId." }),
98
+ IsNotEmpty({
99
+ message: "updatedBy is required and must be a valid MongoDB ObjectId.",
100
+ }),
99
101
  __metadata("design:type", String)
100
102
  ], UpdateChainDto.prototype, "updatedBy", void 0);
@@ -1,4 +1,4 @@
1
- import { ProductStatus } from '../../enums/product-status.enum.js';
1
+ import { type ProductStatus } from "../../types/product-status.type.js";
2
2
  /**
3
3
  * DTO for creating a new product.
4
4
  *
@@ -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, IsNumber, Min, IsOptional, IsEnum, IsMongoId } from 'class-validator';
11
- import { Type } from 'class-transformer';
12
- import { ProductStatus } from '../../enums/product-status.enum.js';
10
+ import { IsString, IsNotEmpty, IsNumber, Min, IsOptional, IsMongoId, IsIn, } from "class-validator";
11
+ import { Type } from "class-transformer";
12
+ import { PRODUCT_STATUS, } from "../../types/product-status.type.js";
13
13
  /**
14
14
  * DTO for creating a new product.
15
15
  *
@@ -54,7 +54,7 @@ export class CreateProductDto {
54
54
  * @example ProductStatus.ACTIVE
55
55
  * @default ProductStatus.ACTIVE
56
56
  */
57
- status = ProductStatus.ACTIVE;
57
+ status = "ACTIVE";
58
58
  /**
59
59
  * User who created the product.
60
60
  * Must be a valid MongoDB ObjectId.
@@ -70,7 +70,7 @@ __decorate([
70
70
  ], CreateProductDto.prototype, "sku", void 0);
71
71
  __decorate([
72
72
  IsString(),
73
- IsNotEmpty({ message: 'Product name is required' }),
73
+ IsNotEmpty({ message: "Product name is required" }),
74
74
  __metadata("design:type", String)
75
75
  ], CreateProductDto.prototype, "name", void 0);
76
76
  __decorate([
@@ -82,14 +82,16 @@ __decorate([
82
82
  IsNotEmpty(),
83
83
  IsNumber({
84
84
  maxDecimalPlaces: 4,
85
- }, { message: 'Base price must be a number with maximum 4 decimal places' }),
85
+ }, { message: "Base price must be a number with maximum 4 decimal places" }),
86
86
  Type(() => Number),
87
- Min(0, { message: 'Base price must be greater than or equal to 0' }),
87
+ Min(0, { message: "Base price must be greater than or equal to 0" }),
88
88
  __metadata("design:type", Number)
89
89
  ], CreateProductDto.prototype, "basePrice", void 0);
90
90
  __decorate([
91
91
  IsOptional(),
92
- IsEnum(ProductStatus, { message: 'Status must be ACTIVE, INACTIVE, or OUT_OF_STOCK' }),
92
+ IsIn(PRODUCT_STATUS, {
93
+ message: "Status must be ACTIVE, INACTIVE, or OUT_OF_STOCK",
94
+ }),
93
95
  __metadata("design:type", String)
94
96
  ], CreateProductDto.prototype, "status", void 0);
95
97
  __decorate([
@@ -1,4 +1,4 @@
1
- import { ProductStatus } from '../../enums/product-status.enum.js';
1
+ import { type ProductStatus } from '../../types/product-status.type.js';
2
2
  /**
3
3
  * DTO for updating an existing product.
4
4
  *
@@ -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 { IsMongoId, IsString, IsUUID, IsOptional, IsEnum, Min, IsNumber, IsNotEmpty } from 'class-validator';
11
- import { ProductStatus } from '../../enums/product-status.enum.js';
10
+ import { IsMongoId, IsString, IsUUID, IsOptional, Min, IsNumber, IsNotEmpty, IsIn } from 'class-validator';
11
+ import { PRODUCT_STATUS } from '../../types/product-status.type.js';
12
12
  import { Type } from 'class-transformer';
13
13
  /**
14
14
  * DTO for updating an existing product.
@@ -55,7 +55,7 @@ export class UpdateProductDto {
55
55
  * @example ProductStatus.ACTIVE
56
56
  * @default ProductStatus.ACTIVE
57
57
  */
58
- status = ProductStatus.ACTIVE;
58
+ status = "ACTIVE";
59
59
  /**
60
60
  * Product ID to update.
61
61
  * Must be a valid UUID.
@@ -97,7 +97,9 @@ __decorate([
97
97
  ], UpdateProductDto.prototype, "basePrice", void 0);
98
98
  __decorate([
99
99
  IsOptional(),
100
- IsEnum(ProductStatus, { message: 'Status must be ACTIVE, INACTIVE, or OUT_OF_STOCK' }),
100
+ IsIn(PRODUCT_STATUS, {
101
+ message: "Status must be ACTIVE, INACTIVE, or OUT_OF_STOCK",
102
+ }),
101
103
  __metadata("design:type", String)
102
104
  ], UpdateProductDto.prototype, "status", void 0);
103
105
  __decorate([
@@ -1,10 +1,8 @@
1
1
  export * from "./http-status-code.enum.js";
2
2
  export * from "./http-status-text.enum.js";
3
- export * from "./currency.enum.js";
4
3
  export * from "./language-code.enum.js";
5
4
  export * from "./question-type.enum.js";
6
5
  export * from "./question-product-type.enum.js";
7
6
  export * from "./translation-entity-type.enum.js";
8
7
  export * from "./role.enum.js";
9
8
  export * from "./auth-provider.enum.js";
10
- export * from "./product-status.enum.js";
@@ -1,10 +1,8 @@
1
1
  export * from "./http-status-code.enum.js";
2
2
  export * from "./http-status-text.enum.js";
3
- export * from "./currency.enum.js";
4
3
  export * from "./language-code.enum.js";
5
4
  export * from "./question-type.enum.js";
6
5
  export * from "./question-product-type.enum.js";
7
6
  export * from "./translation-entity-type.enum.js";
8
7
  export * from "./role.enum.js";
9
8
  export * from "./auth-provider.enum.js";
10
- export * from "./product-status.enum.js";
@@ -34,7 +34,7 @@ export interface Account {
34
34
  * @example "hashed_password_string"
35
35
  * @example null
36
36
  */
37
- passwordHash?: string;
37
+ passwordHash?: string | null;
38
38
  /**
39
39
  * Authentication provider for this account.
40
40
  *
@@ -51,7 +51,7 @@ export interface Account {
51
51
  * @example "google_user_sub_123456789"
52
52
  * @example null
53
53
  */
54
- providerId?: string;
54
+ providerId?: string | null;
55
55
  /**
56
56
  * Optional OAuth access token.
57
57
  * Used for OAuth providers to make authenticated requests.
@@ -60,7 +60,7 @@ export interface Account {
60
60
  * @example "ya29.a0AfH6SMB..."
61
61
  * @example null
62
62
  */
63
- accessToken?: string;
63
+ accessToken?: string | null;
64
64
  /**
65
65
  * Optional OAuth refresh token.
66
66
  * Used for OAuth providers to obtain new access tokens.
@@ -69,7 +69,7 @@ export interface Account {
69
69
  * @example "1//0gXpJ..."
70
70
  * @example null
71
71
  */
72
- refreshToken?: string;
72
+ refreshToken?: string | null;
73
73
  /**
74
74
  * Date and time when the account was created.
75
75
  *
@@ -32,7 +32,7 @@ export interface User {
32
32
  *
33
33
  * @example "https://example.com/avatars/user123.jpg"
34
34
  */
35
- avatarUrl?: string;
35
+ avatarUrl?: string | null;
36
36
  /**
37
37
  * Array of user roles for authorization.
38
38
  * Users can have multiple roles simultaneously.
@@ -28,7 +28,7 @@ export interface Category {
28
28
  * @example "All types of drinks and beverages"
29
29
  * @example "Delicious main dishes and entrees"
30
30
  */
31
- description?: string;
31
+ description?: string | null;
32
32
  /**
33
33
  * Category status (active/inactive).
34
34
  * Determines if the category is visible in menus.
@@ -54,23 +54,23 @@ export interface Category {
54
54
  *
55
55
  * @example "2024-01-20T10:30:00Z"
56
56
  */
57
- deletedAt?: Date;
57
+ deletedAt?: Date | null;
58
58
  /**
59
59
  * Optional identifier of the user who created the category.
60
60
  *
61
61
  * @example "507f1f77bcf86cd799439011"
62
62
  */
63
- createdBy?: string;
63
+ createdBy?: string | null;
64
64
  /**
65
65
  * Optional identifier of the user who last updated the category.
66
66
  *
67
67
  * @example "507f1f77bcf86cd799439012"
68
68
  */
69
- updatedBy?: string;
69
+ updatedBy?: string | null;
70
70
  /**
71
71
  * Optional identifier of the user who deleted the category.
72
72
  *
73
73
  * @example "507f1f77bcf86cd799439013"
74
74
  */
75
- deletedBy?: string;
75
+ deletedBy?: string | null;
76
76
  }
@@ -1,4 +1,4 @@
1
- import { Currency } from '../../enums/currency.enum.js';
1
+ import { CurrencyCode } from "../../types";
2
2
  /**
3
3
  * Chain interface.
4
4
  *
@@ -30,7 +30,7 @@ export interface Chain {
30
30
  * @example Currency.USD
31
31
  * @example Currency.EUR
32
32
  */
33
- currency: Currency;
33
+ currency: CurrencyCode;
34
34
  /**
35
35
  * Global tax percentage for the chain.
36
36
  * Applied across all restaurants in the chain.
@@ -57,23 +57,23 @@ export interface Ingredient {
57
57
  *
58
58
  * @example "2024-01-20T10:30:00Z"
59
59
  */
60
- deletedAt?: Date;
60
+ deletedAt?: Date | null;
61
61
  /**
62
62
  * Optional identifier of the user who created the ingredient.
63
63
  *
64
64
  * @example "507f1f77bcf86cd799439011"
65
65
  */
66
- createdBy?: string;
66
+ createdBy?: string | null;
67
67
  /**
68
68
  * Optional identifier of the user who last updated the ingredient.
69
69
  *
70
70
  * @example "507f1f77bcf86cd799439012"
71
71
  */
72
- updatedBy?: string;
72
+ updatedBy?: string | null;
73
73
  /**
74
74
  * Optional identifier of the user who deleted the ingredient.
75
75
  *
76
76
  * @example "507f1f77bcf86cd799439013"
77
77
  */
78
- deletedBy?: string;
78
+ deletedBy?: string | null;
79
79
  }
@@ -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?: OrderItem[] | null;
69
+ childItems?: OrderItem[];
70
70
  }
@@ -1,6 +1,8 @@
1
- import { ProductSize, ProductImage, ProductTag, ProductSchedule, ProductRecipe } from './index.js';
2
- import { ProductStatus } from '../../enums/product-status.enum.js';
1
+ import { ProductSize, ProductImage, ProductSchedule, ProductRecipe } from './index.js';
2
+ import { ProductStatus } from '../../types/product-status.type.js';
3
3
  import { Translation } from '../translations/translation.interface.js';
4
+ import { Tag } from '../tags/tag.interface.js';
5
+ import { Question } from '../questions/question.interface.js';
4
6
  /**
5
7
  * Product interface.
6
8
  *
@@ -23,7 +25,7 @@ export interface Product {
23
25
  *
24
26
  * @example "PROD-001"
25
27
  */
26
- sku?: string;
28
+ sku?: string | null;
27
29
  /**
28
30
  * Product name.
29
31
  *
@@ -35,7 +37,7 @@ export interface Product {
35
37
  *
36
38
  * @example "Two all-beef patties, special sauce, lettuce, cheese, pickles, onions on a sesame seed bun"
37
39
  */
38
- description?: string;
40
+ description?: string | null;
39
41
  /**
40
42
  * Product base price.
41
43
  *
@@ -67,19 +69,20 @@ export interface Product {
67
69
  *
68
70
  * @example "2024-01-20T10:30:00Z"
69
71
  */
70
- deletedAt?: Date;
72
+ deletedAt?: Date | null;
71
73
  /**
72
74
  * Optional identifier of the user who created the product.
73
75
  *
74
76
  * @example "507f1f77bcf86cd799439011"
75
77
  */
76
- createdBy?: string;
78
+ createdBy?: string | null;
77
79
  /**
78
80
  * Optional identifier of the user who last updated the product.
79
81
  *
80
82
  * @example "507f1f77bcf86cd799439012"
81
83
  */
82
- updatedBy?: string;
84
+ updatedBy?: string | null;
85
+ questions?: Question[];
83
86
  /**
84
87
  * Optional array of product size variants.
85
88
  * Loaded when product is fetched with size relations.
@@ -99,7 +102,7 @@ export interface Product {
99
102
  * Optional array of product tags.
100
103
  * Loaded when product is fetched with tag relations.
101
104
  */
102
- tags?: ProductTag[];
105
+ tags?: Tag[];
103
106
  /**
104
107
  * Optional array of product availability schedules.
105
108
  * Loaded when product is fetched with schedule relations.
@@ -1,4 +1,4 @@
1
1
  import { Tag } from "../../../tags/index.js";
2
2
  import { SubResourceResponse } from "./sub-resource-response.interface.js";
3
- export interface CreateTagResponse extends SubResourceResponse<Omit<Tag, "createdAt" | "updatedAt" | "deletedAt">, "tag"> {
3
+ export interface CreateTagResponse extends SubResourceResponse<Omit<Tag, "createdAt" | "updatedAt" | "deletedAt" | "createdBy" | "updatedBy" | "deletedBy">, "tag"> {
4
4
  }
@@ -1,9 +1,7 @@
1
1
  import { Ingredient } from "../../../ingredients/index.js";
2
2
  export interface RecipeRelationship {
3
- message: string;
4
3
  id: string;
5
4
  quantity: number;
6
- productId: string;
7
5
  unit: string;
8
6
  ingredient: Omit<Ingredient, "createdAt" | "updatedAt" | "deletedAt">;
9
7
  }
@@ -1,15 +1,17 @@
1
+ import { Product } from "../products/product.interface.js";
1
2
  export interface Question {
2
3
  id: string;
3
4
  name: string;
4
5
  required: boolean;
5
- min?: number;
6
- max?: number;
6
+ min?: number | null;
7
+ max?: number | null;
7
8
  type: string;
8
9
  isActive: boolean;
10
+ answers?: Product[];
9
11
  createdAt: Date;
10
12
  updatedAt: Date;
11
- deletedAt?: Date;
12
- createdBy: string;
13
- updatedBy?: string;
14
- deletedBy?: string;
13
+ deletedAt?: Date | null;
14
+ createdBy?: string | null;
15
+ updatedBy?: string | null;
16
+ deletedBy?: string | null;
15
17
  }
@@ -33,14 +33,14 @@ export interface Restaurant {
33
33
  * @example "La planicie"
34
34
  * @example "123 Main St, Downtown"
35
35
  */
36
- address?: string;
36
+ address?: string | null;
37
37
  /**
38
38
  * Optional restaurant phone number.
39
39
  *
40
40
  * @example "903406229"
41
41
  * @example "+1-555-0123"
42
42
  */
43
- phone?: string;
43
+ phone?: string | null;
44
44
  /**
45
45
  * Optional restaurant timezone.
46
46
  * Used for scheduling and availability calculations.
@@ -48,7 +48,7 @@ export interface Restaurant {
48
48
  * @example "America/Lima"
49
49
  * @example "America/New_York"
50
50
  */
51
- timezone?: string;
51
+ timezone?: string | null;
52
52
  /**
53
53
  * Restaurant status (active/inactive).
54
54
  * Determines if the restaurant is operational.
@@ -74,23 +74,23 @@ export interface Restaurant {
74
74
  *
75
75
  * @example "2025-11-20T10:30:00Z"
76
76
  */
77
- deletedAt?: Date;
77
+ deletedAt?: Date | null;
78
78
  /**
79
79
  * Optional identifier of the user who created the restaurant.
80
80
  *
81
81
  * @example "68fc713cb9a5f6ee8fb7ae4e"
82
82
  */
83
- createdBy?: string;
83
+ createdBy?: string | null;
84
84
  /**
85
85
  * Optional identifier of the user who last updated the restaurant.
86
86
  *
87
87
  * @example "68fc713cb9a5f6ee8fb7ae4f"
88
88
  */
89
- updatedBy?: string;
89
+ updatedBy?: string | null;
90
90
  /**
91
91
  * Optional identifier of the user who deleted the restaurant.
92
92
  *
93
93
  * @example "68fc713cb9a5f6ee8fb7ae4g"
94
94
  */
95
- deletedBy?: string;
95
+ deletedBy?: string | null;
96
96
  }
@@ -37,7 +37,7 @@ export interface Translation {
37
37
  *
38
38
  * @example "Dos hamburguesas de carne, salsa especial, lechuga, queso, pepinillos, cebollas en pan de sésamo"
39
39
  */
40
- description?: string;
40
+ description?: string | null;
41
41
  /**
42
42
  * Optional unique identifier of the category this translation belongs to.
43
43
  * Null if this translation is for a product or question.
@@ -45,7 +45,7 @@ export interface Translation {
45
45
  * @example "550e8400-e29b-41d4-a716-446655440000"
46
46
  * @example null
47
47
  */
48
- categoryId?: string;
48
+ categoryId?: string | null;
49
49
  /**
50
50
  * Optional unique identifier of the product this translation belongs to.
51
51
  * Null if this translation is for a category or question.
@@ -53,7 +53,7 @@ export interface Translation {
53
53
  * @example "660e8400-e29b-41d4-a716-446655440001"
54
54
  * @example null
55
55
  */
56
- productId?: string;
56
+ productId?: string | null;
57
57
  /**
58
58
  * Optional unique identifier of the question this translation belongs to.
59
59
  * Null if this translation is for a category or product.
@@ -61,7 +61,7 @@ export interface Translation {
61
61
  * @example "770e8400-e29b-41d4-a716-446655440002"
62
62
  * @example null
63
63
  */
64
- questionId?: string;
64
+ questionId?: string | null;
65
65
  /**
66
66
  * Date and time when the translation was created.
67
67
  *
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Currency code constants for the QeHay platform.
3
+ *
4
+ * This array contains all possible currency codes supported for transactions and financial records.
5
+ * Acts as the single source of truth for currency values across client, waiter, kitchen, and admin modules.
6
+ *
7
+ * - PEN: Peruvian Sol
8
+ * - USD: United States Dollar
9
+ * - EUR: Euro
10
+ * - BRL: Brazilian Real
11
+ * - COP: Colombian Peso
12
+ * - CLP: Chilean Peso
13
+ * - MXN: Mexican Peso
14
+ * - ARS: Argentine Peso
15
+ *
16
+ * @since 2.0.0
17
+ */
18
+ export declare const CURRENCIES: readonly ["PEN", "USD"];
19
+ /**
20
+ * Type representing all supported currency codes within the QeHay platform.
21
+ * @see CURRENCIES
22
+ *
23
+ * @example CurrencyCode.PEN
24
+ * @example CurrencyCode.USD
25
+ */
26
+ export type CurrencyCode = (typeof CURRENCIES)[number];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Currency code constants for the QeHay platform.
3
+ *
4
+ * This array contains all possible currency codes supported for transactions and financial records.
5
+ * Acts as the single source of truth for currency values across client, waiter, kitchen, and admin modules.
6
+ *
7
+ * - PEN: Peruvian Sol
8
+ * - USD: United States Dollar
9
+ * - EUR: Euro
10
+ * - BRL: Brazilian Real
11
+ * - COP: Colombian Peso
12
+ * - CLP: Chilean Peso
13
+ * - MXN: Mexican Peso
14
+ * - ARS: Argentine Peso
15
+ *
16
+ * @since 2.0.0
17
+ */
18
+ export const CURRENCIES = ["PEN", "USD"];
@@ -1,2 +1,4 @@
1
1
  export * from './order-mode.type.js';
2
2
  export * from './order-status.type.js';
3
+ export * from "./currency.type.js";
4
+ export * from "./product-status.type.js";
@@ -1,2 +1,4 @@
1
1
  export * from './order-mode.type.js';
2
2
  export * from './order-status.type.js';
3
+ export * from "./currency.type.js";
4
+ export * from "./product-status.type.js";
@@ -20,4 +20,4 @@ export declare const ORDER_MODES: readonly ["DINE_IN", "DELIVERY", "PICKUP"];
20
20
  *
21
21
  * @example OrderMode.DINE_IN
22
22
  */
23
- export type OrderMode = typeof ORDER_MODES[number];
23
+ export type OrderMode = (typeof ORDER_MODES)[number];
@@ -13,8 +13,4 @@
13
13
  *
14
14
  * @since 2.0.0
15
15
  */
16
- export const ORDER_MODES = [
17
- 'DINE_IN',
18
- 'DELIVERY',
19
- 'PICKUP',
20
- ];
16
+ export const ORDER_MODES = ["DINE_IN", "DELIVERY", "PICKUP"];
@@ -19,4 +19,4 @@ export declare const ORDER_STATUS: readonly ["CREATED", "PENDING_CONFIRMATION",
19
19
  * Type representing all possible statuses for an order within the QeHay platform.
20
20
  * @see ORDER_STATUS
21
21
  */
22
- export type OrderStatus = typeof ORDER_STATUS[number];
22
+ export type OrderStatus = (typeof ORDER_STATUS)[number];
@@ -19,49 +19,49 @@ export const ORDER_STATUS = [
19
19
  * The order has been created but not yet confirmed by the waiter or payment.
20
20
  * This is the initial state for all new orders.
21
21
  */
22
- 'CREATED',
22
+ "CREATED",
23
23
  /**
24
24
  * The order is awaiting confirmation (e.g., by waiter for in-dinner).
25
25
  */
26
- 'PENDING_CONFIRMATION',
26
+ "PENDING_CONFIRMATION",
27
27
  /**
28
28
  * The order was confirmed for preparation (either by payment or by waiter).
29
29
  */
30
- 'CONFIRMED',
30
+ "CONFIRMED",
31
31
  /**
32
32
  * The order is currently being prepared/cooked by the kitchen.
33
33
  */
34
- 'COOKING',
34
+ "COOKING",
35
35
  /**
36
36
  * The order is ready and waiting for further action (serving, pickup, or delivery).
37
37
  */
38
- 'READY',
38
+ "READY",
39
39
  /**
40
40
  * The order has been served to the table (for dine-in).
41
41
  */
42
- 'SERVED',
42
+ "SERVED",
43
43
  /**
44
44
  * The order is ready for the customer to pick up at the venue.
45
45
  */
46
- 'READY_FOR_PICKUP',
46
+ "READY_FOR_PICKUP",
47
47
  /**
48
48
  * The order is ready for delivery (awaiting delivery person pickup).
49
49
  */
50
- 'READY_FOR_DELIVERY',
50
+ "READY_FOR_DELIVERY",
51
51
  /**
52
52
  * The order has been delivered to the customer (for delivery).
53
53
  */
54
- 'DELIVERED',
54
+ "DELIVERED",
55
55
  /**
56
56
  * The order has been picked up by the customer (for takeaway).
57
57
  */
58
- 'PICKED_UP',
58
+ "PICKED_UP",
59
59
  /**
60
60
  * The entire order process has been completed and closed.
61
61
  */
62
- 'COMPLETED',
62
+ "COMPLETED",
63
63
  /**
64
64
  * The order was cancelled before completion (by user or staff).
65
65
  */
66
- 'CANCELLED',
66
+ "CANCELLED",
67
67
  ];
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Product status code constants for the QeHay platform.
3
+ *
4
+ * This array contains all possible status codes supported for products and inventory management.
5
+ * Serves as a single source of truth for product availability across client, waiter, kitchen, and admin modules.
6
+ *
7
+ * - ACTIVE: Product is active and available for ordering.
8
+ * - INACTIVE: Product is inactive and not available for ordering.
9
+ * - OUT_OF_STOCK: Product is temporarily out of stock and cannot be ordered.
10
+ *
11
+ * @since 2.0.0
12
+ */
13
+ export declare const PRODUCT_STATUS: readonly ["ACTIVE", "INACTIVE", "OUT_OF_STOCK"];
14
+ /**
15
+ * Type representing all possible product statuses within the QeHay platform.
16
+ * @see PRODUCT_STATUS
17
+ *
18
+ * @example
19
+ * import { ProductStatus } from './product-status.enum';
20
+ *
21
+ * function isAvailable(status: ProductStatus): boolean {
22
+ * return status === 'ACTIVE';
23
+ * }
24
+ */
25
+ export type ProductStatus = (typeof PRODUCT_STATUS)[number];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Product status code constants for the QeHay platform.
3
+ *
4
+ * This array contains all possible status codes supported for products and inventory management.
5
+ * Serves as a single source of truth for product availability across client, waiter, kitchen, and admin modules.
6
+ *
7
+ * - ACTIVE: Product is active and available for ordering.
8
+ * - INACTIVE: Product is inactive and not available for ordering.
9
+ * - OUT_OF_STOCK: Product is temporarily out of stock and cannot be ordered.
10
+ *
11
+ * @since 2.0.0
12
+ */
13
+ export const PRODUCT_STATUS = [
14
+ 'ACTIVE',
15
+ 'INACTIVE',
16
+ 'OUT_OF_STOCK',
17
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qeai-sdk",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "In this version we have added the interfaces for the qhay sdk",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,21 +0,0 @@
1
- /**
2
- * Enumerates all supported currency codes for transactions and financial records across the QeHay platform.
3
- *
4
- * @enum Currency
5
- * @since 2.0.0
6
- *
7
- * @remarks
8
- * This enum adheres to the ISO 4217 international standard for currency codes.
9
- * It ensures consistent and type-safe usage of currency identifiers throughout the system.
10
- * Extend this enumeration when adding support for new currencies across product, payment, or report modules.
11
- */
12
- export declare enum Currency {
13
- PEN = "PEN",// Peruvian Sol
14
- USD = "USD",// United States Dollar
15
- EUR = "EUR",// Euro
16
- BRL = "BRL",// Brazilian Real
17
- COP = "COP",// Colombian Peso
18
- CLP = "CLP",// Chilean Peso
19
- MXN = "MXN",// Mexican Peso
20
- ARS = "ARS"
21
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * Enumerates all supported currency codes for transactions and financial records across the QeHay platform.
3
- *
4
- * @enum Currency
5
- * @since 2.0.0
6
- *
7
- * @remarks
8
- * This enum adheres to the ISO 4217 international standard for currency codes.
9
- * It ensures consistent and type-safe usage of currency identifiers throughout the system.
10
- * Extend this enumeration when adding support for new currencies across product, payment, or report modules.
11
- */
12
- export var Currency;
13
- (function (Currency) {
14
- Currency["PEN"] = "PEN";
15
- Currency["USD"] = "USD";
16
- Currency["EUR"] = "EUR";
17
- Currency["BRL"] = "BRL";
18
- Currency["COP"] = "COP";
19
- Currency["CLP"] = "CLP";
20
- Currency["MXN"] = "MXN";
21
- Currency["ARS"] = "ARS";
22
- })(Currency || (Currency = {}));
@@ -1,55 +0,0 @@
1
- /**
2
- * Enumerates all possible statuses for a product within the QeHay platform.
3
- *
4
- * @enum ProductStatus
5
- * @since 2.0.0
6
- *
7
- * @description
8
- * This enum standardizes product status representation across all modules.
9
- * It defines the availability and operational state of products,
10
- * used for inventory management, ordering, and display logic.
11
- *
12
- * @remarks
13
- * - Used in both DTOs and interfaces for consistency.
14
- * - Status affects product visibility and orderability.
15
- * - Products can transition between statuses based on stock and availability.
16
- *
17
- * @property ACTIVE Product is active and available for ordering.
18
- * @property INACTIVE Product is inactive and not available for ordering.
19
- * @property OUT_OF_STOCK Product is temporarily out of stock.
20
- *
21
- * @example
22
- * ```
23
- * import { ProductStatus } from './product-status.enum';
24
- *
25
- * function isAvailable(status: ProductStatus): boolean {
26
- * return status === ProductStatus.ACTIVE;
27
- * }
28
- * ```
29
- */
30
- export declare enum ProductStatus {
31
- /**
32
- * Product is active and available for ordering.
33
- * This is the default status for new products.
34
- * Product appears in menus and can be ordered.
35
- *
36
- * @example ProductStatus.ACTIVE
37
- */
38
- ACTIVE = "ACTIVE",
39
- /**
40
- * Product is inactive and not available for ordering.
41
- * Product does not appear in menus and cannot be ordered.
42
- * Used for temporarily disabled products or seasonal items.
43
- *
44
- * @example ProductStatus.INACTIVE
45
- */
46
- INACTIVE = "INACTIVE",
47
- /**
48
- * Product is temporarily out of stock.
49
- * Product may appear in menus but cannot be ordered.
50
- * Used when product is unavailable but expected to return.
51
- *
52
- * @example ProductStatus.OUT_OF_STOCK
53
- */
54
- OUT_OF_STOCK = "OUT_OF_STOCK"
55
- }
@@ -1,56 +0,0 @@
1
- /**
2
- * Enumerates all possible statuses for a product within the QeHay platform.
3
- *
4
- * @enum ProductStatus
5
- * @since 2.0.0
6
- *
7
- * @description
8
- * This enum standardizes product status representation across all modules.
9
- * It defines the availability and operational state of products,
10
- * used for inventory management, ordering, and display logic.
11
- *
12
- * @remarks
13
- * - Used in both DTOs and interfaces for consistency.
14
- * - Status affects product visibility and orderability.
15
- * - Products can transition between statuses based on stock and availability.
16
- *
17
- * @property ACTIVE Product is active and available for ordering.
18
- * @property INACTIVE Product is inactive and not available for ordering.
19
- * @property OUT_OF_STOCK Product is temporarily out of stock.
20
- *
21
- * @example
22
- * ```
23
- * import { ProductStatus } from './product-status.enum';
24
- *
25
- * function isAvailable(status: ProductStatus): boolean {
26
- * return status === ProductStatus.ACTIVE;
27
- * }
28
- * ```
29
- */
30
- export var ProductStatus;
31
- (function (ProductStatus) {
32
- /**
33
- * Product is active and available for ordering.
34
- * This is the default status for new products.
35
- * Product appears in menus and can be ordered.
36
- *
37
- * @example ProductStatus.ACTIVE
38
- */
39
- ProductStatus["ACTIVE"] = "ACTIVE";
40
- /**
41
- * Product is inactive and not available for ordering.
42
- * Product does not appear in menus and cannot be ordered.
43
- * Used for temporarily disabled products or seasonal items.
44
- *
45
- * @example ProductStatus.INACTIVE
46
- */
47
- ProductStatus["INACTIVE"] = "INACTIVE";
48
- /**
49
- * Product is temporarily out of stock.
50
- * Product may appear in menus but cannot be ordered.
51
- * Used when product is unavailable but expected to return.
52
- *
53
- * @example ProductStatus.OUT_OF_STOCK
54
- */
55
- ProductStatus["OUT_OF_STOCK"] = "OUT_OF_STOCK";
56
- })(ProductStatus || (ProductStatus = {}));