@purpleschool/gptbot 0.12.45 → 0.12.46
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/build/commands/team-account/find-team-accounts-by-name.command.js +6 -0
- package/build/commands/team-account/get-invoice-for-payment.command.js +6 -0
- package/build/constants/page/enums/page-sort-by.enum.js +3 -0
- package/build/constants/team-account/enums/index.js +2 -0
- package/build/constants/team-account/enums/invoice-for-payment-sort-by.enum.js +14 -0
- package/build/constants/team-account/enums/team-account-admin-sort-by.enum.js +11 -0
- package/build/models/team-account/team-account-with-balance.schema.js +9 -0
- package/commands/team-account/find-team-accounts-by-name.command.ts +6 -0
- package/commands/team-account/get-invoice-for-payment.command.ts +6 -0
- package/constants/page/enums/page-sort-by.enum.ts +3 -0
- package/constants/team-account/enums/index.ts +2 -0
- package/constants/team-account/enums/invoice-for-payment-sort-by.enum.ts +10 -0
- package/constants/team-account/enums/team-account-admin-sort-by.enum.ts +7 -0
- package/models/team-account/team-account-with-balance.schema.ts +9 -0
- package/package.json +1 -1
|
@@ -3,12 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FindTeamAccountsByNameCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
6
7
|
var FindTeamAccountsByNameCommand;
|
|
7
8
|
(function (FindTeamAccountsByNameCommand) {
|
|
8
9
|
FindTeamAccountsByNameCommand.RequestSchema = zod_1.z.object({
|
|
9
10
|
name: zod_1.z.string().trim().min(1).optional(),
|
|
10
11
|
limit: zod_1.z.coerce.number().int().min(1).max(100).default(20).optional(),
|
|
11
12
|
offset: zod_1.z.coerce.number().int().min(0).default(0).optional(),
|
|
13
|
+
sortBy: zod_1.z
|
|
14
|
+
.nativeEnum(constants_1.TEAM_ACCOUNT_ADMIN_SORT_BY)
|
|
15
|
+
.default(constants_1.TEAM_ACCOUNT_ADMIN_SORT_BY.CREATED_AT)
|
|
16
|
+
.optional(),
|
|
17
|
+
sortOrder: zod_1.z.nativeEnum(constants_1.SORT_ORDER).default(constants_1.SORT_ORDER.DESC).optional(),
|
|
12
18
|
});
|
|
13
19
|
FindTeamAccountsByNameCommand.ResponseSchema = zod_1.z.object({
|
|
14
20
|
data: zod_1.z.array(models_1.TeamAccountWithBalanceSchema),
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GetInvoiceForPaymentCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
6
7
|
var GetInvoiceForPaymentCommand;
|
|
7
8
|
(function (GetInvoiceForPaymentCommand) {
|
|
8
9
|
GetInvoiceForPaymentCommand.RequestQuerySchema = zod_1.z.object({
|
|
@@ -15,6 +16,11 @@ var GetInvoiceForPaymentCommand;
|
|
|
15
16
|
dateTo: zod_1.z.coerce.date().optional(),
|
|
16
17
|
limit: zod_1.z.coerce.number().int().min(1).max(100).default(20).optional(),
|
|
17
18
|
offset: zod_1.z.coerce.number().int().min(0).default(0).optional(),
|
|
19
|
+
sortBy: zod_1.z
|
|
20
|
+
.nativeEnum(constants_1.INVOICE_FOR_PAYMENT_SORT_BY)
|
|
21
|
+
.default(constants_1.INVOICE_FOR_PAYMENT_SORT_BY.CREATED_AT)
|
|
22
|
+
.optional(),
|
|
23
|
+
sortOrder: zod_1.z.nativeEnum(constants_1.SORT_ORDER).default(constants_1.SORT_ORDER.DESC).optional(),
|
|
18
24
|
});
|
|
19
25
|
GetInvoiceForPaymentCommand.ResponseSchema = zod_1.z.object({
|
|
20
26
|
data: zod_1.z.array(models_1.InvoiceForPaymentSchema),
|
|
@@ -5,4 +5,7 @@ var PAGE_SORT_BY;
|
|
|
5
5
|
(function (PAGE_SORT_BY) {
|
|
6
6
|
PAGE_SORT_BY["CREATED_AT"] = "createdAt";
|
|
7
7
|
PAGE_SORT_BY["UPDATED_AT"] = "updatedAt";
|
|
8
|
+
PAGE_SORT_BY["TITLE"] = "title";
|
|
9
|
+
PAGE_SORT_BY["CATEGORY_NAME"] = "categoryName";
|
|
10
|
+
PAGE_SORT_BY["CATEGORY_ID"] = "categoryId";
|
|
8
11
|
})(PAGE_SORT_BY || (exports.PAGE_SORT_BY = PAGE_SORT_BY = {}));
|
|
@@ -14,7 +14,9 @@ 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("./invoice-for-payment-sort-by.enum"), exports);
|
|
17
18
|
__exportStar(require("./team-account-invite-status.enum"), exports);
|
|
19
|
+
__exportStar(require("./team-account-admin-sort-by.enum"), exports);
|
|
18
20
|
__exportStar(require("./team-account-member-role.enum"), exports);
|
|
19
21
|
__exportStar(require("./team-account-member-status.enum"), exports);
|
|
20
22
|
__exportStar(require("./team-account-operation-type.enum"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INVOICE_FOR_PAYMENT_SORT_BY = void 0;
|
|
4
|
+
var INVOICE_FOR_PAYMENT_SORT_BY;
|
|
5
|
+
(function (INVOICE_FOR_PAYMENT_SORT_BY) {
|
|
6
|
+
INVOICE_FOR_PAYMENT_SORT_BY["INVOICE_NUMBER"] = "invoiceNumber";
|
|
7
|
+
INVOICE_FOR_PAYMENT_SORT_BY["SUM"] = "sum";
|
|
8
|
+
INVOICE_FOR_PAYMENT_SORT_BY["CREATED_AT"] = "createdAt";
|
|
9
|
+
INVOICE_FOR_PAYMENT_SORT_BY["UPDATED_AT"] = "updatedAt";
|
|
10
|
+
INVOICE_FOR_PAYMENT_SORT_BY["USER_ID"] = "userId";
|
|
11
|
+
INVOICE_FOR_PAYMENT_SORT_BY["TEAM_ACCOUNT_ID"] = "teamAccountId";
|
|
12
|
+
INVOICE_FOR_PAYMENT_SORT_BY["ORDER_ID"] = "orderId";
|
|
13
|
+
INVOICE_FOR_PAYMENT_SORT_BY["PAYMENT_ID"] = "paymentId";
|
|
14
|
+
})(INVOICE_FOR_PAYMENT_SORT_BY || (exports.INVOICE_FOR_PAYMENT_SORT_BY = INVOICE_FOR_PAYMENT_SORT_BY = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEAM_ACCOUNT_ADMIN_SORT_BY = void 0;
|
|
4
|
+
var TEAM_ACCOUNT_ADMIN_SORT_BY;
|
|
5
|
+
(function (TEAM_ACCOUNT_ADMIN_SORT_BY) {
|
|
6
|
+
TEAM_ACCOUNT_ADMIN_SORT_BY["NAME"] = "name";
|
|
7
|
+
TEAM_ACCOUNT_ADMIN_SORT_BY["EMAIL"] = "email";
|
|
8
|
+
TEAM_ACCOUNT_ADMIN_SORT_BY["CREATED_AT"] = "createdAt";
|
|
9
|
+
TEAM_ACCOUNT_ADMIN_SORT_BY["UPDATED_AT"] = "updatedAt";
|
|
10
|
+
TEAM_ACCOUNT_ADMIN_SORT_BY["SUBSCRIPTION_ENDS_AT"] = "subscriptionEndsAt";
|
|
11
|
+
})(TEAM_ACCOUNT_ADMIN_SORT_BY || (exports.TEAM_ACCOUNT_ADMIN_SORT_BY = TEAM_ACCOUNT_ADMIN_SORT_BY = {}));
|
|
@@ -10,6 +10,15 @@ exports.TeamAccountWithBalanceSchema = team_account_schema_1.TeamAccountSchema.e
|
|
|
10
10
|
productBalance: zod_1.z.number(),
|
|
11
11
|
carriedOverBalance: zod_1.z.number(),
|
|
12
12
|
}),
|
|
13
|
+
subscription: zod_1.z.object({
|
|
14
|
+
isActive: zod_1.z.boolean(),
|
|
15
|
+
activeUntil: zod_1.z.date().nullable(),
|
|
16
|
+
planName: zod_1.z.string().nullable(),
|
|
17
|
+
}),
|
|
18
|
+
balanceUsage: zod_1.z.object({
|
|
19
|
+
spent: zod_1.z.number(),
|
|
20
|
+
total: zod_1.z.number().nullable(),
|
|
21
|
+
}),
|
|
13
22
|
invoicesCount: zod_1.z.number(),
|
|
14
23
|
membersCount: zod_1.z.number(),
|
|
15
24
|
maxSeats: zod_1.z.number(),
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { TeamAccountWithBalanceSchema } from '../../models';
|
|
3
|
+
import { SORT_ORDER, TEAM_ACCOUNT_ADMIN_SORT_BY } from '../../constants';
|
|
3
4
|
|
|
4
5
|
export namespace FindTeamAccountsByNameCommand {
|
|
5
6
|
export const RequestSchema = z.object({
|
|
6
7
|
name: z.string().trim().min(1).optional(),
|
|
7
8
|
limit: z.coerce.number().int().min(1).max(100).default(20).optional(),
|
|
8
9
|
offset: z.coerce.number().int().min(0).default(0).optional(),
|
|
10
|
+
sortBy: z
|
|
11
|
+
.nativeEnum(TEAM_ACCOUNT_ADMIN_SORT_BY)
|
|
12
|
+
.default(TEAM_ACCOUNT_ADMIN_SORT_BY.CREATED_AT)
|
|
13
|
+
.optional(),
|
|
14
|
+
sortOrder: z.nativeEnum(SORT_ORDER).default(SORT_ORDER.DESC).optional(),
|
|
9
15
|
});
|
|
10
16
|
|
|
11
17
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { InvoiceForPaymentSchema } from '../../models';
|
|
3
|
+
import { INVOICE_FOR_PAYMENT_SORT_BY, SORT_ORDER } from '../../constants';
|
|
3
4
|
|
|
4
5
|
export namespace GetInvoiceForPaymentCommand {
|
|
5
6
|
export const RequestQuerySchema = z.object({
|
|
@@ -12,6 +13,11 @@ export namespace GetInvoiceForPaymentCommand {
|
|
|
12
13
|
dateTo: z.coerce.date().optional(),
|
|
13
14
|
limit: z.coerce.number().int().min(1).max(100).default(20).optional(),
|
|
14
15
|
offset: z.coerce.number().int().min(0).default(0).optional(),
|
|
16
|
+
sortBy: z
|
|
17
|
+
.nativeEnum(INVOICE_FOR_PAYMENT_SORT_BY)
|
|
18
|
+
.default(INVOICE_FOR_PAYMENT_SORT_BY.CREATED_AT)
|
|
19
|
+
.optional(),
|
|
20
|
+
sortOrder: z.nativeEnum(SORT_ORDER).default(SORT_ORDER.DESC).optional(),
|
|
15
21
|
});
|
|
16
22
|
|
|
17
23
|
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export * from './invoice-for-payment-sort-by.enum';
|
|
1
2
|
export * from './team-account-invite-status.enum';
|
|
3
|
+
export * from './team-account-admin-sort-by.enum';
|
|
2
4
|
export * from './team-account-member-role.enum';
|
|
3
5
|
export * from './team-account-member-status.enum';
|
|
4
6
|
export * from './team-account-operation-type.enum';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export enum INVOICE_FOR_PAYMENT_SORT_BY {
|
|
2
|
+
INVOICE_NUMBER = 'invoiceNumber',
|
|
3
|
+
SUM = 'sum',
|
|
4
|
+
CREATED_AT = 'createdAt',
|
|
5
|
+
UPDATED_AT = 'updatedAt',
|
|
6
|
+
USER_ID = 'userId',
|
|
7
|
+
TEAM_ACCOUNT_ID = 'teamAccountId',
|
|
8
|
+
ORDER_ID = 'orderId',
|
|
9
|
+
PAYMENT_ID = 'paymentId',
|
|
10
|
+
}
|
|
@@ -8,6 +8,15 @@ export const TeamAccountWithBalanceSchema = TeamAccountSchema.extend({
|
|
|
8
8
|
productBalance: z.number(),
|
|
9
9
|
carriedOverBalance: z.number(),
|
|
10
10
|
}),
|
|
11
|
+
subscription: z.object({
|
|
12
|
+
isActive: z.boolean(),
|
|
13
|
+
activeUntil: z.date().nullable(),
|
|
14
|
+
planName: z.string().nullable(),
|
|
15
|
+
}),
|
|
16
|
+
balanceUsage: z.object({
|
|
17
|
+
spent: z.number(),
|
|
18
|
+
total: z.number().nullable(),
|
|
19
|
+
}),
|
|
11
20
|
invoicesCount: z.number(),
|
|
12
21
|
membersCount: z.number(),
|
|
13
22
|
maxSeats: z.number(),
|