@ecogood/e-calculator-schemas 2.7.10 → 2.7.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.
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BalanceSheetItemsResponseSchema = exports.BalanceSheetItemResponseSchema = exports.BalanceSheetResponseBodySchema = exports.BalanceSheetPatchRequestBodySchema = exports.BalanceSheetCreateRequestBodySchema = void 0;
4
+ const shared_schemas_1 = require("./shared.schemas");
5
+ const zod_1 = require("zod");
6
+ const company_facts_dto_1 = require("./company.facts.dto");
7
+ const rating_dto_1 = require("./rating.dto");
8
+ const stakeholder_weight_dto_1 = require("./stakeholder.weight.dto");
9
+ exports.BalanceSheetCreateRequestBodySchema = zod_1.z.object({
10
+ type: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetType),
11
+ version: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetVersion),
12
+ companyFacts: company_facts_dto_1.CompanyFactsCreateRequestBodySchema.default({}),
13
+ ratings: rating_dto_1.RatingRequestBodySchema.array().default([]),
14
+ stakeholderWeights: stakeholder_weight_dto_1.StakeholderWeightSchema.array().default([]),
15
+ });
16
+ exports.BalanceSheetPatchRequestBodySchema = zod_1.z.object({
17
+ companyFacts: company_facts_dto_1.CompanyFactsPatchRequestBodySchema.optional(),
18
+ ratings: rating_dto_1.RatingRequestBodySchema.array().default([]),
19
+ stakeholderWeights: stakeholder_weight_dto_1.StakeholderWeightSchema.array().optional(),
20
+ });
21
+ exports.BalanceSheetResponseBodySchema = zod_1.z.object({
22
+ id: zod_1.z.number(),
23
+ type: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetType),
24
+ version: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetVersion),
25
+ ratings: rating_dto_1.RatingResponseBodySchema.array(),
26
+ companyFacts: company_facts_dto_1.CompanyFactsResponseBodySchema,
27
+ stakeholderWeights: stakeholder_weight_dto_1.StakeholderWeightSchema.array(),
28
+ });
29
+ exports.BalanceSheetItemResponseSchema = zod_1.z.object({
30
+ id: zod_1.z.number(),
31
+ version: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetVersion),
32
+ type: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetType),
33
+ });
34
+ exports.BalanceSheetItemsResponseSchema = exports.BalanceSheetItemResponseSchema.array();
@@ -0,0 +1,438 @@
1
+ import { z } from 'zod';
2
+ export declare const SupplyFractionSchema: z.ZodArray<z.ZodObject<{
3
+ countryCode: z.ZodOptional<z.ZodString>;
4
+ industryCode: z.ZodOptional<z.ZodString>;
5
+ costs: z.ZodDefault<z.ZodNumber>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ costs: number;
8
+ countryCode?: string | undefined;
9
+ industryCode?: string | undefined;
10
+ }, {
11
+ countryCode?: string | undefined;
12
+ industryCode?: string | undefined;
13
+ costs?: number | undefined;
14
+ }>, "many">;
15
+ export declare const EmployeesFractionSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
16
+ countryCode: z.ZodOptional<z.ZodString>;
17
+ percentage: z.ZodNumber;
18
+ }, "strip", z.ZodTypeAny, {
19
+ percentage: number;
20
+ countryCode?: string | undefined;
21
+ }, {
22
+ percentage: number;
23
+ countryCode?: string | undefined;
24
+ }>, "many">, {
25
+ percentage: number;
26
+ countryCode?: string | undefined;
27
+ }[], {
28
+ percentage: number;
29
+ countryCode?: string | undefined;
30
+ }[]>;
31
+ export declare const IndustrySectorSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
32
+ industryCode: z.ZodOptional<z.ZodString>;
33
+ amountOfTotalTurnover: z.ZodNumber;
34
+ description: z.ZodDefault<z.ZodString>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ description: string;
37
+ amountOfTotalTurnover: number;
38
+ industryCode?: string | undefined;
39
+ }, {
40
+ amountOfTotalTurnover: number;
41
+ description?: string | undefined;
42
+ industryCode?: string | undefined;
43
+ }>, "many">, {
44
+ description: string;
45
+ amountOfTotalTurnover: number;
46
+ industryCode?: string | undefined;
47
+ }[], {
48
+ amountOfTotalTurnover: number;
49
+ description?: string | undefined;
50
+ industryCode?: string | undefined;
51
+ }[]>;
52
+ export declare const CompanyFactsCreateRequestBodySchema: z.ZodObject<{
53
+ totalPurchaseFromSuppliers: z.ZodDefault<z.ZodNumber>;
54
+ totalStaffCosts: z.ZodDefault<z.ZodNumber>;
55
+ profit: z.ZodDefault<z.ZodNumber>;
56
+ financialCosts: z.ZodDefault<z.ZodNumber>;
57
+ incomeFromFinancialInvestments: z.ZodDefault<z.ZodNumber>;
58
+ additionsToFixedAssets: z.ZodDefault<z.ZodNumber>;
59
+ turnover: z.ZodDefault<z.ZodNumber>;
60
+ totalAssets: z.ZodDefault<z.ZodNumber>;
61
+ financialAssetsAndCashBalance: z.ZodDefault<z.ZodNumber>;
62
+ numberOfEmployees: z.ZodDefault<z.ZodNumber>;
63
+ hasCanteen: z.ZodOptional<z.ZodBoolean>;
64
+ averageJourneyToWorkForStaffInKm: z.ZodDefault<z.ZodNumber>;
65
+ isB2B: z.ZodDefault<z.ZodBoolean>;
66
+ supplyFractions: z.ZodDefault<z.ZodArray<z.ZodObject<{
67
+ countryCode: z.ZodOptional<z.ZodString>;
68
+ industryCode: z.ZodOptional<z.ZodString>;
69
+ costs: z.ZodDefault<z.ZodNumber>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ costs: number;
72
+ countryCode?: string | undefined;
73
+ industryCode?: string | undefined;
74
+ }, {
75
+ countryCode?: string | undefined;
76
+ industryCode?: string | undefined;
77
+ costs?: number | undefined;
78
+ }>, "many">>;
79
+ employeesFractions: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
80
+ countryCode: z.ZodOptional<z.ZodString>;
81
+ percentage: z.ZodNumber;
82
+ }, "strip", z.ZodTypeAny, {
83
+ percentage: number;
84
+ countryCode?: string | undefined;
85
+ }, {
86
+ percentage: number;
87
+ countryCode?: string | undefined;
88
+ }>, "many">, {
89
+ percentage: number;
90
+ countryCode?: string | undefined;
91
+ }[], {
92
+ percentage: number;
93
+ countryCode?: string | undefined;
94
+ }[]>>;
95
+ industrySectors: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
96
+ industryCode: z.ZodOptional<z.ZodString>;
97
+ amountOfTotalTurnover: z.ZodNumber;
98
+ description: z.ZodDefault<z.ZodString>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ description: string;
101
+ amountOfTotalTurnover: number;
102
+ industryCode?: string | undefined;
103
+ }, {
104
+ amountOfTotalTurnover: number;
105
+ description?: string | undefined;
106
+ industryCode?: string | undefined;
107
+ }>, "many">, {
108
+ description: string;
109
+ amountOfTotalTurnover: number;
110
+ industryCode?: string | undefined;
111
+ }[], {
112
+ amountOfTotalTurnover: number;
113
+ description?: string | undefined;
114
+ industryCode?: string | undefined;
115
+ }[]>>;
116
+ mainOriginOfOtherSuppliers: z.ZodOptional<z.ZodString>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ totalPurchaseFromSuppliers: number;
119
+ totalStaffCosts: number;
120
+ profit: number;
121
+ financialCosts: number;
122
+ incomeFromFinancialInvestments: number;
123
+ additionsToFixedAssets: number;
124
+ turnover: number;
125
+ totalAssets: number;
126
+ financialAssetsAndCashBalance: number;
127
+ numberOfEmployees: number;
128
+ averageJourneyToWorkForStaffInKm: number;
129
+ isB2B: boolean;
130
+ supplyFractions: {
131
+ costs: number;
132
+ countryCode?: string | undefined;
133
+ industryCode?: string | undefined;
134
+ }[];
135
+ employeesFractions: {
136
+ percentage: number;
137
+ countryCode?: string | undefined;
138
+ }[];
139
+ industrySectors: {
140
+ description: string;
141
+ amountOfTotalTurnover: number;
142
+ industryCode?: string | undefined;
143
+ }[];
144
+ hasCanteen?: boolean | undefined;
145
+ mainOriginOfOtherSuppliers?: string | undefined;
146
+ }, {
147
+ totalPurchaseFromSuppliers?: number | undefined;
148
+ totalStaffCosts?: number | undefined;
149
+ profit?: number | undefined;
150
+ financialCosts?: number | undefined;
151
+ incomeFromFinancialInvestments?: number | undefined;
152
+ additionsToFixedAssets?: number | undefined;
153
+ turnover?: number | undefined;
154
+ totalAssets?: number | undefined;
155
+ financialAssetsAndCashBalance?: number | undefined;
156
+ numberOfEmployees?: number | undefined;
157
+ hasCanteen?: boolean | undefined;
158
+ averageJourneyToWorkForStaffInKm?: number | undefined;
159
+ isB2B?: boolean | undefined;
160
+ supplyFractions?: {
161
+ countryCode?: string | undefined;
162
+ industryCode?: string | undefined;
163
+ costs?: number | undefined;
164
+ }[] | undefined;
165
+ employeesFractions?: {
166
+ percentage: number;
167
+ countryCode?: string | undefined;
168
+ }[] | undefined;
169
+ industrySectors?: {
170
+ amountOfTotalTurnover: number;
171
+ description?: string | undefined;
172
+ industryCode?: string | undefined;
173
+ }[] | undefined;
174
+ mainOriginOfOtherSuppliers?: string | undefined;
175
+ }>;
176
+ export declare const CompanyFactsPatchRequestBodySchema: z.ZodObject<{
177
+ totalPurchaseFromSuppliers: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
178
+ totalStaffCosts: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
179
+ profit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
180
+ financialCosts: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
181
+ incomeFromFinancialInvestments: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
182
+ additionsToFixedAssets: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
183
+ turnover: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
184
+ totalAssets: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
185
+ financialAssetsAndCashBalance: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
186
+ numberOfEmployees: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
187
+ hasCanteen: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
188
+ averageJourneyToWorkForStaffInKm: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
189
+ isB2B: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
190
+ supplyFractions: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
191
+ countryCode: z.ZodOptional<z.ZodString>;
192
+ industryCode: z.ZodOptional<z.ZodString>;
193
+ costs: z.ZodDefault<z.ZodNumber>;
194
+ }, "strip", z.ZodTypeAny, {
195
+ costs: number;
196
+ countryCode?: string | undefined;
197
+ industryCode?: string | undefined;
198
+ }, {
199
+ countryCode?: string | undefined;
200
+ industryCode?: string | undefined;
201
+ costs?: number | undefined;
202
+ }>, "many">>>;
203
+ employeesFractions: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
204
+ countryCode: z.ZodOptional<z.ZodString>;
205
+ percentage: z.ZodNumber;
206
+ }, "strip", z.ZodTypeAny, {
207
+ percentage: number;
208
+ countryCode?: string | undefined;
209
+ }, {
210
+ percentage: number;
211
+ countryCode?: string | undefined;
212
+ }>, "many">, {
213
+ percentage: number;
214
+ countryCode?: string | undefined;
215
+ }[], {
216
+ percentage: number;
217
+ countryCode?: string | undefined;
218
+ }[]>>>;
219
+ industrySectors: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
220
+ industryCode: z.ZodOptional<z.ZodString>;
221
+ amountOfTotalTurnover: z.ZodNumber;
222
+ description: z.ZodDefault<z.ZodString>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ description: string;
225
+ amountOfTotalTurnover: number;
226
+ industryCode?: string | undefined;
227
+ }, {
228
+ amountOfTotalTurnover: number;
229
+ description?: string | undefined;
230
+ industryCode?: string | undefined;
231
+ }>, "many">, {
232
+ description: string;
233
+ amountOfTotalTurnover: number;
234
+ industryCode?: string | undefined;
235
+ }[], {
236
+ amountOfTotalTurnover: number;
237
+ description?: string | undefined;
238
+ industryCode?: string | undefined;
239
+ }[]>>>;
240
+ mainOriginOfOtherSuppliers: z.ZodOptional<z.ZodOptional<z.ZodString>>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ totalPurchaseFromSuppliers?: number | undefined;
243
+ totalStaffCosts?: number | undefined;
244
+ profit?: number | undefined;
245
+ financialCosts?: number | undefined;
246
+ incomeFromFinancialInvestments?: number | undefined;
247
+ additionsToFixedAssets?: number | undefined;
248
+ turnover?: number | undefined;
249
+ totalAssets?: number | undefined;
250
+ financialAssetsAndCashBalance?: number | undefined;
251
+ numberOfEmployees?: number | undefined;
252
+ hasCanteen?: boolean | undefined;
253
+ averageJourneyToWorkForStaffInKm?: number | undefined;
254
+ isB2B?: boolean | undefined;
255
+ supplyFractions?: {
256
+ costs: number;
257
+ countryCode?: string | undefined;
258
+ industryCode?: string | undefined;
259
+ }[] | undefined;
260
+ employeesFractions?: {
261
+ percentage: number;
262
+ countryCode?: string | undefined;
263
+ }[] | undefined;
264
+ industrySectors?: {
265
+ description: string;
266
+ amountOfTotalTurnover: number;
267
+ industryCode?: string | undefined;
268
+ }[] | undefined;
269
+ mainOriginOfOtherSuppliers?: string | undefined;
270
+ }, {
271
+ totalPurchaseFromSuppliers?: number | undefined;
272
+ totalStaffCosts?: number | undefined;
273
+ profit?: number | undefined;
274
+ financialCosts?: number | undefined;
275
+ incomeFromFinancialInvestments?: number | undefined;
276
+ additionsToFixedAssets?: number | undefined;
277
+ turnover?: number | undefined;
278
+ totalAssets?: number | undefined;
279
+ financialAssetsAndCashBalance?: number | undefined;
280
+ numberOfEmployees?: number | undefined;
281
+ hasCanteen?: boolean | undefined;
282
+ averageJourneyToWorkForStaffInKm?: number | undefined;
283
+ isB2B?: boolean | undefined;
284
+ supplyFractions?: {
285
+ countryCode?: string | undefined;
286
+ industryCode?: string | undefined;
287
+ costs?: number | undefined;
288
+ }[] | undefined;
289
+ employeesFractions?: {
290
+ percentage: number;
291
+ countryCode?: string | undefined;
292
+ }[] | undefined;
293
+ industrySectors?: {
294
+ amountOfTotalTurnover: number;
295
+ description?: string | undefined;
296
+ industryCode?: string | undefined;
297
+ }[] | undefined;
298
+ mainOriginOfOtherSuppliers?: string | undefined;
299
+ }>;
300
+ export declare const CompanyFactsResponseBodySchema: z.ZodObject<{
301
+ totalPurchaseFromSuppliers: z.ZodDefault<z.ZodNumber>;
302
+ totalStaffCosts: z.ZodDefault<z.ZodNumber>;
303
+ profit: z.ZodDefault<z.ZodNumber>;
304
+ financialCosts: z.ZodDefault<z.ZodNumber>;
305
+ incomeFromFinancialInvestments: z.ZodDefault<z.ZodNumber>;
306
+ additionsToFixedAssets: z.ZodDefault<z.ZodNumber>;
307
+ turnover: z.ZodDefault<z.ZodNumber>;
308
+ totalAssets: z.ZodDefault<z.ZodNumber>;
309
+ financialAssetsAndCashBalance: z.ZodDefault<z.ZodNumber>;
310
+ numberOfEmployees: z.ZodDefault<z.ZodNumber>;
311
+ hasCanteen: z.ZodOptional<z.ZodBoolean>;
312
+ averageJourneyToWorkForStaffInKm: z.ZodDefault<z.ZodNumber>;
313
+ isB2B: z.ZodBoolean;
314
+ supplyFractions: z.ZodArray<z.ZodObject<{
315
+ countryCode: z.ZodOptional<z.ZodString>;
316
+ industryCode: z.ZodOptional<z.ZodString>;
317
+ costs: z.ZodDefault<z.ZodNumber>;
318
+ }, "strip", z.ZodTypeAny, {
319
+ costs: number;
320
+ countryCode?: string | undefined;
321
+ industryCode?: string | undefined;
322
+ }, {
323
+ countryCode?: string | undefined;
324
+ industryCode?: string | undefined;
325
+ costs?: number | undefined;
326
+ }>, "many">;
327
+ employeesFractions: z.ZodEffects<z.ZodArray<z.ZodObject<{
328
+ countryCode: z.ZodOptional<z.ZodString>;
329
+ percentage: z.ZodNumber;
330
+ }, "strip", z.ZodTypeAny, {
331
+ percentage: number;
332
+ countryCode?: string | undefined;
333
+ }, {
334
+ percentage: number;
335
+ countryCode?: string | undefined;
336
+ }>, "many">, {
337
+ percentage: number;
338
+ countryCode?: string | undefined;
339
+ }[], {
340
+ percentage: number;
341
+ countryCode?: string | undefined;
342
+ }[]>;
343
+ industrySectors: z.ZodEffects<z.ZodArray<z.ZodObject<{
344
+ industryCode: z.ZodOptional<z.ZodString>;
345
+ amountOfTotalTurnover: z.ZodNumber;
346
+ description: z.ZodDefault<z.ZodString>;
347
+ }, "strip", z.ZodTypeAny, {
348
+ description: string;
349
+ amountOfTotalTurnover: number;
350
+ industryCode?: string | undefined;
351
+ }, {
352
+ amountOfTotalTurnover: number;
353
+ description?: string | undefined;
354
+ industryCode?: string | undefined;
355
+ }>, "many">, {
356
+ description: string;
357
+ amountOfTotalTurnover: number;
358
+ industryCode?: string | undefined;
359
+ }[], {
360
+ amountOfTotalTurnover: number;
361
+ description?: string | undefined;
362
+ industryCode?: string | undefined;
363
+ }[]>;
364
+ mainOriginOfOtherSuppliers: z.ZodObject<{
365
+ countryCode: z.ZodOptional<z.ZodString>;
366
+ costs: z.ZodNumber;
367
+ }, "strip", z.ZodTypeAny, {
368
+ costs: number;
369
+ countryCode?: string | undefined;
370
+ }, {
371
+ costs: number;
372
+ countryCode?: string | undefined;
373
+ }>;
374
+ }, "strip", z.ZodTypeAny, {
375
+ totalPurchaseFromSuppliers: number;
376
+ totalStaffCosts: number;
377
+ profit: number;
378
+ financialCosts: number;
379
+ incomeFromFinancialInvestments: number;
380
+ additionsToFixedAssets: number;
381
+ turnover: number;
382
+ totalAssets: number;
383
+ financialAssetsAndCashBalance: number;
384
+ numberOfEmployees: number;
385
+ averageJourneyToWorkForStaffInKm: number;
386
+ isB2B: boolean;
387
+ supplyFractions: {
388
+ costs: number;
389
+ countryCode?: string | undefined;
390
+ industryCode?: string | undefined;
391
+ }[];
392
+ employeesFractions: {
393
+ percentage: number;
394
+ countryCode?: string | undefined;
395
+ }[];
396
+ industrySectors: {
397
+ description: string;
398
+ amountOfTotalTurnover: number;
399
+ industryCode?: string | undefined;
400
+ }[];
401
+ mainOriginOfOtherSuppliers: {
402
+ costs: number;
403
+ countryCode?: string | undefined;
404
+ };
405
+ hasCanteen?: boolean | undefined;
406
+ }, {
407
+ isB2B: boolean;
408
+ supplyFractions: {
409
+ countryCode?: string | undefined;
410
+ industryCode?: string | undefined;
411
+ costs?: number | undefined;
412
+ }[];
413
+ employeesFractions: {
414
+ percentage: number;
415
+ countryCode?: string | undefined;
416
+ }[];
417
+ industrySectors: {
418
+ amountOfTotalTurnover: number;
419
+ description?: string | undefined;
420
+ industryCode?: string | undefined;
421
+ }[];
422
+ mainOriginOfOtherSuppliers: {
423
+ costs: number;
424
+ countryCode?: string | undefined;
425
+ };
426
+ totalPurchaseFromSuppliers?: number | undefined;
427
+ totalStaffCosts?: number | undefined;
428
+ profit?: number | undefined;
429
+ financialCosts?: number | undefined;
430
+ incomeFromFinancialInvestments?: number | undefined;
431
+ additionsToFixedAssets?: number | undefined;
432
+ turnover?: number | undefined;
433
+ totalAssets?: number | undefined;
434
+ financialAssetsAndCashBalance?: number | undefined;
435
+ numberOfEmployees?: number | undefined;
436
+ hasCanteen?: boolean | undefined;
437
+ averageJourneyToWorkForStaffInKm?: number | undefined;
438
+ }>;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompanyFactsResponseBodySchema = exports.CompanyFactsPatchRequestBodySchema = exports.CompanyFactsCreateRequestBodySchema = exports.IndustrySectorSchema = exports.EmployeesFractionSchema = exports.SupplyFractionSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_schemas_1 = require("./shared.schemas");
6
+ function isSumGreaterThan(array, value) {
7
+ // Calculate the sum of the array
8
+ const sum = array.reduce((acc, curr) => acc + curr, 0);
9
+ // Check if the sum is greater than the specified value
10
+ return sum > value;
11
+ }
12
+ const sumOfPercentagesSmallerEqual100Msg = 'The sum of all percentage values should not be greater than 100.';
13
+ exports.SupplyFractionSchema = zod_1.z
14
+ .object({
15
+ countryCode: shared_schemas_1.isCountryCode.optional(),
16
+ industryCode: shared_schemas_1.isIndustryCode.optional(),
17
+ costs: shared_schemas_1.isPositiveNumberNotZero,
18
+ })
19
+ .array();
20
+ exports.EmployeesFractionSchema = zod_1.z
21
+ .object({
22
+ countryCode: shared_schemas_1.isCountryCode.optional(),
23
+ percentage: shared_schemas_1.isPercentageNotZero,
24
+ })
25
+ .array()
26
+ .refine((efs) => !isSumGreaterThan(efs.map((ef) => ef.percentage), 100), {
27
+ message: sumOfPercentagesSmallerEqual100Msg,
28
+ });
29
+ exports.IndustrySectorSchema = zod_1.z
30
+ .object({
31
+ industryCode: shared_schemas_1.isIndustryCode.optional(),
32
+ amountOfTotalTurnover: shared_schemas_1.isPercentageNotZero,
33
+ description: zod_1.z.string().default(''),
34
+ })
35
+ .array()
36
+ .refine((is) => !isSumGreaterThan(is.map((is) => is.amountOfTotalTurnover), 100), {
37
+ message: sumOfPercentagesSmallerEqual100Msg,
38
+ });
39
+ const CompanyFactsRequestBodySchema = zod_1.z.object({
40
+ totalPurchaseFromSuppliers: shared_schemas_1.isPositiveNumber,
41
+ totalStaffCosts: shared_schemas_1.isPositiveNumber,
42
+ profit: shared_schemas_1.isNumberWithDefaultZero,
43
+ financialCosts: shared_schemas_1.isPositiveNumber,
44
+ incomeFromFinancialInvestments: shared_schemas_1.isNumberWithDefaultZero,
45
+ additionsToFixedAssets: shared_schemas_1.isNumberWithDefaultZero,
46
+ turnover: shared_schemas_1.isPositiveNumber,
47
+ totalAssets: shared_schemas_1.isPositiveNumber,
48
+ financialAssetsAndCashBalance: shared_schemas_1.isPositiveNumber,
49
+ numberOfEmployees: shared_schemas_1.isPositiveNumber,
50
+ hasCanteen: zod_1.z.oboolean(),
51
+ averageJourneyToWorkForStaffInKm: shared_schemas_1.isPositiveNumber,
52
+ isB2B: zod_1.z.boolean().default(false),
53
+ supplyFractions: exports.SupplyFractionSchema.default([]),
54
+ employeesFractions: exports.EmployeesFractionSchema.default([]),
55
+ industrySectors: exports.IndustrySectorSchema.default([]),
56
+ mainOriginOfOtherSuppliers: shared_schemas_1.isCountryCode.optional(),
57
+ });
58
+ exports.CompanyFactsCreateRequestBodySchema = CompanyFactsRequestBodySchema;
59
+ exports.CompanyFactsPatchRequestBodySchema = CompanyFactsRequestBodySchema.partial();
60
+ exports.CompanyFactsResponseBodySchema = zod_1.z.object({
61
+ totalPurchaseFromSuppliers: shared_schemas_1.isPositiveNumber,
62
+ totalStaffCosts: shared_schemas_1.isPositiveNumber,
63
+ profit: shared_schemas_1.isNumberWithDefaultZero,
64
+ financialCosts: shared_schemas_1.isPositiveNumber,
65
+ incomeFromFinancialInvestments: shared_schemas_1.isNumberWithDefaultZero,
66
+ additionsToFixedAssets: shared_schemas_1.isNumberWithDefaultZero,
67
+ turnover: shared_schemas_1.isPositiveNumber,
68
+ totalAssets: shared_schemas_1.isPositiveNumber,
69
+ financialAssetsAndCashBalance: shared_schemas_1.isPositiveNumber,
70
+ numberOfEmployees: shared_schemas_1.isPositiveNumber,
71
+ hasCanteen: zod_1.z.oboolean(),
72
+ averageJourneyToWorkForStaffInKm: shared_schemas_1.isPositiveNumber,
73
+ isB2B: zod_1.z.boolean(),
74
+ supplyFractions: exports.SupplyFractionSchema,
75
+ employeesFractions: exports.EmployeesFractionSchema,
76
+ industrySectors: exports.IndustrySectorSchema,
77
+ mainOriginOfOtherSuppliers: zod_1.z.object({
78
+ countryCode: shared_schemas_1.isCountryCode.optional(),
79
+ costs: zod_1.z.number(),
80
+ }),
81
+ });
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const IndustryResponseBodySchema: z.ZodObject<{
3
+ industryCode: z.ZodString;
4
+ industryName: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ industryCode: string;
7
+ industryName: string;
8
+ }, {
9
+ industryCode: string;
10
+ industryName: string;
11
+ }>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IndustryResponseBodySchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.IndustryResponseBodySchema = zod_1.z.object({
6
+ industryCode: zod_1.z.string(),
7
+ industryName: zod_1.z.string(),
8
+ });
@@ -0,0 +1,68 @@
1
+ import { z } from 'zod';
2
+ export declare const MatrixRatingBodySchema: z.ZodObject<{
3
+ shortName: z.ZodString;
4
+ name: z.ZodString;
5
+ points: z.ZodNumber;
6
+ maxPoints: z.ZodDefault<z.ZodNumber>;
7
+ percentageReached: z.ZodOptional<z.ZodNumber>;
8
+ notApplicable: z.ZodBoolean;
9
+ }, "strip", z.ZodTypeAny, {
10
+ name: string;
11
+ shortName: string;
12
+ points: number;
13
+ maxPoints: number;
14
+ notApplicable: boolean;
15
+ percentageReached?: number | undefined;
16
+ }, {
17
+ name: string;
18
+ shortName: string;
19
+ points: number;
20
+ notApplicable: boolean;
21
+ maxPoints?: number | undefined;
22
+ percentageReached?: number | undefined;
23
+ }>;
24
+ export declare const MatrixBodySchema: z.ZodObject<{
25
+ ratings: z.ZodArray<z.ZodObject<{
26
+ shortName: z.ZodString;
27
+ name: z.ZodString;
28
+ points: z.ZodNumber;
29
+ maxPoints: z.ZodDefault<z.ZodNumber>;
30
+ percentageReached: z.ZodOptional<z.ZodNumber>;
31
+ notApplicable: z.ZodBoolean;
32
+ }, "strip", z.ZodTypeAny, {
33
+ name: string;
34
+ shortName: string;
35
+ points: number;
36
+ maxPoints: number;
37
+ notApplicable: boolean;
38
+ percentageReached?: number | undefined;
39
+ }, {
40
+ name: string;
41
+ shortName: string;
42
+ points: number;
43
+ notApplicable: boolean;
44
+ maxPoints?: number | undefined;
45
+ percentageReached?: number | undefined;
46
+ }>, "many">;
47
+ totalPoints: z.ZodNumber;
48
+ }, "strip", z.ZodTypeAny, {
49
+ ratings: {
50
+ name: string;
51
+ shortName: string;
52
+ points: number;
53
+ maxPoints: number;
54
+ notApplicable: boolean;
55
+ percentageReached?: number | undefined;
56
+ }[];
57
+ totalPoints: number;
58
+ }, {
59
+ ratings: {
60
+ name: string;
61
+ shortName: string;
62
+ points: number;
63
+ notApplicable: boolean;
64
+ maxPoints?: number | undefined;
65
+ percentageReached?: number | undefined;
66
+ }[];
67
+ totalPoints: number;
68
+ }>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MatrixBodySchema = exports.MatrixRatingBodySchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_schemas_1 = require("./shared.schemas");
6
+ exports.MatrixRatingBodySchema = zod_1.z.object({
7
+ shortName: zod_1.z.string(),
8
+ name: zod_1.z.string(),
9
+ points: zod_1.z.number(),
10
+ maxPoints: shared_schemas_1.isPositiveNumber,
11
+ percentageReached: shared_schemas_1.isPercentage.optional(),
12
+ notApplicable: zod_1.z.boolean(),
13
+ });
14
+ exports.MatrixBodySchema = zod_1.z.object({
15
+ ratings: exports.MatrixRatingBodySchema.array(),
16
+ totalPoints: zod_1.z.number(),
17
+ });