@floristcloud/api-lib 1.2.94 → 1.2.96
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/constant/error.js
CHANGED
|
@@ -136,6 +136,7 @@ exports.ERRORS = {
|
|
|
136
136
|
CLIENT_NOT_FOUND: { code: 'CL004', message: 'The client with the specified UUID was not found', httpCode: 404 },
|
|
137
137
|
CLIENT_FETCH_FAILED: { code: 'CL005', message: 'Error when retrieving a list of clients', httpCode: 500 },
|
|
138
138
|
CLIENT_ALREADY_EXIST: { code: 'CL006', message: 'Client with this properties already exist', httpCode: 409 },
|
|
139
|
+
CLIENT_ACCESS_DENIED: { code: 'CL043', message: 'You are not responsible for this client', httpCode: 403 },
|
|
139
140
|
CLIENT_EMAIL_ALREADY_EXIST: { code: 'CL007', message: 'Client with this email already exist', httpCode: 409 },
|
|
140
141
|
CLIENT_PHONE_ALREADY_EXIST: { code: 'CL008', message: 'Client with this phone already exist', httpCode: 409 },
|
|
141
142
|
CLIENT_WITH_SAME_USER_ALREADY_EXIST: { code: 'CL009', message: 'Client with same user already exist', httpCode: 409 },
|
|
@@ -167,6 +168,7 @@ exports.ERRORS = {
|
|
|
167
168
|
CLIENT_MARKING_NOT_DELETED: { code: 'CL028', message: 'Client marking not deleted', httpCode: 500 },
|
|
168
169
|
CLIENT_MARKING_ALREADY_EXISTS: { code: 'CL029', message: 'Client marking already exists', httpCode: 409 },
|
|
169
170
|
CLIENT_MARKING_NOT_UPDATED: { code: 'CL030', message: 'Client marking not updated', httpCode: 500 },
|
|
171
|
+
CLIENT_MARKING_FETCH_FAILED: { code: 'CL044', message: 'Error when retrieving client marking', httpCode: 500 },
|
|
170
172
|
CLIENT_HAS_TRANSACTIONS: { code: 'CL031', message: 'Client has transactions', httpCode: 400 },
|
|
171
173
|
CLIENT_DEBT_LIST_FETCH_FAILED: { code: 'CL032', message: 'Failed to get client debt list', httpCode: 500 },
|
|
172
174
|
CLIENT_OVERDUE_STATUS_FETCH_FAILED: { code: 'CL033', message: 'Failed to get client overdue status', httpCode: 500 },
|
|
@@ -9,7 +9,10 @@ var PermissionKeyEnum;
|
|
|
9
9
|
PermissionKeyEnum["CONSIGNMENT_VIEW"] = "consignment.view";
|
|
10
10
|
PermissionKeyEnum["CONSIGNMENT_EDIT"] = "consignment.edit";
|
|
11
11
|
PermissionKeyEnum["CONSIGNMENT_DELETE"] = "consignment.delete";
|
|
12
|
+
// Per-product cost price (себестоимость товара).
|
|
12
13
|
PermissionKeyEnum["COST_VIEW"] = "cost.view";
|
|
14
|
+
// Consignment-level financial totals: total cost + profit (итоги по поставке).
|
|
15
|
+
PermissionKeyEnum["CONSIGNMENT_FINANCIALS_VIEW"] = "consignment.financials.view";
|
|
13
16
|
})(PermissionKeyEnum || (exports.PermissionKeyEnum = PermissionKeyEnum = {}));
|
|
14
17
|
exports.PERMISSION_KEY_LIST = [
|
|
15
18
|
PermissionKeyEnum.PRODUCT_VIEW,
|
|
@@ -19,4 +22,5 @@ exports.PERMISSION_KEY_LIST = [
|
|
|
19
22
|
PermissionKeyEnum.CONSIGNMENT_EDIT,
|
|
20
23
|
PermissionKeyEnum.CONSIGNMENT_DELETE,
|
|
21
24
|
PermissionKeyEnum.COST_VIEW,
|
|
25
|
+
PermissionKeyEnum.CONSIGNMENT_FINANCIALS_VIEW,
|
|
22
26
|
];
|
|
@@ -90,6 +90,7 @@ exports.SettingsSchema = zod_1.z.object({
|
|
|
90
90
|
importantMessage: exports.ImportantMessageSchema.nullable(),
|
|
91
91
|
deliveryPricingEnabled: zod_1.z.boolean(),
|
|
92
92
|
deliveryPricingTiers: zod_1.z.array(exports.DeliveryPricingTierSchema).nullable(),
|
|
93
|
+
employeeClientScopeEnabled: zod_1.z.boolean(),
|
|
93
94
|
telegramStaffBotName: zod_1.z.string().nullable().optional(),
|
|
94
95
|
});
|
|
95
96
|
exports.SettingsForAdminSchema = exports.SettingsSchema.extend({
|
|
@@ -236,6 +237,7 @@ exports.UpdateSettingsRequestSchema = zod_1.z.object({
|
|
|
236
237
|
importantMessage: exports.ImportantMessageSchema.nullable().optional(),
|
|
237
238
|
deliveryPricingEnabled: zod_1.z.coerce.boolean().optional(),
|
|
238
239
|
deliveryPricingTiers: zod_1.z.array(exports.DeliveryPricingTierSchema).nullable().optional(),
|
|
240
|
+
employeeClientScopeEnabled: zod_1.z.coerce.boolean().optional(),
|
|
239
241
|
// post terminal settings
|
|
240
242
|
vatTag: zod_1.z.string().nullable().optional(),
|
|
241
243
|
taxMode: zod_1.z.string().nullable().optional(),
|
package/constant/error.ts
CHANGED
|
@@ -141,6 +141,7 @@ export const ERRORS = {
|
|
|
141
141
|
CLIENT_NOT_FOUND: { code: 'CL004', message: 'The client with the specified UUID was not found', httpCode: 404 },
|
|
142
142
|
CLIENT_FETCH_FAILED: { code: 'CL005', message: 'Error when retrieving a list of clients', httpCode: 500 },
|
|
143
143
|
CLIENT_ALREADY_EXIST: { code: 'CL006', message: 'Client with this properties already exist', httpCode: 409 },
|
|
144
|
+
CLIENT_ACCESS_DENIED: { code: 'CL043', message: 'You are not responsible for this client', httpCode: 403 },
|
|
144
145
|
CLIENT_EMAIL_ALREADY_EXIST: { code: 'CL007', message: 'Client with this email already exist', httpCode: 409 },
|
|
145
146
|
CLIENT_PHONE_ALREADY_EXIST: { code: 'CL008', message: 'Client with this phone already exist', httpCode: 409 },
|
|
146
147
|
CLIENT_WITH_SAME_USER_ALREADY_EXIST: { code: 'CL009', message: 'Client with same user already exist', httpCode: 409 },
|
|
@@ -173,6 +174,7 @@ export const ERRORS = {
|
|
|
173
174
|
CLIENT_MARKING_NOT_DELETED: { code: 'CL028', message: 'Client marking not deleted', httpCode: 500 },
|
|
174
175
|
CLIENT_MARKING_ALREADY_EXISTS: { code: 'CL029', message: 'Client marking already exists', httpCode: 409 },
|
|
175
176
|
CLIENT_MARKING_NOT_UPDATED: { code: 'CL030', message: 'Client marking not updated', httpCode: 500 },
|
|
177
|
+
CLIENT_MARKING_FETCH_FAILED: { code: 'CL044', message: 'Error when retrieving client marking', httpCode: 500 },
|
|
176
178
|
CLIENT_HAS_TRANSACTIONS: { code: 'CL031', message: 'Client has transactions', httpCode: 400 },
|
|
177
179
|
CLIENT_DEBT_LIST_FETCH_FAILED: { code: 'CL032', message: 'Failed to get client debt list', httpCode: 500 },
|
|
178
180
|
CLIENT_OVERDUE_STATUS_FETCH_FAILED: { code: 'CL033', message: 'Failed to get client overdue status', httpCode: 500 },
|
|
@@ -5,7 +5,10 @@ export enum PermissionKeyEnum {
|
|
|
5
5
|
CONSIGNMENT_VIEW = 'consignment.view',
|
|
6
6
|
CONSIGNMENT_EDIT = 'consignment.edit',
|
|
7
7
|
CONSIGNMENT_DELETE = 'consignment.delete',
|
|
8
|
+
// Per-product cost price (себестоимость товара).
|
|
8
9
|
COST_VIEW = 'cost.view',
|
|
10
|
+
// Consignment-level financial totals: total cost + profit (итоги по поставке).
|
|
11
|
+
CONSIGNMENT_FINANCIALS_VIEW = 'consignment.financials.view',
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export const PERMISSION_KEY_LIST: PermissionKeyEnum[] = [
|
|
@@ -16,4 +19,5 @@ export const PERMISSION_KEY_LIST: PermissionKeyEnum[] = [
|
|
|
16
19
|
PermissionKeyEnum.CONSIGNMENT_EDIT,
|
|
17
20
|
PermissionKeyEnum.CONSIGNMENT_DELETE,
|
|
18
21
|
PermissionKeyEnum.COST_VIEW,
|
|
22
|
+
PermissionKeyEnum.CONSIGNMENT_FINANCIALS_VIEW,
|
|
19
23
|
];
|
package/package.json
CHANGED
|
@@ -91,6 +91,7 @@ export const SettingsSchema = z.object({
|
|
|
91
91
|
importantMessage: ImportantMessageSchema.nullable(),
|
|
92
92
|
deliveryPricingEnabled: z.boolean(),
|
|
93
93
|
deliveryPricingTiers: z.array(DeliveryPricingTierSchema).nullable(),
|
|
94
|
+
employeeClientScopeEnabled: z.boolean(),
|
|
94
95
|
telegramStaffBotName: z.string().nullable().optional(),
|
|
95
96
|
});
|
|
96
97
|
|
|
@@ -244,6 +245,7 @@ export const UpdateSettingsRequestSchema = z.object({
|
|
|
244
245
|
importantMessage: ImportantMessageSchema.nullable().optional(),
|
|
245
246
|
deliveryPricingEnabled: z.coerce.boolean().optional(),
|
|
246
247
|
deliveryPricingTiers: z.array(DeliveryPricingTierSchema).nullable().optional(),
|
|
248
|
+
employeeClientScopeEnabled: z.coerce.boolean().optional(),
|
|
247
249
|
// post terminal settings
|
|
248
250
|
vatTag: z.string().nullable().optional(),
|
|
249
251
|
taxMode: z.string().nullable().optional(),
|