@gigapay-dev/contracts 1.8.6 → 3.0.0
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/README.md +1 -0
- package/build/domains/admin/index.d.ts +150 -0
- package/build/domains/admin/index.d.ts.map +1 -0
- package/build/domains/admin/index.js +72 -0
- package/build/domains/admin/index.js.map +1 -0
- package/build/domains/auth/commands.d.ts +294 -0
- package/build/domains/auth/commands.d.ts.map +1 -0
- package/build/domains/auth/commands.js +116 -0
- package/build/domains/auth/commands.js.map +1 -0
- package/build/domains/auth/dtos.d.ts +37 -0
- package/build/domains/auth/dtos.d.ts.map +1 -0
- package/build/domains/auth/dtos.js +26 -0
- package/build/domains/auth/dtos.js.map +1 -0
- package/build/domains/auth/events.d.ts +35 -0
- package/build/domains/auth/events.d.ts.map +1 -0
- package/build/domains/auth/events.js +24 -0
- package/build/domains/auth/events.js.map +1 -0
- package/build/domains/auth/index.d.ts +165 -0
- package/build/domains/auth/index.d.ts.map +1 -0
- package/build/{commands/products → domains/auth}/index.js +12 -6
- package/build/domains/auth/index.js.map +1 -0
- package/build/domains/auth/queries.d.ts +75 -0
- package/build/domains/auth/queries.d.ts.map +1 -0
- package/build/domains/auth/queries.js +25 -0
- package/build/domains/auth/queries.js.map +1 -0
- package/build/domains/catalog/commands.d.ts +255 -0
- package/build/domains/catalog/commands.d.ts.map +1 -0
- package/build/domains/catalog/commands.js +82 -0
- package/build/domains/catalog/commands.js.map +1 -0
- package/build/domains/catalog/dtos.d.ts +89 -0
- package/build/domains/catalog/dtos.d.ts.map +1 -0
- package/build/domains/catalog/dtos.js +43 -0
- package/build/domains/catalog/dtos.js.map +1 -0
- package/build/domains/catalog/index.d.ts +194 -0
- package/build/domains/catalog/index.d.ts.map +1 -0
- package/build/{commands/payment-methods → domains/catalog}/index.js +11 -4
- package/build/domains/catalog/index.js.map +1 -0
- package/build/domains/catalog/queries.d.ts +168 -0
- package/build/domains/catalog/queries.d.ts.map +1 -0
- package/build/domains/catalog/queries.js +29 -0
- package/build/domains/catalog/queries.js.map +1 -0
- package/build/domains/config/index.d.ts +40 -0
- package/build/domains/config/index.d.ts.map +1 -0
- package/build/domains/config/index.js +18 -0
- package/build/domains/config/index.js.map +1 -0
- package/build/domains/orders/commands.d.ts +262 -0
- package/build/domains/orders/commands.d.ts.map +1 -0
- package/build/domains/orders/commands.js +47 -0
- package/build/domains/orders/commands.js.map +1 -0
- package/build/domains/orders/dtos.d.ts +112 -0
- package/build/domains/orders/dtos.d.ts.map +1 -0
- package/build/domains/orders/dtos.js +44 -0
- package/build/domains/orders/dtos.js.map +1 -0
- package/build/domains/orders/events.d.ts +21 -0
- package/build/domains/orders/events.d.ts.map +1 -0
- package/build/domains/orders/events.js +19 -0
- package/build/domains/orders/events.js.map +1 -0
- package/build/domains/orders/index.d.ts +381 -0
- package/build/domains/orders/index.d.ts.map +1 -0
- package/build/domains/orders/index.js +28 -0
- package/build/domains/orders/index.js.map +1 -0
- package/build/domains/orders/queries.d.ts +532 -0
- package/build/domains/orders/queries.d.ts.map +1 -0
- package/build/domains/orders/queries.js +40 -0
- package/build/domains/orders/queries.js.map +1 -0
- package/build/domains/payments/index.d.ts +96 -0
- package/build/domains/payments/index.d.ts.map +1 -0
- package/build/domains/payments/index.js +34 -0
- package/build/domains/payments/index.js.map +1 -0
- package/build/domains/products/commands.d.ts +302 -0
- package/build/domains/products/commands.d.ts.map +1 -0
- package/build/domains/products/commands.js +101 -0
- package/build/domains/products/commands.js.map +1 -0
- package/build/domains/products/dtos.d.ts +122 -0
- package/build/domains/products/dtos.d.ts.map +1 -0
- package/build/domains/products/dtos.js +54 -0
- package/build/domains/products/dtos.js.map +1 -0
- package/build/domains/products/index.d.ts +276 -0
- package/build/domains/products/index.d.ts.map +1 -0
- package/build/{commands/auth → domains/products}/index.js +11 -5
- package/build/domains/products/index.js.map +1 -0
- package/build/domains/products/queries.d.ts +334 -0
- package/build/domains/products/queries.d.ts.map +1 -0
- package/build/domains/products/queries.js +41 -0
- package/build/domains/products/queries.js.map +1 -0
- package/build/domains/promo-codes/index.d.ts +92 -0
- package/build/domains/promo-codes/index.d.ts.map +1 -0
- package/build/domains/promo-codes/index.js +40 -0
- package/build/domains/promo-codes/index.js.map +1 -0
- package/build/domains/stats/index.d.ts +274 -0
- package/build/domains/stats/index.d.ts.map +1 -0
- package/build/domains/stats/index.js +76 -0
- package/build/domains/stats/index.js.map +1 -0
- package/build/domains/users/dtos.d.ts +9 -0
- package/build/domains/users/dtos.d.ts.map +1 -0
- package/build/domains/users/dtos.js +11 -0
- package/build/domains/users/dtos.js.map +1 -0
- package/build/domains/users/index.d.ts +101 -0
- package/build/domains/users/index.d.ts.map +1 -0
- package/build/domains/users/index.js +52 -0
- package/build/domains/users/index.js.map +1 -0
- package/build/index.d.ts +1310 -1
- package/build/index.d.ts.map +1 -0
- package/build/index.js +35 -1
- package/build/index.js.map +1 -0
- package/build/shared/api-response.d.ts +17 -0
- package/build/shared/api-response.d.ts.map +1 -0
- package/build/shared/api-response.js +22 -0
- package/build/shared/api-response.js.map +1 -0
- package/build/shared/common.d.ts +14 -0
- package/build/shared/common.d.ts.map +1 -0
- package/build/shared/common.js +8 -0
- package/build/shared/common.js.map +1 -0
- package/build/shared/errors.d.ts +34 -0
- package/build/shared/errors.d.ts.map +1 -0
- package/build/shared/errors.js +36 -0
- package/build/shared/errors.js.map +1 -0
- package/build/shared/index.d.ts +7 -0
- package/build/shared/index.d.ts.map +1 -0
- package/build/{commands/orders → shared}/index.js +7 -6
- package/build/shared/index.js.map +1 -0
- package/build/shared/money.d.ts +32 -0
- package/build/shared/money.d.ts.map +1 -0
- package/build/shared/money.js +20 -0
- package/build/shared/money.js.map +1 -0
- package/build/shared/pagination.d.ts +27 -0
- package/build/shared/pagination.d.ts.map +1 -0
- package/build/shared/pagination.js +22 -0
- package/build/shared/pagination.js.map +1 -0
- package/build/shared/types.d.ts +20 -0
- package/build/shared/types.d.ts.map +1 -0
- package/build/{types.js → shared/types.js} +1 -0
- package/build/shared/types.js.map +1 -0
- package/package.json +41 -15
- package/build/commands/api-response.d.ts +0 -18
- package/build/commands/api-response.js +0 -13
- package/build/commands/auth/confirm.d.ts +0 -11
- package/build/commands/auth/confirm.js +0 -11
- package/build/commands/auth/endpoints.d.ts +0 -114
- package/build/commands/auth/endpoints.js +0 -50
- package/build/commands/auth/index.d.ts +0 -5
- package/build/commands/auth/login.d.ts +0 -20
- package/build/commands/auth/login.js +0 -11
- package/build/commands/auth/profile.d.ts +0 -18
- package/build/commands/auth/profile.js +0 -10
- package/build/commands/auth/register.d.ts +0 -12
- package/build/commands/auth/register.js +0 -11
- package/build/commands/auth/reset.d.ts +0 -12
- package/build/commands/auth/reset.js +0 -9
- package/build/commands/consts.d.ts +0 -1
- package/build/commands/consts.js +0 -4
- package/build/commands/index.d.ts +0 -13
- package/build/commands/index.js +0 -29
- package/build/commands/orders/create.d.ts +0 -95
- package/build/commands/orders/create.js +0 -40
- package/build/commands/orders/endpoints.d.ts +0 -726
- package/build/commands/orders/endpoints.js +0 -47
- package/build/commands/orders/enums.d.ts +0 -7
- package/build/commands/orders/enums.js +0 -25
- package/build/commands/orders/index.d.ts +0 -6
- package/build/commands/orders/query.d.ts +0 -103
- package/build/commands/orders/query.js +0 -45
- package/build/commands/orders/read.d.ts +0 -230
- package/build/commands/orders/read.js +0 -81
- package/build/commands/orders/update.d.ts +0 -23
- package/build/commands/orders/update.js +0 -16
- package/build/commands/pagination.d.ts +0 -12
- package/build/commands/pagination.js +0 -11
- package/build/commands/payment-methods/create.d.ts +0 -45
- package/build/commands/payment-methods/create.js +0 -22
- package/build/commands/payment-methods/endpoints.d.ts +0 -536
- package/build/commands/payment-methods/endpoints.js +0 -63
- package/build/commands/payment-methods/index.d.ts +0 -4
- package/build/commands/payment-methods/read.d.ts +0 -71
- package/build/commands/payment-methods/read.js +0 -28
- package/build/commands/payment-methods/update.d.ts +0 -45
- package/build/commands/payment-methods/update.js +0 -19
- package/build/commands/products/create.d.ts +0 -229
- package/build/commands/products/create.js +0 -122
- package/build/commands/products/endpoints.d.ts +0 -1881
- package/build/commands/products/endpoints.js +0 -99
- package/build/commands/products/enums.d.ts +0 -19
- package/build/commands/products/enums.js +0 -27
- package/build/commands/products/index.d.ts +0 -6
- package/build/commands/products/query.d.ts +0 -79
- package/build/commands/products/query.js +0 -55
- package/build/commands/products/read.d.ts +0 -1178
- package/build/commands/products/read.js +0 -231
- package/build/commands/products/update.d.ts +0 -78
- package/build/commands/products/update.js +0 -10
- package/build/commands/promocode-activations/create.d.ts +0 -18
- package/build/commands/promocode-activations/create.js +0 -10
- package/build/commands/promocode-activations/index.d.ts +0 -3
- package/build/commands/promocode-activations/index.js +0 -19
- package/build/commands/promocode-activations/read.d.ts +0 -21
- package/build/commands/promocode-activations/read.js +0 -14
- package/build/commands/promocode-activations/update.d.ts +0 -18
- package/build/commands/promocode-activations/update.js +0 -10
- package/build/commands/promocodes/create.d.ts +0 -39
- package/build/commands/promocodes/create.js +0 -18
- package/build/commands/promocodes/endpoints.d.ts +0 -353
- package/build/commands/promocodes/endpoints.js +0 -46
- package/build/commands/promocodes/enums.d.ts +0 -5
- package/build/commands/promocodes/enums.js +0 -9
- package/build/commands/promocodes/index.d.ts +0 -5
- package/build/commands/promocodes/index.js +0 -21
- package/build/commands/promocodes/read.d.ts +0 -45
- package/build/commands/promocodes/read.js +0 -23
- package/build/commands/promocodes/update.d.ts +0 -33
- package/build/commands/promocodes/update.js +0 -16
- package/build/commands/refresh-sessions/create.d.ts +0 -24
- package/build/commands/refresh-sessions/create.js +0 -13
- package/build/commands/refresh-sessions/enums.d.ts +0 -3
- package/build/commands/refresh-sessions/enums.js +0 -8
- package/build/commands/refresh-sessions/index.d.ts +0 -4
- package/build/commands/refresh-sessions/index.js +0 -20
- package/build/commands/refresh-sessions/read.d.ts +0 -27
- package/build/commands/refresh-sessions/read.js +0 -17
- package/build/commands/refresh-sessions/update.d.ts +0 -24
- package/build/commands/refresh-sessions/update.js +0 -16
- package/build/commands/settings/endpoints.d.ts +0 -108
- package/build/commands/settings/endpoints.js +0 -43
- package/build/commands/settings/index.d.ts +0 -3
- package/build/commands/settings/index.js +0 -19
- package/build/commands/settings/read.d.ts +0 -18
- package/build/commands/settings/read.js +0 -10
- package/build/commands/settings/update.d.ts +0 -18
- package/build/commands/settings/update.js +0 -10
- package/build/commands/stats/endpoints.d.ts +0 -67
- package/build/commands/stats/endpoints.js +0 -13
- package/build/commands/stats/index.d.ts +0 -3
- package/build/commands/stats/index.js +0 -19
- package/build/commands/stats/query.d.ts +0 -31
- package/build/commands/stats/query.js +0 -15
- package/build/commands/stats/read.d.ts +0 -30
- package/build/commands/stats/read.js +0 -17
- package/build/commands/users/create.d.ts +0 -42
- package/build/commands/users/create.js +0 -19
- package/build/commands/users/endpoints.d.ts +0 -403
- package/build/commands/users/endpoints.js +0 -39
- package/build/commands/users/enums.d.ts +0 -6
- package/build/commands/users/enums.js +0 -10
- package/build/commands/users/index.d.ts +0 -6
- package/build/commands/users/index.js +0 -22
- package/build/commands/users/query.d.ts +0 -52
- package/build/commands/users/query.js +0 -21
- package/build/commands/users/read.d.ts +0 -60
- package/build/commands/users/read.js +0 -28
- package/build/commands/users/update.d.ts +0 -42
- package/build/commands/users/update.js +0 -19
- package/build/types.d.ts +0 -8
- package/commands/api-response.ts +0 -10
- package/commands/auth/confirm.ts +0 -10
- package/commands/auth/endpoints.ts +0 -51
- package/commands/auth/index.ts +0 -5
- package/commands/auth/login.ts +0 -13
- package/commands/auth/profile.ts +0 -10
- package/commands/auth/register.ts +0 -8
- package/commands/auth/reset.ts +0 -9
- package/commands/consts.ts +0 -1
- package/commands/index.ts +0 -13
- package/commands/orders/create.ts +0 -41
- package/commands/orders/endpoints.ts +0 -51
- package/commands/orders/enums.ts +0 -25
- package/commands/orders/index.ts +0 -6
- package/commands/orders/query.ts +0 -46
- package/commands/orders/read.ts +0 -83
- package/commands/orders/update.ts +0 -16
- package/commands/pagination.ts +0 -8
- package/commands/payment-methods/create.ts +0 -19
- package/commands/payment-methods/endpoints.ts +0 -67
- package/commands/payment-methods/index.ts +0 -4
- package/commands/payment-methods/read.ts +0 -30
- package/commands/payment-methods/update.ts +0 -19
- package/commands/products/create.ts +0 -134
- package/commands/products/endpoints.ts +0 -108
- package/commands/products/enums.ts +0 -33
- package/commands/products/index.ts +0 -6
- package/commands/products/query.ts +0 -52
- package/commands/products/read.ts +0 -268
- package/commands/products/update.ts +0 -11
- package/commands/promocode-activations/create.ts +0 -10
- package/commands/promocode-activations/index.ts +0 -3
- package/commands/promocode-activations/read.ts +0 -11
- package/commands/promocode-activations/update.ts +0 -10
- package/commands/promocodes/create.ts +0 -18
- package/commands/promocodes/endpoints.ts +0 -62
- package/commands/promocodes/enums.ts +0 -9
- package/commands/promocodes/index.ts +0 -5
- package/commands/promocodes/read.ts +0 -20
- package/commands/promocodes/update.ts +0 -16
- package/commands/refresh-sessions/create.ts +0 -13
- package/commands/refresh-sessions/enums.ts +0 -4
- package/commands/refresh-sessions/index.ts +0 -4
- package/commands/refresh-sessions/read.ts +0 -14
- package/commands/refresh-sessions/update.ts +0 -13
- package/commands/settings/endpoints.ts +0 -52
- package/commands/settings/index.ts +0 -3
- package/commands/settings/read.ts +0 -10
- package/commands/settings/update.ts +0 -10
- package/commands/stats/endpoints.ts +0 -23
- package/commands/stats/index.ts +0 -3
- package/commands/stats/query.ts +0 -18
- package/commands/stats/read.ts +0 -14
- package/commands/users/create.ts +0 -19
- package/commands/users/endpoints.ts +0 -47
- package/commands/users/enums.ts +0 -10
- package/commands/users/index.ts +0 -6
- package/commands/users/query.ts +0 -20
- package/commands/users/read.ts +0 -25
- package/commands/users/update.ts +0 -19
- package/index.ts +0 -1
- package/tsconfig.json +0 -111
- package/types.ts +0 -9
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const UserUpdateSchema: z.ZodObject<{
|
|
3
|
-
username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4
|
-
picture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
-
email: z.ZodOptional<z.ZodString>;
|
|
6
|
-
password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
-
provider: z.ZodOptional<z.ZodEnum<["GOOGLE", "STEAM"]>>;
|
|
8
|
-
steamId: z.ZodOptional<z.ZodString>;
|
|
9
|
-
telegramId: z.ZodOptional<z.ZodString>;
|
|
10
|
-
vkId: z.ZodOptional<z.ZodString>;
|
|
11
|
-
googleId: z.ZodOptional<z.ZodString>;
|
|
12
|
-
isConfirmEmail: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
-
role: z.ZodOptional<z.ZodEnum<["USER", "ADMIN", "NO_AUTH"]>>;
|
|
14
|
-
status: z.ZodOptional<z.ZodEnum<["ACTIVE", "BLOCKED"]>>;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
email?: string | undefined;
|
|
17
|
-
password?: string | null | undefined;
|
|
18
|
-
status?: "ACTIVE" | "BLOCKED" | undefined;
|
|
19
|
-
username?: string | null | undefined;
|
|
20
|
-
telegramId?: string | undefined;
|
|
21
|
-
picture?: string | null | undefined;
|
|
22
|
-
steamId?: string | undefined;
|
|
23
|
-
vkId?: string | undefined;
|
|
24
|
-
googleId?: string | undefined;
|
|
25
|
-
isConfirmEmail?: boolean | undefined;
|
|
26
|
-
role?: "USER" | "ADMIN" | "NO_AUTH" | undefined;
|
|
27
|
-
provider?: "GOOGLE" | "STEAM" | undefined;
|
|
28
|
-
}, {
|
|
29
|
-
email?: string | undefined;
|
|
30
|
-
password?: string | null | undefined;
|
|
31
|
-
status?: "ACTIVE" | "BLOCKED" | undefined;
|
|
32
|
-
username?: string | null | undefined;
|
|
33
|
-
telegramId?: string | undefined;
|
|
34
|
-
picture?: string | null | undefined;
|
|
35
|
-
steamId?: string | undefined;
|
|
36
|
-
vkId?: string | undefined;
|
|
37
|
-
googleId?: string | undefined;
|
|
38
|
-
isConfirmEmail?: boolean | undefined;
|
|
39
|
-
role?: "USER" | "ADMIN" | "NO_AUTH" | undefined;
|
|
40
|
-
provider?: "GOOGLE" | "STEAM" | undefined;
|
|
41
|
-
}>;
|
|
42
|
-
export type UserUpdate = z.infer<typeof UserUpdateSchema>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserUpdateSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const enums_1 = require("./enums");
|
|
6
|
-
exports.UserUpdateSchema = zod_1.z.object({
|
|
7
|
-
username: zod_1.z.string().nullable().optional(),
|
|
8
|
-
picture: zod_1.z.string().nullable().optional(),
|
|
9
|
-
email: zod_1.z.string().optional(),
|
|
10
|
-
password: zod_1.z.string().nullable().optional(),
|
|
11
|
-
provider: enums_1.SocialProviderEnum.optional(),
|
|
12
|
-
steamId: zod_1.z.string().optional(),
|
|
13
|
-
telegramId: zod_1.z.string().optional(),
|
|
14
|
-
vkId: zod_1.z.string().optional(),
|
|
15
|
-
googleId: zod_1.z.string().optional(),
|
|
16
|
-
isConfirmEmail: zod_1.z.boolean().optional(),
|
|
17
|
-
role: enums_1.UserRoleEnum.optional(),
|
|
18
|
-
status: enums_1.UserStatusEnum.optional(),
|
|
19
|
-
});
|
package/build/types.d.ts
DELETED
package/commands/api-response.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
|
|
3
|
-
export const ApiResponseSchema = z.object({
|
|
4
|
-
status: z.coerce.number(),
|
|
5
|
-
error: z.union([z.string(), z.literal(false)]),
|
|
6
|
-
error_code: z.union([z.string(), z.literal(false)]),
|
|
7
|
-
data: z.any().optional(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type ApiResponse = z.infer<typeof ApiResponseSchema>;
|
package/commands/auth/confirm.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { UserLoginResponseSchema } from "./login";
|
|
3
|
-
import { CONFIRMATION_CODE_LENGTH } from "../consts";
|
|
4
|
-
|
|
5
|
-
export const ConfirmCodeRequestSchema = z.object({
|
|
6
|
-
code: z.string().min(CONFIRMATION_CODE_LENGTH),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export type ConfirmCodeRequest = z.infer<typeof ConfirmCodeRequestSchema>;
|
|
10
|
-
export type ConfirmCodeResponse = z.infer<typeof UserLoginResponseSchema>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { UserLoginRequestSchema, UserLoginResponseSchema } from "./login";
|
|
3
|
-
import { UserRegisterRequestSchema } from "./register";
|
|
4
|
-
import { EndpointContract } from "../../types";
|
|
5
|
-
import { ConfirmCodeRequestSchema } from "./confirm";
|
|
6
|
-
import { UserResetRequestSchema } from "./reset";
|
|
7
|
-
import { UserProfileResponseSchema } from "./profile";
|
|
8
|
-
|
|
9
|
-
export const AuthEndpoints = {
|
|
10
|
-
login: {
|
|
11
|
-
method: "POST",
|
|
12
|
-
path: "/auth/login",
|
|
13
|
-
request: UserLoginRequestSchema,
|
|
14
|
-
response: UserLoginResponseSchema,
|
|
15
|
-
},
|
|
16
|
-
register: {
|
|
17
|
-
method: "POST",
|
|
18
|
-
path: "/auth/sign-up",
|
|
19
|
-
request: UserRegisterRequestSchema,
|
|
20
|
-
response: UserLoginResponseSchema,
|
|
21
|
-
},
|
|
22
|
-
refresh: {
|
|
23
|
-
method: "GET",
|
|
24
|
-
path: "/auth/refresh",
|
|
25
|
-
request: z.void(),
|
|
26
|
-
response: UserLoginResponseSchema,
|
|
27
|
-
},
|
|
28
|
-
reset: {
|
|
29
|
-
method: "POST",
|
|
30
|
-
path: "/auth/reset",
|
|
31
|
-
request: UserResetRequestSchema,
|
|
32
|
-
response: z.void(),
|
|
33
|
-
},
|
|
34
|
-
confirm: {
|
|
35
|
-
method: "GET",
|
|
36
|
-
path: "/auth/confirm-code/:code",
|
|
37
|
-
request: ConfirmCodeRequestSchema,
|
|
38
|
-
response: UserLoginResponseSchema,
|
|
39
|
-
},
|
|
40
|
-
profile: {
|
|
41
|
-
method: "GET",
|
|
42
|
-
path: "/auth/profile",
|
|
43
|
-
request: z.void(),
|
|
44
|
-
response: UserProfileResponseSchema,
|
|
45
|
-
}
|
|
46
|
-
} satisfies Record<string, EndpointContract>;
|
|
47
|
-
|
|
48
|
-
export type AuthEndpointKey = keyof typeof AuthEndpoints;
|
|
49
|
-
|
|
50
|
-
export type GetAuthRequest<K extends AuthEndpointKey> = z.infer<typeof AuthEndpoints[K]["request"]>;
|
|
51
|
-
export type GetAuthResponse<K extends AuthEndpointKey> = z.infer<typeof AuthEndpoints[K]["response"]>;
|
package/commands/auth/index.ts
DELETED
package/commands/auth/login.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const UserLoginRequestSchema = z.object({
|
|
4
|
-
email: z.string().email(),
|
|
5
|
-
password: z.string().min(6),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const UserLoginResponseSchema = z.object({
|
|
9
|
-
accessToken: z.string(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export type UserLoginRequest = z.infer<typeof UserLoginRequestSchema>;
|
|
13
|
-
export type UserLoginResponse = z.infer<typeof UserLoginResponseSchema>;
|
package/commands/auth/profile.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const UserProfileResponseSchema = z.object({
|
|
4
|
-
id: z.coerce.number(),
|
|
5
|
-
username: z.string(),
|
|
6
|
-
email: z.string(),
|
|
7
|
-
avatar: z.string().nullable(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type UserProfileResponse = z.infer<typeof UserProfileResponseSchema>;
|
package/commands/auth/reset.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { CONFIRMATION_CODE_LENGTH } from "../consts";
|
|
3
|
-
|
|
4
|
-
export const UserResetRequestSchema = z.object({
|
|
5
|
-
code: z.string().min(CONFIRMATION_CODE_LENGTH),
|
|
6
|
-
password: z.string().min(6),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export type UserResetRequest = z.infer<typeof UserResetRequestSchema>;
|
package/commands/consts.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const CONFIRMATION_CODE_LENGTH = 4;
|
package/commands/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from './auth';
|
|
2
|
-
export * from './orders';
|
|
3
|
-
export * from './promocodes';
|
|
4
|
-
export * from './promocode-activations';
|
|
5
|
-
export * from './refresh-sessions';
|
|
6
|
-
export * from './consts';
|
|
7
|
-
export * from './pagination';
|
|
8
|
-
export * from './payment-methods';
|
|
9
|
-
export * from './api-response';
|
|
10
|
-
export * from './users';
|
|
11
|
-
export * from './stats';
|
|
12
|
-
export * from './settings';
|
|
13
|
-
export * from './products';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { OrderType } from "./enums";
|
|
3
|
-
|
|
4
|
-
export const OrderItemInputSchema = z.object({
|
|
5
|
-
variantId: z.coerce.number().int().positive(),
|
|
6
|
-
quantity: z.coerce.number().int().min(1).default(1),
|
|
7
|
-
gameUsername: z.string().max(255).optional(),
|
|
8
|
-
gameUsernameType: z.string().max(64).optional(),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
/** Запрос на создание заказа */
|
|
12
|
-
export const OrderCreateRequestSchema = z.object({
|
|
13
|
-
/** Email покупателя */
|
|
14
|
-
email: z.string().email(),
|
|
15
|
-
/** ID способа оплаты */
|
|
16
|
-
paymentMethodId: z.coerce.number().positive(),
|
|
17
|
-
/** Список товаров в заказе (минимум 1) */
|
|
18
|
-
items: z.array(OrderItemInputSchema).min(1),
|
|
19
|
-
/** ID промокода (опционально) */
|
|
20
|
-
promocodeId: z.coerce.number().positive().optional(),
|
|
21
|
-
/** ID существующего пользователя (опционально) */
|
|
22
|
-
userId: z.coerce.number().positive().optional(),
|
|
23
|
-
/** Telegram ID покупателя (опционально) */
|
|
24
|
-
telegramId: z.string().optional(),
|
|
25
|
-
/** UTM-метка источника трафика */
|
|
26
|
-
utmSource: z.string().optional(),
|
|
27
|
-
/** Тип дизайна формы оплаты */
|
|
28
|
-
designType: z.string().optional(),
|
|
29
|
-
/** Тип заказа: MAIN (сайт) или WEBAPP (Telegram Mini App) */
|
|
30
|
-
type: OrderType.optional().default("MAIN"),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
/** Ответ на создание заказа — ссылка для оплаты */
|
|
34
|
-
export const OrderCreateResponseSchema = z.object({
|
|
35
|
-
/** URL для редиректа на платёжную страницу */
|
|
36
|
-
redirectUrl: z.string(),
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export type OrderItemInput = z.infer<typeof OrderItemInputSchema>;
|
|
40
|
-
export type OrderCreateRequest = z.infer<typeof OrderCreateRequestSchema>;
|
|
41
|
-
export type OrderCreateResponse = z.infer<typeof OrderCreateResponseSchema>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { OrderReadResponseSchema } from "./read";
|
|
3
|
-
import { EndpointContract } from "../../types";
|
|
4
|
-
import { OrderCreateRequestSchema, OrderCreateResponseSchema } from "./create";
|
|
5
|
-
import { OrdersListQuerySchema } from "./query";
|
|
6
|
-
|
|
7
|
-
export const OrderEndpoints = {
|
|
8
|
-
create: {
|
|
9
|
-
method: "POST",
|
|
10
|
-
path: "/orders",
|
|
11
|
-
request: OrderCreateRequestSchema,
|
|
12
|
-
response: OrderCreateResponseSchema,
|
|
13
|
-
},
|
|
14
|
-
list: {
|
|
15
|
-
method: "GET",
|
|
16
|
-
path: "/orders",
|
|
17
|
-
request: OrdersListQuerySchema,
|
|
18
|
-
response: z.array(OrderReadResponseSchema),
|
|
19
|
-
},
|
|
20
|
-
getById: {
|
|
21
|
-
method: "GET",
|
|
22
|
-
path: "/orders/:id",
|
|
23
|
-
request: z.object({
|
|
24
|
-
id: z.coerce.number().positive(),
|
|
25
|
-
}),
|
|
26
|
-
response: OrderReadResponseSchema,
|
|
27
|
-
},
|
|
28
|
-
getUserOrders: {
|
|
29
|
-
method: "GET",
|
|
30
|
-
path: "/orders/user",
|
|
31
|
-
request: OrdersListQuerySchema,
|
|
32
|
-
response: z.array(OrderReadResponseSchema),
|
|
33
|
-
},
|
|
34
|
-
getUserOrderById: {
|
|
35
|
-
method: "GET",
|
|
36
|
-
path: "/orders/user/:userId/:orderId",
|
|
37
|
-
request: z.object({
|
|
38
|
-
userId: z.coerce.number().positive(),
|
|
39
|
-
orderId: z.coerce.number().positive(),
|
|
40
|
-
}),
|
|
41
|
-
response: OrderReadResponseSchema,
|
|
42
|
-
},
|
|
43
|
-
} satisfies Record<string, EndpointContract>;
|
|
44
|
-
|
|
45
|
-
export type OrderEndpointKey = keyof typeof OrderEndpoints;
|
|
46
|
-
|
|
47
|
-
export type GetOrderRequest<K extends OrderEndpointKey> =
|
|
48
|
-
z.infer<typeof OrderEndpoints[K]["request"]>;
|
|
49
|
-
|
|
50
|
-
export type GetOrderResponse<K extends OrderEndpointKey> =
|
|
51
|
-
z.infer<typeof OrderEndpoints[K]["response"]>;
|
package/commands/orders/enums.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
|
|
3
|
-
export const OrderType = z.enum(["MAIN", "WEBAPP"]);
|
|
4
|
-
export type OrderType = z.infer<typeof OrderType>;
|
|
5
|
-
|
|
6
|
-
export const OrderStatus = z.enum([
|
|
7
|
-
"PENDING",
|
|
8
|
-
"AWAITING_PAYMENT",
|
|
9
|
-
"PAID",
|
|
10
|
-
"PROCESSING",
|
|
11
|
-
"SUCCESS",
|
|
12
|
-
"FAILED",
|
|
13
|
-
"REFUNDED",
|
|
14
|
-
"CANCELLED",
|
|
15
|
-
]);
|
|
16
|
-
export type OrderStatus = z.infer<typeof OrderStatus>;
|
|
17
|
-
|
|
18
|
-
export const OrderItemStatus = z.enum([
|
|
19
|
-
"PENDING",
|
|
20
|
-
"PROCESSING",
|
|
21
|
-
"DELIVERED",
|
|
22
|
-
"FAILED",
|
|
23
|
-
"REFUNDED",
|
|
24
|
-
]);
|
|
25
|
-
export type OrderItemStatus = z.infer<typeof OrderItemStatus>;
|
package/commands/orders/index.ts
DELETED
package/commands/orders/query.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { PaginationQuery } from "../pagination";
|
|
3
|
-
import { OrderStatus } from "./enums";
|
|
4
|
-
|
|
5
|
-
/** Фильтр по периоду (базовая схема без refinements для merge) */
|
|
6
|
-
const OrdersPeriodBase = z.object({
|
|
7
|
-
/** Предустановленный период: day, week, month, year, custom */
|
|
8
|
-
period: z.enum(["day", "week", "month", "year", "custom"]).optional(),
|
|
9
|
-
/** Начало периода (ISO datetime, обязателен при period=custom) */
|
|
10
|
-
start: z.string().datetime().optional(),
|
|
11
|
-
/** Конец периода (ISO datetime, обязателен при period=custom) */
|
|
12
|
-
end: z.string().datetime().optional(),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
/** Фильтр по периоду с валидацией custom-диапазона */
|
|
16
|
-
export const OrdersPeriodSchema = OrdersPeriodBase
|
|
17
|
-
.refine(v => v.period !== "custom" || (v.start && v.end), {
|
|
18
|
-
message: "start/end обязательны при period=custom",
|
|
19
|
-
})
|
|
20
|
-
.refine(v => v.period !== "custom" || new Date(v.start!) < new Date(v.end!), {
|
|
21
|
-
message: "start должен быть раньше end",
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
/** Фильтры списка заказов */
|
|
25
|
-
export const OrdersFiltersSchema = z.object({
|
|
26
|
-
/** Фильтр по email покупателя (частичное совпадение) */
|
|
27
|
-
email: z.string().optional(),
|
|
28
|
-
/** Фильтр по статусу заказа */
|
|
29
|
-
status: OrderStatus.optional(),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
/** Сортировка списка заказов */
|
|
33
|
-
export const OrdersSortSchema = z.object({
|
|
34
|
-
/** Поле для сортировки: createdAt, updatedAt, total, subtotal */
|
|
35
|
-
sortBy: z.enum(["createdAt", "updatedAt", "total", "subtotal"]).default("createdAt"),
|
|
36
|
-
/** Направление сортировки */
|
|
37
|
-
sortDir: z.enum(["asc", "desc"]).default("desc"),
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
/** Объединённая схема запроса списка заказов */
|
|
41
|
-
export const OrdersListQuerySchema = PaginationQuery
|
|
42
|
-
.merge(OrdersFiltersSchema)
|
|
43
|
-
.merge(OrdersSortSchema)
|
|
44
|
-
.merge(OrdersPeriodBase);
|
|
45
|
-
|
|
46
|
-
export type OrdersListQuery = z.infer<typeof OrdersListQuerySchema>;
|
package/commands/orders/read.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { OrderType, OrderStatus, OrderItemStatus } from "./enums";
|
|
3
|
-
|
|
4
|
-
/** Элемент заказа в ответе */
|
|
5
|
-
export const OrderItemResponseSchema = z.object({
|
|
6
|
-
/** ID элемента заказа */
|
|
7
|
-
id: z.number(),
|
|
8
|
-
/** ID товара */
|
|
9
|
-
productId: z.number(),
|
|
10
|
-
/** ID варианта товара */
|
|
11
|
-
variantId: z.number(),
|
|
12
|
-
/** Количество */
|
|
13
|
-
quantity: z.number(),
|
|
14
|
-
/** Цена на момент покупки (строка, Decimal) */
|
|
15
|
-
price: z.string(),
|
|
16
|
-
/** Игровой логин для доставки */
|
|
17
|
-
gameUsername: z.string().nullable(),
|
|
18
|
-
/** Тип игрового логина */
|
|
19
|
-
gameUsernameType: z.string().nullable(),
|
|
20
|
-
/** Выданный ключ (если автоматическая доставка) */
|
|
21
|
-
deliveredKey: z.string().nullable(),
|
|
22
|
-
/** Дата доставки */
|
|
23
|
-
deliveredAt: z.coerce.date().nullable(),
|
|
24
|
-
/** Статус элемента заказа */
|
|
25
|
-
status: OrderItemStatus,
|
|
26
|
-
/** Название товара */
|
|
27
|
-
productTitle: z.string().optional(),
|
|
28
|
-
/** Название варианта */
|
|
29
|
-
variantName: z.string().optional(),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
/** Полная информация о заказе */
|
|
33
|
-
export const OrderReadResponseSchema = z.object({
|
|
34
|
-
/** ID заказа */
|
|
35
|
-
id: z.coerce.number().positive(),
|
|
36
|
-
/** ID пользователя (null для гостевых заказов) */
|
|
37
|
-
userId: z.coerce.number().positive().nullable().optional(),
|
|
38
|
-
/** ID промокода */
|
|
39
|
-
promocodeId: z.coerce.number().nonnegative().nullable().optional(),
|
|
40
|
-
/** ID способа оплаты */
|
|
41
|
-
paymentMethodId: z.coerce.number().nonnegative().nullable().optional(),
|
|
42
|
-
/** Email покупателя */
|
|
43
|
-
email: z.string(),
|
|
44
|
-
/** Статус заказа */
|
|
45
|
-
status: OrderStatus,
|
|
46
|
-
/** Тип заказа */
|
|
47
|
-
type: OrderType,
|
|
48
|
-
/** Сумма товаров до скидки и комиссий (строка, Decimal) */
|
|
49
|
-
subtotal: z.string(),
|
|
50
|
-
/** Сумма скидки (строка, Decimal) */
|
|
51
|
-
discount: z.string(),
|
|
52
|
-
/** Комиссия эквайринга (строка, Decimal) */
|
|
53
|
-
commission: z.string(),
|
|
54
|
-
/** Комиссия сервиса (строка, Decimal) */
|
|
55
|
-
serviceCommission: z.string(),
|
|
56
|
-
/** Итого к оплате (строка, Decimal) */
|
|
57
|
-
total: z.string(),
|
|
58
|
-
/** IP-адрес покупателя */
|
|
59
|
-
ipAddress: z.string().nullable().optional(),
|
|
60
|
-
/** UTM-метка источника трафика */
|
|
61
|
-
utmSource: z.string().nullable(),
|
|
62
|
-
/** Тип дизайна формы оплаты */
|
|
63
|
-
designType: z.string().nullable(),
|
|
64
|
-
/** Название способа оплаты */
|
|
65
|
-
paymentMethodName: z.string().nullable(),
|
|
66
|
-
/** Значение промокода */
|
|
67
|
-
promocodeValue: z.string().nullable(),
|
|
68
|
-
/** Скидка промокода в процентах (строка, Decimal) */
|
|
69
|
-
promocodeDiscount: z.string().nullable(),
|
|
70
|
-
/** Процент комиссии сервиса (serviceComission + secretComission) */
|
|
71
|
-
serviceCommissionPercent: z.coerce.number().nonnegative().optional(),
|
|
72
|
-
/** Процент комиссии эквайринга */
|
|
73
|
-
acquiringCommissionPercent: z.coerce.number().nonnegative().optional(),
|
|
74
|
-
/** Элементы заказа */
|
|
75
|
-
items: z.array(OrderItemResponseSchema).optional(),
|
|
76
|
-
/** Дата создания */
|
|
77
|
-
createdAt: z.coerce.date().default(() => new Date()),
|
|
78
|
-
/** Дата обновления */
|
|
79
|
-
updatedAt: z.coerce.date().default(() => new Date()),
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
export type OrderItemResponse = z.infer<typeof OrderItemResponseSchema>;
|
|
83
|
-
export type OrderReadResponse = z.infer<typeof OrderReadResponseSchema>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { OrderStatus } from "./enums";
|
|
3
|
-
|
|
4
|
-
/** Запрос на обновление заказа (администратором) */
|
|
5
|
-
export const OrderUpdateRequestSchema = z.object({
|
|
6
|
-
/** Новый статус заказа */
|
|
7
|
-
status: OrderStatus.optional(),
|
|
8
|
-
/** Email покупателя */
|
|
9
|
-
email: z.string().email().optional(),
|
|
10
|
-
/** ID способа оплаты */
|
|
11
|
-
paymentMethodId: z.coerce.number().positive().optional(),
|
|
12
|
-
/** ID промокода */
|
|
13
|
-
promocodeId: z.coerce.number().positive().optional(),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export type OrderUpdateRequest = z.infer<typeof OrderUpdateRequestSchema>;
|
package/commands/pagination.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
|
|
3
|
-
export const PaymentMethodsCreateRequestSchema = z.object({
|
|
4
|
-
name: z.string(),
|
|
5
|
-
image: z.string(),
|
|
6
|
-
key: z.string(),
|
|
7
|
-
uniqueKey: z.string(),
|
|
8
|
-
isActive: z.boolean().default(true),
|
|
9
|
-
type: z.string(),
|
|
10
|
-
maxAmount: z.coerce.number().nonnegative(),
|
|
11
|
-
minAmount: z.coerce.number().nonnegative(),
|
|
12
|
-
comission: z.coerce.number().nonnegative(),
|
|
13
|
-
secretComission: z.coerce.number().nonnegative(),
|
|
14
|
-
serviceComission: z.coerce.number().nonnegative(),
|
|
15
|
-
cryptoToken: z.string().optional(),
|
|
16
|
-
cryptoTokenSecret: z.string().optional(),
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export type PaymentMethodsCreateRequest = z.infer<typeof PaymentMethodsCreateRequestSchema>;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { CourseReadResponseSchema, PaymentMethodReadResponseSchema } from "./read";
|
|
3
|
-
import { EndpointContract } from "../../types";
|
|
4
|
-
import { PaymentMethodUpdateRequestSchema } from "./update";
|
|
5
|
-
import { PaymentMethodsCreateRequestSchema } from "./create";
|
|
6
|
-
|
|
7
|
-
export const PaymentMethodEndpoints = {
|
|
8
|
-
course: {
|
|
9
|
-
method: "GET",
|
|
10
|
-
path: "/course",
|
|
11
|
-
request: z.object({}),
|
|
12
|
-
response: CourseReadResponseSchema,
|
|
13
|
-
},
|
|
14
|
-
create: {
|
|
15
|
-
method: "POST",
|
|
16
|
-
path: "/payment-methods",
|
|
17
|
-
request: z.object({
|
|
18
|
-
data: PaymentMethodsCreateRequestSchema,
|
|
19
|
-
}),
|
|
20
|
-
response: PaymentMethodReadResponseSchema,
|
|
21
|
-
},
|
|
22
|
-
update: {
|
|
23
|
-
method: "PUT",
|
|
24
|
-
path: "/payment-methods/:id",
|
|
25
|
-
request: z.object({
|
|
26
|
-
id: z.coerce.number().positive(),
|
|
27
|
-
data: PaymentMethodUpdateRequestSchema,
|
|
28
|
-
}),
|
|
29
|
-
response: PaymentMethodReadResponseSchema,
|
|
30
|
-
},
|
|
31
|
-
list: {
|
|
32
|
-
method: "GET",
|
|
33
|
-
path: "/payment-methods",
|
|
34
|
-
request: z.object({}),
|
|
35
|
-
response: z.array(PaymentMethodReadResponseSchema),
|
|
36
|
-
},
|
|
37
|
-
listAdmin: {
|
|
38
|
-
method: "GET",
|
|
39
|
-
path: "/payment-methods/admin",
|
|
40
|
-
request: z.object({}),
|
|
41
|
-
response: z.array(PaymentMethodReadResponseSchema),
|
|
42
|
-
},
|
|
43
|
-
getById: {
|
|
44
|
-
method: "GET",
|
|
45
|
-
path: "/payment-methods/:id",
|
|
46
|
-
request: z.object({
|
|
47
|
-
id: z.coerce.number().positive(),
|
|
48
|
-
}),
|
|
49
|
-
response: PaymentMethodReadResponseSchema,
|
|
50
|
-
},
|
|
51
|
-
getByIdAdmin: {
|
|
52
|
-
method: "GET",
|
|
53
|
-
path: "/payment-methods/admin/:id",
|
|
54
|
-
request: z.object({
|
|
55
|
-
id: z.coerce.number().positive(),
|
|
56
|
-
}),
|
|
57
|
-
response: PaymentMethodReadResponseSchema,
|
|
58
|
-
},
|
|
59
|
-
} satisfies Record<string, EndpointContract>;
|
|
60
|
-
|
|
61
|
-
export type PaymentMethodEndpointKey = keyof typeof PaymentMethodEndpoints;
|
|
62
|
-
|
|
63
|
-
export type GetPaymentMethodRequest<K extends PaymentMethodEndpointKey> =
|
|
64
|
-
z.infer<typeof PaymentMethodEndpoints[K]["request"]>;
|
|
65
|
-
|
|
66
|
-
export type GetPaymentMethodResponse<K extends PaymentMethodEndpointKey> =
|
|
67
|
-
z.infer<typeof PaymentMethodEndpoints[K]["response"]>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const CourseReadResponseSchema = z.object({
|
|
4
|
-
USD_RUB: z.string(),
|
|
5
|
-
RUB_KZT: z.string(),
|
|
6
|
-
USD_KZT: z.string(),
|
|
7
|
-
KZT_RUB: z.string(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const PaymentMethodReadResponseSchema = z.object({
|
|
11
|
-
id: z.coerce.number().positive(),
|
|
12
|
-
name: z.string(),
|
|
13
|
-
image: z.string(),
|
|
14
|
-
key: z.string(),
|
|
15
|
-
uniqueKey: z.string(),
|
|
16
|
-
isActive: z.boolean(),
|
|
17
|
-
type: z.string(),
|
|
18
|
-
maxAmount: z.coerce.number().nonnegative(),
|
|
19
|
-
minAmount: z.coerce.number().nonnegative(),
|
|
20
|
-
comission: z.coerce.number().nonnegative(),
|
|
21
|
-
secretComission: z.coerce.number().nonnegative().optional(),
|
|
22
|
-
serviceComission: z.coerce.number().nonnegative(),
|
|
23
|
-
cryptoToken: z.string().nullable(),
|
|
24
|
-
cryptoNetwork: z.string().nullable(),
|
|
25
|
-
updatedAt: z.coerce.date(),
|
|
26
|
-
createdAt: z.coerce.date(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export type CourseReadResponse = z.infer<typeof CourseReadResponseSchema>;
|
|
30
|
-
export type PaymentMethodReadResponse = z.infer<typeof PaymentMethodReadResponseSchema>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const PaymentMethodUpdateRequestSchema = z.object({
|
|
4
|
-
name: z.string().optional(),
|
|
5
|
-
image: z.string().optional(),
|
|
6
|
-
key: z.string().optional(),
|
|
7
|
-
uniqueKey: z.string().optional(),
|
|
8
|
-
isActive: z.boolean().optional(),
|
|
9
|
-
type: z.string().optional(),
|
|
10
|
-
maxAmount: z.coerce.number().nonnegative().optional(),
|
|
11
|
-
minAmount: z.coerce.number().nonnegative().optional(),
|
|
12
|
-
comission: z.coerce.number().nonnegative().optional(),
|
|
13
|
-
secretComission: z.coerce.number().nonnegative().optional(),
|
|
14
|
-
serviceComission: z.coerce.number().nonnegative().optional(),
|
|
15
|
-
cryptoToken: z.string().nullable().optional(),
|
|
16
|
-
cryptoTokenSecret: z.string().nullable().optional(),
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
export type PaymentMethodUpdateRequest = z.infer<typeof PaymentMethodUpdateRequestSchema>
|