@purpleschool/multisite 0.0.18 → 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.
- package/api/controller/http/subscription.ts +5 -1
- package/api/controller/http/user.ts +7 -0
- package/api/routes.ts +21 -1
- package/build/api/controller/http/subscription.d.ts +5 -1
- package/build/api/controller/http/subscription.d.ts.map +1 -1
- package/build/api/controller/http/subscription.js +5 -1
- package/build/api/controller/http/user.d.ts +7 -0
- package/build/api/controller/http/user.d.ts.map +1 -1
- package/build/api/controller/http/user.js +7 -0
- package/build/api/routes.d.ts +11 -0
- package/build/api/routes.d.ts.map +1 -1
- package/build/api/routes.js +12 -1
- package/build/commands/subscription/delete-subscription.command.d.ts +20 -0
- package/build/commands/subscription/delete-subscription.command.d.ts.map +1 -0
- package/build/commands/subscription/delete-subscription.command.js +13 -0
- package/build/commands/subscription/index.d.ts +4 -0
- package/build/commands/subscription/index.d.ts.map +1 -1
- package/build/commands/subscription/index.js +4 -0
- package/build/commands/subscription/recover-subscription.command.d.ts +14 -0
- package/build/commands/subscription/recover-subscription.command.d.ts.map +1 -0
- package/build/commands/subscription/recover-subscription.command.js +11 -0
- package/build/commands/subscription/refund-subscription.command.d.ts +20 -0
- package/build/commands/subscription/refund-subscription.command.d.ts.map +1 -0
- package/build/commands/subscription/refund-subscription.command.js +13 -0
- package/build/commands/subscription/update-subscription.command.d.ts +148 -0
- package/build/commands/subscription/update-subscription.command.d.ts.map +1 -0
- package/build/commands/subscription/update-subscription.command.js +30 -0
- package/build/constants/cloud-payments/index.d.ts +1 -0
- package/build/constants/cloud-payments/index.d.ts.map +1 -1
- package/build/constants/cloud-payments/index.js +2 -1
- package/build/constants/errors/errors.d.ts +10 -0
- package/build/constants/errors/errors.d.ts.map +1 -1
- package/build/constants/errors/errors.js +10 -0
- package/build/queries/user/find-users.command.d.ts +99 -0
- package/build/queries/user/find-users.command.d.ts.map +1 -0
- package/build/queries/user/find-users.command.js +29 -0
- package/build/queries/user/get-all-users.command.d.ts +48 -0
- package/build/queries/user/get-all-users.command.d.ts.map +1 -0
- package/build/queries/user/get-all-users.command.js +18 -0
- package/build/queries/user/get-my-subscriptions.command.d.ts +5 -0
- package/build/queries/user/get-my-subscriptions.command.d.ts.map +1 -1
- package/build/queries/user/get-my-subscriptions.command.js +1 -0
- package/build/queries/user/get-user-payments.command.d.ts +134 -0
- package/build/queries/user/get-user-payments.command.d.ts.map +1 -0
- package/build/queries/user/get-user-payments.command.js +27 -0
- package/build/queries/user/get-user.command.d.ts +11 -1
- package/build/queries/user/get-user.command.d.ts.map +1 -1
- package/build/queries/user/get-user.command.js +2 -0
- package/build/queries/user/index.d.ts +3 -0
- package/build/queries/user/index.d.ts.map +1 -1
- package/build/queries/user/index.js +3 -0
- package/commands/subscription/delete-subscription.command.ts +13 -0
- package/commands/subscription/index.ts +4 -0
- package/commands/subscription/recover-subscription.command.ts +11 -0
- package/commands/subscription/refund-subscription.command.ts +13 -0
- package/commands/subscription/update-subscription.command.ts +34 -0
- package/constants/cloud-payments/index.ts +1 -0
- package/constants/errors/errors.ts +10 -0
- package/package.json +1 -1
- package/queries/user/find-users.command.ts +31 -0
- package/queries/user/get-all-users.command.ts +19 -0
- package/queries/user/get-my-subscriptions.command.ts +1 -0
- package/queries/user/get-user-payments.command.ts +26 -0
- package/queries/user/get-user.command.ts +3 -1
- package/queries/user/index.ts +3 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_ROLE, USER_STATUS } from '../../constants';
|
|
3
|
+
|
|
4
|
+
export namespace GetAllUsersCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: z.array(
|
|
7
|
+
z.object({
|
|
8
|
+
uuid: z.string().uuid(),
|
|
9
|
+
email: z.string().email(),
|
|
10
|
+
role: z.nativeEnum(USER_ROLE),
|
|
11
|
+
status: z.nativeEnum(USER_STATUS),
|
|
12
|
+
siteId: z.string().uuid(),
|
|
13
|
+
tokenBonusBalance: z.number().int(),
|
|
14
|
+
}),
|
|
15
|
+
),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -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>;
|
package/queries/user/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from './get-user.command';
|
|
2
|
+
export * from './get-all-users.command';
|
|
2
3
|
export * from './get-user-balance.command';
|
|
3
4
|
export * from './get-my-products.command';
|
|
4
5
|
export * from './get-my-subscriptions.command';
|
|
6
|
+
export * from './find-users.command';
|
|
7
|
+
export * from './get-user-payments.command';
|