@floristcloud/api-lib 1.0.11 → 1.0.13
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/commands/order/update-order.command.js +5 -3
- 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/build/schemas/order/order.schema.js +2 -0
- package/build/schemas/settings/settings.schema.js +3 -0
- package/commands/client/get-client-debt-list.query.ts +24 -0
- package/commands/client/index.ts +1 -0
- package/commands/order/update-order.command.ts +5 -3
- 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
- package/schemas/order/order.schema.ts +3 -0
- package/schemas/settings/settings.schema.ts +3 -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);
|
|
@@ -7,15 +7,17 @@ const schemas_1 = require("../../schemas");
|
|
|
7
7
|
const UpdateOrderRequestSchema = zod_1.z.object({
|
|
8
8
|
clientUUID: zod_1.z.string().uuid(),
|
|
9
9
|
branchUUID: zod_1.z.string().uuid().nullable(),
|
|
10
|
-
deliveryCost: zod_1.z.number(),
|
|
10
|
+
deliveryCost: zod_1.z.coerce.number(),
|
|
11
11
|
type: zod_1.z.nativeEnum(enum_1.OrderTypeEnum),
|
|
12
12
|
comment: zod_1.z.string().nullable(),
|
|
13
13
|
clientComment: zod_1.z.string().nullable(),
|
|
14
14
|
tag: zod_1.z.string().nullable(),
|
|
15
15
|
status: zod_1.z.nativeEnum(enum_1.OrderStatusEnum),
|
|
16
16
|
isPaid: zod_1.z.coerce.boolean(),
|
|
17
|
-
deliveryVat: zod_1.z.number().nullable(),
|
|
18
|
-
deliveryVatAmount: zod_1.z.number(),
|
|
17
|
+
deliveryVat: zod_1.z.coerce.number().nullable(),
|
|
18
|
+
deliveryVatAmount: zod_1.z.coerce.number(),
|
|
19
|
+
completedAt: zod_1.z.coerce.date().nullable().optional(),
|
|
20
|
+
paymentDueAt: zod_1.z.coerce.date().nullable().optional(),
|
|
19
21
|
});
|
|
20
22
|
const UpdateOrderResponseSchema = zod_1.z.object({
|
|
21
23
|
message: zod_1.z.string().optional(),
|
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);
|
|
@@ -33,6 +33,8 @@ exports.OrderSchema = zod_1.z.object({
|
|
|
33
33
|
totalProductNumber: zod_1.z.number(),
|
|
34
34
|
invoiceSendAt: zod_1.z.date().nullable(),
|
|
35
35
|
deliveryRouteUUID: zod_1.z.string().uuid().nullable(),
|
|
36
|
+
completedAt: zod_1.z.date().nullable(),
|
|
37
|
+
paymentDueAt: zod_1.z.date().nullable(),
|
|
36
38
|
createdAt: zod_1.z.date(),
|
|
37
39
|
updatedAt: zod_1.z.date(),
|
|
38
40
|
deletedAt: zod_1.z.date().nullable(),
|
|
@@ -41,6 +41,7 @@ exports.SettingsSchema = zod_1.z.object({
|
|
|
41
41
|
isShowPriceAnonymous: zod_1.z.boolean(),
|
|
42
42
|
orderExpirationWarningMin: zod_1.z.number().nullable(),
|
|
43
43
|
orderExpirationMin: zod_1.z.number().nullable(),
|
|
44
|
+
paymentGraceDaysAfterCompletion: zod_1.z.number().nullable(),
|
|
44
45
|
discountPriceRounding: zod_1.z.nativeEnum(enum_1.DiscountPriceRoundingEnum),
|
|
45
46
|
createdAt: zod_1.z.coerce.date(),
|
|
46
47
|
updatedAt: zod_1.z.coerce.date(),
|
|
@@ -97,6 +98,7 @@ exports.CreateSettingsSchema = zod_1.z.object({
|
|
|
97
98
|
bankAccountNumber: zod_1.z.string().optional(),
|
|
98
99
|
orderExpirationWarningMin: zod_1.z.coerce.number().nullable().optional(),
|
|
99
100
|
orderExpirationMin: zod_1.z.coerce.number().nullable().optional(),
|
|
101
|
+
paymentGraceDaysAfterCompletion: zod_1.z.coerce.number().nullable().optional(),
|
|
100
102
|
isShowPriceAnonymous: zod_1.z.coerce.boolean().optional(),
|
|
101
103
|
discountPriceRounding: zod_1.z.nativeEnum(enum_1.DiscountPriceRoundingEnum).optional(),
|
|
102
104
|
vatTag: zod_1.z.string().nullable().optional(),
|
|
@@ -151,6 +153,7 @@ exports.UpdateSettingsRequestSchema = zod_1.z.object({
|
|
|
151
153
|
isShowPriceAnonymous: zod_1.z.coerce.boolean().optional(),
|
|
152
154
|
orderExpirationWarningMin: zod_1.z.coerce.number().nullable().optional(),
|
|
153
155
|
orderExpirationMin: zod_1.z.coerce.number().nullable().optional(),
|
|
156
|
+
paymentGraceDaysAfterCompletion: zod_1.z.coerce.number().nullable().optional(),
|
|
154
157
|
discountPriceRounding: zod_1.z.nativeEnum(enum_1.DiscountPriceRoundingEnum).optional(),
|
|
155
158
|
webshopMainDisplayMode: zod_1.z.nativeEnum(webshop_main_display_mode_enum_1.WebshopMainDisplayModeEnum).nullable().optional(),
|
|
156
159
|
webshopMode: zod_1.z.nativeEnum(enum_1.WebshopModeEnum).nullable().optional(),
|
|
@@ -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';
|
|
@@ -5,15 +5,17 @@ import { OrderSchema } from '../../schemas';
|
|
|
5
5
|
const UpdateOrderRequestSchema = z.object({
|
|
6
6
|
clientUUID: z.string().uuid(),
|
|
7
7
|
branchUUID: z.string().uuid().nullable(),
|
|
8
|
-
deliveryCost: z.number(),
|
|
8
|
+
deliveryCost: z.coerce.number(),
|
|
9
9
|
type: z.nativeEnum(OrderTypeEnum),
|
|
10
10
|
comment: z.string().nullable(),
|
|
11
11
|
clientComment: z.string().nullable(),
|
|
12
12
|
tag: z.string().nullable(),
|
|
13
13
|
status: z.nativeEnum(OrderStatusEnum),
|
|
14
14
|
isPaid: z.coerce.boolean(),
|
|
15
|
-
deliveryVat: z.number().nullable(),
|
|
16
|
-
deliveryVatAmount: z.number(),
|
|
15
|
+
deliveryVat: z.coerce.number().nullable(),
|
|
16
|
+
deliveryVatAmount: z.coerce.number(),
|
|
17
|
+
completedAt: z.coerce.date().nullable().optional(),
|
|
18
|
+
paymentDueAt: z.coerce.date().nullable().optional(),
|
|
17
19
|
});
|
|
18
20
|
|
|
19
21
|
const UpdateOrderResponseSchema = z.object({
|
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
|
@@ -36,6 +36,9 @@ export const OrderSchema = z.object({
|
|
|
36
36
|
invoiceSendAt: z.date().nullable(),
|
|
37
37
|
deliveryRouteUUID: z.string().uuid().nullable(),
|
|
38
38
|
|
|
39
|
+
completedAt: z.date().nullable(),
|
|
40
|
+
paymentDueAt: z.date().nullable(),
|
|
41
|
+
|
|
39
42
|
createdAt: z.date(),
|
|
40
43
|
updatedAt: z.date(),
|
|
41
44
|
deletedAt: z.date().nullable(),
|
|
@@ -40,6 +40,7 @@ export const SettingsSchema = z.object({
|
|
|
40
40
|
isShowPriceAnonymous: z.boolean(),
|
|
41
41
|
orderExpirationWarningMin: z.number().nullable(),
|
|
42
42
|
orderExpirationMin: z.number().nullable(),
|
|
43
|
+
paymentGraceDaysAfterCompletion: z.number().nullable(),
|
|
43
44
|
discountPriceRounding: z.nativeEnum(DiscountPriceRoundingEnum),
|
|
44
45
|
createdAt: z.coerce.date(),
|
|
45
46
|
updatedAt: z.coerce.date(),
|
|
@@ -98,6 +99,7 @@ export const CreateSettingsSchema = z.object({
|
|
|
98
99
|
bankAccountNumber: z.string().optional(),
|
|
99
100
|
orderExpirationWarningMin: z.coerce.number().nullable().optional(),
|
|
100
101
|
orderExpirationMin: z.coerce.number().nullable().optional(),
|
|
102
|
+
paymentGraceDaysAfterCompletion: z.coerce.number().nullable().optional(),
|
|
101
103
|
isShowPriceAnonymous: z.coerce.boolean().optional(),
|
|
102
104
|
discountPriceRounding: z.nativeEnum(DiscountPriceRoundingEnum).optional(),
|
|
103
105
|
vatTag: z.string().nullable().optional(),
|
|
@@ -155,6 +157,7 @@ export const UpdateSettingsRequestSchema = z.object({
|
|
|
155
157
|
isShowPriceAnonymous: z.coerce.boolean().optional(),
|
|
156
158
|
orderExpirationWarningMin: z.coerce.number().nullable().optional(),
|
|
157
159
|
orderExpirationMin: z.coerce.number().nullable().optional(),
|
|
160
|
+
paymentGraceDaysAfterCompletion: z.coerce.number().nullable().optional(),
|
|
158
161
|
discountPriceRounding: z.nativeEnum(DiscountPriceRoundingEnum).optional(),
|
|
159
162
|
webshopMainDisplayMode: z.nativeEnum(WebshopMainDisplayModeEnum).nullable().optional(),
|
|
160
163
|
webshopMode: z.nativeEnum(WebshopModeEnum).nullable().optional(),
|