@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.
Files changed (65) hide show
  1. package/api/controller/http/subscription.ts +5 -1
  2. package/api/controller/http/user.ts +7 -0
  3. package/api/routes.ts +21 -1
  4. package/build/api/controller/http/subscription.d.ts +5 -1
  5. package/build/api/controller/http/subscription.d.ts.map +1 -1
  6. package/build/api/controller/http/subscription.js +5 -1
  7. package/build/api/controller/http/user.d.ts +7 -0
  8. package/build/api/controller/http/user.d.ts.map +1 -1
  9. package/build/api/controller/http/user.js +7 -0
  10. package/build/api/routes.d.ts +11 -0
  11. package/build/api/routes.d.ts.map +1 -1
  12. package/build/api/routes.js +12 -1
  13. package/build/commands/subscription/delete-subscription.command.d.ts +20 -0
  14. package/build/commands/subscription/delete-subscription.command.d.ts.map +1 -0
  15. package/build/commands/subscription/delete-subscription.command.js +13 -0
  16. package/build/commands/subscription/index.d.ts +4 -0
  17. package/build/commands/subscription/index.d.ts.map +1 -1
  18. package/build/commands/subscription/index.js +4 -0
  19. package/build/commands/subscription/recover-subscription.command.d.ts +14 -0
  20. package/build/commands/subscription/recover-subscription.command.d.ts.map +1 -0
  21. package/build/commands/subscription/recover-subscription.command.js +11 -0
  22. package/build/commands/subscription/refund-subscription.command.d.ts +20 -0
  23. package/build/commands/subscription/refund-subscription.command.d.ts.map +1 -0
  24. package/build/commands/subscription/refund-subscription.command.js +13 -0
  25. package/build/commands/subscription/update-subscription.command.d.ts +148 -0
  26. package/build/commands/subscription/update-subscription.command.d.ts.map +1 -0
  27. package/build/commands/subscription/update-subscription.command.js +30 -0
  28. package/build/constants/cloud-payments/index.d.ts +1 -0
  29. package/build/constants/cloud-payments/index.d.ts.map +1 -1
  30. package/build/constants/cloud-payments/index.js +2 -1
  31. package/build/constants/errors/errors.d.ts +10 -0
  32. package/build/constants/errors/errors.d.ts.map +1 -1
  33. package/build/constants/errors/errors.js +10 -0
  34. package/build/queries/user/find-users.command.d.ts +99 -0
  35. package/build/queries/user/find-users.command.d.ts.map +1 -0
  36. package/build/queries/user/find-users.command.js +29 -0
  37. package/build/queries/user/get-all-users.command.d.ts +48 -0
  38. package/build/queries/user/get-all-users.command.d.ts.map +1 -0
  39. package/build/queries/user/get-all-users.command.js +18 -0
  40. package/build/queries/user/get-my-subscriptions.command.d.ts +5 -0
  41. package/build/queries/user/get-my-subscriptions.command.d.ts.map +1 -1
  42. package/build/queries/user/get-my-subscriptions.command.js +1 -0
  43. package/build/queries/user/get-user-payments.command.d.ts +134 -0
  44. package/build/queries/user/get-user-payments.command.d.ts.map +1 -0
  45. package/build/queries/user/get-user-payments.command.js +27 -0
  46. package/build/queries/user/get-user.command.d.ts +11 -1
  47. package/build/queries/user/get-user.command.d.ts.map +1 -1
  48. package/build/queries/user/get-user.command.js +2 -0
  49. package/build/queries/user/index.d.ts +3 -0
  50. package/build/queries/user/index.d.ts.map +1 -1
  51. package/build/queries/user/index.js +3 -0
  52. package/commands/subscription/delete-subscription.command.ts +13 -0
  53. package/commands/subscription/index.ts +4 -0
  54. package/commands/subscription/recover-subscription.command.ts +11 -0
  55. package/commands/subscription/refund-subscription.command.ts +13 -0
  56. package/commands/subscription/update-subscription.command.ts +34 -0
  57. package/constants/cloud-payments/index.ts +1 -0
  58. package/constants/errors/errors.ts +10 -0
  59. package/package.json +1 -1
  60. package/queries/user/find-users.command.ts +31 -0
  61. package/queries/user/get-all-users.command.ts +19 -0
  62. package/queries/user/get-my-subscriptions.command.ts +1 -0
  63. package/queries/user/get-user-payments.command.ts +26 -0
  64. package/queries/user/get-user.command.ts +3 -1
  65. 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>;
@@ -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';