@ecogood/e-calculator-schemas 1.0.0
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/LICENSE +21 -0
- package/README.md +26 -0
- package/dist/balance.sheet.diff.d.ts +23 -0
- package/dist/balance.sheet.diff.js +13 -0
- package/dist/balance.sheet.dto.d.ts +686 -0
- package/dist/balance.sheet.dto.js +28 -0
- package/dist/company.facts.dto.d.ts +346 -0
- package/dist/company.facts.dto.js +77 -0
- package/dist/industry.dto.d.ts +11 -0
- package/dist/industry.dto.js +8 -0
- package/dist/matrix.dto.d.ts +23 -0
- package/dist/matrix.dto.js +12 -0
- package/dist/rating.dto.d.ts +65 -0
- package/dist/rating.dto.js +45 -0
- package/dist/region.dto.d.ts +11 -0
- package/dist/region.dto.js +8 -0
- package/dist/shared.schemas.d.ts +14 -0
- package/dist/shared.schemas.js +24 -0
- package/dist/user.schema.d.ts +18 -0
- package/dist/user.schema.js +12 -0
- package/package.json +60 -0
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
exports.BalanceSheetCreateRequestBodySchema = zod_1.z.object({
|
|
9
|
+
type: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetType),
|
|
10
|
+
version: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetVersion),
|
|
11
|
+
companyFacts: company_facts_dto_1.CompanyFactsCreateRequestBodySchema.default({}),
|
|
12
|
+
ratings: rating_dto_1.RatingRequestBodySchema.array().default([]),
|
|
13
|
+
});
|
|
14
|
+
exports.BalanceSheetPatchRequestBodySchema = zod_1.z.object({
|
|
15
|
+
companyFacts: company_facts_dto_1.CompanyFactsPatchRequestBodySchema.optional(),
|
|
16
|
+
ratings: rating_dto_1.RatingRequestBodySchema.array().default([]),
|
|
17
|
+
});
|
|
18
|
+
exports.BalanceSheetResponseBodySchema = zod_1.z.object({
|
|
19
|
+
id: zod_1.z.number().optional(),
|
|
20
|
+
type: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetType),
|
|
21
|
+
version: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetVersion),
|
|
22
|
+
ratings: rating_dto_1.RatingResponseBodySchema.array(),
|
|
23
|
+
companyFacts: company_facts_dto_1.CompanyFactsResponseBodySchema,
|
|
24
|
+
});
|
|
25
|
+
exports.BalanceSheetItemResponseSchema = zod_1.z.object({
|
|
26
|
+
id: zod_1.z.number(),
|
|
27
|
+
});
|
|
28
|
+
exports.BalanceSheetItemsResponseSchema = exports.BalanceSheetItemResponseSchema.array();
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CompanyFactsCreateRequestBodySchema: z.ZodObject<{
|
|
3
|
+
totalPurchaseFromSuppliers: z.ZodDefault<z.ZodNumber>;
|
|
4
|
+
totalStaffCosts: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
profit: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
financialCosts: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
incomeFromFinancialInvestments: z.ZodDefault<z.ZodNumber>;
|
|
8
|
+
additionsToFixedAssets: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
turnover: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
totalAssets: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
financialAssetsAndCashBalance: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
numberOfEmployees: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
hasCanteen: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
averageJourneyToWorkForStaffInKm: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
isB2B: z.ZodDefault<z.ZodBoolean>;
|
|
16
|
+
supplyFractions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
17
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
18
|
+
industryCode: z.ZodOptional<z.ZodString>;
|
|
19
|
+
costs: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
costs: number;
|
|
22
|
+
countryCode?: string | undefined;
|
|
23
|
+
industryCode?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
countryCode?: string | undefined;
|
|
26
|
+
industryCode?: string | undefined;
|
|
27
|
+
costs?: number | undefined;
|
|
28
|
+
}>, "many">>;
|
|
29
|
+
employeesFractions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
30
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
31
|
+
percentage: z.ZodNumber;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
percentage: number;
|
|
34
|
+
countryCode?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
percentage: number;
|
|
37
|
+
countryCode?: string | undefined;
|
|
38
|
+
}>, "many">>;
|
|
39
|
+
industrySectors: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
40
|
+
industryCode: z.ZodOptional<z.ZodString>;
|
|
41
|
+
amountOfTotalTurnover: z.ZodNumber;
|
|
42
|
+
description: z.ZodDefault<z.ZodString>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
description: string;
|
|
45
|
+
amountOfTotalTurnover: number;
|
|
46
|
+
industryCode?: string | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
amountOfTotalTurnover: number;
|
|
49
|
+
industryCode?: string | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
}>, "many">>;
|
|
52
|
+
mainOriginOfOtherSuppliers: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
totalPurchaseFromSuppliers: number;
|
|
55
|
+
totalStaffCosts: number;
|
|
56
|
+
profit: number;
|
|
57
|
+
financialCosts: number;
|
|
58
|
+
incomeFromFinancialInvestments: number;
|
|
59
|
+
additionsToFixedAssets: number;
|
|
60
|
+
turnover: number;
|
|
61
|
+
totalAssets: number;
|
|
62
|
+
financialAssetsAndCashBalance: number;
|
|
63
|
+
numberOfEmployees: number;
|
|
64
|
+
averageJourneyToWorkForStaffInKm: number;
|
|
65
|
+
isB2B: boolean;
|
|
66
|
+
supplyFractions: {
|
|
67
|
+
costs: number;
|
|
68
|
+
countryCode?: string | undefined;
|
|
69
|
+
industryCode?: string | undefined;
|
|
70
|
+
}[];
|
|
71
|
+
employeesFractions: {
|
|
72
|
+
percentage: number;
|
|
73
|
+
countryCode?: string | undefined;
|
|
74
|
+
}[];
|
|
75
|
+
industrySectors: {
|
|
76
|
+
description: string;
|
|
77
|
+
amountOfTotalTurnover: number;
|
|
78
|
+
industryCode?: string | undefined;
|
|
79
|
+
}[];
|
|
80
|
+
hasCanteen?: boolean | undefined;
|
|
81
|
+
mainOriginOfOtherSuppliers?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
totalPurchaseFromSuppliers?: number | undefined;
|
|
84
|
+
totalStaffCosts?: number | undefined;
|
|
85
|
+
profit?: number | undefined;
|
|
86
|
+
financialCosts?: number | undefined;
|
|
87
|
+
incomeFromFinancialInvestments?: number | undefined;
|
|
88
|
+
additionsToFixedAssets?: number | undefined;
|
|
89
|
+
turnover?: number | undefined;
|
|
90
|
+
totalAssets?: number | undefined;
|
|
91
|
+
financialAssetsAndCashBalance?: number | undefined;
|
|
92
|
+
numberOfEmployees?: number | undefined;
|
|
93
|
+
hasCanteen?: boolean | undefined;
|
|
94
|
+
averageJourneyToWorkForStaffInKm?: number | undefined;
|
|
95
|
+
isB2B?: boolean | undefined;
|
|
96
|
+
supplyFractions?: {
|
|
97
|
+
countryCode?: string | undefined;
|
|
98
|
+
industryCode?: string | undefined;
|
|
99
|
+
costs?: number | undefined;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
employeesFractions?: {
|
|
102
|
+
percentage: number;
|
|
103
|
+
countryCode?: string | undefined;
|
|
104
|
+
}[] | undefined;
|
|
105
|
+
industrySectors?: {
|
|
106
|
+
amountOfTotalTurnover: number;
|
|
107
|
+
industryCode?: string | undefined;
|
|
108
|
+
description?: string | undefined;
|
|
109
|
+
}[] | undefined;
|
|
110
|
+
mainOriginOfOtherSuppliers?: string | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
export declare const CompanyFactsPatchRequestBodySchema: z.ZodObject<{
|
|
113
|
+
totalPurchaseFromSuppliers: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
114
|
+
totalStaffCosts: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
115
|
+
profit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
116
|
+
financialCosts: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
117
|
+
incomeFromFinancialInvestments: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
118
|
+
additionsToFixedAssets: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
119
|
+
turnover: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
120
|
+
totalAssets: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
121
|
+
financialAssetsAndCashBalance: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
122
|
+
numberOfEmployees: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
123
|
+
hasCanteen: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
124
|
+
averageJourneyToWorkForStaffInKm: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
125
|
+
isB2B: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
126
|
+
supplyFractions: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
127
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
128
|
+
industryCode: z.ZodOptional<z.ZodString>;
|
|
129
|
+
costs: z.ZodDefault<z.ZodNumber>;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
costs: number;
|
|
132
|
+
countryCode?: string | undefined;
|
|
133
|
+
industryCode?: string | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
countryCode?: string | undefined;
|
|
136
|
+
industryCode?: string | undefined;
|
|
137
|
+
costs?: number | undefined;
|
|
138
|
+
}>, "many">>>;
|
|
139
|
+
employeesFractions: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
140
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
141
|
+
percentage: z.ZodNumber;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
percentage: number;
|
|
144
|
+
countryCode?: string | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
percentage: number;
|
|
147
|
+
countryCode?: string | undefined;
|
|
148
|
+
}>, "many">>>;
|
|
149
|
+
industrySectors: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
150
|
+
industryCode: z.ZodOptional<z.ZodString>;
|
|
151
|
+
amountOfTotalTurnover: z.ZodNumber;
|
|
152
|
+
description: z.ZodDefault<z.ZodString>;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
description: string;
|
|
155
|
+
amountOfTotalTurnover: number;
|
|
156
|
+
industryCode?: string | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
amountOfTotalTurnover: number;
|
|
159
|
+
industryCode?: string | undefined;
|
|
160
|
+
description?: string | undefined;
|
|
161
|
+
}>, "many">>>;
|
|
162
|
+
mainOriginOfOtherSuppliers: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
totalPurchaseFromSuppliers?: number | undefined;
|
|
165
|
+
totalStaffCosts?: number | undefined;
|
|
166
|
+
profit?: number | undefined;
|
|
167
|
+
financialCosts?: number | undefined;
|
|
168
|
+
incomeFromFinancialInvestments?: number | undefined;
|
|
169
|
+
additionsToFixedAssets?: number | undefined;
|
|
170
|
+
turnover?: number | undefined;
|
|
171
|
+
totalAssets?: number | undefined;
|
|
172
|
+
financialAssetsAndCashBalance?: number | undefined;
|
|
173
|
+
numberOfEmployees?: number | undefined;
|
|
174
|
+
hasCanteen?: boolean | undefined;
|
|
175
|
+
averageJourneyToWorkForStaffInKm?: number | undefined;
|
|
176
|
+
isB2B?: boolean | undefined;
|
|
177
|
+
supplyFractions?: {
|
|
178
|
+
costs: number;
|
|
179
|
+
countryCode?: string | undefined;
|
|
180
|
+
industryCode?: string | undefined;
|
|
181
|
+
}[] | undefined;
|
|
182
|
+
employeesFractions?: {
|
|
183
|
+
percentage: number;
|
|
184
|
+
countryCode?: string | undefined;
|
|
185
|
+
}[] | undefined;
|
|
186
|
+
industrySectors?: {
|
|
187
|
+
description: string;
|
|
188
|
+
amountOfTotalTurnover: number;
|
|
189
|
+
industryCode?: string | undefined;
|
|
190
|
+
}[] | undefined;
|
|
191
|
+
mainOriginOfOtherSuppliers?: string | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
totalPurchaseFromSuppliers?: number | undefined;
|
|
194
|
+
totalStaffCosts?: number | undefined;
|
|
195
|
+
profit?: number | undefined;
|
|
196
|
+
financialCosts?: number | undefined;
|
|
197
|
+
incomeFromFinancialInvestments?: number | undefined;
|
|
198
|
+
additionsToFixedAssets?: number | undefined;
|
|
199
|
+
turnover?: number | undefined;
|
|
200
|
+
totalAssets?: number | undefined;
|
|
201
|
+
financialAssetsAndCashBalance?: number | undefined;
|
|
202
|
+
numberOfEmployees?: number | undefined;
|
|
203
|
+
hasCanteen?: boolean | undefined;
|
|
204
|
+
averageJourneyToWorkForStaffInKm?: number | undefined;
|
|
205
|
+
isB2B?: boolean | undefined;
|
|
206
|
+
supplyFractions?: {
|
|
207
|
+
countryCode?: string | undefined;
|
|
208
|
+
industryCode?: string | undefined;
|
|
209
|
+
costs?: number | undefined;
|
|
210
|
+
}[] | undefined;
|
|
211
|
+
employeesFractions?: {
|
|
212
|
+
percentage: number;
|
|
213
|
+
countryCode?: string | undefined;
|
|
214
|
+
}[] | undefined;
|
|
215
|
+
industrySectors?: {
|
|
216
|
+
amountOfTotalTurnover: number;
|
|
217
|
+
industryCode?: string | undefined;
|
|
218
|
+
description?: string | undefined;
|
|
219
|
+
}[] | undefined;
|
|
220
|
+
mainOriginOfOtherSuppliers?: string | undefined;
|
|
221
|
+
}>;
|
|
222
|
+
export declare const CompanyFactsResponseBodySchema: z.ZodObject<{
|
|
223
|
+
totalPurchaseFromSuppliers: z.ZodDefault<z.ZodNumber>;
|
|
224
|
+
totalStaffCosts: z.ZodDefault<z.ZodNumber>;
|
|
225
|
+
profit: z.ZodDefault<z.ZodNumber>;
|
|
226
|
+
financialCosts: z.ZodDefault<z.ZodNumber>;
|
|
227
|
+
incomeFromFinancialInvestments: z.ZodDefault<z.ZodNumber>;
|
|
228
|
+
additionsToFixedAssets: z.ZodDefault<z.ZodNumber>;
|
|
229
|
+
turnover: z.ZodDefault<z.ZodNumber>;
|
|
230
|
+
totalAssets: z.ZodDefault<z.ZodNumber>;
|
|
231
|
+
financialAssetsAndCashBalance: z.ZodDefault<z.ZodNumber>;
|
|
232
|
+
numberOfEmployees: z.ZodDefault<z.ZodNumber>;
|
|
233
|
+
hasCanteen: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
averageJourneyToWorkForStaffInKm: z.ZodDefault<z.ZodNumber>;
|
|
235
|
+
isB2B: z.ZodBoolean;
|
|
236
|
+
supplyFractions: z.ZodArray<z.ZodObject<{
|
|
237
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
238
|
+
industryCode: z.ZodOptional<z.ZodString>;
|
|
239
|
+
costs: z.ZodDefault<z.ZodNumber>;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
costs: number;
|
|
242
|
+
countryCode?: string | undefined;
|
|
243
|
+
industryCode?: string | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
countryCode?: string | undefined;
|
|
246
|
+
industryCode?: string | undefined;
|
|
247
|
+
costs?: number | undefined;
|
|
248
|
+
}>, "many">;
|
|
249
|
+
employeesFractions: z.ZodArray<z.ZodObject<{
|
|
250
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
251
|
+
percentage: z.ZodNumber;
|
|
252
|
+
}, "strip", z.ZodTypeAny, {
|
|
253
|
+
percentage: number;
|
|
254
|
+
countryCode?: string | undefined;
|
|
255
|
+
}, {
|
|
256
|
+
percentage: number;
|
|
257
|
+
countryCode?: string | undefined;
|
|
258
|
+
}>, "many">;
|
|
259
|
+
industrySectors: z.ZodArray<z.ZodObject<{
|
|
260
|
+
industryCode: z.ZodOptional<z.ZodString>;
|
|
261
|
+
amountOfTotalTurnover: z.ZodNumber;
|
|
262
|
+
description: z.ZodDefault<z.ZodString>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
description: string;
|
|
265
|
+
amountOfTotalTurnover: number;
|
|
266
|
+
industryCode?: string | undefined;
|
|
267
|
+
}, {
|
|
268
|
+
amountOfTotalTurnover: number;
|
|
269
|
+
industryCode?: string | undefined;
|
|
270
|
+
description?: string | undefined;
|
|
271
|
+
}>, "many">;
|
|
272
|
+
mainOriginOfOtherSuppliers: z.ZodObject<{
|
|
273
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
274
|
+
costs: z.ZodNumber;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
costs: number;
|
|
277
|
+
countryCode?: string | undefined;
|
|
278
|
+
}, {
|
|
279
|
+
costs: number;
|
|
280
|
+
countryCode?: string | undefined;
|
|
281
|
+
}>;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
totalPurchaseFromSuppliers: number;
|
|
284
|
+
totalStaffCosts: number;
|
|
285
|
+
profit: number;
|
|
286
|
+
financialCosts: number;
|
|
287
|
+
incomeFromFinancialInvestments: number;
|
|
288
|
+
additionsToFixedAssets: number;
|
|
289
|
+
turnover: number;
|
|
290
|
+
totalAssets: number;
|
|
291
|
+
financialAssetsAndCashBalance: number;
|
|
292
|
+
numberOfEmployees: number;
|
|
293
|
+
averageJourneyToWorkForStaffInKm: number;
|
|
294
|
+
isB2B: boolean;
|
|
295
|
+
supplyFractions: {
|
|
296
|
+
costs: number;
|
|
297
|
+
countryCode?: string | undefined;
|
|
298
|
+
industryCode?: string | undefined;
|
|
299
|
+
}[];
|
|
300
|
+
employeesFractions: {
|
|
301
|
+
percentage: number;
|
|
302
|
+
countryCode?: string | undefined;
|
|
303
|
+
}[];
|
|
304
|
+
industrySectors: {
|
|
305
|
+
description: string;
|
|
306
|
+
amountOfTotalTurnover: number;
|
|
307
|
+
industryCode?: string | undefined;
|
|
308
|
+
}[];
|
|
309
|
+
mainOriginOfOtherSuppliers: {
|
|
310
|
+
costs: number;
|
|
311
|
+
countryCode?: string | undefined;
|
|
312
|
+
};
|
|
313
|
+
hasCanteen?: boolean | undefined;
|
|
314
|
+
}, {
|
|
315
|
+
isB2B: boolean;
|
|
316
|
+
supplyFractions: {
|
|
317
|
+
countryCode?: string | undefined;
|
|
318
|
+
industryCode?: string | undefined;
|
|
319
|
+
costs?: number | undefined;
|
|
320
|
+
}[];
|
|
321
|
+
employeesFractions: {
|
|
322
|
+
percentage: number;
|
|
323
|
+
countryCode?: string | undefined;
|
|
324
|
+
}[];
|
|
325
|
+
industrySectors: {
|
|
326
|
+
amountOfTotalTurnover: number;
|
|
327
|
+
industryCode?: string | undefined;
|
|
328
|
+
description?: string | undefined;
|
|
329
|
+
}[];
|
|
330
|
+
mainOriginOfOtherSuppliers: {
|
|
331
|
+
costs: number;
|
|
332
|
+
countryCode?: string | undefined;
|
|
333
|
+
};
|
|
334
|
+
totalPurchaseFromSuppliers?: number | undefined;
|
|
335
|
+
totalStaffCosts?: number | undefined;
|
|
336
|
+
profit?: number | undefined;
|
|
337
|
+
financialCosts?: number | undefined;
|
|
338
|
+
incomeFromFinancialInvestments?: number | undefined;
|
|
339
|
+
additionsToFixedAssets?: number | undefined;
|
|
340
|
+
turnover?: number | undefined;
|
|
341
|
+
totalAssets?: number | undefined;
|
|
342
|
+
financialAssetsAndCashBalance?: number | undefined;
|
|
343
|
+
numberOfEmployees?: number | undefined;
|
|
344
|
+
hasCanteen?: boolean | undefined;
|
|
345
|
+
averageJourneyToWorkForStaffInKm?: number | undefined;
|
|
346
|
+
}>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompanyFactsResponseBodySchema = exports.CompanyFactsPatchRequestBodySchema = exports.CompanyFactsCreateRequestBodySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_schemas_1 = require("./shared.schemas");
|
|
6
|
+
const isNumberCustomError = zod_1.z.number({
|
|
7
|
+
invalid_type_error: 'Number expected',
|
|
8
|
+
required_error: 'Number expected',
|
|
9
|
+
});
|
|
10
|
+
const isNumberWithDefaultZero = isNumberCustomError.default(0);
|
|
11
|
+
const isPositiveNumber = isNumberCustomError
|
|
12
|
+
.nonnegative('Number should be positive')
|
|
13
|
+
.default(0);
|
|
14
|
+
const isPercentage = zod_1.z
|
|
15
|
+
.number({
|
|
16
|
+
invalid_type_error: 'Percentage expected',
|
|
17
|
+
required_error: 'Percentage expected',
|
|
18
|
+
})
|
|
19
|
+
.min(0, 'Percentage should be between 0 and 100')
|
|
20
|
+
.max(100, 'Percentage should be between 0 and 100');
|
|
21
|
+
const SupplyFractionRequestBodySchema = zod_1.z.object({
|
|
22
|
+
countryCode: shared_schemas_1.isCountryCode.optional(),
|
|
23
|
+
industryCode: shared_schemas_1.isIndustryCode.optional(),
|
|
24
|
+
costs: isPositiveNumber,
|
|
25
|
+
});
|
|
26
|
+
const EmployeesFractionRequestBodySchema = zod_1.z.object({
|
|
27
|
+
countryCode: shared_schemas_1.isCountryCode.optional(),
|
|
28
|
+
percentage: isPercentage,
|
|
29
|
+
});
|
|
30
|
+
const IndustrySectorRequestBodySchema = zod_1.z.object({
|
|
31
|
+
industryCode: shared_schemas_1.isIndustryCode.optional(),
|
|
32
|
+
amountOfTotalTurnover: isPercentage,
|
|
33
|
+
description: zod_1.z.string().default(''),
|
|
34
|
+
});
|
|
35
|
+
const CompanyFactsRequestBodySchema = zod_1.z.object({
|
|
36
|
+
totalPurchaseFromSuppliers: isPositiveNumber,
|
|
37
|
+
totalStaffCosts: isPositiveNumber,
|
|
38
|
+
profit: isPositiveNumber,
|
|
39
|
+
financialCosts: isPositiveNumber,
|
|
40
|
+
incomeFromFinancialInvestments: isNumberWithDefaultZero,
|
|
41
|
+
additionsToFixedAssets: isNumberWithDefaultZero,
|
|
42
|
+
turnover: isPositiveNumber,
|
|
43
|
+
totalAssets: isPositiveNumber,
|
|
44
|
+
financialAssetsAndCashBalance: isPositiveNumber,
|
|
45
|
+
numberOfEmployees: isPositiveNumber,
|
|
46
|
+
hasCanteen: zod_1.z.oboolean(),
|
|
47
|
+
averageJourneyToWorkForStaffInKm: isPositiveNumber,
|
|
48
|
+
isB2B: zod_1.z.boolean().default(false),
|
|
49
|
+
supplyFractions: SupplyFractionRequestBodySchema.array().default([]),
|
|
50
|
+
employeesFractions: EmployeesFractionRequestBodySchema.array().default([]),
|
|
51
|
+
industrySectors: IndustrySectorRequestBodySchema.array().default([]),
|
|
52
|
+
mainOriginOfOtherSuppliers: shared_schemas_1.isCountryCode.optional(),
|
|
53
|
+
});
|
|
54
|
+
exports.CompanyFactsCreateRequestBodySchema = CompanyFactsRequestBodySchema;
|
|
55
|
+
exports.CompanyFactsPatchRequestBodySchema = CompanyFactsRequestBodySchema.partial();
|
|
56
|
+
exports.CompanyFactsResponseBodySchema = zod_1.z.object({
|
|
57
|
+
totalPurchaseFromSuppliers: isPositiveNumber,
|
|
58
|
+
totalStaffCosts: isPositiveNumber,
|
|
59
|
+
profit: isPositiveNumber,
|
|
60
|
+
financialCosts: isPositiveNumber,
|
|
61
|
+
incomeFromFinancialInvestments: isNumberWithDefaultZero,
|
|
62
|
+
additionsToFixedAssets: isNumberWithDefaultZero,
|
|
63
|
+
turnover: isPositiveNumber,
|
|
64
|
+
totalAssets: isPositiveNumber,
|
|
65
|
+
financialAssetsAndCashBalance: isPositiveNumber,
|
|
66
|
+
numberOfEmployees: isPositiveNumber,
|
|
67
|
+
hasCanteen: zod_1.z.oboolean(),
|
|
68
|
+
averageJourneyToWorkForStaffInKm: isPositiveNumber,
|
|
69
|
+
isB2B: zod_1.z.boolean(),
|
|
70
|
+
supplyFractions: SupplyFractionRequestBodySchema.array(),
|
|
71
|
+
employeesFractions: EmployeesFractionRequestBodySchema.array(),
|
|
72
|
+
industrySectors: IndustrySectorRequestBodySchema.array(),
|
|
73
|
+
mainOriginOfOtherSuppliers: zod_1.z.object({
|
|
74
|
+
countryCode: shared_schemas_1.isCountryCode.optional(),
|
|
75
|
+
costs: zod_1.z.number(),
|
|
76
|
+
}),
|
|
77
|
+
});
|
|
@@ -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,23 @@
|
|
|
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.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
|
+
maxPoints: number;
|
|
21
|
+
notApplicable: boolean;
|
|
22
|
+
percentageReached?: number | undefined;
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MatrixRatingBodySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.MatrixRatingBodySchema = zod_1.z.object({
|
|
6
|
+
shortName: zod_1.z.string(),
|
|
7
|
+
name: zod_1.z.string(),
|
|
8
|
+
points: zod_1.z.number(),
|
|
9
|
+
maxPoints: zod_1.z.number(),
|
|
10
|
+
percentageReached: zod_1.z.number().optional(),
|
|
11
|
+
notApplicable: zod_1.z.boolean(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const WEIGHT_VALUES: number[];
|
|
3
|
+
export declare const RatingRequestBodySchema: z.ZodObject<{
|
|
4
|
+
shortName: z.ZodString;
|
|
5
|
+
weight: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
6
|
+
estimations: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
shortName: string;
|
|
9
|
+
weight?: number | undefined;
|
|
10
|
+
estimations?: number | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
shortName: string;
|
|
13
|
+
weight?: number | undefined;
|
|
14
|
+
estimations?: number | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export declare enum RatingType {
|
|
17
|
+
topic = "topic",
|
|
18
|
+
aspect = "aspect"
|
|
19
|
+
}
|
|
20
|
+
export declare const RatingResponseBodySchema: z.ZodEffects<z.ZodObject<{
|
|
21
|
+
shortName: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
type: z.ZodNativeEnum<typeof RatingType>;
|
|
24
|
+
isPositive: z.ZodBoolean;
|
|
25
|
+
estimations: z.ZodNumber;
|
|
26
|
+
weight: z.ZodNumber;
|
|
27
|
+
points: z.ZodNumber;
|
|
28
|
+
maxPoints: z.ZodNumber;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
type: RatingType;
|
|
31
|
+
name: string;
|
|
32
|
+
shortName: string;
|
|
33
|
+
weight: number;
|
|
34
|
+
estimations: number;
|
|
35
|
+
isPositive: boolean;
|
|
36
|
+
points: number;
|
|
37
|
+
maxPoints: number;
|
|
38
|
+
}, {
|
|
39
|
+
type: RatingType;
|
|
40
|
+
name: string;
|
|
41
|
+
shortName: string;
|
|
42
|
+
weight: number;
|
|
43
|
+
estimations: number;
|
|
44
|
+
isPositive: boolean;
|
|
45
|
+
points: number;
|
|
46
|
+
maxPoints: number;
|
|
47
|
+
}>, {
|
|
48
|
+
type: RatingType;
|
|
49
|
+
name: string;
|
|
50
|
+
shortName: string;
|
|
51
|
+
weight: number;
|
|
52
|
+
estimations: number;
|
|
53
|
+
isPositive: boolean;
|
|
54
|
+
points: number;
|
|
55
|
+
maxPoints: number;
|
|
56
|
+
}, {
|
|
57
|
+
type: RatingType;
|
|
58
|
+
name: string;
|
|
59
|
+
shortName: string;
|
|
60
|
+
weight: number;
|
|
61
|
+
estimations: number;
|
|
62
|
+
isPositive: boolean;
|
|
63
|
+
points: number;
|
|
64
|
+
maxPoints: number;
|
|
65
|
+
}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RatingResponseBodySchema = exports.RatingType = exports.RatingRequestBodySchema = exports.WEIGHT_VALUES = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.WEIGHT_VALUES = [0, 0.5, 1, 1.5, 2];
|
|
6
|
+
exports.RatingRequestBodySchema = zod_1.z.object({
|
|
7
|
+
shortName: zod_1.z.string(),
|
|
8
|
+
weight: zod_1.z
|
|
9
|
+
.number()
|
|
10
|
+
.refine((v) => exports.WEIGHT_VALUES.some((w) => w === v), {
|
|
11
|
+
message: `Weight has to be one of the following values ${exports.WEIGHT_VALUES}`,
|
|
12
|
+
})
|
|
13
|
+
.optional(),
|
|
14
|
+
estimations: zod_1.z.number().min(-200).max(10).optional(),
|
|
15
|
+
});
|
|
16
|
+
var RatingType;
|
|
17
|
+
(function (RatingType) {
|
|
18
|
+
RatingType["topic"] = "topic";
|
|
19
|
+
RatingType["aspect"] = "aspect";
|
|
20
|
+
})(RatingType = exports.RatingType || (exports.RatingType = {}));
|
|
21
|
+
exports.RatingResponseBodySchema = zod_1.z
|
|
22
|
+
.object({
|
|
23
|
+
shortName: zod_1.z.string(),
|
|
24
|
+
name: zod_1.z.string(),
|
|
25
|
+
type: zod_1.z.nativeEnum(RatingType),
|
|
26
|
+
isPositive: zod_1.z.boolean(),
|
|
27
|
+
estimations: zod_1.z.number({
|
|
28
|
+
invalid_type_error: 'Number expected',
|
|
29
|
+
required_error: 'Number expected',
|
|
30
|
+
}),
|
|
31
|
+
weight: zod_1.z.number(),
|
|
32
|
+
points: zod_1.z.number(),
|
|
33
|
+
maxPoints: zod_1.z.number(),
|
|
34
|
+
})
|
|
35
|
+
.refine((data) => {
|
|
36
|
+
const isValid = data.type === RatingType.topic ||
|
|
37
|
+
(data.isPositive &&
|
|
38
|
+
zod_1.z.number().min(0).max(10).safeParse(data.estimations).success) ||
|
|
39
|
+
(!data.isPositive &&
|
|
40
|
+
zod_1.z.number().min(-200).max(0).safeParse(data.estimations).success);
|
|
41
|
+
return isValid;
|
|
42
|
+
}, (data) => ({
|
|
43
|
+
message: `Number should be between ${data.isPositive ? '0 and 10' : '-200 and 0'}`,
|
|
44
|
+
path: ['estimations'],
|
|
45
|
+
}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RegionResponseBodySchema: z.ZodObject<{
|
|
3
|
+
countryCode: z.ZodString;
|
|
4
|
+
countryName: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
countryCode: string;
|
|
7
|
+
countryName: string;
|
|
8
|
+
}, {
|
|
9
|
+
countryCode: string;
|
|
10
|
+
countryName: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RegionResponseBodySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.RegionResponseBodySchema = zod_1.z.object({
|
|
6
|
+
countryCode: zod_1.z.string(),
|
|
7
|
+
countryName: zod_1.z.string(),
|
|
8
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const isCountryCode: z.ZodString;
|
|
3
|
+
export declare const isIndustryCode: z.ZodString;
|
|
4
|
+
export declare enum BalanceSheetType {
|
|
5
|
+
Compact = "Compact",
|
|
6
|
+
Full = "Full"
|
|
7
|
+
}
|
|
8
|
+
export declare enum BalanceSheetVersion {
|
|
9
|
+
v5_0_4 = "5.04",
|
|
10
|
+
v5_0_5 = "5.05",
|
|
11
|
+
v5_0_6 = "5.06",
|
|
12
|
+
v5_0_7 = "5.07",
|
|
13
|
+
v5_0_8 = "5.08"
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BalanceSheetVersion = exports.BalanceSheetType = exports.isIndustryCode = exports.isCountryCode = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.isCountryCode = zod_1.z.string().min(3).max(3);
|
|
6
|
+
exports.isIndustryCode = zod_1.z.string().min(1).max(4);
|
|
7
|
+
var BalanceSheetType;
|
|
8
|
+
(function (BalanceSheetType) {
|
|
9
|
+
BalanceSheetType["Compact"] = "Compact";
|
|
10
|
+
BalanceSheetType["Full"] = "Full";
|
|
11
|
+
})(BalanceSheetType = exports.BalanceSheetType || (exports.BalanceSheetType = {}));
|
|
12
|
+
var BalanceSheetVersion;
|
|
13
|
+
(function (BalanceSheetVersion) {
|
|
14
|
+
// eslint-disable-next-line camelcase
|
|
15
|
+
BalanceSheetVersion["v5_0_4"] = "5.04";
|
|
16
|
+
// eslint-disable-next-line camelcase
|
|
17
|
+
BalanceSheetVersion["v5_0_5"] = "5.05";
|
|
18
|
+
// eslint-disable-next-line camelcase
|
|
19
|
+
BalanceSheetVersion["v5_0_6"] = "5.06";
|
|
20
|
+
// eslint-disable-next-line camelcase
|
|
21
|
+
BalanceSheetVersion["v5_0_7"] = "5.07";
|
|
22
|
+
// eslint-disable-next-line camelcase
|
|
23
|
+
BalanceSheetVersion["v5_0_8"] = "5.08";
|
|
24
|
+
})(BalanceSheetVersion = exports.BalanceSheetVersion || (exports.BalanceSheetVersion = {}));
|