@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
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CreateOrderRequestSchema: z.ZodObject<{
|
|
3
|
+
items: z.ZodArray<z.ZodObject<{
|
|
4
|
+
variantId: z.ZodNumber;
|
|
5
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
gameUsername: z.ZodOptional<z.ZodString>;
|
|
7
|
+
gameUsernameType: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
displayCurrency: z.ZodEnum<{
|
|
10
|
+
USD: "USD";
|
|
11
|
+
RUB: "RUB";
|
|
12
|
+
UAH: "UAH";
|
|
13
|
+
}>;
|
|
14
|
+
email: z.ZodEmail;
|
|
15
|
+
promocodeValue: z.ZodOptional<z.ZodString>;
|
|
16
|
+
utmSource: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type CreateOrderRequest = z.infer<typeof CreateOrderRequestSchema>;
|
|
19
|
+
export declare const CreateOrderResponseSchema: z.ZodObject<{
|
|
20
|
+
orderId: z.ZodNumber;
|
|
21
|
+
paymentToken: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type CreateOrderResponse = z.infer<typeof CreateOrderResponseSchema>;
|
|
24
|
+
export declare const CreateOrderEndpoint: {
|
|
25
|
+
readonly method: "POST";
|
|
26
|
+
readonly path: "/api/orders";
|
|
27
|
+
readonly request: z.ZodObject<{
|
|
28
|
+
items: z.ZodArray<z.ZodObject<{
|
|
29
|
+
variantId: z.ZodNumber;
|
|
30
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
31
|
+
gameUsername: z.ZodOptional<z.ZodString>;
|
|
32
|
+
gameUsernameType: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
displayCurrency: z.ZodEnum<{
|
|
35
|
+
USD: "USD";
|
|
36
|
+
RUB: "RUB";
|
|
37
|
+
UAH: "UAH";
|
|
38
|
+
}>;
|
|
39
|
+
email: z.ZodEmail;
|
|
40
|
+
promocodeValue: z.ZodOptional<z.ZodString>;
|
|
41
|
+
utmSource: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
readonly response: z.ZodObject<{
|
|
44
|
+
orderId: z.ZodNumber;
|
|
45
|
+
paymentToken: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
readonly requiresCaptcha: "order_create";
|
|
48
|
+
readonly rateLimit: {
|
|
49
|
+
readonly limit: 10;
|
|
50
|
+
readonly ttlSec: 60;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export declare const CancelOrderEndpoint: {
|
|
54
|
+
readonly method: "POST";
|
|
55
|
+
readonly path: "/api/orders/:id/cancel";
|
|
56
|
+
readonly params: z.ZodObject<{
|
|
57
|
+
id: z.ZodCoercedNumber<unknown>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
readonly response: z.ZodObject<{
|
|
60
|
+
ok: z.ZodLiteral<true>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
readonly requiresAuth: true;
|
|
63
|
+
};
|
|
64
|
+
export declare const RefundOrderEndpoint: {
|
|
65
|
+
readonly method: "POST";
|
|
66
|
+
readonly path: "/api/admin/orders/:id/refund";
|
|
67
|
+
readonly params: z.ZodObject<{
|
|
68
|
+
id: z.ZodCoercedNumber<unknown>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
readonly response: z.ZodObject<{
|
|
71
|
+
id: z.ZodNumber;
|
|
72
|
+
email: z.ZodString;
|
|
73
|
+
displayCurrency: z.ZodEnum<{
|
|
74
|
+
USD: "USD";
|
|
75
|
+
RUB: "RUB";
|
|
76
|
+
UAH: "UAH";
|
|
77
|
+
}>;
|
|
78
|
+
subtotal: z.ZodObject<{
|
|
79
|
+
usd: z.ZodString;
|
|
80
|
+
rub: z.ZodString;
|
|
81
|
+
uah: z.ZodString;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
discount: z.ZodObject<{
|
|
84
|
+
usd: z.ZodString;
|
|
85
|
+
rub: z.ZodString;
|
|
86
|
+
uah: z.ZodString;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
total: z.ZodObject<{
|
|
89
|
+
usd: z.ZodString;
|
|
90
|
+
rub: z.ZodString;
|
|
91
|
+
uah: z.ZodString;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
exchangeRateSnapshot: z.ZodObject<{
|
|
94
|
+
source: z.ZodEnum<{
|
|
95
|
+
dessly: "dessly";
|
|
96
|
+
cbr: "cbr";
|
|
97
|
+
nbu: "nbu";
|
|
98
|
+
cache: "cache";
|
|
99
|
+
fallback: "fallback";
|
|
100
|
+
mixed: "mixed";
|
|
101
|
+
}>;
|
|
102
|
+
fetchedAt: z.ZodString;
|
|
103
|
+
rates: z.ZodObject<{
|
|
104
|
+
usdRub: z.ZodString;
|
|
105
|
+
usdUah: z.ZodString;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
status: z.ZodEnum<{
|
|
109
|
+
PENDING: "PENDING";
|
|
110
|
+
AWAITING_PAYMENT: "AWAITING_PAYMENT";
|
|
111
|
+
PAID: "PAID";
|
|
112
|
+
PROCESSING: "PROCESSING";
|
|
113
|
+
SUCCESS: "SUCCESS";
|
|
114
|
+
FAILED: "FAILED";
|
|
115
|
+
REFUNDED: "REFUNDED";
|
|
116
|
+
CANCELLED: "CANCELLED";
|
|
117
|
+
}>;
|
|
118
|
+
items: z.ZodArray<z.ZodObject<{
|
|
119
|
+
id: z.ZodNumber;
|
|
120
|
+
productId: z.ZodNumber;
|
|
121
|
+
variantId: z.ZodNumber;
|
|
122
|
+
quantity: z.ZodNumber;
|
|
123
|
+
price: z.ZodObject<{
|
|
124
|
+
usd: z.ZodString;
|
|
125
|
+
rub: z.ZodString;
|
|
126
|
+
uah: z.ZodString;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
deliveredAt: z.ZodNullable<z.ZodString>;
|
|
129
|
+
status: z.ZodEnum<{
|
|
130
|
+
PENDING: "PENDING";
|
|
131
|
+
PROCESSING: "PROCESSING";
|
|
132
|
+
FAILED: "FAILED";
|
|
133
|
+
REFUNDED: "REFUNDED";
|
|
134
|
+
DELIVERED: "DELIVERED";
|
|
135
|
+
}>;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
createdAt: z.ZodString;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
readonly requiresAuth: true;
|
|
140
|
+
readonly requiresAdmin: true;
|
|
141
|
+
};
|
|
142
|
+
export declare const OrderCommands: {
|
|
143
|
+
readonly create: {
|
|
144
|
+
readonly method: "POST";
|
|
145
|
+
readonly path: "/api/orders";
|
|
146
|
+
readonly request: z.ZodObject<{
|
|
147
|
+
items: z.ZodArray<z.ZodObject<{
|
|
148
|
+
variantId: z.ZodNumber;
|
|
149
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
150
|
+
gameUsername: z.ZodOptional<z.ZodString>;
|
|
151
|
+
gameUsernameType: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
displayCurrency: z.ZodEnum<{
|
|
154
|
+
USD: "USD";
|
|
155
|
+
RUB: "RUB";
|
|
156
|
+
UAH: "UAH";
|
|
157
|
+
}>;
|
|
158
|
+
email: z.ZodEmail;
|
|
159
|
+
promocodeValue: z.ZodOptional<z.ZodString>;
|
|
160
|
+
utmSource: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
readonly response: z.ZodObject<{
|
|
163
|
+
orderId: z.ZodNumber;
|
|
164
|
+
paymentToken: z.ZodString;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
readonly requiresCaptcha: "order_create";
|
|
167
|
+
readonly rateLimit: {
|
|
168
|
+
readonly limit: 10;
|
|
169
|
+
readonly ttlSec: 60;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
readonly cancel: {
|
|
173
|
+
readonly method: "POST";
|
|
174
|
+
readonly path: "/api/orders/:id/cancel";
|
|
175
|
+
readonly params: z.ZodObject<{
|
|
176
|
+
id: z.ZodCoercedNumber<unknown>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
readonly response: z.ZodObject<{
|
|
179
|
+
ok: z.ZodLiteral<true>;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
readonly requiresAuth: true;
|
|
182
|
+
};
|
|
183
|
+
readonly refundAdmin: {
|
|
184
|
+
readonly method: "POST";
|
|
185
|
+
readonly path: "/api/admin/orders/:id/refund";
|
|
186
|
+
readonly params: z.ZodObject<{
|
|
187
|
+
id: z.ZodCoercedNumber<unknown>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
readonly response: z.ZodObject<{
|
|
190
|
+
id: z.ZodNumber;
|
|
191
|
+
email: z.ZodString;
|
|
192
|
+
displayCurrency: z.ZodEnum<{
|
|
193
|
+
USD: "USD";
|
|
194
|
+
RUB: "RUB";
|
|
195
|
+
UAH: "UAH";
|
|
196
|
+
}>;
|
|
197
|
+
subtotal: z.ZodObject<{
|
|
198
|
+
usd: z.ZodString;
|
|
199
|
+
rub: z.ZodString;
|
|
200
|
+
uah: z.ZodString;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
discount: z.ZodObject<{
|
|
203
|
+
usd: z.ZodString;
|
|
204
|
+
rub: z.ZodString;
|
|
205
|
+
uah: z.ZodString;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
total: z.ZodObject<{
|
|
208
|
+
usd: z.ZodString;
|
|
209
|
+
rub: z.ZodString;
|
|
210
|
+
uah: z.ZodString;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
exchangeRateSnapshot: z.ZodObject<{
|
|
213
|
+
source: z.ZodEnum<{
|
|
214
|
+
dessly: "dessly";
|
|
215
|
+
cbr: "cbr";
|
|
216
|
+
nbu: "nbu";
|
|
217
|
+
cache: "cache";
|
|
218
|
+
fallback: "fallback";
|
|
219
|
+
mixed: "mixed";
|
|
220
|
+
}>;
|
|
221
|
+
fetchedAt: z.ZodString;
|
|
222
|
+
rates: z.ZodObject<{
|
|
223
|
+
usdRub: z.ZodString;
|
|
224
|
+
usdUah: z.ZodString;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
status: z.ZodEnum<{
|
|
228
|
+
PENDING: "PENDING";
|
|
229
|
+
AWAITING_PAYMENT: "AWAITING_PAYMENT";
|
|
230
|
+
PAID: "PAID";
|
|
231
|
+
PROCESSING: "PROCESSING";
|
|
232
|
+
SUCCESS: "SUCCESS";
|
|
233
|
+
FAILED: "FAILED";
|
|
234
|
+
REFUNDED: "REFUNDED";
|
|
235
|
+
CANCELLED: "CANCELLED";
|
|
236
|
+
}>;
|
|
237
|
+
items: z.ZodArray<z.ZodObject<{
|
|
238
|
+
id: z.ZodNumber;
|
|
239
|
+
productId: z.ZodNumber;
|
|
240
|
+
variantId: z.ZodNumber;
|
|
241
|
+
quantity: z.ZodNumber;
|
|
242
|
+
price: z.ZodObject<{
|
|
243
|
+
usd: z.ZodString;
|
|
244
|
+
rub: z.ZodString;
|
|
245
|
+
uah: z.ZodString;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
deliveredAt: z.ZodNullable<z.ZodString>;
|
|
248
|
+
status: z.ZodEnum<{
|
|
249
|
+
PENDING: "PENDING";
|
|
250
|
+
PROCESSING: "PROCESSING";
|
|
251
|
+
FAILED: "FAILED";
|
|
252
|
+
REFUNDED: "REFUNDED";
|
|
253
|
+
DELIVERED: "DELIVERED";
|
|
254
|
+
}>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
createdAt: z.ZodString;
|
|
257
|
+
}, z.core.$strip>;
|
|
258
|
+
readonly requiresAuth: true;
|
|
259
|
+
readonly requiresAdmin: true;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/domains/orders/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;iBAMnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;;iBAGpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOK,CAAC;AAEtC,eAAO,MAAM,mBAAmB;;;;;;;;;;CAMK,CAAC;AAEtC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOK,CAAC;AAEtC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderCommands = exports.RefundOrderEndpoint = exports.CancelOrderEndpoint = exports.CreateOrderEndpoint = exports.CreateOrderResponseSchema = exports.CreateOrderRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const money_1 = require("../../shared/money");
|
|
6
|
+
const common_1 = require("../../shared/common");
|
|
7
|
+
const dtos_1 = require("./dtos");
|
|
8
|
+
exports.CreateOrderRequestSchema = zod_1.z.object({
|
|
9
|
+
items: zod_1.z.array(dtos_1.OrderItemRequestSchema).min(1),
|
|
10
|
+
displayCurrency: money_1.CurrencySchema,
|
|
11
|
+
email: zod_1.z.email(),
|
|
12
|
+
promocodeValue: zod_1.z.string().max(32).optional(),
|
|
13
|
+
utmSource: zod_1.z.string().max(32).optional(),
|
|
14
|
+
});
|
|
15
|
+
exports.CreateOrderResponseSchema = zod_1.z.object({
|
|
16
|
+
orderId: zod_1.z.number().int().positive(),
|
|
17
|
+
paymentToken: zod_1.z.string(),
|
|
18
|
+
});
|
|
19
|
+
exports.CreateOrderEndpoint = {
|
|
20
|
+
method: "POST",
|
|
21
|
+
path: "/api/orders",
|
|
22
|
+
request: exports.CreateOrderRequestSchema,
|
|
23
|
+
response: exports.CreateOrderResponseSchema,
|
|
24
|
+
requiresCaptcha: "order_create",
|
|
25
|
+
rateLimit: { limit: 10, ttlSec: 60 },
|
|
26
|
+
};
|
|
27
|
+
exports.CancelOrderEndpoint = {
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: "/api/orders/:id/cancel",
|
|
30
|
+
params: common_1.IdParamSchema,
|
|
31
|
+
response: common_1.SuccessResponseSchema,
|
|
32
|
+
requiresAuth: true,
|
|
33
|
+
};
|
|
34
|
+
exports.RefundOrderEndpoint = {
|
|
35
|
+
method: "POST",
|
|
36
|
+
path: "/api/admin/orders/:id/refund",
|
|
37
|
+
params: common_1.IdParamSchema,
|
|
38
|
+
response: dtos_1.OrderResponseSchema,
|
|
39
|
+
requiresAuth: true,
|
|
40
|
+
requiresAdmin: true,
|
|
41
|
+
};
|
|
42
|
+
exports.OrderCommands = {
|
|
43
|
+
create: exports.CreateOrderEndpoint,
|
|
44
|
+
cancel: exports.CancelOrderEndpoint,
|
|
45
|
+
refundAdmin: exports.RefundOrderEndpoint,
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/domains/orders/commands.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,8CAAoD;AACpD,gDAA2E;AAC3E,iCAAqE;AAExD,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,6BAAsB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,eAAe,EAAE,sBAAc;IAC/B,KAAK,EAAE,OAAC,CAAC,KAAK,EAAE;IAChB,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC7C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAGU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAGU,QAAA,mBAAmB,GAAG;IAClC,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,gCAAwB;IACjC,QAAQ,EAAE,iCAAyB;IACnC,eAAe,EAAE,cAAc;IAC/B,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;CACA,CAAC;AAEzB,QAAA,mBAAmB,GAAG;IAClC,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,wBAAwB;IAC9B,MAAM,EAAE,sBAAa;IACrB,QAAQ,EAAE,8BAAqB;IAC/B,YAAY,EAAE,IAAI;CACkB,CAAC;AAEzB,QAAA,mBAAmB,GAAG;IAClC,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,8BAA8B;IACpC,MAAM,EAAE,sBAAa;IACrB,QAAQ,EAAE,0BAAmB;IAC7B,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;CACiB,CAAC;AAEzB,QAAA,aAAa,GAAG;IAC5B,MAAM,EAAE,2BAAmB;IAC3B,MAAM,EAAE,2BAAmB;IAC3B,WAAW,EAAE,2BAAmB;CACvB,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { MoneyAmountSchema } from "../../shared/money";
|
|
3
|
+
export declare const OrderStatusSchema: z.ZodEnum<{
|
|
4
|
+
PENDING: "PENDING";
|
|
5
|
+
AWAITING_PAYMENT: "AWAITING_PAYMENT";
|
|
6
|
+
PAID: "PAID";
|
|
7
|
+
PROCESSING: "PROCESSING";
|
|
8
|
+
SUCCESS: "SUCCESS";
|
|
9
|
+
FAILED: "FAILED";
|
|
10
|
+
REFUNDED: "REFUNDED";
|
|
11
|
+
CANCELLED: "CANCELLED";
|
|
12
|
+
}>;
|
|
13
|
+
export type OrderStatus = z.infer<typeof OrderStatusSchema>;
|
|
14
|
+
export declare const OrderItemRequestSchema: z.ZodObject<{
|
|
15
|
+
variantId: z.ZodNumber;
|
|
16
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
gameUsername: z.ZodOptional<z.ZodString>;
|
|
18
|
+
gameUsernameType: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type OrderItemRequest = z.infer<typeof OrderItemRequestSchema>;
|
|
21
|
+
export declare const OrderItemResponseSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodNumber;
|
|
23
|
+
productId: z.ZodNumber;
|
|
24
|
+
variantId: z.ZodNumber;
|
|
25
|
+
quantity: z.ZodNumber;
|
|
26
|
+
price: z.ZodObject<{
|
|
27
|
+
usd: z.ZodString;
|
|
28
|
+
rub: z.ZodString;
|
|
29
|
+
uah: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
deliveredAt: z.ZodNullable<z.ZodString>;
|
|
32
|
+
status: z.ZodEnum<{
|
|
33
|
+
PENDING: "PENDING";
|
|
34
|
+
PROCESSING: "PROCESSING";
|
|
35
|
+
FAILED: "FAILED";
|
|
36
|
+
REFUNDED: "REFUNDED";
|
|
37
|
+
DELIVERED: "DELIVERED";
|
|
38
|
+
}>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type OrderItemResponse = z.infer<typeof OrderItemResponseSchema>;
|
|
41
|
+
export declare const OrderResponseSchema: z.ZodObject<{
|
|
42
|
+
id: z.ZodNumber;
|
|
43
|
+
email: z.ZodString;
|
|
44
|
+
displayCurrency: z.ZodEnum<{
|
|
45
|
+
USD: "USD";
|
|
46
|
+
RUB: "RUB";
|
|
47
|
+
UAH: "UAH";
|
|
48
|
+
}>;
|
|
49
|
+
subtotal: z.ZodObject<{
|
|
50
|
+
usd: z.ZodString;
|
|
51
|
+
rub: z.ZodString;
|
|
52
|
+
uah: z.ZodString;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
discount: z.ZodObject<{
|
|
55
|
+
usd: z.ZodString;
|
|
56
|
+
rub: z.ZodString;
|
|
57
|
+
uah: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
total: z.ZodObject<{
|
|
60
|
+
usd: z.ZodString;
|
|
61
|
+
rub: z.ZodString;
|
|
62
|
+
uah: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
exchangeRateSnapshot: z.ZodObject<{
|
|
65
|
+
source: z.ZodEnum<{
|
|
66
|
+
dessly: "dessly";
|
|
67
|
+
cbr: "cbr";
|
|
68
|
+
nbu: "nbu";
|
|
69
|
+
cache: "cache";
|
|
70
|
+
fallback: "fallback";
|
|
71
|
+
mixed: "mixed";
|
|
72
|
+
}>;
|
|
73
|
+
fetchedAt: z.ZodString;
|
|
74
|
+
rates: z.ZodObject<{
|
|
75
|
+
usdRub: z.ZodString;
|
|
76
|
+
usdUah: z.ZodString;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
status: z.ZodEnum<{
|
|
80
|
+
PENDING: "PENDING";
|
|
81
|
+
AWAITING_PAYMENT: "AWAITING_PAYMENT";
|
|
82
|
+
PAID: "PAID";
|
|
83
|
+
PROCESSING: "PROCESSING";
|
|
84
|
+
SUCCESS: "SUCCESS";
|
|
85
|
+
FAILED: "FAILED";
|
|
86
|
+
REFUNDED: "REFUNDED";
|
|
87
|
+
CANCELLED: "CANCELLED";
|
|
88
|
+
}>;
|
|
89
|
+
items: z.ZodArray<z.ZodObject<{
|
|
90
|
+
id: z.ZodNumber;
|
|
91
|
+
productId: z.ZodNumber;
|
|
92
|
+
variantId: z.ZodNumber;
|
|
93
|
+
quantity: z.ZodNumber;
|
|
94
|
+
price: z.ZodObject<{
|
|
95
|
+
usd: z.ZodString;
|
|
96
|
+
rub: z.ZodString;
|
|
97
|
+
uah: z.ZodString;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
deliveredAt: z.ZodNullable<z.ZodString>;
|
|
100
|
+
status: z.ZodEnum<{
|
|
101
|
+
PENDING: "PENDING";
|
|
102
|
+
PROCESSING: "PROCESSING";
|
|
103
|
+
FAILED: "FAILED";
|
|
104
|
+
REFUNDED: "REFUNDED";
|
|
105
|
+
DELIVERED: "DELIVERED";
|
|
106
|
+
}>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
createdAt: z.ZodString;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
export type OrderResponse = z.infer<typeof OrderResponseSchema>;
|
|
111
|
+
export { MoneyAmountSchema };
|
|
112
|
+
//# sourceMappingURL=dtos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dtos.d.ts","sourceRoot":"","sources":["../../../src/domains/orders/dtos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvH,eAAO,MAAM,iBAAiB;;;;;;;;;EAS5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;iBAQlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoneyAmountSchema = exports.OrderResponseSchema = exports.OrderItemResponseSchema = exports.OrderItemRequestSchema = exports.OrderStatusSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const money_1 = require("../../shared/money");
|
|
6
|
+
Object.defineProperty(exports, "MoneyAmountSchema", { enumerable: true, get: function () { return money_1.MoneyAmountSchema; } });
|
|
7
|
+
exports.OrderStatusSchema = zod_1.z.enum([
|
|
8
|
+
"PENDING",
|
|
9
|
+
"AWAITING_PAYMENT",
|
|
10
|
+
"PAID",
|
|
11
|
+
"PROCESSING",
|
|
12
|
+
"SUCCESS",
|
|
13
|
+
"FAILED",
|
|
14
|
+
"REFUNDED",
|
|
15
|
+
"CANCELLED",
|
|
16
|
+
]);
|
|
17
|
+
exports.OrderItemRequestSchema = zod_1.z.object({
|
|
18
|
+
variantId: zod_1.z.number().int().positive(),
|
|
19
|
+
quantity: zod_1.z.number().int().positive().default(1),
|
|
20
|
+
gameUsername: zod_1.z.string().min(1).max(256).optional(),
|
|
21
|
+
gameUsernameType: zod_1.z.string().max(64).optional(),
|
|
22
|
+
});
|
|
23
|
+
exports.OrderItemResponseSchema = zod_1.z.object({
|
|
24
|
+
id: zod_1.z.number().int().positive(),
|
|
25
|
+
productId: zod_1.z.number().int().positive(),
|
|
26
|
+
variantId: zod_1.z.number().int().positive(),
|
|
27
|
+
quantity: zod_1.z.number().int().positive(),
|
|
28
|
+
price: money_1.MoneyTripletSchema,
|
|
29
|
+
deliveredAt: zod_1.z.string().nullable(),
|
|
30
|
+
status: zod_1.z.enum(["PENDING", "PROCESSING", "DELIVERED", "FAILED", "REFUNDED"]),
|
|
31
|
+
});
|
|
32
|
+
exports.OrderResponseSchema = zod_1.z.object({
|
|
33
|
+
id: zod_1.z.number().int().positive(),
|
|
34
|
+
email: zod_1.z.string().email(),
|
|
35
|
+
displayCurrency: money_1.CurrencySchema,
|
|
36
|
+
subtotal: money_1.MoneyTripletSchema,
|
|
37
|
+
discount: money_1.MoneyTripletSchema,
|
|
38
|
+
total: money_1.MoneyTripletSchema,
|
|
39
|
+
exchangeRateSnapshot: money_1.ExchangeRateSnapshotSchema,
|
|
40
|
+
status: exports.OrderStatusSchema,
|
|
41
|
+
items: zod_1.z.array(exports.OrderItemResponseSchema),
|
|
42
|
+
createdAt: zod_1.z.string(),
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=dtos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dtos.js","sourceRoot":"","sources":["../../../src/domains/orders/dtos.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,8CAAuH;AA+C9G,kGA/CgE,yBAAiB,OA+ChE;AA7Cb,QAAA,iBAAiB,GAAG,OAAC,CAAC,IAAI,CAAC;IACvC,SAAS;IACT,kBAAkB;IAClB,MAAM;IACN,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;IACV,WAAW;CACX,CAAC,CAAC;AAGU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACnD,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC;AAGU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACrC,KAAK,EAAE,0BAAkB;IACzB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;CAC5E,CAAC,CAAC;AAGU,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACzB,eAAe,EAAE,sBAAc;IAC/B,QAAQ,EAAE,0BAAkB;IAC5B,QAAQ,EAAE,0BAAkB;IAC5B,KAAK,EAAE,0BAAkB;IACzB,oBAAoB,EAAE,kCAA0B;IAChD,MAAM,EAAE,yBAAiB;IACzB,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,+BAAuB,CAAC;IACvC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const OrderCreatedEventSchema: z.ZodObject<{
|
|
3
|
+
orderId: z.ZodNumber;
|
|
4
|
+
userId: z.ZodNullable<z.ZodNumber>;
|
|
5
|
+
email: z.ZodString;
|
|
6
|
+
displayCurrency: z.ZodEnum<{
|
|
7
|
+
USD: "USD";
|
|
8
|
+
RUB: "RUB";
|
|
9
|
+
UAH: "UAH";
|
|
10
|
+
}>;
|
|
11
|
+
subtotalUsd: z.ZodString;
|
|
12
|
+
at: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type OrderCreatedEvent = z.infer<typeof OrderCreatedEventSchema>;
|
|
15
|
+
export declare const OrderSucceededEventSchema: z.ZodObject<{
|
|
16
|
+
orderId: z.ZodNumber;
|
|
17
|
+
subtotalUsd: z.ZodString;
|
|
18
|
+
at: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type OrderSucceededEvent = z.infer<typeof OrderSucceededEventSchema>;
|
|
21
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/domains/orders/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;iBAOlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderSucceededEventSchema = exports.OrderCreatedEventSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const money_1 = require("../../shared/money");
|
|
6
|
+
exports.OrderCreatedEventSchema = zod_1.z.object({
|
|
7
|
+
orderId: zod_1.z.number().int().positive(),
|
|
8
|
+
userId: zod_1.z.number().int().positive().nullable(),
|
|
9
|
+
email: zod_1.z.string().email(),
|
|
10
|
+
displayCurrency: money_1.CurrencySchema,
|
|
11
|
+
subtotalUsd: money_1.MoneyAmountSchema,
|
|
12
|
+
at: zod_1.z.string(),
|
|
13
|
+
});
|
|
14
|
+
exports.OrderSucceededEventSchema = zod_1.z.object({
|
|
15
|
+
orderId: zod_1.z.number().int().positive(),
|
|
16
|
+
subtotalUsd: money_1.MoneyAmountSchema,
|
|
17
|
+
at: zod_1.z.string(),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/domains/orders/events.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,8CAAuE;AAE1D,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACzB,eAAe,EAAE,sBAAc;IAC/B,WAAW,EAAE,yBAAiB;IAC9B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACd,CAAC,CAAC;AAGU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,yBAAiB;IAC9B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACd,CAAC,CAAC"}
|