@floristcloud/api-lib 1.0.11 → 1.0.12
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/client/get-client-debt-list.query.js +22 -0
- package/build/commands/client/index.js +1 -0
- package/build/constant/error.js +1 -0
- package/build/schemas/client/client-debt.schema.js +21 -0
- package/build/schemas/client/index.js +1 -0
- package/build/schemas/index.js +1 -0
- package/commands/client/get-client-debt-list.query.ts +24 -0
- package/commands/client/index.ts +1 -0
- package/constant/error.ts +1 -0
- package/package.json +1 -1
- package/schemas/client/client-debt.schema.ts +20 -0
- package/schemas/client/index.ts +1 -0
- package/schemas/index.ts +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetClientDebtListContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_1 = require("../../schemas/client");
|
|
6
|
+
const GetClientDebtListRequestSchema = zod_1.z.object({
|
|
7
|
+
page: zod_1.z.coerce.number().optional().default(1),
|
|
8
|
+
count: zod_1.z.coerce.number().optional().default(10),
|
|
9
|
+
responsibleUserUUID: zod_1.z.string().optional(),
|
|
10
|
+
searchQuery: zod_1.z.string().optional(),
|
|
11
|
+
group: zod_1.z.string().optional(),
|
|
12
|
+
paymentDelayDays: zod_1.z.coerce.number().optional().default(0),
|
|
13
|
+
});
|
|
14
|
+
const GetClientDebtListResponseSchema = zod_1.z.object({
|
|
15
|
+
message: zod_1.z.string().optional(),
|
|
16
|
+
data: client_1.ClientDebtListSchema,
|
|
17
|
+
});
|
|
18
|
+
var GetClientDebtListContractQuery;
|
|
19
|
+
(function (GetClientDebtListContractQuery) {
|
|
20
|
+
GetClientDebtListContractQuery.RequestSchema = GetClientDebtListRequestSchema;
|
|
21
|
+
GetClientDebtListContractQuery.ResponseSchema = GetClientDebtListResponseSchema;
|
|
22
|
+
})(GetClientDebtListContractQuery || (exports.GetClientDebtListContractQuery = GetClientDebtListContractQuery = {}));
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./profile"), exports);
|
|
18
18
|
__exportStar(require("./get-client.query"), exports);
|
|
19
19
|
__exportStar(require("./get-client-list.query"), exports);
|
|
20
|
+
__exportStar(require("./get-client-debt-list.query"), exports);
|
|
20
21
|
__exportStar(require("./create-client.command"), exports);
|
|
21
22
|
__exportStar(require("./update-client.command"), exports);
|
|
22
23
|
__exportStar(require("./delete-client.command"), exports);
|
package/build/constant/error.js
CHANGED
|
@@ -151,6 +151,7 @@ exports.ERRORS = {
|
|
|
151
151
|
CLIENT_MARKING_ALREADY_EXISTS: { code: 'CL029', message: 'Client marking already exists', httpCode: 409 },
|
|
152
152
|
CLIENT_MARKING_NOT_UPDATED: { code: 'CL030', message: 'Client marking not updated', httpCode: 500 },
|
|
153
153
|
CLIENT_HAS_TRANSACTIONS: { code: 'CL031', message: 'Client has transactions', httpCode: 400 },
|
|
154
|
+
CLIENT_DEBT_LIST_FETCH_FAILED: { code: 'CL032', message: 'Failed to get client debt list', httpCode: 500 },
|
|
154
155
|
//INDIVIDUAL PROFILE
|
|
155
156
|
CLIENT_INDIVIDUAL_PROFILE_NOT_CREATED: { code: 'CL013', message: 'Failed to create client individual profile', httpCode: 500 },
|
|
156
157
|
CLIENT_INDIVIDUAL_PROFILE_ALREADY_EXIST: { code: 'CL014', message: 'Individual profile already exist', httpCode: 409 },
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientDebtListSchema = exports.ClientDebtItemSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ClientDebtItemSchema = zod_1.z.object({
|
|
6
|
+
clientUUID: zod_1.z.string().uuid(),
|
|
7
|
+
name: zod_1.z.string(),
|
|
8
|
+
code: zod_1.z.string().nullable(),
|
|
9
|
+
group: zod_1.z.string().nullable(),
|
|
10
|
+
city: zod_1.z.string().nullable(),
|
|
11
|
+
responsibleUserName: zod_1.z.string().nullable(),
|
|
12
|
+
currentBalance: zod_1.z.number(),
|
|
13
|
+
transactionNet: zod_1.z.number(),
|
|
14
|
+
completedOrdersBalance: zod_1.z.number(),
|
|
15
|
+
completedOrdersBalanceWithDelay: zod_1.z.number(),
|
|
16
|
+
nonCompletedBalance: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
exports.ClientDebtListSchema = zod_1.z.object({
|
|
19
|
+
clientList: exports.ClientDebtItemSchema.array(),
|
|
20
|
+
total: zod_1.z.number(),
|
|
21
|
+
});
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./client.schema"), exports);
|
|
|
18
18
|
__exportStar(require("./client-individual-profile.schema"), exports);
|
|
19
19
|
__exportStar(require("./client-legal-profile.schema"), exports);
|
|
20
20
|
__exportStar(require("./client-marking.schema"), exports);
|
|
21
|
+
__exportStar(require("./client-debt.schema"), exports);
|
package/build/schemas/index.js
CHANGED
|
@@ -68,3 +68,4 @@ __exportStar(require("./pre-order-collection-item/pre-order-collection-item-mult
|
|
|
68
68
|
__exportStar(require("./message"), exports);
|
|
69
69
|
__exportStar(require("./product-configuration/product-configuration.schema"), exports);
|
|
70
70
|
__exportStar(require("./bank-payment"), exports);
|
|
71
|
+
__exportStar(require("./client"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ClientDebtListSchema } from '../../schemas/client';
|
|
3
|
+
|
|
4
|
+
const GetClientDebtListRequestSchema = z.object({
|
|
5
|
+
page: z.coerce.number().optional().default(1),
|
|
6
|
+
count: z.coerce.number().optional().default(10),
|
|
7
|
+
responsibleUserUUID: z.string().optional(),
|
|
8
|
+
searchQuery: z.string().optional(),
|
|
9
|
+
group: z.string().optional(),
|
|
10
|
+
paymentDelayDays: z.coerce.number().optional().default(0),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const GetClientDebtListResponseSchema = z.object({
|
|
14
|
+
message: z.string().optional(),
|
|
15
|
+
data: ClientDebtListSchema,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export namespace GetClientDebtListContractQuery {
|
|
19
|
+
export const RequestSchema = GetClientDebtListRequestSchema;
|
|
20
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = GetClientDebtListResponseSchema;
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
package/commands/client/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './profile';
|
|
2
2
|
export * from './get-client.query';
|
|
3
3
|
export * from './get-client-list.query';
|
|
4
|
+
export * from './get-client-debt-list.query';
|
|
4
5
|
export * from './create-client.command';
|
|
5
6
|
export * from './update-client.command';
|
|
6
7
|
export * from './delete-client.command';
|
package/constant/error.ts
CHANGED
|
@@ -157,6 +157,7 @@ export const ERRORS = {
|
|
|
157
157
|
CLIENT_MARKING_ALREADY_EXISTS: { code: 'CL029', message: 'Client marking already exists', httpCode: 409 },
|
|
158
158
|
CLIENT_MARKING_NOT_UPDATED: { code: 'CL030', message: 'Client marking not updated', httpCode: 500 },
|
|
159
159
|
CLIENT_HAS_TRANSACTIONS: { code: 'CL031', message: 'Client has transactions', httpCode: 400 },
|
|
160
|
+
CLIENT_DEBT_LIST_FETCH_FAILED: { code: 'CL032', message: 'Failed to get client debt list', httpCode: 500 },
|
|
160
161
|
|
|
161
162
|
//INDIVIDUAL PROFILE
|
|
162
163
|
CLIENT_INDIVIDUAL_PROFILE_NOT_CREATED: { code: 'CL013', message: 'Failed to create client individual profile', httpCode: 500 },
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const ClientDebtItemSchema = z.object({
|
|
4
|
+
clientUUID: z.string().uuid(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
code: z.string().nullable(),
|
|
7
|
+
group: z.string().nullable(),
|
|
8
|
+
city: z.string().nullable(),
|
|
9
|
+
responsibleUserName: z.string().nullable(),
|
|
10
|
+
currentBalance: z.number(),
|
|
11
|
+
transactionNet: z.number(),
|
|
12
|
+
completedOrdersBalance: z.number(),
|
|
13
|
+
completedOrdersBalanceWithDelay: z.number(),
|
|
14
|
+
nonCompletedBalance: z.number(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const ClientDebtListSchema = z.object({
|
|
18
|
+
clientList: ClientDebtItemSchema.array(),
|
|
19
|
+
total: z.number(),
|
|
20
|
+
});
|
package/schemas/client/index.ts
CHANGED
package/schemas/index.ts
CHANGED