@purpleschool/multisite 0.0.19 → 0.0.20

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.
Files changed (57) hide show
  1. package/api/controller/http/subscription.ts +5 -2
  2. package/api/routes.ts +8 -2
  3. package/build/api/controller/http/subscription.d.ts +5 -2
  4. package/build/api/controller/http/subscription.d.ts.map +1 -1
  5. package/build/api/controller/http/subscription.js +5 -2
  6. package/build/api/routes.d.ts +3 -0
  7. package/build/api/routes.d.ts.map +1 -1
  8. package/build/api/routes.js +5 -2
  9. package/build/commands/subscription/delete-subscription.command.d.ts +20 -0
  10. package/build/commands/subscription/delete-subscription.command.d.ts.map +1 -0
  11. package/build/commands/subscription/delete-subscription.command.js +13 -0
  12. package/build/commands/subscription/index.d.ts +3 -0
  13. package/build/commands/subscription/index.d.ts.map +1 -1
  14. package/build/commands/subscription/index.js +3 -0
  15. package/build/commands/subscription/refund-subscription.command.d.ts +20 -0
  16. package/build/commands/subscription/refund-subscription.command.d.ts.map +1 -0
  17. package/build/commands/subscription/refund-subscription.command.js +13 -0
  18. package/build/commands/subscription/update-subscription.command.d.ts +148 -0
  19. package/build/commands/subscription/update-subscription.command.d.ts.map +1 -0
  20. package/build/commands/subscription/update-subscription.command.js +30 -0
  21. package/build/constants/cloud-payments/index.d.ts +1 -0
  22. package/build/constants/cloud-payments/index.d.ts.map +1 -1
  23. package/build/constants/cloud-payments/index.js +2 -1
  24. package/build/constants/errors/errors.d.ts +5 -0
  25. package/build/constants/errors/errors.d.ts.map +1 -1
  26. package/build/constants/errors/errors.js +5 -0
  27. package/build/queries/user/find-users.command.d.ts +16 -0
  28. package/build/queries/user/find-users.command.d.ts.map +1 -1
  29. package/build/queries/user/find-users.command.js +2 -0
  30. package/build/queries/user/get-all-users.command.d.ts +11 -1
  31. package/build/queries/user/get-all-users.command.d.ts.map +1 -1
  32. package/build/queries/user/get-all-users.command.js +2 -0
  33. package/build/queries/user/get-my-subscriptions.command.d.ts +5 -0
  34. package/build/queries/user/get-my-subscriptions.command.d.ts.map +1 -1
  35. package/build/queries/user/get-my-subscriptions.command.js +1 -0
  36. package/build/queries/user/get-user-payments.command.d.ts +134 -0
  37. package/build/queries/user/get-user-payments.command.d.ts.map +1 -0
  38. package/build/queries/user/get-user-payments.command.js +27 -0
  39. package/build/queries/user/get-user.command.d.ts +11 -1
  40. package/build/queries/user/get-user.command.d.ts.map +1 -1
  41. package/build/queries/user/get-user.command.js +2 -0
  42. package/build/queries/user/index.d.ts +1 -0
  43. package/build/queries/user/index.d.ts.map +1 -1
  44. package/build/queries/user/index.js +1 -0
  45. package/commands/subscription/delete-subscription.command.ts +13 -0
  46. package/commands/subscription/index.ts +3 -0
  47. package/commands/subscription/refund-subscription.command.ts +13 -0
  48. package/commands/subscription/update-subscription.command.ts +34 -0
  49. package/constants/cloud-payments/index.ts +1 -0
  50. package/constants/errors/errors.ts +5 -0
  51. package/package.json +1 -1
  52. package/queries/user/find-users.command.ts +2 -0
  53. package/queries/user/get-all-users.command.ts +3 -1
  54. package/queries/user/get-my-subscriptions.command.ts +1 -0
  55. package/queries/user/get-user-payments.command.ts +26 -0
  56. package/queries/user/get-user.command.ts +3 -1
  57. package/queries/user/index.ts +1 -0
@@ -7,6 +7,9 @@ export const SUBSCRIPTION_ROUTES = {
7
7
  FAST_BUY: 'fast/buy',
8
8
  SUMMARY: 'summary',
9
9
  GET_MY: 'my',
10
- CANCEL: 'cancel',
11
- RECOVER: 'recover',
10
+ CANCEL: (uuid: string) => `${uuid}/cancel`,
11
+ RECOVER: (uuid: string) => `${uuid}/recover`,
12
+ UPDATE: (uuid: string) => `${uuid}`,
13
+ DELETE: (uuid: string) => `${uuid}`,
14
+ REFUND: (uuid: string) => `${uuid}/refund`,
12
15
  } as const;
package/api/routes.ts CHANGED
@@ -62,9 +62,15 @@ export const REST_API = {
62
62
  SUMMARY: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.SUMMARY}`,
63
63
  GET_MY: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_MY}`,
64
64
  CANCEL: (uuid: string) =>
65
- `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.CANCEL}`,
65
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.CANCEL(uuid)}`,
66
66
  RECOVER: (uuid: string) =>
67
- `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.RECOVER}`,
67
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.RECOVER(uuid)}`,
68
+ UPDATE: (uuid: string) =>
69
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.UPDATE(uuid)}`,
70
+ DELETE: (uuid: string) =>
71
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.DELETE(uuid)}`,
72
+ REFUND: (uuid: string) =>
73
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.REFUND(uuid)}`,
68
74
  },
69
75
  PAYMENT: {
70
76
  HISTORY: `${ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.HISTORY}`,
@@ -6,7 +6,10 @@ export declare const SUBSCRIPTION_ROUTES: {
6
6
  readonly FAST_BUY: "fast/buy";
7
7
  readonly SUMMARY: "summary";
8
8
  readonly GET_MY: "my";
9
- readonly CANCEL: "cancel";
10
- readonly RECOVER: "recover";
9
+ readonly CANCEL: (uuid: string) => string;
10
+ readonly RECOVER: (uuid: string) => string;
11
+ readonly UPDATE: (uuid: string) => string;
12
+ readonly DELETE: (uuid: string) => string;
13
+ readonly REFUND: (uuid: string) => string;
11
14
  };
12
15
  //# sourceMappingURL=subscription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/subscription.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,EAAG,sBAA+B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,EAAG,qBAA8B,CAAC;AAE7E,eAAO,MAAM,mBAAmB;;;;;;;;CAQtB,CAAC"}
1
+ {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/subscription.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,EAAG,sBAA+B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,EAAG,qBAA8B,CAAC;AAE7E,eAAO,MAAM,mBAAmB;;;;;;4BAMb,MAAM;6BACL,MAAM;4BACP,MAAM;4BACN,MAAM;4BACN,MAAM;CACf,CAAC"}
@@ -9,6 +9,9 @@ exports.SUBSCRIPTION_ROUTES = {
9
9
  FAST_BUY: 'fast/buy',
10
10
  SUMMARY: 'summary',
11
11
  GET_MY: 'my',
12
- CANCEL: 'cancel',
13
- RECOVER: 'recover',
12
+ CANCEL: (uuid) => `${uuid}/cancel`,
13
+ RECOVER: (uuid) => `${uuid}/recover`,
14
+ UPDATE: (uuid) => `${uuid}`,
15
+ DELETE: (uuid) => `${uuid}`,
16
+ REFUND: (uuid) => `${uuid}/refund`,
14
17
  };
@@ -51,6 +51,9 @@ export declare const REST_API: {
51
51
  readonly GET_MY: "/api/subscription/private/my";
52
52
  readonly CANCEL: (uuid: string) => string;
53
53
  readonly RECOVER: (uuid: string) => string;
54
+ readonly UPDATE: (uuid: string) => string;
55
+ readonly DELETE: (uuid: string) => string;
56
+ readonly REFUND: (uuid: string) => string;
54
57
  };
55
58
  readonly PAYMENT: {
56
59
  readonly HISTORY: "/api/payments/history";
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AAEpC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;sCA0BQ,MAAM;qCAEP,MAAM;2CAEA,MAAM;sCAEX,MAAM;sCAEN,MAAM;;;;kCAKV,MAAM;;;;6BAKX,MAAM;;;;;kCAMD,MAAM;;;;6BAKX,MAAM;;;gCAIH,MAAM;iCAEL,MAAM;;;;;;kCAOL,MAAM;;;;;;iCAOP,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;iCAQJ,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;iCASL,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;;;;iCAYL,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;6BAQR,MAAM;;;;;6BAKN,MAAM;;;;;;;;sCAQG,MAAM;wCAEJ,MAAM;;gCAGd,MAAM;gCAEN,MAAM;iDAEW,MAAM;;;;sCAKjB,MAAM;;gCAGZ,MAAM;gCAEN,MAAM;;CAGnB,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AAEpC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;sCA0BQ,MAAM;qCAEP,MAAM;2CAEA,MAAM;sCAEX,MAAM;sCAEN,MAAM;;;;kCAKV,MAAM;;;;6BAKX,MAAM;;;;;kCAMD,MAAM;;;;6BAKX,MAAM;;;gCAIH,MAAM;iCAEL,MAAM;gCAEP,MAAM;gCAEN,MAAM;gCAEN,MAAM;;;;;;kCAOJ,MAAM;;;;;;iCAOP,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;iCAQJ,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;iCASL,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;;;;iCAYL,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;6BAQR,MAAM;;;;;6BAKN,MAAM;;;;;;;;sCAQG,MAAM;wCAEJ,MAAM;;gCAGd,MAAM;gCAEN,MAAM;iDAEW,MAAM;;;;sCAKjB,MAAM;;gCAGZ,MAAM;gCAEN,MAAM;;CAGnB,CAAC"}
@@ -86,8 +86,11 @@ exports.REST_API = {
86
86
  BUY: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.BUY}`,
87
87
  SUMMARY: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.SUMMARY}`,
88
88
  GET_MY: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_MY}`,
89
- CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.CANCEL}`,
90
- RECOVER: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.RECOVER}`,
89
+ CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.CANCEL(uuid)}`,
90
+ RECOVER: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.RECOVER(uuid)}`,
91
+ UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.UPDATE(uuid)}`,
92
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.DELETE(uuid)}`,
93
+ REFUND: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.REFUND(uuid)}`,
91
94
  },
92
95
  PAYMENT: {
93
96
  HISTORY: `${exports.ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.HISTORY}`,
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare namespace DeleteSubscriptionCommand {
3
+ const RequestParamSchema: z.ZodObject<{
4
+ uuid: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ uuid: string;
7
+ }, {
8
+ uuid: string;
9
+ }>;
10
+ type RequestParam = z.infer<typeof RequestParamSchema>;
11
+ const ResponseSchema: z.ZodObject<{
12
+ data: z.ZodBoolean;
13
+ }, "strip", z.ZodTypeAny, {
14
+ data: boolean;
15
+ }, {
16
+ data: boolean;
17
+ }>;
18
+ type Response = z.infer<typeof ResponseSchema>;
19
+ }
20
+ //# sourceMappingURL=delete-subscription.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-subscription.command.d.ts","sourceRoot":"","sources":["../../../commands/subscription/delete-subscription.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yBAAiB,yBAAyB,CAAC;IAChC,MAAM,kBAAkB;;;;;;MAE7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;MAEzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteSubscriptionCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var DeleteSubscriptionCommand;
6
+ (function (DeleteSubscriptionCommand) {
7
+ DeleteSubscriptionCommand.RequestParamSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ DeleteSubscriptionCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.boolean(),
12
+ });
13
+ })(DeleteSubscriptionCommand || (exports.DeleteSubscriptionCommand = DeleteSubscriptionCommand = {}));
@@ -2,4 +2,7 @@ export * from './buy-subscription.command';
2
2
  export * from './fast-buy-subscription.command';
3
3
  export * from './cancel-subscription.command';
4
4
  export * from './recover-subscription.command';
5
+ export * from './update-subscription.command';
6
+ export * from './delete-subscription.command';
7
+ export * from './refund-subscription.command';
5
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/subscription/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/subscription/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC"}
@@ -18,3 +18,6 @@ __exportStar(require("./buy-subscription.command"), exports);
18
18
  __exportStar(require("./fast-buy-subscription.command"), exports);
19
19
  __exportStar(require("./cancel-subscription.command"), exports);
20
20
  __exportStar(require("./recover-subscription.command"), exports);
21
+ __exportStar(require("./update-subscription.command"), exports);
22
+ __exportStar(require("./delete-subscription.command"), exports);
23
+ __exportStar(require("./refund-subscription.command"), exports);
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare namespace RefundSubscriptionCommand {
3
+ const RequestParamSchema: z.ZodObject<{
4
+ uuid: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ uuid: string;
7
+ }, {
8
+ uuid: string;
9
+ }>;
10
+ type RequestParam = z.infer<typeof RequestParamSchema>;
11
+ const ResponseSchema: z.ZodObject<{
12
+ data: z.ZodBoolean;
13
+ }, "strip", z.ZodTypeAny, {
14
+ data: boolean;
15
+ }, {
16
+ data: boolean;
17
+ }>;
18
+ type Response = z.infer<typeof ResponseSchema>;
19
+ }
20
+ //# sourceMappingURL=refund-subscription.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refund-subscription.command.d.ts","sourceRoot":"","sources":["../../../commands/subscription/refund-subscription.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yBAAiB,yBAAyB,CAAC;IAChC,MAAM,kBAAkB;;;;;;MAE7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;MAEzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RefundSubscriptionCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var RefundSubscriptionCommand;
6
+ (function (RefundSubscriptionCommand) {
7
+ RefundSubscriptionCommand.RequestParamSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ RefundSubscriptionCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.boolean(),
12
+ });
13
+ })(RefundSubscriptionCommand || (exports.RefundSubscriptionCommand = RefundSubscriptionCommand = {}));
@@ -0,0 +1,148 @@
1
+ import { z } from 'zod';
2
+ export declare namespace UpdateSubscriptionCommand {
3
+ const RequestParamSchema: z.ZodObject<{
4
+ uuid: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ uuid: string;
7
+ }, {
8
+ uuid: string;
9
+ }>;
10
+ type RequestParam = z.infer<typeof RequestParamSchema>;
11
+ const RequestSchema: z.ZodObject<{
12
+ name: z.ZodOptional<z.ZodString>;
13
+ description: z.ZodOptional<z.ZodString>;
14
+ price: z.ZodOptional<z.ZodNumber>;
15
+ interval: z.ZodOptional<z.ZodString>;
16
+ period: z.ZodOptional<z.ZodNumber>;
17
+ tokens: z.ZodOptional<z.ZodNumber>;
18
+ discount: z.ZodOptional<z.ZodNumber>;
19
+ features: z.ZodOptional<z.ZodArray<z.ZodObject<{
20
+ type: z.ZodString;
21
+ name: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ type: string;
24
+ name: string;
25
+ }, {
26
+ type: string;
27
+ name: string;
28
+ }>, "many">>;
29
+ carryoverPercent: z.ZodOptional<z.ZodNumber>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ price?: number | undefined;
32
+ interval?: string | undefined;
33
+ name?: string | undefined;
34
+ description?: string | undefined;
35
+ tokens?: number | undefined;
36
+ features?: {
37
+ type: string;
38
+ name: string;
39
+ }[] | undefined;
40
+ period?: number | undefined;
41
+ discount?: number | undefined;
42
+ carryoverPercent?: number | undefined;
43
+ }, {
44
+ price?: number | undefined;
45
+ interval?: string | undefined;
46
+ name?: string | undefined;
47
+ description?: string | undefined;
48
+ tokens?: number | undefined;
49
+ features?: {
50
+ type: string;
51
+ name: string;
52
+ }[] | undefined;
53
+ period?: number | undefined;
54
+ discount?: number | undefined;
55
+ carryoverPercent?: number | undefined;
56
+ }>;
57
+ type Request = z.infer<typeof RequestSchema>;
58
+ const ResponseSchema: z.ZodObject<{
59
+ data: z.ZodObject<{
60
+ uuid: z.ZodString;
61
+ siteId: z.ZodString;
62
+ name: z.ZodString;
63
+ description: z.ZodString;
64
+ price: z.ZodNumber;
65
+ interval: z.ZodString;
66
+ period: z.ZodNumber;
67
+ tokens: z.ZodNumber;
68
+ discount: z.ZodNumber;
69
+ features: z.ZodArray<z.ZodObject<{
70
+ type: z.ZodString;
71
+ name: z.ZodString;
72
+ }, "strip", z.ZodTypeAny, {
73
+ type: string;
74
+ name: string;
75
+ }, {
76
+ type: string;
77
+ name: string;
78
+ }>, "many">;
79
+ carryoverPercent: z.ZodNumber;
80
+ }, "strip", z.ZodTypeAny, {
81
+ price: number;
82
+ interval: string;
83
+ uuid: string;
84
+ siteId: string;
85
+ name: string;
86
+ description: string;
87
+ tokens: number;
88
+ features: {
89
+ type: string;
90
+ name: string;
91
+ }[];
92
+ period: number;
93
+ discount: number;
94
+ carryoverPercent: number;
95
+ }, {
96
+ price: number;
97
+ interval: string;
98
+ uuid: string;
99
+ siteId: string;
100
+ name: string;
101
+ description: string;
102
+ tokens: number;
103
+ features: {
104
+ type: string;
105
+ name: string;
106
+ }[];
107
+ period: number;
108
+ discount: number;
109
+ carryoverPercent: number;
110
+ }>;
111
+ }, "strip", z.ZodTypeAny, {
112
+ data: {
113
+ price: number;
114
+ interval: string;
115
+ uuid: string;
116
+ siteId: string;
117
+ name: string;
118
+ description: string;
119
+ tokens: number;
120
+ features: {
121
+ type: string;
122
+ name: string;
123
+ }[];
124
+ period: number;
125
+ discount: number;
126
+ carryoverPercent: number;
127
+ };
128
+ }, {
129
+ data: {
130
+ price: number;
131
+ interval: string;
132
+ uuid: string;
133
+ siteId: string;
134
+ name: string;
135
+ description: string;
136
+ tokens: number;
137
+ features: {
138
+ type: string;
139
+ name: string;
140
+ }[];
141
+ period: number;
142
+ discount: number;
143
+ carryoverPercent: number;
144
+ };
145
+ }>;
146
+ type Response = z.infer<typeof ResponseSchema>;
147
+ }
148
+ //# sourceMappingURL=update-subscription.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-subscription.command.d.ts","sourceRoot":"","sources":["../../../commands/subscription/update-subscription.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,yBAAiB,yBAAyB,CAAC;IAChC,MAAM,kBAAkB;;;;;;MAE7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBxB,CAAC;IACH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateSubscriptionCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var UpdateSubscriptionCommand;
7
+ (function (UpdateSubscriptionCommand) {
8
+ UpdateSubscriptionCommand.RequestParamSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ UpdateSubscriptionCommand.RequestSchema = zod_1.z.object({
12
+ name: zod_1.z.string().min(1).max(200).optional(),
13
+ description: zod_1.z.string().min(1).max(2000).optional(),
14
+ price: zod_1.z.number().int().min(0).optional(),
15
+ interval: zod_1.z.string().max(20).optional(),
16
+ period: zod_1.z.number().int().min(1).max(36).optional(),
17
+ tokens: zod_1.z.number().int().min(0).optional(),
18
+ discount: zod_1.z.number().int().min(0).optional(),
19
+ features: zod_1.z
20
+ .array(zod_1.z.object({
21
+ type: zod_1.z.string(),
22
+ name: zod_1.z.string(),
23
+ }))
24
+ .optional(),
25
+ carryoverPercent: zod_1.z.number().int().min(0).max(100).optional(),
26
+ });
27
+ UpdateSubscriptionCommand.ResponseSchema = zod_1.z.object({
28
+ data: models_1.SubscriptionSchema,
29
+ });
30
+ })(UpdateSubscriptionCommand || (exports.UpdateSubscriptionCommand = UpdateSubscriptionCommand = {}));
@@ -1,2 +1,3 @@
1
1
  export declare const CLOUD_PAYMENTS_CANCEL = "https://api.cloudpayments.ru/subscriptions/cancel";
2
+ export declare const CLOUD_PAYMENTS_REFUND = "https://api.cloudpayments.ru/payments/refund";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../constants/cloud-payments/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,sDAAsD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../constants/cloud-payments/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,sDAAsD,CAAC;AACzF,eAAO,MAAM,qBAAqB,iDAAiD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLOUD_PAYMENTS_CANCEL = void 0;
3
+ exports.CLOUD_PAYMENTS_REFUND = exports.CLOUD_PAYMENTS_CANCEL = void 0;
4
4
  exports.CLOUD_PAYMENTS_CANCEL = 'https://api.cloudpayments.ru/subscriptions/cancel';
5
+ exports.CLOUD_PAYMENTS_REFUND = 'https://api.cloudpayments.ru/payments/refund';
@@ -209,6 +209,11 @@ export declare const ERRORS: {
209
209
  readonly code: "SUBSCRIPTION_007";
210
210
  readonly httpCode: 500;
211
211
  };
212
+ readonly SUBSCRIPTION_REFUND_ERROR: {
213
+ readonly message: "Ошибка при возврате подписки";
214
+ readonly code: "SUBSCRIPTION_008";
215
+ readonly httpCode: 500;
216
+ };
212
217
  readonly ORDER_NOT_FOUND: {
213
218
  readonly message: "Заказ не найден";
214
219
  readonly code: "ORDER_001";
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2xBT,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgyBT,CAAC"}
@@ -218,6 +218,11 @@ exports.ERRORS = {
218
218
  code: 'SUBSCRIPTION_007',
219
219
  httpCode: 500,
220
220
  },
221
+ SUBSCRIPTION_REFUND_ERROR: {
222
+ message: 'Ошибка при возврате подписки',
223
+ code: 'SUBSCRIPTION_008',
224
+ httpCode: 500,
225
+ },
221
226
  // ORDER
222
227
  ORDER_NOT_FOUND: {
223
228
  message: 'Заказ не найден',
@@ -28,34 +28,46 @@ export declare namespace FindUsersCommand {
28
28
  uuid: z.ZodString;
29
29
  email: z.ZodString;
30
30
  role: z.ZodNativeEnum<typeof USER_ROLE>;
31
+ status: z.ZodNativeEnum<typeof USER_STATUS>;
31
32
  siteId: z.ZodString;
33
+ tokenBonusBalance: z.ZodNumber;
32
34
  }, "strip", z.ZodTypeAny, {
33
35
  email: string;
34
36
  uuid: string;
35
37
  siteId: string;
36
38
  role: USER_ROLE;
39
+ status: USER_STATUS;
40
+ tokenBonusBalance: number;
37
41
  }, {
38
42
  email: string;
39
43
  uuid: string;
40
44
  siteId: string;
41
45
  role: USER_ROLE;
46
+ status: USER_STATUS;
47
+ tokenBonusBalance: number;
42
48
  }>;
43
49
  const ResponseSchema: z.ZodObject<{
44
50
  data: z.ZodArray<z.ZodObject<{
45
51
  uuid: z.ZodString;
46
52
  email: z.ZodString;
47
53
  role: z.ZodNativeEnum<typeof USER_ROLE>;
54
+ status: z.ZodNativeEnum<typeof USER_STATUS>;
48
55
  siteId: z.ZodString;
56
+ tokenBonusBalance: z.ZodNumber;
49
57
  }, "strip", z.ZodTypeAny, {
50
58
  email: string;
51
59
  uuid: string;
52
60
  siteId: string;
53
61
  role: USER_ROLE;
62
+ status: USER_STATUS;
63
+ tokenBonusBalance: number;
54
64
  }, {
55
65
  email: string;
56
66
  uuid: string;
57
67
  siteId: string;
58
68
  role: USER_ROLE;
69
+ status: USER_STATUS;
70
+ tokenBonusBalance: number;
59
71
  }>, "many">;
60
72
  totalPages: z.ZodNumber;
61
73
  page: z.ZodNumber;
@@ -66,6 +78,8 @@ export declare namespace FindUsersCommand {
66
78
  uuid: string;
67
79
  siteId: string;
68
80
  role: USER_ROLE;
81
+ status: USER_STATUS;
82
+ tokenBonusBalance: number;
69
83
  }[];
70
84
  totalPages: number;
71
85
  }, {
@@ -75,6 +89,8 @@ export declare namespace FindUsersCommand {
75
89
  uuid: string;
76
90
  siteId: string;
77
91
  role: USER_ROLE;
92
+ status: USER_STATUS;
93
+ tokenBonusBalance: number;
78
94
  }[];
79
95
  totalPages: number;
80
96
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"find-users.command.d.ts","sourceRoot":"","sources":["../../../queries/user/find-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,yBAAiB,gBAAgB,CAAC;IACvB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;MAO7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,kBAAkB;;;;;;;;;;;;;;;MAK7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAIzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"find-users.command.d.ts","sourceRoot":"","sources":["../../../queries/user/find-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,yBAAiB,gBAAgB,CAAC;IACvB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;MAO7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;MAO7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAIzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -17,7 +17,9 @@ var FindUsersCommand;
17
17
  uuid: zod_1.z.string().uuid(),
18
18
  email: zod_1.z.string().email(),
19
19
  role: zod_1.z.nativeEnum(constants_1.USER_ROLE),
20
+ status: zod_1.z.nativeEnum(constants_1.USER_STATUS),
20
21
  siteId: zod_1.z.string().uuid(),
22
+ tokenBonusBalance: zod_1.z.number().int(),
21
23
  });
22
24
  FindUsersCommand.ResponseSchema = zod_1.z.object({
23
25
  data: zod_1.z.array(FindUsersCommand.ResponseItemSchema),
@@ -1,22 +1,28 @@
1
1
  import { z } from 'zod';
2
- import { USER_ROLE } from '../../constants';
2
+ import { USER_ROLE, USER_STATUS } from '../../constants';
3
3
  export declare namespace GetAllUsersCommand {
4
4
  const ResponseSchema: z.ZodObject<{
5
5
  data: z.ZodArray<z.ZodObject<{
6
6
  uuid: z.ZodString;
7
7
  email: z.ZodString;
8
8
  role: z.ZodNativeEnum<typeof USER_ROLE>;
9
+ status: z.ZodNativeEnum<typeof USER_STATUS>;
9
10
  siteId: z.ZodString;
11
+ tokenBonusBalance: z.ZodNumber;
10
12
  }, "strip", z.ZodTypeAny, {
11
13
  email: string;
12
14
  uuid: string;
13
15
  siteId: string;
14
16
  role: USER_ROLE;
17
+ status: USER_STATUS;
18
+ tokenBonusBalance: number;
15
19
  }, {
16
20
  email: string;
17
21
  uuid: string;
18
22
  siteId: string;
19
23
  role: USER_ROLE;
24
+ status: USER_STATUS;
25
+ tokenBonusBalance: number;
20
26
  }>, "many">;
21
27
  }, "strip", z.ZodTypeAny, {
22
28
  data: {
@@ -24,6 +30,8 @@ export declare namespace GetAllUsersCommand {
24
30
  uuid: string;
25
31
  siteId: string;
26
32
  role: USER_ROLE;
33
+ status: USER_STATUS;
34
+ tokenBonusBalance: number;
27
35
  }[];
28
36
  }, {
29
37
  data: {
@@ -31,6 +39,8 @@ export declare namespace GetAllUsersCommand {
31
39
  uuid: string;
32
40
  siteId: string;
33
41
  role: USER_ROLE;
42
+ status: USER_STATUS;
43
+ tokenBonusBalance: number;
34
44
  }[];
35
45
  }>;
36
46
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-all-users.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-all-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MASzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"get-all-users.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-all-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAWzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -10,7 +10,9 @@ var GetAllUsersCommand;
10
10
  uuid: zod_1.z.string().uuid(),
11
11
  email: zod_1.z.string().email(),
12
12
  role: zod_1.z.nativeEnum(constants_1.USER_ROLE),
13
+ status: zod_1.z.nativeEnum(constants_1.USER_STATUS),
13
14
  siteId: zod_1.z.string().uuid(),
15
+ tokenBonusBalance: zod_1.z.number().int(),
14
16
  })),
15
17
  });
16
18
  })(GetAllUsersCommand || (exports.GetAllUsersCommand = GetAllUsersCommand = {}));
@@ -9,6 +9,7 @@ export declare namespace GetMySubscriptionsCommand {
9
9
  carriedOverTokenBalance: z.ZodNumber;
10
10
  status: z.ZodNativeEnum<typeof USER_TO_SUBSCRIPTION_STATUS>;
11
11
  active: z.ZodBoolean;
12
+ endDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
12
13
  createdAt: z.ZodUnion<[z.ZodDate, z.ZodString]>;
13
14
  subscription: z.ZodObject<{
14
15
  uuid: z.ZodString;
@@ -86,6 +87,7 @@ export declare namespace GetMySubscriptionsCommand {
86
87
  discount: number;
87
88
  carryoverPercent: number;
88
89
  };
90
+ endDate: string | Date | null;
89
91
  }, {
90
92
  active: boolean;
91
93
  uuid: string;
@@ -110,6 +112,7 @@ export declare namespace GetMySubscriptionsCommand {
110
112
  discount: number;
111
113
  carryoverPercent: number;
112
114
  };
115
+ endDate: string | Date | null;
113
116
  }>, "many">;
114
117
  }, "strip", z.ZodTypeAny, {
115
118
  data: {
@@ -136,6 +139,7 @@ export declare namespace GetMySubscriptionsCommand {
136
139
  discount: number;
137
140
  carryoverPercent: number;
138
141
  };
142
+ endDate: string | Date | null;
139
143
  }[];
140
144
  }, {
141
145
  data: {
@@ -162,6 +166,7 @@ export declare namespace GetMySubscriptionsCommand {
162
166
  discount: number;
163
167
  carryoverPercent: number;
164
168
  };
169
+ endDate: string | Date | null;
165
170
  }[];
166
171
  }>;
167
172
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-my-subscriptions.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-my-subscriptions.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D,yBAAiB,yBAAyB,CAAC;IAChC,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAazB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"get-my-subscriptions.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-my-subscriptions.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D,yBAAiB,yBAAyB,CAAC;IAChC,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAczB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -14,6 +14,7 @@ var GetMySubscriptionsCommand;
14
14
  carriedOverTokenBalance: zod_1.z.number().int(),
15
15
  status: zod_1.z.nativeEnum(constants_1.USER_TO_SUBSCRIPTION_STATUS),
16
16
  active: zod_1.z.boolean(),
17
+ endDate: zod_1.z.date().or(zod_1.z.string().datetime()).nullable(),
17
18
  createdAt: zod_1.z.date().or(zod_1.z.string().datetime()),
18
19
  subscription: models_1.SubscriptionSchema,
19
20
  })),
@@ -0,0 +1,134 @@
1
+ import { z } from 'zod';
2
+ import { ORDER_STATUS, ORDER_TYPE, PAYMENT_STATUS } from '../../constants';
3
+ export declare namespace GetUserPaymentsCommand {
4
+ const ResponseItemSchema: z.ZodObject<{
5
+ uuid: z.ZodString;
6
+ orderType: z.ZodNativeEnum<typeof ORDER_TYPE>;
7
+ orderStatus: z.ZodNativeEnum<typeof ORDER_STATUS>;
8
+ description: z.ZodString;
9
+ productId: z.ZodNullable<z.ZodString>;
10
+ productName: z.ZodNullable<z.ZodString>;
11
+ subscriptionId: z.ZodNullable<z.ZodString>;
12
+ subscriptionName: z.ZodNullable<z.ZodString>;
13
+ paymentStatus: z.ZodNativeEnum<typeof PAYMENT_STATUS>;
14
+ userId: z.ZodString;
15
+ userEmail: z.ZodString;
16
+ sum: z.ZodNumber;
17
+ currency: z.ZodString;
18
+ updatedAt: z.ZodUnion<[z.ZodDate, z.ZodString]>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ uuid: string;
21
+ description: string;
22
+ currency: string;
23
+ updatedAt: string | Date;
24
+ userId: string;
25
+ subscriptionId: string | null;
26
+ sum: number;
27
+ orderType: ORDER_TYPE;
28
+ orderStatus: ORDER_STATUS;
29
+ productId: string | null;
30
+ productName: string | null;
31
+ subscriptionName: string | null;
32
+ paymentStatus: PAYMENT_STATUS;
33
+ userEmail: string;
34
+ }, {
35
+ uuid: string;
36
+ description: string;
37
+ currency: string;
38
+ updatedAt: string | Date;
39
+ userId: string;
40
+ subscriptionId: string | null;
41
+ sum: number;
42
+ orderType: ORDER_TYPE;
43
+ orderStatus: ORDER_STATUS;
44
+ productId: string | null;
45
+ productName: string | null;
46
+ subscriptionName: string | null;
47
+ paymentStatus: PAYMENT_STATUS;
48
+ userEmail: string;
49
+ }>;
50
+ const ResponseSchema: z.ZodObject<{
51
+ data: z.ZodArray<z.ZodObject<{
52
+ uuid: z.ZodString;
53
+ orderType: z.ZodNativeEnum<typeof ORDER_TYPE>;
54
+ orderStatus: z.ZodNativeEnum<typeof ORDER_STATUS>;
55
+ description: z.ZodString;
56
+ productId: z.ZodNullable<z.ZodString>;
57
+ productName: z.ZodNullable<z.ZodString>;
58
+ subscriptionId: z.ZodNullable<z.ZodString>;
59
+ subscriptionName: z.ZodNullable<z.ZodString>;
60
+ paymentStatus: z.ZodNativeEnum<typeof PAYMENT_STATUS>;
61
+ userId: z.ZodString;
62
+ userEmail: z.ZodString;
63
+ sum: z.ZodNumber;
64
+ currency: z.ZodString;
65
+ updatedAt: z.ZodUnion<[z.ZodDate, z.ZodString]>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ uuid: string;
68
+ description: string;
69
+ currency: string;
70
+ updatedAt: string | Date;
71
+ userId: string;
72
+ subscriptionId: string | null;
73
+ sum: number;
74
+ orderType: ORDER_TYPE;
75
+ orderStatus: ORDER_STATUS;
76
+ productId: string | null;
77
+ productName: string | null;
78
+ subscriptionName: string | null;
79
+ paymentStatus: PAYMENT_STATUS;
80
+ userEmail: string;
81
+ }, {
82
+ uuid: string;
83
+ description: string;
84
+ currency: string;
85
+ updatedAt: string | Date;
86
+ userId: string;
87
+ subscriptionId: string | null;
88
+ sum: number;
89
+ orderType: ORDER_TYPE;
90
+ orderStatus: ORDER_STATUS;
91
+ productId: string | null;
92
+ productName: string | null;
93
+ subscriptionName: string | null;
94
+ paymentStatus: PAYMENT_STATUS;
95
+ userEmail: string;
96
+ }>, "many">;
97
+ }, "strip", z.ZodTypeAny, {
98
+ data: {
99
+ uuid: string;
100
+ description: string;
101
+ currency: string;
102
+ updatedAt: string | Date;
103
+ userId: string;
104
+ subscriptionId: string | null;
105
+ sum: number;
106
+ orderType: ORDER_TYPE;
107
+ orderStatus: ORDER_STATUS;
108
+ productId: string | null;
109
+ productName: string | null;
110
+ subscriptionName: string | null;
111
+ paymentStatus: PAYMENT_STATUS;
112
+ userEmail: string;
113
+ }[];
114
+ }, {
115
+ data: {
116
+ uuid: string;
117
+ description: string;
118
+ currency: string;
119
+ updatedAt: string | Date;
120
+ userId: string;
121
+ subscriptionId: string | null;
122
+ sum: number;
123
+ orderType: ORDER_TYPE;
124
+ orderStatus: ORDER_STATUS;
125
+ productId: string | null;
126
+ productName: string | null;
127
+ subscriptionName: string | null;
128
+ paymentStatus: PAYMENT_STATUS;
129
+ userEmail: string;
130
+ }[];
131
+ }>;
132
+ type Response = z.infer<typeof ResponseSchema>;
133
+ }
134
+ //# sourceMappingURL=get-user-payments.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-user-payments.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-user-payments.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE3E,yBAAiB,sBAAsB,CAAC;IAC7B,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAe7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUserPaymentsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ var GetUserPaymentsCommand;
7
+ (function (GetUserPaymentsCommand) {
8
+ GetUserPaymentsCommand.ResponseItemSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ orderType: zod_1.z.nativeEnum(constants_1.ORDER_TYPE),
11
+ orderStatus: zod_1.z.nativeEnum(constants_1.ORDER_STATUS),
12
+ description: zod_1.z.string(),
13
+ productId: zod_1.z.string().uuid().nullable(),
14
+ productName: zod_1.z.string().nullable(),
15
+ subscriptionId: zod_1.z.string().uuid().nullable(),
16
+ subscriptionName: zod_1.z.string().nullable(),
17
+ paymentStatus: zod_1.z.nativeEnum(constants_1.PAYMENT_STATUS),
18
+ userId: zod_1.z.string().uuid(),
19
+ userEmail: zod_1.z.string().email(),
20
+ sum: zod_1.z.number(),
21
+ currency: zod_1.z.string(),
22
+ updatedAt: zod_1.z.date().or(zod_1.z.string().datetime()),
23
+ });
24
+ GetUserPaymentsCommand.ResponseSchema = zod_1.z.object({
25
+ data: zod_1.z.array(GetUserPaymentsCommand.ResponseItemSchema),
26
+ });
27
+ })(GetUserPaymentsCommand || (exports.GetUserPaymentsCommand = GetUserPaymentsCommand = {}));
@@ -1,22 +1,28 @@
1
1
  import { z } from 'zod';
2
- import { USER_ROLE } from '../../constants';
2
+ import { USER_ROLE, USER_STATUS } from '../../constants';
3
3
  export declare namespace GetUserCommand {
4
4
  const ResponseSchema: z.ZodObject<{
5
5
  data: z.ZodObject<{
6
6
  uuid: z.ZodString;
7
7
  email: z.ZodString;
8
8
  role: z.ZodNativeEnum<typeof USER_ROLE>;
9
+ status: z.ZodNativeEnum<typeof USER_STATUS>;
9
10
  siteId: z.ZodString;
11
+ tokenBonusBalance: z.ZodNumber;
10
12
  }, "strip", z.ZodTypeAny, {
11
13
  email: string;
12
14
  uuid: string;
13
15
  siteId: string;
14
16
  role: USER_ROLE;
17
+ status: USER_STATUS;
18
+ tokenBonusBalance: number;
15
19
  }, {
16
20
  email: string;
17
21
  uuid: string;
18
22
  siteId: string;
19
23
  role: USER_ROLE;
24
+ status: USER_STATUS;
25
+ tokenBonusBalance: number;
20
26
  }>;
21
27
  }, "strip", z.ZodTypeAny, {
22
28
  data: {
@@ -24,6 +30,8 @@ export declare namespace GetUserCommand {
24
30
  uuid: string;
25
31
  siteId: string;
26
32
  role: USER_ROLE;
33
+ status: USER_STATUS;
34
+ tokenBonusBalance: number;
27
35
  };
28
36
  }, {
29
37
  data: {
@@ -31,6 +39,8 @@ export declare namespace GetUserCommand {
31
39
  uuid: string;
32
40
  siteId: string;
33
41
  role: USER_ROLE;
42
+ status: USER_STATUS;
43
+ tokenBonusBalance: number;
34
44
  };
35
45
  }>;
36
46
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-user.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-user.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,yBAAiB,cAAc,CAAC;IACrB,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAOzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"get-user.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-user.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,yBAAiB,cAAc,CAAC;IACrB,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MASzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -10,7 +10,9 @@ var GetUserCommand;
10
10
  uuid: zod_1.z.string().uuid(),
11
11
  email: zod_1.z.string().email(),
12
12
  role: zod_1.z.nativeEnum(constants_1.USER_ROLE),
13
+ status: zod_1.z.nativeEnum(constants_1.USER_STATUS),
13
14
  siteId: zod_1.z.string().uuid(),
15
+ tokenBonusBalance: zod_1.z.number().int(),
14
16
  }),
15
17
  });
16
18
  })(GetUserCommand || (exports.GetUserCommand = GetUserCommand = {}));
@@ -4,4 +4,5 @@ export * from './get-user-balance.command';
4
4
  export * from './get-my-products.command';
5
5
  export * from './get-my-subscriptions.command';
6
6
  export * from './find-users.command';
7
+ export * from './get-user-payments.command';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../queries/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../queries/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC"}
@@ -20,3 +20,4 @@ __exportStar(require("./get-user-balance.command"), exports);
20
20
  __exportStar(require("./get-my-products.command"), exports);
21
21
  __exportStar(require("./get-my-subscriptions.command"), exports);
22
22
  __exportStar(require("./find-users.command"), exports);
23
+ __exportStar(require("./get-user-payments.command"), exports);
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteSubscriptionCommand {
4
+ export const RequestParamSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
8
+
9
+ export const ResponseSchema = z.object({
10
+ data: z.boolean(),
11
+ });
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -2,3 +2,6 @@ export * from './buy-subscription.command';
2
2
  export * from './fast-buy-subscription.command';
3
3
  export * from './cancel-subscription.command';
4
4
  export * from './recover-subscription.command';
5
+ export * from './update-subscription.command';
6
+ export * from './delete-subscription.command';
7
+ export * from './refund-subscription.command';
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace RefundSubscriptionCommand {
4
+ export const RequestParamSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
8
+
9
+ export const ResponseSchema = z.object({
10
+ data: z.boolean(),
11
+ });
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ import { SubscriptionSchema } from '../../models';
3
+
4
+ export namespace UpdateSubscriptionCommand {
5
+ export const RequestParamSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
9
+
10
+ export const RequestSchema = z.object({
11
+ name: z.string().min(1).max(200).optional(),
12
+ description: z.string().min(1).max(2000).optional(),
13
+ price: z.number().int().min(0).optional(),
14
+ interval: z.string().max(20).optional(),
15
+ period: z.number().int().min(1).max(36).optional(),
16
+ tokens: z.number().int().min(0).optional(),
17
+ discount: z.number().int().min(0).optional(),
18
+ features: z
19
+ .array(
20
+ z.object({
21
+ type: z.string(),
22
+ name: z.string(),
23
+ }),
24
+ )
25
+ .optional(),
26
+ carryoverPercent: z.number().int().min(0).max(100).optional(),
27
+ });
28
+ export type Request = z.infer<typeof RequestSchema>;
29
+
30
+ export const ResponseSchema = z.object({
31
+ data: SubscriptionSchema,
32
+ });
33
+ export type Response = z.infer<typeof ResponseSchema>;
34
+ }
@@ -1 +1,2 @@
1
1
  export const CLOUD_PAYMENTS_CANCEL = 'https://api.cloudpayments.ru/subscriptions/cancel';
2
+ export const CLOUD_PAYMENTS_REFUND = 'https://api.cloudpayments.ru/payments/refund';
@@ -221,6 +221,11 @@ export const ERRORS = {
221
221
  code: 'SUBSCRIPTION_007',
222
222
  httpCode: 500,
223
223
  },
224
+ SUBSCRIPTION_REFUND_ERROR: {
225
+ message: 'Ошибка при возврате подписки',
226
+ code: 'SUBSCRIPTION_008',
227
+ httpCode: 500,
228
+ },
224
229
 
225
230
  // ORDER
226
231
  ORDER_NOT_FOUND: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/multisite",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "Multisite API contracts (DTO schemas, routes, constants)",
5
5
  "type": "commonjs",
6
6
  "main": "build/index.js",
@@ -17,7 +17,9 @@ export namespace FindUsersCommand {
17
17
  uuid: z.string().uuid(),
18
18
  email: z.string().email(),
19
19
  role: z.nativeEnum(USER_ROLE),
20
+ status: z.nativeEnum(USER_STATUS),
20
21
  siteId: z.string().uuid(),
22
+ tokenBonusBalance: z.number().int(),
21
23
  });
22
24
 
23
25
  export const ResponseSchema = z.object({
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { USER_ROLE } from '../../constants';
2
+ import { USER_ROLE, USER_STATUS } from '../../constants';
3
3
 
4
4
  export namespace GetAllUsersCommand {
5
5
  export const ResponseSchema = z.object({
@@ -8,7 +8,9 @@ export namespace GetAllUsersCommand {
8
8
  uuid: z.string().uuid(),
9
9
  email: z.string().email(),
10
10
  role: z.nativeEnum(USER_ROLE),
11
+ status: z.nativeEnum(USER_STATUS),
11
12
  siteId: z.string().uuid(),
13
+ tokenBonusBalance: z.number().int(),
12
14
  }),
13
15
  ),
14
16
  });
@@ -12,6 +12,7 @@ export namespace GetMySubscriptionsCommand {
12
12
  carriedOverTokenBalance: z.number().int(),
13
13
  status: z.nativeEnum(USER_TO_SUBSCRIPTION_STATUS),
14
14
  active: z.boolean(),
15
+ endDate: z.date().or(z.string().datetime()).nullable(),
15
16
  createdAt: z.date().or(z.string().datetime()),
16
17
  subscription: SubscriptionSchema,
17
18
  }),
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { ORDER_STATUS, ORDER_TYPE, PAYMENT_STATUS } from '../../constants';
3
+
4
+ export namespace GetUserPaymentsCommand {
5
+ export const ResponseItemSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ orderType: z.nativeEnum(ORDER_TYPE),
8
+ orderStatus: z.nativeEnum(ORDER_STATUS),
9
+ description: z.string(),
10
+ productId: z.string().uuid().nullable(),
11
+ productName: z.string().nullable(),
12
+ subscriptionId: z.string().uuid().nullable(),
13
+ subscriptionName: z.string().nullable(),
14
+ paymentStatus: z.nativeEnum(PAYMENT_STATUS),
15
+ userId: z.string().uuid(),
16
+ userEmail: z.string().email(),
17
+ sum: z.number(),
18
+ currency: z.string(),
19
+ updatedAt: z.date().or(z.string().datetime()),
20
+ });
21
+
22
+ export const ResponseSchema = z.object({
23
+ data: z.array(ResponseItemSchema),
24
+ });
25
+ export type Response = z.infer<typeof ResponseSchema>;
26
+ }
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { USER_ROLE } from '../../constants';
2
+ import { USER_ROLE, USER_STATUS } from '../../constants';
3
3
 
4
4
  export namespace GetUserCommand {
5
5
  export const ResponseSchema = z.object({
@@ -7,7 +7,9 @@ export namespace GetUserCommand {
7
7
  uuid: z.string().uuid(),
8
8
  email: z.string().email(),
9
9
  role: z.nativeEnum(USER_ROLE),
10
+ status: z.nativeEnum(USER_STATUS),
10
11
  siteId: z.string().uuid(),
12
+ tokenBonusBalance: z.number().int(),
11
13
  }),
12
14
  });
13
15
  export type Response = z.infer<typeof ResponseSchema>;
@@ -4,3 +4,4 @@ export * from './get-user-balance.command';
4
4
  export * from './get-my-products.command';
5
5
  export * from './get-my-subscriptions.command';
6
6
  export * from './find-users.command';
7
+ export * from './get-user-payments.command';