@zyacreatives/shared 2.2.99 → 2.3.1

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.
@@ -193,6 +193,7 @@ export declare const JOB_STATUS: {
193
193
  };
194
194
  export declare const PRODUCT_STATUS: {
195
195
  readonly ACTIVE: "ACTIVE";
196
+ readonly UNDER_REVIEW: "UNDER_REVIEW";
196
197
  readonly DRAFT: "DRAFT";
197
198
  readonly ARCHIVED: "ARCHIVED";
198
199
  readonly DELETED: "DELETED";
package/dist/constants.js CHANGED
@@ -189,7 +189,13 @@ exports.JOB_STATUS = {
189
189
  ARCHIVED: "ARCHIVED",
190
190
  DELETED: "DELETED",
191
191
  };
192
- exports.PRODUCT_STATUS = exports.JOB_STATUS;
192
+ exports.PRODUCT_STATUS = {
193
+ ACTIVE: "ACTIVE",
194
+ UNDER_REVIEW: "UNDER_REVIEW",
195
+ DRAFT: "DRAFT",
196
+ ARCHIVED: "ARCHIVED",
197
+ DELETED: "DELETED",
198
+ };
193
199
  exports.MESSAGE_REQUEST_STATUS = {
194
200
  PENDING: "PENDING",
195
201
  ACCEPTED: "ACCEPTED",
@@ -26,6 +26,7 @@ export declare const ProductDiscountEntitySchema: z.ZodObject<{
26
26
  }>;
27
27
  amount: z.ZodNumber;
28
28
  discountCode: z.ZodOptional<z.ZodString>;
29
+ expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
29
30
  }, z.core.$strip>;
30
31
  export declare const ProductLinkSchema: z.ZodObject<{
31
32
  title: z.ZodNullable<z.ZodString>;
@@ -39,6 +40,7 @@ export declare const BaseProductSchema: z.ZodObject<{
39
40
  deletedAt: z.ZodNullable<z.ZodDate>;
40
41
  status: z.ZodDefault<z.ZodEnum<{
41
42
  readonly ACTIVE: "ACTIVE";
43
+ readonly UNDER_REVIEW: "UNDER_REVIEW";
42
44
  readonly DRAFT: "DRAFT";
43
45
  readonly ARCHIVED: "ARCHIVED";
44
46
  readonly DELETED: "DELETED";
@@ -80,7 +82,7 @@ export declare const BaseProductSchema: z.ZodObject<{
80
82
  }>;
81
83
  amount: z.ZodNumber;
82
84
  discountCode: z.ZodNullable<z.ZodOptional<z.ZodString>>;
83
- expiry: z.ZodNullable<z.ZodOptional<z.ZodISODateTime>>;
85
+ expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
84
86
  }, z.core.$strip>>>;
85
87
  supportEmail: z.ZodNullable<z.ZodString>;
86
88
  supportPhone: z.ZodNullable<z.ZodString>;
@@ -92,6 +94,7 @@ export declare const CreateProductInputSchema: z.ZodObject<{
92
94
  keyFeatures: z.ZodString;
93
95
  status: z.ZodDefault<z.ZodEnum<{
94
96
  readonly ACTIVE: "ACTIVE";
97
+ readonly UNDER_REVIEW: "UNDER_REVIEW";
95
98
  readonly DRAFT: "DRAFT";
96
99
  readonly ARCHIVED: "ARCHIVED";
97
100
  readonly DELETED: "DELETED";
@@ -140,6 +143,7 @@ export declare const CreateProductInputSchema: z.ZodObject<{
140
143
  }>;
141
144
  amount: z.ZodNumber;
142
145
  discountCode: z.ZodOptional<z.ZodString>;
146
+ expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
143
147
  }, z.core.$strip>>>;
144
148
  }, z.core.$strip>;
145
149
  export declare const ProductServiceAndComplianceInputSchema: z.ZodObject<{
@@ -157,6 +161,7 @@ export declare const UpdateProductInputSchema: z.ZodObject<{
157
161
  keyFeatures: z.ZodOptional<z.ZodString>;
158
162
  status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
159
163
  readonly ACTIVE: "ACTIVE";
164
+ readonly UNDER_REVIEW: "UNDER_REVIEW";
160
165
  readonly DRAFT: "DRAFT";
161
166
  readonly ARCHIVED: "ARCHIVED";
162
167
  readonly DELETED: "DELETED";
@@ -205,6 +210,7 @@ export declare const UpdateProductInputSchema: z.ZodObject<{
205
210
  }>;
206
211
  amount: z.ZodNumber;
207
212
  discountCode: z.ZodOptional<z.ZodString>;
213
+ expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
208
214
  }, z.core.$strip>>>>;
209
215
  supportEmail: z.ZodOptional<z.ZodEmail>;
210
216
  supportPhone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -225,6 +231,7 @@ export declare const ProductEntitySchema: z.ZodObject<{
225
231
  keyFeatures: z.ZodString;
226
232
  status: z.ZodDefault<z.ZodEnum<{
227
233
  readonly ACTIVE: "ACTIVE";
234
+ readonly UNDER_REVIEW: "UNDER_REVIEW";
228
235
  readonly DRAFT: "DRAFT";
229
236
  readonly ARCHIVED: "ARCHIVED";
230
237
  readonly DELETED: "DELETED";
@@ -268,6 +275,7 @@ export declare const ProductEntitySchema: z.ZodObject<{
268
275
  }>;
269
276
  amount: z.ZodNumber;
270
277
  discountCode: z.ZodOptional<z.ZodString>;
278
+ expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
271
279
  }, z.core.$strip>>>;
272
280
  supportEmail: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
273
281
  supportPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -34,6 +34,7 @@ exports.ProductDiscountEntitySchema = zod_openapi_1.z.object({
34
34
  .int("Amount must be a whole number")
35
35
  .min(0, "Discount amount cannot be negative"),
36
36
  discountCode: zod_openapi_1.z.string().optional(),
37
+ expiry: zod_openapi_1.z.coerce.date().optional().nullable(),
37
38
  });
38
39
  exports.ProductLinkSchema = zod_openapi_1.z.object({
39
40
  title: zod_openapi_1.z.string().nullable(),
@@ -62,7 +63,7 @@ exports.BaseProductSchema = zod_openapi_1.z.object({
62
63
  discountType: zod_openapi_1.z.enum(constants_1.DISCOUNT_TYPES),
63
64
  amount: zod_openapi_1.z.number(),
64
65
  discountCode: zod_openapi_1.z.string().optional().nullable(),
65
- expiry: zod_openapi_1.z.iso.datetime().optional().nullable(),
66
+ expiry: zod_openapi_1.z.coerce.date().optional().nullable(),
66
67
  }))
67
68
  .nullable(),
68
69
  supportEmail: zod_openapi_1.z.string().nullable(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.2.99",
3
+ "version": "2.3.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/constants.ts CHANGED
@@ -217,7 +217,13 @@ export const JOB_STATUS = {
217
217
  DELETED: "DELETED",
218
218
  } as const;
219
219
 
220
- export const PRODUCT_STATUS = JOB_STATUS;
220
+ export const PRODUCT_STATUS = {
221
+ ACTIVE: "ACTIVE",
222
+ UNDER_REVIEW: "UNDER_REVIEW",
223
+ DRAFT: "DRAFT",
224
+ ARCHIVED: "ARCHIVED",
225
+ DELETED: "DELETED",
226
+ } as const;
221
227
 
222
228
  export const MESSAGE_REQUEST_STATUS = {
223
229
  PENDING: "PENDING",
@@ -6,7 +6,6 @@ import {
6
6
  WAGES_CURRENCY,
7
7
  } from "../constants";
8
8
 
9
-
10
9
  export const CoverImageInputSchema = z.object({
11
10
  key: z.string().openapi({ description: "Storage key of the uploaded file" }),
12
11
  mimeType: z.string().openapi({ example: "image/jpeg" }),
@@ -20,7 +19,6 @@ export const DeliveryFileInputSchema = z.object({
20
19
  order: z.number().int().default(0),
21
20
  });
22
21
 
23
-
24
22
  export const ProductCoverImageEntitySchema = z.object({
25
23
  fileId: z
26
24
  .cuid2()
@@ -43,6 +41,7 @@ export const ProductDiscountEntitySchema = z.object({
43
41
  .int("Amount must be a whole number")
44
42
  .min(0, "Discount amount cannot be negative"),
45
43
  discountCode: z.string().optional(),
44
+ expiry: z.coerce.date().optional().nullable(),
46
45
  });
47
46
 
48
47
  export const ProductLinkSchema = z.object({
@@ -71,14 +70,13 @@ export const BaseProductSchema = z.object({
71
70
  currency: z.enum(WAGES_CURRENCY),
72
71
  price: z.number().nullable(),
73
72
  suggestedPrice: z.number().nullable(),
74
-
75
73
  discounts: z
76
74
  .array(
77
75
  z.object({
78
76
  discountType: z.enum(DISCOUNT_TYPES),
79
77
  amount: z.number(),
80
78
  discountCode: z.string().optional().nullable(),
81
- expiry: z.iso.datetime().optional().nullable(),
79
+ expiry: z.coerce.date().optional().nullable(),
82
80
  }),
83
81
  )
84
82
  .nullable(),
@@ -86,7 +84,6 @@ export const BaseProductSchema = z.object({
86
84
  supportPhone: z.string().nullable(),
87
85
  });
88
86
 
89
-
90
87
  const ProductCoreInputSchema = z.object({
91
88
  id: z.cuid2().openapi({ description: "Client-generated ID for the product" }),
92
89