chopme-frontend-common 1.0.53 → 1.0.55
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/build/dto/create-category.dto.d.ts +6 -0
- package/build/dto/create-category.dto.js +8 -0
- package/build/dto/create-menu.dto.d.ts +9 -0
- package/build/dto/create-menu.dto.js +17 -0
- package/build/dto/index.d.ts +2 -0
- package/build/dto/index.js +2 -0
- package/build/enums/response-status-code.d.ts +2 -1
- package/build/enums/response-status-code.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCategorySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.createCategorySchema = zod_1.z.object({
|
|
6
|
+
name: zod_1.z.string().min(1, "Category name is required"),
|
|
7
|
+
description: zod_1.z.string().optional(),
|
|
8
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const createMenuSchema: (roundToNearestFCFA?: number) => z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
category: z.ZodString;
|
|
5
|
+
description: z.ZodOptional<z.ZodString>;
|
|
6
|
+
price: z.ZodCoercedNumber<unknown>;
|
|
7
|
+
available: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type CreateMenuDto = z.infer<ReturnType<typeof createMenuSchema>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMenuSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const createMenuSchema = (roundToNearestFCFA = 5) => zod_1.z.object({
|
|
6
|
+
name: zod_1.z.string().min(1, "Menu name is required"),
|
|
7
|
+
category: zod_1.z.string().min(1, "Category is required"),
|
|
8
|
+
description: zod_1.z.string().optional(),
|
|
9
|
+
price: zod_1.z.coerce
|
|
10
|
+
.number({ message: "Price must be a number" })
|
|
11
|
+
.min(0, "Price must be at least 0")
|
|
12
|
+
.refine((val) => val % roundToNearestFCFA === 0, {
|
|
13
|
+
message: `Price must be divisible by ${roundToNearestFCFA}`,
|
|
14
|
+
}),
|
|
15
|
+
available: zod_1.z.boolean().optional(),
|
|
16
|
+
});
|
|
17
|
+
exports.createMenuSchema = createMenuSchema;
|
package/build/dto/index.d.ts
CHANGED
package/build/dto/index.js
CHANGED
|
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create-category.dto"), exports);
|
|
17
18
|
__exportStar(require("./create-client.dto"), exports);
|
|
19
|
+
__exportStar(require("./create-menu.dto"), exports);
|
|
18
20
|
__exportStar(require("./create-order.dto"), exports);
|
|
19
21
|
__exportStar(require("./create-restaurant-member.dto"), exports);
|
|
20
22
|
__exportStar(require("./email-password-login.dto"), exports);
|
|
@@ -53,5 +53,6 @@ export declare enum EnumStatusCode {
|
|
|
53
53
|
WALLET_EXISTS_ALREADY = "WALLET_EXISTS_ALREADY",
|
|
54
54
|
NO_WALLET = "NO_WALLET",
|
|
55
55
|
UNABLE_TO_START_TRANSFER = "UNABLE_TO_START_TRANSFER",
|
|
56
|
-
STARTED_SUCCESSFULLY = "STARTED_SUCCESSFULLY"
|
|
56
|
+
STARTED_SUCCESSFULLY = "STARTED_SUCCESSFULLY",
|
|
57
|
+
CATEGORY_IN_USE = "CATEGORY_IN_USE"
|
|
57
58
|
}
|
|
@@ -58,4 +58,5 @@ var EnumStatusCode;
|
|
|
58
58
|
EnumStatusCode["NO_WALLET"] = "NO_WALLET";
|
|
59
59
|
EnumStatusCode["UNABLE_TO_START_TRANSFER"] = "UNABLE_TO_START_TRANSFER";
|
|
60
60
|
EnumStatusCode["STARTED_SUCCESSFULLY"] = "STARTED_SUCCESSFULLY";
|
|
61
|
+
EnumStatusCode["CATEGORY_IN_USE"] = "CATEGORY_IN_USE";
|
|
61
62
|
})(EnumStatusCode || (exports.EnumStatusCode = EnumStatusCode = {}));
|