@purpleschool/gptbot 0.5.13 → 0.5.15
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/api/controllers/index.ts +10 -8
- package/api/controllers/referral.ts +5 -0
- package/build/api/controllers/index.js +10 -8
- package/build/api/controllers/referral.js +7 -0
- package/build/commands/ai-model/index.js +2 -2
- package/build/commands/auth/index.js +4 -3
- package/build/commands/auth/register-user.command.js +3 -4
- package/build/commands/blog/index.js +2 -2
- package/build/commands/category/index.js +2 -2
- package/build/commands/chat/index.js +9 -8
- package/build/commands/index.js +8 -7
- package/build/commands/message/index.js +1 -1
- package/build/commands/page/index.js +3 -3
- package/build/commands/product/buy-product.command.js +1 -0
- package/build/commands/product/index.js +3 -3
- package/build/commands/question/index.js +2 -2
- package/build/commands/referral/get-by-bonuses.command.js +15 -0
- package/build/commands/referral/index.js +17 -0
- package/build/commands/subscription/buy-subscription.command.js +1 -0
- package/build/commands/subscription/index.js +6 -5
- package/build/commands/subscription/upgrade-subscription.command.js +4 -1
- package/build/commands/user/index.js +1 -1
- package/build/constants/category/enums/index.js +1 -1
- package/build/constants/chat/enums/index.js +1 -1
- package/build/constants/domains/index.js +17 -0
- package/build/constants/email/index.js +18 -0
- package/build/constants/email/subjects.js +1 -0
- package/build/constants/errors/errors.js +61 -1
- package/build/constants/index.js +13 -7
- package/build/constants/payment/enums/index.js +1 -1
- package/build/constants/referral/enums/index.js +17 -0
- package/build/constants/referral/enums/referral-bonus-type.enum.js +8 -0
- package/build/constants/referral/index.js +17 -0
- package/build/constants/subscription/enums/index.js +3 -3
- package/build/constants/transaction/enums/index.js +17 -0
- package/build/constants/transaction/enums/user-balance-status.enum.js +1 -0
- package/build/constants/transaction/index.js +17 -0
- package/build/constants/user/enums/index.js +17 -0
- package/build/constants/user/index.js +18 -0
- package/build/index.js +3 -3
- package/build/models/index.js +11 -7
- package/build/models/referral-bonus.schema.js +19 -0
- package/commands/ai-model/index.ts +2 -2
- package/commands/auth/index.ts +4 -3
- package/commands/auth/register-user.command.ts +6 -4
- package/commands/blog/index.ts +2 -2
- package/commands/category/index.ts +2 -2
- package/commands/chat/index.ts +9 -8
- package/commands/index.ts +8 -7
- package/commands/message/index.ts +1 -1
- package/commands/page/index.ts +3 -3
- package/commands/product/buy-product.command.ts +1 -0
- package/commands/product/index.ts +3 -3
- package/commands/question/index.ts +2 -2
- package/commands/referral/get-by-bonuses.command.ts +14 -0
- package/commands/referral/index.ts +1 -0
- package/commands/subscription/buy-subscription.command.ts +1 -0
- package/commands/subscription/index.ts +6 -5
- package/commands/subscription/upgrade-subscription.command.ts +6 -2
- package/commands/user/index.ts +1 -1
- package/constants/category/enums/index.ts +1 -1
- package/constants/chat/enums/index.ts +1 -1
- package/constants/domains/index.ts +1 -0
- package/constants/email/index.ts +2 -0
- package/constants/email/subjects.ts +1 -0
- package/constants/errors/errors.ts +61 -1
- package/constants/index.ts +13 -7
- package/constants/payment/enums/index.ts +1 -1
- package/constants/referral/enums/index.ts +1 -0
- package/constants/referral/enums/referral-bonus-type.enum.ts +4 -0
- package/constants/referral/index.ts +1 -0
- package/constants/subscription/enums/index.ts +3 -3
- package/constants/transaction/enums/index.ts +2 -0
- package/constants/transaction/enums/user-balance-status.enum.ts +1 -0
- package/constants/transaction/index.ts +1 -0
- package/constants/user/enums/index.ts +1 -0
- package/constants/user/index.ts +2 -0
- package/index.ts +3 -3
- package/models/index.ts +11 -7
- package/models/referral-bonus.schema.ts +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./user-public"), exports);
|
package/build/index.js
CHANGED
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./constants"), exports);
|
|
18
|
-
__exportStar(require("./commands"), exports);
|
|
19
17
|
__exportStar(require("./api"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./commands"), exports);
|
|
19
|
+
__exportStar(require("./constants"), exports);
|
|
21
20
|
__exportStar(require("./helpers"), exports);
|
|
21
|
+
__exportStar(require("./models"), exports);
|
package/build/models/index.js
CHANGED
|
@@ -14,16 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./page.schema"), exports);
|
|
17
|
+
__exportStar(require("./ai-model.schema"), exports);
|
|
19
18
|
__exportStar(require("./category.schema"), exports);
|
|
20
|
-
__exportStar(require("./question.schema"), exports);
|
|
21
|
-
__exportStar(require("./unregistered-user.schema"), exports);
|
|
22
19
|
__exportStar(require("./chat.schema"), exports);
|
|
23
20
|
__exportStar(require("./message.schema"), exports);
|
|
24
|
-
__exportStar(require("./ai-model.schema"), exports);
|
|
25
|
-
__exportStar(require("./product.schema"), exports);
|
|
26
|
-
__exportStar(require("./subscription.schema"), exports);
|
|
27
21
|
__exportStar(require("./order.schema"), exports);
|
|
22
|
+
__exportStar(require("./page.schema"), exports);
|
|
23
|
+
__exportStar(require("./payment-history-item.schema"), exports);
|
|
24
|
+
__exportStar(require("./payment.schema"), exports);
|
|
28
25
|
__exportStar(require("./post.schema"), exports);
|
|
26
|
+
__exportStar(require("./product.schema"), exports);
|
|
27
|
+
__exportStar(require("./question.schema"), exports);
|
|
28
|
+
__exportStar(require("./referral-bonus.schema"), exports);
|
|
29
|
+
__exportStar(require("./subscription-upgrade-schema"), exports);
|
|
30
|
+
__exportStar(require("./subscription.schema"), exports);
|
|
31
|
+
__exportStar(require("./unregistered-user.schema"), exports);
|
|
29
32
|
__exportStar(require("./user-to-subscription.schema"), exports);
|
|
33
|
+
__exportStar(require("./user.schema"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReferralBonusStatisticsSchema = exports.ReferralBonusSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const referral_1 = require("../constants/referral");
|
|
6
|
+
exports.ReferralBonusSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
partnerId: zod_1.z.string().uuid(),
|
|
9
|
+
referralId: zod_1.z.string().uuid(),
|
|
10
|
+
initial: zod_1.z.number(),
|
|
11
|
+
total: zod_1.z.number(),
|
|
12
|
+
type: zod_1.z.nativeEnum(referral_1.ReferralBonusType),
|
|
13
|
+
createdAt: zod_1.z.date(),
|
|
14
|
+
updatedAt: zod_1.z.date(),
|
|
15
|
+
});
|
|
16
|
+
exports.ReferralBonusStatisticsSchema = zod_1.z.object({
|
|
17
|
+
initial: zod_1.z.number(),
|
|
18
|
+
weekStart: zod_1.z.date(),
|
|
19
|
+
});
|
package/commands/auth/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './restore-password.command';
|
|
1
|
+
export * from './create-user.command';
|
|
3
2
|
export * from './login.command';
|
|
4
3
|
export * from './register-user.command';
|
|
5
|
-
export * from './
|
|
4
|
+
export * from './reset-password.command';
|
|
5
|
+
export * from './restore-password.command';
|
|
6
|
+
export * from './verify-email-retry.command';
|
|
6
7
|
export * from './verify-email.command';
|
|
@@ -2,10 +2,12 @@ import { UserSchema } from '../../models';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
export namespace RegisterUserCommand {
|
|
5
|
-
export const RequestSchema =
|
|
6
|
-
email: true,
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export const RequestSchema = z.intersection(
|
|
6
|
+
UserSchema.pick({ email: true, password: true }),
|
|
7
|
+
z.object({
|
|
8
|
+
partnerId: z.string().uuid().optional(),
|
|
9
|
+
}),
|
|
10
|
+
);
|
|
9
11
|
|
|
10
12
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
13
|
|
package/commands/blog/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './create-post.command';
|
|
2
|
-
export * from './update-post.command';
|
|
3
2
|
export * from './delete-post.command';
|
|
4
|
-
export * from './find-post-by-uuid.command';
|
|
5
3
|
export * from './find-post-by-alias.command';
|
|
4
|
+
export * from './find-post-by-uuid.command';
|
|
6
5
|
export * from './find-post.command';
|
|
6
|
+
export * from './update-post.command';
|
package/commands/chat/index.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './delete-chat.command';
|
|
3
|
-
export * from './create-chat.command';
|
|
4
|
-
export * from './find-chat.command';
|
|
5
|
-
export * from './get-my-last-active-chat.command';
|
|
1
|
+
export * from './archive-all.command';
|
|
6
2
|
export * from './check-limit.command';
|
|
7
3
|
export * from './check-limit.command.v2';
|
|
8
|
-
export * from './
|
|
4
|
+
export * from './create-chat.command';
|
|
9
5
|
export * from './create-chat.command.v2';
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './archive-all.command';
|
|
6
|
+
export * from './delete-chat.command';
|
|
12
7
|
export * from './delete-chat.command.v2';
|
|
8
|
+
export * from './find-chat-by-uuid.command';
|
|
9
|
+
export * from './find-chat.command';
|
|
10
|
+
export * from './find-chats.command';
|
|
11
|
+
export * from './get-my-last-active-chat-command.v2';
|
|
12
|
+
export * from './get-my-last-active-chat.command';
|
|
13
|
+
export * from './update-chat.command';
|
package/commands/index.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
export * from './ai-model';
|
|
1
2
|
export * from './auth';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './page';
|
|
3
|
+
export * from './blog';
|
|
4
4
|
export * from './category';
|
|
5
|
-
export * from './question';
|
|
6
|
-
export * from './unregistered-user';
|
|
7
|
-
export * from './ai-model';
|
|
8
5
|
export * from './chat';
|
|
9
6
|
export * from './message';
|
|
7
|
+
export * from './page';
|
|
8
|
+
export * from './payment';
|
|
10
9
|
export * from './product';
|
|
10
|
+
export * from './question';
|
|
11
|
+
export * from './referral';
|
|
11
12
|
export * from './subscription';
|
|
12
|
-
export * from './
|
|
13
|
+
export * from './unregistered-user';
|
|
14
|
+
export * from './user';
|
|
13
15
|
export * from './user-to-subscription';
|
|
14
|
-
export * from './payment';
|
package/commands/page/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './update-page.command';
|
|
2
|
-
export * from './delete-page.command';
|
|
3
1
|
export * from './create-page.command';
|
|
4
|
-
export * from './
|
|
2
|
+
export * from './delete-page.command';
|
|
5
3
|
export * from './find-page-by-alias.command';
|
|
4
|
+
export * from './find-page.command';
|
|
5
|
+
export * from './update-page.command';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './delete-product.command';
|
|
1
|
+
export * from './buy-product.command';
|
|
3
2
|
export * from './create-product.command';
|
|
3
|
+
export * from './delete-product.command';
|
|
4
4
|
export * from './find-product.command';
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './update-product.command';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReferralBonusStatisticsSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export namespace GetMyBonusesCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: z.object({
|
|
7
|
+
sumTotal: z.number(),
|
|
8
|
+
sumInitial: z.number(),
|
|
9
|
+
statistics: z.array(ReferralBonusStatisticsSchema),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-by-bonuses.command';
|
|
@@ -13,6 +13,7 @@ export namespace BuySubscriptionCommand {
|
|
|
13
13
|
export type Request = z.infer<typeof RequestSchema>;
|
|
14
14
|
export const RequestFastSchema = z.object({
|
|
15
15
|
email: z.string().email(),
|
|
16
|
+
partnerId: z.string().uuid().optional(),
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
export type RequestFast = z.infer<typeof RequestFastSchema>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './buy-subscription.command';
|
|
2
|
+
export * from './cancel-subscription.command';
|
|
3
|
+
export * from './create-custom-subscription-plan.command';
|
|
3
4
|
export * from './create-subscription.command';
|
|
5
|
+
export * from './delete-subscription.command';
|
|
4
6
|
export * from './find-subscription.command';
|
|
5
|
-
export * from './cancel-subscription.command';
|
|
6
|
-
export * from './recover-subscription.command';
|
|
7
7
|
export * from './get-available-upgrades.command';
|
|
8
|
+
export * from './recover-subscription.command';
|
|
8
9
|
export * from './update-subscription.command';
|
|
9
|
-
export * from './
|
|
10
|
+
export * from './upgrade-subscription.command';
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { UserToSubscriptionSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace UpgradeSubscriptionCommand {
|
|
5
|
-
export const RequestSchema =
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
upgradeSubscriptionId: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const RequestParamSchema = UserToSubscriptionSchema.pick({
|
|
6
10
|
uuid: true,
|
|
7
11
|
});
|
|
8
12
|
|
package/commands/user/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './white-list';
|
|
@@ -4,4 +4,5 @@ export const EMAIL_SUBJECTS = {
|
|
|
4
4
|
SUBSCRIPTION_PURCHASE: 'Спасибо за покупку подписки',
|
|
5
5
|
SUBSCRIPTION_CANCEL: 'Нам жаль, что вы от нас уходите(',
|
|
6
6
|
PRODUCT_PURCHASE: 'Спасибо за покупку тарифа',
|
|
7
|
+
RECURRENT_PAYMENT_FAILED: 'Важно: Не удалось получить оплату по подписке',
|
|
7
8
|
};
|
|
@@ -552,7 +552,67 @@ export const ERRORS = {
|
|
|
552
552
|
},
|
|
553
553
|
SUBSCRIPTION_UPGRADE_INVALID: {
|
|
554
554
|
code: 'A124',
|
|
555
|
-
message: 'Невозможно улучшить подписку
|
|
555
|
+
message: 'Невозможно улучшить подписку до указанного уровня',
|
|
556
556
|
httpCode: 400,
|
|
557
557
|
},
|
|
558
|
+
PARTNER_NOT_FOUND: {
|
|
559
|
+
code: 'A125',
|
|
560
|
+
message: 'Не удалось найти партнера по реферальной программе',
|
|
561
|
+
httpCode: 404,
|
|
562
|
+
},
|
|
563
|
+
REFERRAL_BONUSES_NOT_FOUND: {
|
|
564
|
+
code: 'A126',
|
|
565
|
+
message: 'Не удалось найти бонусы по реферальной программе',
|
|
566
|
+
httpCode: 404,
|
|
567
|
+
},
|
|
568
|
+
REFERRAL_BONUS_UPDATE_ERROR: {
|
|
569
|
+
code: 'A127',
|
|
570
|
+
message: 'Не удалось обновить бонусы по реферальной программе',
|
|
571
|
+
httpCode: 500,
|
|
572
|
+
},
|
|
573
|
+
REFERRAL_BONUS_STATS_ERROR: {
|
|
574
|
+
code: 'A128',
|
|
575
|
+
message: 'Не удалось получить статистику по бонусам по реферальной программе',
|
|
576
|
+
httpCode: 500,
|
|
577
|
+
},
|
|
578
|
+
REFERRAL_BONUS_APPLY_ERROR: {
|
|
579
|
+
code: 'A129',
|
|
580
|
+
message: 'Не удалось применить бонусы по реферальной программе',
|
|
581
|
+
httpCode: 500,
|
|
582
|
+
},
|
|
583
|
+
SUBSCRIPTION_OWNERSHIP_ERROR: {
|
|
584
|
+
code: 'A130',
|
|
585
|
+
message: 'Пользователь не является владельцем подписки или подписка неактивна',
|
|
586
|
+
httpCode: 400,
|
|
587
|
+
},
|
|
588
|
+
SUBSCRIPTION_NOT_FOUND: {
|
|
589
|
+
code: 'A131',
|
|
590
|
+
message: 'Подписка с данным идентификатором не найдена',
|
|
591
|
+
httpCode: 404,
|
|
592
|
+
},
|
|
593
|
+
SUBSCRIPTION_UPGRADE_NOT_FOUND: {
|
|
594
|
+
code: 'A132',
|
|
595
|
+
message: 'Улучшение подписки с данным идентификатором не найдено',
|
|
596
|
+
httpCode: 404,
|
|
597
|
+
},
|
|
598
|
+
SUBSCRIPTION_TOO_MANY: {
|
|
599
|
+
code: 'A133',
|
|
600
|
+
message: 'На данной учетной записи более одной активной подписки',
|
|
601
|
+
httpCode: 400,
|
|
602
|
+
},
|
|
603
|
+
SUBSCRIPTION_CANCEL_ERROR: {
|
|
604
|
+
code: 'A134',
|
|
605
|
+
message: 'Не удалось отменить подписку',
|
|
606
|
+
httpCode: 500,
|
|
607
|
+
},
|
|
608
|
+
SUBSCRIPTION_RECOVER_ERROR: {
|
|
609
|
+
code: 'A135',
|
|
610
|
+
message: 'Не удалось восстановить подписку',
|
|
611
|
+
httpCode: 500,
|
|
612
|
+
},
|
|
613
|
+
CLOUD_PAYMENTS_WIDGET_DATA_ERROR: {
|
|
614
|
+
code: 'A136',
|
|
615
|
+
message: 'Не удалось получить данные для создания платежа',
|
|
616
|
+
httpCode: 500,
|
|
617
|
+
},
|
|
558
618
|
};
|
package/constants/index.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
export * from './ai-model';
|
|
2
|
+
export * from './category';
|
|
3
|
+
export * from './chat';
|
|
4
|
+
export * from './cloud-payments';
|
|
5
|
+
export * from './domains';
|
|
6
|
+
export * from './email';
|
|
1
7
|
export * from './errors';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './payment';
|
|
8
|
+
export * from './message';
|
|
4
9
|
export * from './order';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './subscription';
|
|
10
|
+
export * from './payment';
|
|
7
11
|
export * from './product';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
12
|
+
export * from './referral';
|
|
13
|
+
export * from './roles';
|
|
14
|
+
export * from './subscription';
|
|
15
|
+
export * from './transaction';
|
|
16
|
+
export * from './user';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './referral-bonus-type.enum';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './subscription-
|
|
1
|
+
export * from './subscription-action.enum';
|
|
2
2
|
export * from './subscription-plan.enum';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './subscription-status.enum';
|
|
4
4
|
export * from './subscription-type.enum';
|
|
5
|
-
export * from './subscription-
|
|
5
|
+
export * from './user-to-subscription-type.enum';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user-status';
|
package/index.ts
CHANGED
package/models/index.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './page.schema';
|
|
1
|
+
export * from './ai-model.schema';
|
|
3
2
|
export * from './category.schema';
|
|
4
|
-
export * from './question.schema';
|
|
5
|
-
export * from './unregistered-user.schema';
|
|
6
3
|
export * from './chat.schema';
|
|
7
4
|
export * from './message.schema';
|
|
8
|
-
export * from './ai-model.schema';
|
|
9
|
-
export * from './product.schema';
|
|
10
|
-
export * from './subscription.schema';
|
|
11
5
|
export * from './order.schema';
|
|
6
|
+
export * from './page.schema';
|
|
7
|
+
export * from './payment-history-item.schema';
|
|
8
|
+
export * from './payment.schema';
|
|
12
9
|
export * from './post.schema';
|
|
10
|
+
export * from './product.schema';
|
|
11
|
+
export * from './question.schema';
|
|
12
|
+
export * from './referral-bonus.schema';
|
|
13
|
+
export * from './subscription-upgrade-schema';
|
|
14
|
+
export * from './subscription.schema';
|
|
15
|
+
export * from './unregistered-user.schema';
|
|
13
16
|
export * from './user-to-subscription.schema';
|
|
17
|
+
export * from './user.schema';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ReferralBonusType } from '../constants/referral';
|
|
3
|
+
|
|
4
|
+
export const ReferralBonusSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
partnerId: z.string().uuid(),
|
|
7
|
+
referralId: z.string().uuid(),
|
|
8
|
+
initial: z.number(),
|
|
9
|
+
total: z.number(),
|
|
10
|
+
type: z.nativeEnum(ReferralBonusType),
|
|
11
|
+
createdAt: z.date(),
|
|
12
|
+
updatedAt: z.date(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const ReferralBonusStatisticsSchema = z.object({
|
|
16
|
+
initial: z.number(),
|
|
17
|
+
weekStart: z.date(),
|
|
18
|
+
});
|