chopme-frontend-common 1.0.59 → 1.0.60

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.
@@ -0,0 +1,60 @@
1
+ import { z } from "zod";
2
+ import { EnumRestaurantType } from "../enums/restaurant-types";
3
+ export declare const restaurantAddressSchema: z.ZodObject<{
4
+ country: z.ZodString;
5
+ city: z.ZodString;
6
+ longName: z.ZodOptional<z.ZodString>;
7
+ countryCode: z.ZodString;
8
+ state: z.ZodOptional<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export declare const restaurantLocationSchema: z.ZodObject<{
11
+ type: z.ZodLiteral<"Point">;
12
+ coordinates: z.ZodArray<z.ZodNumber>;
13
+ }, z.core.$strip>;
14
+ export declare const deliveryPricingKmSchema: z.ZodObject<{
15
+ from: z.ZodNumber;
16
+ to: z.ZodNumber;
17
+ price: z.ZodNumber;
18
+ }, z.core.$strip>;
19
+ export declare const availabilitySchema: z.ZodObject<{
20
+ day: z.ZodString;
21
+ openTime: z.ZodString;
22
+ closeTime: z.ZodString;
23
+ }, z.core.$strip>;
24
+ export declare const createRestaurantSchema: z.ZodObject<{
25
+ fullName: z.ZodString;
26
+ email: z.ZodString;
27
+ password: z.ZodString;
28
+ name: z.ZodString;
29
+ slogan: z.ZodOptional<z.ZodString>;
30
+ description: z.ZodOptional<z.ZodString>;
31
+ phone: z.ZodOptional<z.ZodString>;
32
+ restaurantEmail: z.ZodOptional<z.ZodString>;
33
+ type: z.ZodEnum<typeof EnumRestaurantType>;
34
+ address: z.ZodObject<{
35
+ country: z.ZodString;
36
+ city: z.ZodString;
37
+ longName: z.ZodOptional<z.ZodString>;
38
+ countryCode: z.ZodString;
39
+ state: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ location: z.ZodObject<{
42
+ type: z.ZodLiteral<"Point">;
43
+ coordinates: z.ZodArray<z.ZodNumber>;
44
+ }, z.core.$strip>;
45
+ deliveryPricingKm: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ from: z.ZodNumber;
47
+ to: z.ZodNumber;
48
+ price: z.ZodNumber;
49
+ }, z.core.$strip>>>;
50
+ availability: z.ZodOptional<z.ZodArray<z.ZodObject<{
51
+ day: z.ZodString;
52
+ openTime: z.ZodString;
53
+ closeTime: z.ZodString;
54
+ }, z.core.$strip>>>;
55
+ }, z.core.$strip>;
56
+ export type CreateRestaurantDto = z.infer<typeof createRestaurantSchema>;
57
+ export type RestaurantAddressDto = z.infer<typeof restaurantAddressSchema>;
58
+ export type RestaurantLocationDto = z.infer<typeof restaurantLocationSchema>;
59
+ export type DeliveryPricingKmDto = z.infer<typeof deliveryPricingKmSchema>;
60
+ export type AvailabilityDto = z.infer<typeof availabilitySchema>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRestaurantSchema = exports.availabilitySchema = exports.deliveryPricingKmSchema = exports.restaurantLocationSchema = exports.restaurantAddressSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const restaurant_types_1 = require("../enums/restaurant-types");
6
+ exports.restaurantAddressSchema = zod_1.z.object({
7
+ country: zod_1.z.string().min(1, "Country is required"),
8
+ city: zod_1.z.string().min(1, "City is required"),
9
+ longName: zod_1.z.string().optional(),
10
+ countryCode: zod_1.z.string().min(1, "Country code is required"),
11
+ state: zod_1.z.string().optional(),
12
+ });
13
+ exports.restaurantLocationSchema = zod_1.z.object({
14
+ type: zod_1.z.literal("Point"),
15
+ coordinates: zod_1.z.array(zod_1.z.number()).length(2),
16
+ });
17
+ exports.deliveryPricingKmSchema = zod_1.z.object({
18
+ from: zod_1.z.number(),
19
+ to: zod_1.z.number(),
20
+ price: zod_1.z.number(),
21
+ });
22
+ exports.availabilitySchema = zod_1.z.object({
23
+ day: zod_1.z.string().min(1, "Day is required"),
24
+ openTime: zod_1.z.string().min(1, "Open time is required"),
25
+ closeTime: zod_1.z.string().min(1, "Close time is required"),
26
+ });
27
+ exports.createRestaurantSchema = zod_1.z.object({
28
+ fullName: zod_1.z.string().min(1, "Full name is required"),
29
+ email: zod_1.z.string().email("Enter a valid email address"),
30
+ password: zod_1.z
31
+ .string()
32
+ .min(8, "Password must be at least 8 characters long")
33
+ .regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\w\s]).+$/, "Password must contain uppercase, lowercase, number and special character"),
34
+ name: zod_1.z.string().min(1, "Restaurant name is required"),
35
+ slogan: zod_1.z.string().optional(),
36
+ description: zod_1.z.string().optional(),
37
+ phone: zod_1.z
38
+ .string()
39
+ .regex(/^\+2376\d{8}$/, "Phone number must be a valid Cameroonian number in the format +237620487789")
40
+ .optional(),
41
+ restaurantEmail: zod_1.z.string().optional(),
42
+ type: zod_1.z.nativeEnum(restaurant_types_1.EnumRestaurantType),
43
+ address: exports.restaurantAddressSchema,
44
+ location: exports.restaurantLocationSchema,
45
+ deliveryPricingKm: zod_1.z.array(exports.deliveryPricingKmSchema).optional(),
46
+ availability: zod_1.z.array(exports.availabilitySchema).optional(),
47
+ });
@@ -3,8 +3,10 @@ export * from "./create-client.dto";
3
3
  export * from "./create-menu.dto";
4
4
  export * from "./create-order.dto";
5
5
  export * from "./create-restaurant-member.dto";
6
+ export * from "./create-restaurant.dto";
6
7
  export * from "./email-password-login.dto";
7
8
  export * from "./update-address.dto";
9
+ export * from "./update-restaurant.dto";
8
10
  export * from "./find-restaurant.dto";
9
11
  export * from "./create-rating.dto";
10
12
  export * from "./update-user-profile.dto";
@@ -19,8 +19,10 @@ __exportStar(require("./create-client.dto"), exports);
19
19
  __exportStar(require("./create-menu.dto"), exports);
20
20
  __exportStar(require("./create-order.dto"), exports);
21
21
  __exportStar(require("./create-restaurant-member.dto"), exports);
22
+ __exportStar(require("./create-restaurant.dto"), exports);
22
23
  __exportStar(require("./email-password-login.dto"), exports);
23
24
  __exportStar(require("./update-address.dto"), exports);
25
+ __exportStar(require("./update-restaurant.dto"), exports);
24
26
  __exportStar(require("./find-restaurant.dto"), exports);
25
27
  __exportStar(require("./create-rating.dto"), exports);
26
28
  __exportStar(require("./update-user-profile.dto"), exports);
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ import { EnumRestaurantType } from "../enums/restaurant-types";
3
+ export declare const updateRestaurantSchema: z.ZodObject<{
4
+ slogan: z.ZodOptional<z.ZodString>;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ phone: z.ZodOptional<z.ZodString>;
7
+ restaurantEmail: z.ZodOptional<z.ZodString>;
8
+ pictures: z.ZodOptional<z.ZodArray<z.ZodString>>;
9
+ deliveryPricingKm: z.ZodOptional<z.ZodArray<z.ZodObject<{
10
+ from: z.ZodNumber;
11
+ to: z.ZodNumber;
12
+ price: z.ZodNumber;
13
+ }, z.core.$strip>>>;
14
+ availability: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
+ day: z.ZodString;
16
+ openTime: z.ZodString;
17
+ closeTime: z.ZodString;
18
+ }, z.core.$strip>>>;
19
+ }, z.core.$strip>;
20
+ export declare const adminUpdateRestaurantSchema: z.ZodObject<{
21
+ name: z.ZodOptional<z.ZodString>;
22
+ type: z.ZodOptional<z.ZodEnum<typeof EnumRestaurantType>>;
23
+ address: z.ZodOptional<z.ZodObject<{
24
+ country: z.ZodString;
25
+ city: z.ZodString;
26
+ longName: z.ZodOptional<z.ZodString>;
27
+ countryCode: z.ZodString;
28
+ state: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>>;
30
+ location: z.ZodOptional<z.ZodObject<{
31
+ type: z.ZodLiteral<"Point">;
32
+ coordinates: z.ZodArray<z.ZodNumber>;
33
+ }, z.core.$strip>>;
34
+ }, z.core.$strip>;
35
+ export type UpdateRestaurantDto = z.infer<typeof updateRestaurantSchema>;
36
+ export type AdminUpdateRestaurantDto = z.infer<typeof adminUpdateRestaurantSchema>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adminUpdateRestaurantSchema = exports.updateRestaurantSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const restaurant_types_1 = require("../enums/restaurant-types");
6
+ const create_restaurant_dto_1 = require("./create-restaurant.dto");
7
+ exports.updateRestaurantSchema = zod_1.z.object({
8
+ slogan: zod_1.z.string().optional(),
9
+ description: zod_1.z.string().optional(),
10
+ phone: zod_1.z
11
+ .string()
12
+ .regex(/^\+2376\d{8}$/, "Phone number must be a valid Cameroonian number in the format +237620487789")
13
+ .optional(),
14
+ restaurantEmail: zod_1.z.string().optional(),
15
+ pictures: zod_1.z.array(zod_1.z.string()).optional(),
16
+ deliveryPricingKm: zod_1.z.array(create_restaurant_dto_1.deliveryPricingKmSchema).optional(),
17
+ availability: zod_1.z.array(create_restaurant_dto_1.availabilitySchema).optional(),
18
+ });
19
+ exports.adminUpdateRestaurantSchema = zod_1.z.object({
20
+ name: zod_1.z.string().optional(),
21
+ type: zod_1.z.nativeEnum(restaurant_types_1.EnumRestaurantType).optional(),
22
+ address: create_restaurant_dto_1.restaurantAddressSchema.optional(),
23
+ location: create_restaurant_dto_1.restaurantLocationSchema.optional(),
24
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chopme-frontend-common",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",