@gigapay-dev/contracts 1.0.9 → 1.1.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.
- package/build/commands/orders/endpoints.js +2 -4
- package/build/commands/promocodes/create.js +2 -2
- package/build/commands/promocodes/read.js +3 -3
- package/build/commands/promocodes/update.js +2 -2
- package/commands/orders/endpoints.ts +2 -4
- package/commands/promocodes/create.ts +2 -2
- package/commands/promocodes/read.ts +3 -3
- package/commands/promocodes/update.ts +2 -2
- package/package.json +1 -1
|
@@ -30,10 +30,8 @@ exports.OrderEndpoints = {
|
|
|
30
30
|
},
|
|
31
31
|
getUserOrders: {
|
|
32
32
|
method: "GET",
|
|
33
|
-
path: "/orders/user
|
|
34
|
-
request: zod_1.default.object({
|
|
35
|
-
userId: zod_1.default.coerce.number().positive(),
|
|
36
|
-
}),
|
|
33
|
+
path: "/orders/user",
|
|
34
|
+
request: zod_1.default.object({}),
|
|
37
35
|
response: zod_1.default.array(read_1.OrderReadResponseSchema),
|
|
38
36
|
},
|
|
39
37
|
getUserOrderById: {
|
|
@@ -7,8 +7,8 @@ exports.PromoCodeCreateSchema = zod_1.z.object({
|
|
|
7
7
|
value: zod_1.z.string(),
|
|
8
8
|
discountValue: zod_1.z.string(),
|
|
9
9
|
expiredAt: zod_1.z.coerce.date().nullable().optional(),
|
|
10
|
-
activationLimit: zod_1.z.number().positive().nullable().optional(),
|
|
11
|
-
activationPerUserLimit: zod_1.z.number().positive().nullable().optional(),
|
|
10
|
+
activationLimit: zod_1.z.coerce.number().positive().nullable().optional(),
|
|
11
|
+
activationPerUserLimit: zod_1.z.coerce.number().positive().nullable().optional(),
|
|
12
12
|
type: enums_1.PromoCodeType,
|
|
13
13
|
status: enums_1.PromoCodeStatus,
|
|
14
14
|
});
|
|
@@ -7,12 +7,12 @@ exports.PromoCodeReadResponseSchema = void 0;
|
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
const enums_1 = require("./enums");
|
|
9
9
|
exports.PromoCodeReadResponseSchema = zod_1.default.object({
|
|
10
|
-
id: zod_1.default.number().positive(),
|
|
10
|
+
id: zod_1.default.coerce.number().positive(),
|
|
11
11
|
value: zod_1.default.string(),
|
|
12
12
|
discountValue: zod_1.default.string(),
|
|
13
13
|
expiredAt: zod_1.default.coerce.date().nullable().optional(),
|
|
14
|
-
activationLimit: zod_1.default.number().positive().nullable().optional(),
|
|
15
|
-
activationPerUserLimit: zod_1.default.number().positive().nullable().optional(),
|
|
14
|
+
activationLimit: zod_1.default.coerce.number().positive().nullable().optional(),
|
|
15
|
+
activationPerUserLimit: zod_1.default.coerce.number().positive().nullable().optional(),
|
|
16
16
|
type: enums_1.PromoCodeType,
|
|
17
17
|
status: enums_1.PromoCodeStatus,
|
|
18
18
|
});
|
|
@@ -7,8 +7,8 @@ exports.PromoCodeUpdateSchema = zod_1.z.object({
|
|
|
7
7
|
value: zod_1.z.string().optional(),
|
|
8
8
|
discountValue: zod_1.z.string().optional(),
|
|
9
9
|
expiredAt: zod_1.z.coerce.date().nullable().optional(),
|
|
10
|
-
activationLimit: zod_1.z.number().positive().nullable().optional(),
|
|
11
|
-
activationPerUserLimit: zod_1.z.number().positive().nullable().optional(),
|
|
10
|
+
activationLimit: zod_1.z.coerce.number().positive().nullable().optional(),
|
|
11
|
+
activationPerUserLimit: zod_1.z.coerce.number().positive().nullable().optional(),
|
|
12
12
|
type: enums_1.PromoCodeType.optional(),
|
|
13
13
|
status: enums_1.PromoCodeStatus.optional(),
|
|
14
14
|
});
|
|
@@ -30,10 +30,8 @@ export const OrderEndpoints = {
|
|
|
30
30
|
},
|
|
31
31
|
getUserOrders: {
|
|
32
32
|
method: "GET",
|
|
33
|
-
path: "/orders/user
|
|
34
|
-
request: z.object({
|
|
35
|
-
userId: z.coerce.number().positive(),
|
|
36
|
-
}),
|
|
33
|
+
path: "/orders/user",
|
|
34
|
+
request: z.object({}),
|
|
37
35
|
response: z.array(OrderReadResponseSchema),
|
|
38
36
|
},
|
|
39
37
|
getUserOrderById: {
|
|
@@ -5,8 +5,8 @@ export const PromoCodeCreateSchema = z.object({
|
|
|
5
5
|
value: z.string(),
|
|
6
6
|
discountValue: z.string(),
|
|
7
7
|
expiredAt: z.coerce.date().nullable().optional(),
|
|
8
|
-
activationLimit: z.number().positive().nullable().optional(),
|
|
9
|
-
activationPerUserLimit: z.number().positive().nullable().optional(),
|
|
8
|
+
activationLimit: z.coerce.number().positive().nullable().optional(),
|
|
9
|
+
activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
|
|
10
10
|
type: PromoCodeType,
|
|
11
11
|
status: PromoCodeStatus,
|
|
12
12
|
});
|
|
@@ -2,12 +2,12 @@ import z from "zod";
|
|
|
2
2
|
import { PromoCodeStatus, PromoCodeType } from "./enums";
|
|
3
3
|
|
|
4
4
|
export const PromoCodeReadResponseSchema = z.object({
|
|
5
|
-
id: z.number().positive(),
|
|
5
|
+
id: z.coerce.number().positive(),
|
|
6
6
|
value: z.string(),
|
|
7
7
|
discountValue: z.string(),
|
|
8
8
|
expiredAt: z.coerce.date().nullable().optional(),
|
|
9
|
-
activationLimit: z.number().positive().nullable().optional(),
|
|
10
|
-
activationPerUserLimit: z.number().positive().nullable().optional(),
|
|
9
|
+
activationLimit: z.coerce.number().positive().nullable().optional(),
|
|
10
|
+
activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
|
|
11
11
|
type: PromoCodeType,
|
|
12
12
|
status: PromoCodeStatus,
|
|
13
13
|
});
|
|
@@ -5,8 +5,8 @@ export const PromoCodeUpdateSchema = z.object({
|
|
|
5
5
|
value: z.string().optional(),
|
|
6
6
|
discountValue: z.string().optional(),
|
|
7
7
|
expiredAt: z.coerce.date().nullable().optional(),
|
|
8
|
-
activationLimit: z.number().positive().nullable().optional(),
|
|
9
|
-
activationPerUserLimit: z.number().positive().nullable().optional(),
|
|
8
|
+
activationLimit: z.coerce.number().positive().nullable().optional(),
|
|
9
|
+
activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
|
|
10
10
|
type: PromoCodeType.optional(),
|
|
11
11
|
status: PromoCodeStatus.optional(),
|
|
12
12
|
})
|