@purpleschool/gptbot 0.5.23 → 0.5.25

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 (37) hide show
  1. package/api/controllers/index.ts +1 -0
  2. package/api/controllers/user-to-task.ts +7 -0
  3. package/build/api/controllers/index.js +1 -0
  4. package/build/api/controllers/user-to-task.js +9 -0
  5. package/build/commands/chat/check-limit.command.v2.js +1 -0
  6. package/build/commands/index.js +1 -0
  7. package/build/commands/user-to-task/claim-task-reward.command.js +12 -0
  8. package/build/commands/user-to-task/get-my-tasks.command.js +11 -0
  9. package/build/commands/user-to-task/index.js +19 -0
  10. package/build/commands/user-to-task/start-task.command.js +14 -0
  11. package/build/constants/errors/errors.js +65 -0
  12. package/build/constants/index.js +1 -0
  13. package/build/constants/task/enums/index.js +19 -0
  14. package/build/constants/task/enums/task-status.enum.js +9 -0
  15. package/build/constants/task/enums/task-type.enum.js +8 -0
  16. package/build/constants/task/enums/user-to-task-status.enum.js +9 -0
  17. package/build/constants/task/index.js +17 -0
  18. package/build/models/index.js +1 -1
  19. package/build/models/user-task.schema.js +15 -0
  20. package/commands/chat/check-limit.command.v2.ts +1 -0
  21. package/commands/index.ts +1 -0
  22. package/commands/user-to-task/claim-task-reward.command.ts +12 -0
  23. package/commands/user-to-task/get-my-tasks.command.ts +10 -0
  24. package/commands/user-to-task/index.ts +3 -0
  25. package/commands/user-to-task/start-task.command.ts +14 -0
  26. package/constants/errors/errors.ts +65 -0
  27. package/constants/index.ts +1 -0
  28. package/constants/task/enums/index.ts +3 -0
  29. package/constants/task/enums/task-status.enum.ts +5 -0
  30. package/constants/task/enums/task-type.enum.ts +4 -0
  31. package/constants/task/enums/user-to-task-status.enum.ts +5 -0
  32. package/constants/task/index.ts +1 -0
  33. package/models/index.ts +1 -1
  34. package/models/user-task.schema.ts +12 -0
  35. package/package.json +1 -1
  36. package/build/models/cloud-payments-data.schema.js +0 -43
  37. package/models/cloud-payments-data.schema.ts +0 -45
@@ -16,4 +16,5 @@ export * from './product';
16
16
  export * from './question';
17
17
  export * from './subscription';
18
18
  export * from './unregistered-user';
19
+ export * from './user-to-task';
19
20
  export * from './user';
@@ -0,0 +1,7 @@
1
+ export const USER_TO_TASK_CONTROLLER = 'user-to-task' as const;
2
+
3
+ export const USER_TO_TASK_ROUTES = {
4
+ MY: 'my',
5
+ START: (uuid: string) => `${uuid}/start`,
6
+ CLAIM_REWARD: (uuid: string) => `${uuid}/claim-reward`,
7
+ } as const;
@@ -32,4 +32,5 @@ __exportStar(require("./product"), exports);
32
32
  __exportStar(require("./question"), exports);
33
33
  __exportStar(require("./subscription"), exports);
34
34
  __exportStar(require("./unregistered-user"), exports);
35
+ __exportStar(require("./user-to-task"), exports);
35
36
  __exportStar(require("./user"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_TO_TASK_ROUTES = exports.USER_TO_TASK_CONTROLLER = void 0;
4
+ exports.USER_TO_TASK_CONTROLLER = 'user-to-task';
5
+ exports.USER_TO_TASK_ROUTES = {
6
+ MY: 'my',
7
+ START: (uuid) => `${uuid}/start`,
8
+ CLAIM_REWARD: (uuid) => `${uuid}/claim-reward`,
9
+ };
@@ -7,6 +7,7 @@ var CheckLimitV2Command;
7
7
  CheckLimitV2Command.ResponseSchema = zod_1.z.object({
8
8
  data: zod_1.z.object({
9
9
  totalTokenBalance: zod_1.z.number(),
10
+ potentialTasksRewards: zod_1.z.number(),
10
11
  }),
11
12
  });
12
13
  })(CheckLimitV2Command || (exports.CheckLimitV2Command = CheckLimitV2Command = {}));
@@ -31,3 +31,4 @@ __exportStar(require("./subscription"), exports);
31
31
  __exportStar(require("./unregistered-user"), exports);
32
32
  __exportStar(require("./user"), exports);
33
33
  __exportStar(require("./user-to-subscription"), exports);
34
+ __exportStar(require("./user-to-task"), exports);
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClaimTaskRewardCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var ClaimTaskRewardCommand;
7
+ (function (ClaimTaskRewardCommand) {
8
+ ClaimTaskRewardCommand.RequestParamsSchema = models_1.UserTaskSchema.pick({
9
+ taskId: true,
10
+ });
11
+ ClaimTaskRewardCommand.ResponseSchema = zod_1.z.void();
12
+ })(ClaimTaskRewardCommand || (exports.ClaimTaskRewardCommand = ClaimTaskRewardCommand = {}));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetMyTasksCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var GetMyTasksCommand;
7
+ (function (GetMyTasksCommand) {
8
+ GetMyTasksCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.array(models_1.UserTaskSchema),
10
+ });
11
+ })(GetMyTasksCommand || (exports.GetMyTasksCommand = GetMyTasksCommand = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./claim-task-reward.command"), exports);
18
+ __exportStar(require("./get-my-tasks.command"), exports);
19
+ __exportStar(require("./start-task.command"), exports);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StartTaskCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var StartTaskCommand;
7
+ (function (StartTaskCommand) {
8
+ StartTaskCommand.RequestParamsSchema = models_1.UserTaskSchema.pick({
9
+ taskId: true,
10
+ });
11
+ StartTaskCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.UserTaskSchema,
13
+ });
14
+ })(StartTaskCommand || (exports.StartTaskCommand = StartTaskCommand = {}));
@@ -650,4 +650,69 @@ exports.ERRORS = {
650
650
  message: 'Пользователь не является владельцем отзыва',
651
651
  httpCode: 400,
652
652
  },
653
+ TASK_NOT_FOUND: {
654
+ code: 'A144',
655
+ message: 'Задание не найдено',
656
+ httpCode: 404,
657
+ },
658
+ TASK_FIND_INTERNAL_ERROR: {
659
+ code: 'A145',
660
+ message: 'Произовшла ошибка при поиске задания',
661
+ httpCode: 500,
662
+ },
663
+ TASK_START_INTERNAL_ERROR: {
664
+ code: 'A146',
665
+ message: 'Произовшла ошибка при взятии задания',
666
+ httpCode: 500,
667
+ },
668
+ TASK_EXPIRED: {
669
+ code: 'A147',
670
+ message: 'Задание устарело',
671
+ httpCode: 400,
672
+ },
673
+ TASK_ALREADY_STARTED: {
674
+ code: 'A148',
675
+ message: 'Задание уже взято',
676
+ httpCode: 400,
677
+ },
678
+ TASK_ALREADY_COMPLETED: {
679
+ code: 'A149',
680
+ message: 'Задание уже выполнено',
681
+ httpCode: 400,
682
+ },
683
+ TASK_NOT_STARTED: {
684
+ code: 'A150',
685
+ message: 'Задание не активно',
686
+ httpCode: 400,
687
+ },
688
+ TASK_NOT_READY_FOR_CLAIM: {
689
+ code: 'A151',
690
+ message: 'Не удовлетворены условия для получения награды',
691
+ httpCode: 400,
692
+ },
693
+ TASK_CREATE_ERROR: {
694
+ code: 'A152',
695
+ message: 'Произовшла ошибка при создании задания',
696
+ httpCode: 500,
697
+ },
698
+ TASK_UPDATE_ERROR: {
699
+ code: 'A153',
700
+ message: 'Произовшла ошибка при обновлении задания',
701
+ httpCode: 500,
702
+ },
703
+ TASK_DELETE_ERROR: {
704
+ code: 'A154',
705
+ message: 'Произовшла ошибка при удалении задания',
706
+ httpCode: 500,
707
+ },
708
+ TASK_GET_POTENTIAL_REWARDS_ERROR: {
709
+ code: 'A155',
710
+ message: 'Произовшла ошибка при списка наград за выполение доступных заданий',
711
+ httpCode: 500,
712
+ },
713
+ USER_BALANCE_CALCULATION_ERROR: {
714
+ code: 'A156',
715
+ message: 'Произовшла ошибка при расчете баланса пользователя',
716
+ httpCode: 500,
717
+ },
653
718
  };
@@ -30,5 +30,6 @@ __exportStar(require("./product"), exports);
30
30
  __exportStar(require("./referral"), exports);
31
31
  __exportStar(require("./roles"), exports);
32
32
  __exportStar(require("./subscription"), exports);
33
+ __exportStar(require("./task"), exports);
33
34
  __exportStar(require("./transaction"), exports);
34
35
  __exportStar(require("./user"), exports);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./task-status.enum"), exports);
18
+ __exportStar(require("./task-type.enum"), exports);
19
+ __exportStar(require("./user-to-task-status.enum"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TASK_STATUS = void 0;
4
+ var TASK_STATUS;
5
+ (function (TASK_STATUS) {
6
+ TASK_STATUS["ACTIVE"] = "active";
7
+ TASK_STATUS["PENDING"] = "pending";
8
+ TASK_STATUS["EXPIRED"] = "expired";
9
+ })(TASK_STATUS || (exports.TASK_STATUS = TASK_STATUS = {}));
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TASK_TYPE = void 0;
4
+ var TASK_TYPE;
5
+ (function (TASK_TYPE) {
6
+ TASK_TYPE["CLICK"] = "click";
7
+ TASK_TYPE["TELEGRAM_CHANNEL_INVITE"] = "telegram_channel_invite";
8
+ })(TASK_TYPE || (exports.TASK_TYPE = TASK_TYPE = {}));
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_TO_TASK_STATUS = void 0;
4
+ var USER_TO_TASK_STATUS;
5
+ (function (USER_TO_TASK_STATUS) {
6
+ USER_TO_TASK_STATUS["IDLE"] = "idle";
7
+ USER_TO_TASK_STATUS["READY_FOR_CHECK"] = "ready_for_check";
8
+ USER_TO_TASK_STATUS["COMPLETED"] = "completed";
9
+ })(USER_TO_TASK_STATUS || (exports.USER_TO_TASK_STATUS = USER_TO_TASK_STATUS = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./enums"), exports);
@@ -18,7 +18,6 @@ __exportStar(require("./ai-model-formatted.schema"), exports);
18
18
  __exportStar(require("./ai-model.schema"), exports);
19
19
  __exportStar(require("./category.schema"), exports);
20
20
  __exportStar(require("./chat.schema"), exports);
21
- __exportStar(require("./cloud-payments-data.schema"), exports);
22
21
  __exportStar(require("./course-author.schema"), exports);
23
22
  __exportStar(require("./course.schema"), exports);
24
23
  __exportStar(require("./feedback.schema"), exports);
@@ -36,5 +35,6 @@ __exportStar(require("./section.schema"), exports);
36
35
  __exportStar(require("./subscription-upgrade-schema"), exports);
37
36
  __exportStar(require("./subscription.schema"), exports);
38
37
  __exportStar(require("./unregistered-user.schema"), exports);
38
+ __exportStar(require("./user-task.schema"), exports);
39
39
  __exportStar(require("./user-to-subscription.schema"), exports);
40
40
  __exportStar(require("./user.schema"), exports);
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserTaskSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../constants");
6
+ exports.UserTaskSchema = zod_1.z.object({
7
+ taskId: zod_1.z.string().uuid(),
8
+ title: zod_1.z.string(),
9
+ reward: zod_1.z.number(),
10
+ icon: zod_1.z.string(),
11
+ type: zod_1.z.nativeEnum(constants_1.TASK_TYPE),
12
+ content: zod_1.z.string().nullable().optional(),
13
+ description: zod_1.z.string().nullable(),
14
+ status: zod_1.z.nativeEnum(constants_1.USER_TO_TASK_STATUS),
15
+ });
@@ -4,6 +4,7 @@ export namespace CheckLimitV2Command {
4
4
  export const ResponseSchema = z.object({
5
5
  data: z.object({
6
6
  totalTokenBalance: z.number(),
7
+ potentialTasksRewards: z.number(),
7
8
  }),
8
9
  });
9
10
  export type Response = z.infer<typeof ResponseSchema>;
package/commands/index.ts CHANGED
@@ -15,3 +15,4 @@ export * from './subscription';
15
15
  export * from './unregistered-user';
16
16
  export * from './user';
17
17
  export * from './user-to-subscription';
18
+ export * from './user-to-task';
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { UserTaskSchema } from '../../models';
3
+
4
+ export namespace ClaimTaskRewardCommand {
5
+ export const RequestParamsSchema = UserTaskSchema.pick({
6
+ taskId: true,
7
+ });
8
+
9
+ export const ResponseSchema = z.void();
10
+
11
+ export type Response = z.infer<typeof ResponseSchema>;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { UserTaskSchema } from '../../models';
3
+
4
+ export namespace GetMyTasksCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: z.array(UserTaskSchema),
7
+ });
8
+
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1,3 @@
1
+ export * from './claim-task-reward.command';
2
+ export * from './get-my-tasks.command';
3
+ export * from './start-task.command';
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { UserTaskSchema } from '../../models';
3
+
4
+ export namespace StartTaskCommand {
5
+ export const RequestParamsSchema = UserTaskSchema.pick({
6
+ taskId: true,
7
+ });
8
+
9
+ export const ResponseSchema = z.object({
10
+ data: UserTaskSchema,
11
+ });
12
+
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -650,4 +650,69 @@ export const ERRORS = {
650
650
  message: 'Пользователь не является владельцем отзыва',
651
651
  httpCode: 400,
652
652
  },
653
+ TASK_NOT_FOUND: {
654
+ code: 'A144',
655
+ message: 'Задание не найдено',
656
+ httpCode: 404,
657
+ },
658
+ TASK_FIND_INTERNAL_ERROR: {
659
+ code: 'A145',
660
+ message: 'Произовшла ошибка при поиске задания',
661
+ httpCode: 500,
662
+ },
663
+ TASK_START_INTERNAL_ERROR: {
664
+ code: 'A146',
665
+ message: 'Произовшла ошибка при взятии задания',
666
+ httpCode: 500,
667
+ },
668
+ TASK_EXPIRED: {
669
+ code: 'A147',
670
+ message: 'Задание устарело',
671
+ httpCode: 400,
672
+ },
673
+ TASK_ALREADY_STARTED: {
674
+ code: 'A148',
675
+ message: 'Задание уже взято',
676
+ httpCode: 400,
677
+ },
678
+ TASK_ALREADY_COMPLETED: {
679
+ code: 'A149',
680
+ message: 'Задание уже выполнено',
681
+ httpCode: 400,
682
+ },
683
+ TASK_NOT_STARTED: {
684
+ code: 'A150',
685
+ message: 'Задание не активно',
686
+ httpCode: 400,
687
+ },
688
+ TASK_NOT_READY_FOR_CLAIM: {
689
+ code: 'A151',
690
+ message: 'Не удовлетворены условия для получения награды',
691
+ httpCode: 400,
692
+ },
693
+ TASK_CREATE_ERROR: {
694
+ code: 'A152',
695
+ message: 'Произовшла ошибка при создании задания',
696
+ httpCode: 500,
697
+ },
698
+ TASK_UPDATE_ERROR: {
699
+ code: 'A153',
700
+ message: 'Произовшла ошибка при обновлении задания',
701
+ httpCode: 500,
702
+ },
703
+ TASK_DELETE_ERROR: {
704
+ code: 'A154',
705
+ message: 'Произовшла ошибка при удалении задания',
706
+ httpCode: 500,
707
+ },
708
+ TASK_GET_POTENTIAL_REWARDS_ERROR: {
709
+ code: 'A155',
710
+ message: 'Произовшла ошибка при списка наград за выполение доступных заданий',
711
+ httpCode: 500,
712
+ },
713
+ USER_BALANCE_CALCULATION_ERROR: {
714
+ code: 'A156',
715
+ message: 'Произовшла ошибка при расчете баланса пользователя',
716
+ httpCode: 500,
717
+ },
653
718
  };
@@ -14,5 +14,6 @@ export * from './product';
14
14
  export * from './referral';
15
15
  export * from './roles';
16
16
  export * from './subscription';
17
+ export * from './task';
17
18
  export * from './transaction';
18
19
  export * from './user';
@@ -0,0 +1,3 @@
1
+ export * from './task-status.enum';
2
+ export * from './task-type.enum';
3
+ export * from './user-to-task-status.enum';
@@ -0,0 +1,5 @@
1
+ export enum TASK_STATUS {
2
+ ACTIVE = 'active',
3
+ PENDING = 'pending',
4
+ EXPIRED = 'expired',
5
+ }
@@ -0,0 +1,4 @@
1
+ export enum TASK_TYPE {
2
+ CLICK = 'click',
3
+ TELEGRAM_CHANNEL_INVITE = 'telegram_channel_invite',
4
+ }
@@ -0,0 +1,5 @@
1
+ export enum USER_TO_TASK_STATUS {
2
+ IDLE = 'idle',
3
+ READY_FOR_CHECK = 'ready_for_check',
4
+ COMPLETED = 'completed',
5
+ }
@@ -0,0 +1 @@
1
+ export * from './enums';
package/models/index.ts CHANGED
@@ -2,7 +2,6 @@ export * from './ai-model-formatted.schema';
2
2
  export * from './ai-model.schema';
3
3
  export * from './category.schema';
4
4
  export * from './chat.schema';
5
- export * from './cloud-payments-data.schema';
6
5
  export * from './course-author.schema';
7
6
  export * from './course.schema';
8
7
  export * from './feedback.schema';
@@ -20,5 +19,6 @@ export * from './section.schema';
20
19
  export * from './subscription-upgrade-schema';
21
20
  export * from './subscription.schema';
22
21
  export * from './unregistered-user.schema';
22
+ export * from './user-task.schema';
23
23
  export * from './user-to-subscription.schema';
24
24
  export * from './user.schema';
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { TASK_TYPE, USER_TO_TASK_STATUS } from '../constants';
3
+ export const UserTaskSchema = z.object({
4
+ taskId: z.string().uuid(),
5
+ title: z.string(),
6
+ reward: z.number(),
7
+ icon: z.string(),
8
+ type: z.nativeEnum(TASK_TYPE),
9
+ content: z.string().nullable().optional(),
10
+ description: z.string().nullable(),
11
+ status: z.nativeEnum(USER_TO_TASK_STATUS),
12
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.5.23",
3
+ "version": "0.5.25",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CloudPaymentsDataSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.CloudPaymentsDataSchema = zod_1.z.object({
6
- CloudPayments: zod_1.z.object({
7
- CustomerReceipt: zod_1.z.object({
8
- items: zod_1.z.array(zod_1.z.object({
9
- label: zod_1.z.string(),
10
- price: zod_1.z.number(),
11
- quantity: zod_1.z.number(),
12
- amount: zod_1.z.number(),
13
- vat: zod_1.z.number(),
14
- })),
15
- email: zod_1.z.string(),
16
- isBso: zod_1.z.boolean(),
17
- amounts: zod_1.z.object({
18
- electronic: zod_1.z.number(),
19
- }),
20
- }),
21
- recurrent: zod_1.z
22
- .object({
23
- period: zod_1.z.number(),
24
- interval: zod_1.z.string(),
25
- customerReceipt: zod_1.z.object({
26
- items: zod_1.z.array(zod_1.z.object({
27
- label: zod_1.z.string(),
28
- price: zod_1.z.number(),
29
- quantity: zod_1.z.number(),
30
- amount: zod_1.z.number(),
31
- vat: zod_1.z.number(),
32
- })),
33
- email: zod_1.z.string(),
34
- isBso: zod_1.z.boolean(),
35
- amounts: zod_1.z.object({
36
- electronic: zod_1.z.number(),
37
- }),
38
- }),
39
- amount: zod_1.z.number(),
40
- })
41
- .optional(),
42
- }),
43
- });
@@ -1,45 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- export const CloudPaymentsDataSchema = z.object({
4
- CloudPayments: z.object({
5
- CustomerReceipt: z.object({
6
- items: z.array(
7
- z.object({
8
- label: z.string(),
9
- price: z.number(),
10
- quantity: z.number(),
11
- amount: z.number(),
12
- vat: z.number(),
13
- }),
14
- ),
15
- email: z.string(),
16
- isBso: z.boolean(),
17
- amounts: z.object({
18
- electronic: z.number(),
19
- }),
20
- }),
21
- recurrent: z
22
- .object({
23
- period: z.number(),
24
- interval: z.string(),
25
- customerReceipt: z.object({
26
- items: z.array(
27
- z.object({
28
- label: z.string(),
29
- price: z.number(),
30
- quantity: z.number(),
31
- amount: z.number(),
32
- vat: z.number(),
33
- }),
34
- ),
35
- email: z.string(),
36
- isBso: z.boolean(),
37
- amounts: z.object({
38
- electronic: z.number(),
39
- }),
40
- }),
41
- amount: z.number(),
42
- })
43
- .optional(),
44
- }),
45
- });