@purpleschool/multisite 0.0.20 → 0.0.22
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/index.ts +2 -0
- package/api/controller/http/payment.ts +1 -0
- package/api/controller/http/product.ts +2 -0
- package/api/controller/http/subscription.ts +0 -1
- package/api/controller/http/user-to-product.ts +7 -0
- package/api/controller/http/user-to-subscription.ts +8 -0
- package/api/routes.ts +23 -2
- package/build/api/controller/http/index.d.ts +2 -0
- package/build/api/controller/http/index.d.ts.map +1 -1
- package/build/api/controller/http/index.js +2 -0
- package/build/api/controller/http/payment.d.ts +1 -0
- package/build/api/controller/http/payment.d.ts.map +1 -1
- package/build/api/controller/http/payment.js +1 -0
- package/build/api/controller/http/product.d.ts +2 -0
- package/build/api/controller/http/product.d.ts.map +1 -1
- package/build/api/controller/http/product.js +2 -0
- package/build/api/controller/http/subscription.d.ts +0 -1
- package/build/api/controller/http/subscription.d.ts.map +1 -1
- package/build/api/controller/http/subscription.js +0 -1
- package/build/api/controller/http/user-to-product.d.ts +7 -0
- package/build/api/controller/http/user-to-product.d.ts.map +1 -0
- package/build/api/controller/http/user-to-product.js +9 -0
- package/build/api/controller/http/user-to-subscription.d.ts +8 -0
- package/build/api/controller/http/user-to-subscription.d.ts.map +1 -0
- package/build/api/controller/http/user-to-subscription.js +10 -0
- package/build/api/routes.d.ts +14 -1
- package/build/api/routes.d.ts.map +1 -1
- package/build/api/routes.js +14 -1
- package/build/commands/image-editor/execute-image-editor.command.d.ts +4 -4
- package/build/commands/image-editor/retry-image-editor-job.command.d.ts +4 -4
- package/build/commands/image-editor/set-reaction-to-image-editor-job.command.d.ts +4 -4
- package/build/commands/image-editor/update-image-editor-job-title.command.d.ts +4 -4
- package/build/commands/image-generation/execute-image-generation.command.d.ts +4 -4
- package/build/commands/image-generation/retry-image-generation-job.command.d.ts +4 -4
- package/build/commands/image-generation/set-reaction-to-image-generation-job.command.d.ts +4 -4
- package/build/commands/image-generation/update-image-generation-job-title.command.d.ts +4 -4
- package/build/commands/index.d.ts +2 -0
- package/build/commands/index.d.ts.map +1 -1
- package/build/commands/index.js +2 -0
- package/build/commands/page/create-page.command.d.ts +4 -4
- package/build/commands/page/find-page-by-alias.command.d.ts +12 -12
- package/build/commands/page/find-page-by-criteria.command.d.ts +4 -4
- package/build/commands/page/find-page.command.d.ts +8 -8
- package/build/commands/page/update-page.command.d.ts +4 -4
- package/build/commands/payment/cloud-payments.command.d.ts +2 -2
- package/build/commands/payment/index.d.ts +1 -0
- package/build/commands/payment/index.d.ts.map +1 -1
- package/build/commands/payment/index.js +1 -0
- package/build/commands/payment/refund-payment.command.d.ts +20 -0
- package/build/commands/payment/refund-payment.command.d.ts.map +1 -0
- package/build/commands/payment/refund-payment.command.js +13 -0
- package/build/commands/{subscription/refund-subscription.command.d.ts → product/delete-product.command.d.ts} +2 -2
- package/build/commands/product/delete-product.command.d.ts.map +1 -0
- package/build/commands/product/delete-product.command.js +13 -0
- package/build/commands/product/index.d.ts +2 -0
- package/build/commands/product/index.d.ts.map +1 -1
- package/build/commands/product/index.js +2 -0
- package/build/commands/product/update-product.command.d.ts +116 -0
- package/build/commands/product/update-product.command.d.ts.map +1 -0
- package/build/commands/product/update-product.command.js +26 -0
- package/build/commands/stt/execute-stt.command.d.ts +12 -12
- package/build/commands/stt/retry-stt-job.command.d.ts +12 -12
- package/build/commands/stt/set-reaction-to-stt-job.command.d.ts +12 -12
- package/build/commands/stt/update-stt-job-title.command.d.ts +12 -12
- package/build/commands/subscription/index.d.ts +0 -1
- package/build/commands/subscription/index.d.ts.map +1 -1
- package/build/commands/subscription/index.js +0 -1
- package/build/commands/tts/execute-tts.command.d.ts +12 -12
- package/build/commands/tts/retry-tts-job.command.d.ts +12 -12
- package/build/commands/tts/set-reaction-to-tts-job.command.d.ts +12 -12
- package/build/commands/tts/update-tts-job-title.command.d.ts +12 -12
- package/build/commands/unregistered-user/upsert-unregistered-user.command.d.ts +4 -4
- package/build/commands/user-to-product/delete-user-to-product.command.d.ts +20 -0
- package/build/commands/user-to-product/delete-user-to-product.command.d.ts.map +1 -0
- package/build/commands/user-to-product/delete-user-to-product.command.js +13 -0
- package/build/commands/user-to-product/get-user-to-product-by-uuid.command.d.ts +75 -0
- package/build/commands/user-to-product/get-user-to-product-by-uuid.command.d.ts.map +1 -0
- package/build/commands/user-to-product/get-user-to-product-by-uuid.command.js +14 -0
- package/build/commands/user-to-product/index.d.ts +4 -0
- package/build/commands/user-to-product/index.d.ts.map +1 -0
- package/build/commands/user-to-product/index.js +19 -0
- package/build/commands/user-to-product/update-user-to-product.command.d.ts +93 -0
- package/build/commands/user-to-product/update-user-to-product.command.d.ts.map +1 -0
- package/build/commands/user-to-product/update-user-to-product.command.js +21 -0
- package/build/commands/user-to-subscription/admin-cancel-subscription.command.d.ts +14 -0
- package/build/commands/user-to-subscription/admin-cancel-subscription.command.d.ts.map +1 -0
- package/build/commands/user-to-subscription/admin-cancel-subscription.command.js +11 -0
- package/build/commands/user-to-subscription/delete-user-to-subscription.command.d.ts +20 -0
- package/build/commands/user-to-subscription/delete-user-to-subscription.command.d.ts.map +1 -0
- package/build/commands/user-to-subscription/delete-user-to-subscription.command.js +13 -0
- package/build/commands/user-to-subscription/get-user-to-subscription-by-uuid.command.d.ts +115 -0
- package/build/commands/user-to-subscription/get-user-to-subscription-by-uuid.command.d.ts.map +1 -0
- package/build/commands/user-to-subscription/get-user-to-subscription-by-uuid.command.js +14 -0
- package/build/commands/user-to-subscription/index.d.ts +5 -0
- package/build/commands/user-to-subscription/index.d.ts.map +1 -0
- package/build/commands/user-to-subscription/index.js +20 -0
- package/build/commands/user-to-subscription/update-user-to-subscription.command.d.ts +157 -0
- package/build/commands/user-to-subscription/update-user-to-subscription.command.d.ts.map +1 -0
- package/build/commands/user-to-subscription/update-user-to-subscription.command.js +29 -0
- package/build/constants/errors/errors.d.ts +65 -0
- package/build/constants/errors/errors.d.ts.map +1 -1
- package/build/constants/errors/errors.js +67 -0
- package/build/constants/payment/enums/payment-status.enum.d.ts +2 -1
- package/build/constants/payment/enums/payment-status.enum.d.ts.map +1 -1
- package/build/constants/payment/enums/payment-status.enum.js +1 -0
- package/build/models/image-editor/image-editor-config.schema.d.ts +10 -10
- package/build/models/image-editor/image-editor-job.schema.d.ts +2 -2
- package/build/models/image-editor/image-editor-model.schema.d.ts +2 -2
- package/build/models/image-editor/image-editor-prompt-group.schema.d.ts +4 -4
- package/build/models/image-editor/image-editor-system-prompt.schema.d.ts +2 -2
- package/build/models/image-generation/image-generation-config.schema.d.ts +6 -6
- package/build/models/image-generation/image-generation-job.schema.d.ts +2 -2
- package/build/models/image-generation/image-generation-model.schema.d.ts +2 -2
- package/build/models/image-generation/image-generation-vendor.schema.d.ts +4 -4
- package/build/models/index.d.ts +2 -0
- package/build/models/index.d.ts.map +1 -1
- package/build/models/index.js +2 -0
- package/build/models/page.schema.d.ts +4 -4
- package/build/models/stt/stt-config.schema.d.ts +8 -8
- package/build/models/stt/stt-job.schema.d.ts +6 -6
- package/build/models/stt/stt-model.schema.d.ts +4 -4
- package/build/models/tts/tts-config.schema.d.ts +8 -8
- package/build/models/tts/tts-job.schema.d.ts +6 -6
- package/build/models/tts/tts-model.schema.d.ts +4 -4
- package/build/models/user-to-product.schema.d.ts +37 -0
- package/build/models/user-to-product.schema.d.ts.map +1 -0
- package/build/models/user-to-product.schema.js +17 -0
- package/build/models/user-to-subscription.schema.d.ts +61 -0
- package/build/models/user-to-subscription.schema.d.ts.map +1 -0
- package/build/models/user-to-subscription.schema.js +25 -0
- package/build/queries/image-editor/find-image-editor-jobs.command.d.ts +4 -4
- package/build/queries/image-editor/get-image-editor-config.command.d.ts +14 -14
- package/build/queries/image-editor/get-image-editor-job.command.d.ts +4 -4
- package/build/queries/image-generation/find-image-generation-jobs.command.d.ts +4 -4
- package/build/queries/image-generation/get-image-generation-config.command.d.ts +8 -8
- package/build/queries/image-generation/get-image-generation-job.command.d.ts +4 -4
- package/build/queries/payment/get-payment-history.command.d.ts +6 -6
- package/build/queries/stt/find-stt-jobs.command.d.ts +12 -12
- package/build/queries/stt/get-stt-config.command.d.ts +12 -12
- package/build/queries/stt/get-stt-job.command.d.ts +12 -12
- package/build/queries/subscription/get-subscriptions-summary.command.d.ts +16 -16
- package/build/queries/tts/find-tts-jobs.command.d.ts +12 -12
- package/build/queries/tts/get-tts-config.command.d.ts +12 -12
- package/build/queries/tts/get-tts-job.command.d.ts +12 -12
- package/build/queries/user/get-my-products.command.d.ts +8 -8
- package/build/queries/user/get-my-subscriptions.command.d.ts +12 -12
- package/build/queries/user/get-user-payments.command.d.ts +18 -18
- package/commands/index.ts +2 -0
- package/commands/payment/index.ts +1 -0
- package/commands/payment/refund-payment.command.ts +13 -0
- package/commands/{subscription/refund-subscription.command.ts → product/delete-product.command.ts} +1 -1
- package/commands/product/index.ts +2 -0
- package/commands/product/update-product.command.ts +30 -0
- package/commands/subscription/index.ts +0 -1
- package/commands/user-to-product/delete-user-to-product.command.ts +13 -0
- package/commands/user-to-product/get-user-to-product-by-uuid.command.ts +14 -0
- package/commands/user-to-product/index.ts +3 -0
- package/commands/user-to-product/update-user-to-product.command.ts +23 -0
- package/commands/user-to-subscription/admin-cancel-subscription.command.ts +11 -0
- package/commands/user-to-subscription/delete-user-to-subscription.command.ts +13 -0
- package/commands/user-to-subscription/get-user-to-subscription-by-uuid.command.ts +14 -0
- package/commands/user-to-subscription/index.ts +4 -0
- package/commands/user-to-subscription/update-user-to-subscription.command.ts +31 -0
- package/constants/errors/errors.ts +69 -0
- package/constants/payment/enums/payment-status.enum.ts +1 -0
- package/models/index.ts +2 -0
- package/models/user-to-product.schema.ts +15 -0
- package/models/user-to-subscription.schema.ts +23 -0
- package/package.json +1 -1
- package/build/commands/subscription/refund-subscription.command.d.ts.map +0 -1
- package/build/commands/subscription/refund-subscription.command.js +0 -13
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_TO_PRODUCT_STATUS } from '../../constants';
|
|
3
|
+
import { UserToProductSchema } from '../../models';
|
|
4
|
+
|
|
5
|
+
export namespace UpdateUserToProductCommand {
|
|
6
|
+
export const RequestParamSchema = z.object({
|
|
7
|
+
uuid: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestSchema = z.object({
|
|
12
|
+
initTokenBalance: z.number().int().min(0).optional(),
|
|
13
|
+
tokenBalance: z.number().int().min(0).optional(),
|
|
14
|
+
status: z.nativeEnum(USER_TO_PRODUCT_STATUS).optional(),
|
|
15
|
+
orderId: z.string().uuid().nullable().optional(),
|
|
16
|
+
});
|
|
17
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
18
|
+
|
|
19
|
+
export const ResponseSchema = z.object({
|
|
20
|
+
data: UserToProductSchema,
|
|
21
|
+
});
|
|
22
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace AdminCancelSubscriptionCommand {
|
|
4
|
+
export const RequestParamSchema = z.object({
|
|
5
|
+
uuidSiteUserToSubscription: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = z.void();
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteUserToSubscriptionCommand {
|
|
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,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UserToSubscriptionSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetUserToSubscriptionByUuidCommand {
|
|
5
|
+
export const RequestParamSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: UserToSubscriptionSchema,
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_TO_SUBSCRIPTION_STATUS, USER_TO_SUBSCRIPTION_TYPE } from '../../constants';
|
|
3
|
+
import { UserToSubscriptionSchema } from '../../models';
|
|
4
|
+
|
|
5
|
+
export namespace AdminUpdateUserToSubscriptionCommand {
|
|
6
|
+
export const RequestParamSchema = z.object({
|
|
7
|
+
uuid: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestSchema = z.object({
|
|
12
|
+
orderId: z.string().uuid().nullable().optional(),
|
|
13
|
+
cloudPaymentsSubscriptionId: z.string().nullable().optional(),
|
|
14
|
+
type: z.nativeEnum(USER_TO_SUBSCRIPTION_TYPE).optional(),
|
|
15
|
+
initTokenBalance: z.number().int().min(0).optional(),
|
|
16
|
+
tokenBalance: z.number().int().min(0).optional(),
|
|
17
|
+
initCarriedOverTokenBalance: z.number().int().min(0).optional(),
|
|
18
|
+
carriedOverTokenBalance: z.number().int().min(0).optional(),
|
|
19
|
+
status: z.nativeEnum(USER_TO_SUBSCRIPTION_STATUS).optional(),
|
|
20
|
+
active: z.boolean().optional(),
|
|
21
|
+
startDate: z.coerce.date().nullable().optional(),
|
|
22
|
+
intervalEndDate: z.coerce.date().nullable().optional(),
|
|
23
|
+
endDate: z.coerce.date().nullable().optional(),
|
|
24
|
+
});
|
|
25
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
26
|
+
|
|
27
|
+
export const ResponseSchema = z.object({
|
|
28
|
+
data: UserToSubscriptionSchema,
|
|
29
|
+
});
|
|
30
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
31
|
+
}
|
|
@@ -184,6 +184,38 @@ export const ERRORS = {
|
|
|
184
184
|
code: 'PRODUCT_004',
|
|
185
185
|
httpCode: 500,
|
|
186
186
|
},
|
|
187
|
+
PRODUCT_UPDATE_ERROR: {
|
|
188
|
+
message: 'Ошибка при обновлении продукта',
|
|
189
|
+
code: 'PRODUCT_005',
|
|
190
|
+
httpCode: 500,
|
|
191
|
+
},
|
|
192
|
+
PRODUCT_DELETE_ERROR: {
|
|
193
|
+
message: 'Ошибка при удалении продукта',
|
|
194
|
+
code: 'PRODUCT_006',
|
|
195
|
+
httpCode: 500,
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
// USER TO PRODUCT
|
|
199
|
+
USER_TO_PRODUCT_NOT_FOUND: {
|
|
200
|
+
message: 'Продукт пользователя не найден',
|
|
201
|
+
code: 'USER_TO_PRODUCT_001',
|
|
202
|
+
httpCode: 404,
|
|
203
|
+
},
|
|
204
|
+
USER_TO_PRODUCT_FIND_ERROR: {
|
|
205
|
+
message: 'Ошибка при поиске продукта пользователя',
|
|
206
|
+
code: 'USER_TO_PRODUCT_002',
|
|
207
|
+
httpCode: 500,
|
|
208
|
+
},
|
|
209
|
+
USER_TO_PRODUCT_UPDATE_ERROR: {
|
|
210
|
+
message: 'Ошибка при обновлении продукта пользователя',
|
|
211
|
+
code: 'USER_TO_PRODUCT_003',
|
|
212
|
+
httpCode: 500,
|
|
213
|
+
},
|
|
214
|
+
USER_TO_PRODUCT_DELETE_ERROR: {
|
|
215
|
+
message: 'Ошибка при удалении продукта пользователя',
|
|
216
|
+
code: 'USER_TO_PRODUCT_004',
|
|
217
|
+
httpCode: 500,
|
|
218
|
+
},
|
|
187
219
|
|
|
188
220
|
// SUBSCRIPTION
|
|
189
221
|
SUBSCRIPTION_NOT_FOUND: {
|
|
@@ -226,6 +258,38 @@ export const ERRORS = {
|
|
|
226
258
|
code: 'SUBSCRIPTION_008',
|
|
227
259
|
httpCode: 500,
|
|
228
260
|
},
|
|
261
|
+
SUBSCRIPTION_UPDATE_ERROR: {
|
|
262
|
+
message: 'Ошибка при обновлении подписки',
|
|
263
|
+
code: 'SUBSCRIPTION_009',
|
|
264
|
+
httpCode: 500,
|
|
265
|
+
},
|
|
266
|
+
SUBSCRIPTION_DELETE_ERROR: {
|
|
267
|
+
message: 'Ошибка при удалении подписки',
|
|
268
|
+
code: 'SUBSCRIPTION_010',
|
|
269
|
+
httpCode: 500,
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
// USER TO SUBSCRIPTION
|
|
273
|
+
USER_TO_SUBSCRIPTION_NOT_FOUND: {
|
|
274
|
+
message: 'Подписка пользователя не найдена',
|
|
275
|
+
code: 'USER_TO_SUBSCRIPTION_001',
|
|
276
|
+
httpCode: 404,
|
|
277
|
+
},
|
|
278
|
+
USER_TO_SUBSCRIPTION_FIND_ERROR: {
|
|
279
|
+
message: 'Ошибка при поиске подписки пользователя',
|
|
280
|
+
code: 'USER_TO_SUBSCRIPTION_002',
|
|
281
|
+
httpCode: 500,
|
|
282
|
+
},
|
|
283
|
+
USER_TO_SUBSCRIPTION_UPDATE_ERROR: {
|
|
284
|
+
message: 'Ошибка при обновлении подписки пользователя',
|
|
285
|
+
code: 'USER_TO_SUBSCRIPTION_003',
|
|
286
|
+
httpCode: 500,
|
|
287
|
+
},
|
|
288
|
+
USER_TO_SUBSCRIPTION_DELETE_ERROR: {
|
|
289
|
+
message: 'Ошибка при удалении подписки пользователя',
|
|
290
|
+
code: 'USER_TO_SUBSCRIPTION_004',
|
|
291
|
+
httpCode: 500,
|
|
292
|
+
},
|
|
229
293
|
|
|
230
294
|
// ORDER
|
|
231
295
|
ORDER_NOT_FOUND: {
|
|
@@ -260,6 +324,11 @@ export const ERRORS = {
|
|
|
260
324
|
code: 'PAYMENT_002',
|
|
261
325
|
httpCode: 500,
|
|
262
326
|
},
|
|
327
|
+
PAYMENT_REFUND_ERROR: {
|
|
328
|
+
message: 'Ошибка при возврате платежа',
|
|
329
|
+
code: 'PAYMENT_003',
|
|
330
|
+
httpCode: 500,
|
|
331
|
+
},
|
|
263
332
|
|
|
264
333
|
// TRANSACTION
|
|
265
334
|
TRANSACTION_WRITE_OFF_ERROR: {
|
package/models/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './user.schema';
|
|
2
2
|
export * from './product.schema';
|
|
3
3
|
export * from './subscription.schema';
|
|
4
|
+
export * from './user-to-product.schema';
|
|
5
|
+
export * from './user-to-subscription.schema';
|
|
4
6
|
export * from './cloud-payments-widget.schema';
|
|
5
7
|
export * from './cloud-payments-widget-data.schema';
|
|
6
8
|
export * from './image-generation';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_TO_PRODUCT_STATUS } from '../constants';
|
|
3
|
+
|
|
4
|
+
export const UserToProductSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
siteId: z.string().uuid(),
|
|
7
|
+
userId: z.string().uuid(),
|
|
8
|
+
productId: z.string().uuid(),
|
|
9
|
+
orderId: z.string().uuid().nullable(),
|
|
10
|
+
initTokenBalance: z.number().int().min(0),
|
|
11
|
+
tokenBalance: z.number().int().min(0),
|
|
12
|
+
status: z.nativeEnum(USER_TO_PRODUCT_STATUS),
|
|
13
|
+
createdAt: z.date(),
|
|
14
|
+
updatedAt: z.date(),
|
|
15
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_TO_SUBSCRIPTION_STATUS, USER_TO_SUBSCRIPTION_TYPE } from '../constants';
|
|
3
|
+
|
|
4
|
+
export const UserToSubscriptionSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
siteId: z.string().uuid(),
|
|
7
|
+
userId: z.string().uuid(),
|
|
8
|
+
subscriptionId: z.string().uuid(),
|
|
9
|
+
orderId: z.string().uuid().nullable(),
|
|
10
|
+
cloudPaymentsSubscriptionId: z.string().nullable(),
|
|
11
|
+
type: z.nativeEnum(USER_TO_SUBSCRIPTION_TYPE),
|
|
12
|
+
initTokenBalance: z.number().int().min(0),
|
|
13
|
+
tokenBalance: z.number().int().min(0),
|
|
14
|
+
initCarriedOverTokenBalance: z.number().int().min(0),
|
|
15
|
+
carriedOverTokenBalance: z.number().int().min(0),
|
|
16
|
+
status: z.nativeEnum(USER_TO_SUBSCRIPTION_STATUS),
|
|
17
|
+
active: z.boolean(),
|
|
18
|
+
startDate: z.date().nullable(),
|
|
19
|
+
intervalEndDate: z.date().nullable(),
|
|
20
|
+
endDate: z.date().nullable(),
|
|
21
|
+
createdAt: z.date(),
|
|
22
|
+
updatedAt: z.date(),
|
|
23
|
+
});
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 = {}));
|