@ecogood/e-calculator-schemas 2.4.3 → 2.4.5
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/dist/company.facts.dto.d.ts +37 -0
- package/dist/company.facts.dto.js +20 -1
- package/package.json +1 -1
|
@@ -28,6 +28,22 @@ export declare const EmployeesFractionSchema: z.ZodEffects<z.ZodArray<z.ZodObjec
|
|
|
28
28
|
percentage: number;
|
|
29
29
|
countryCode?: string | undefined;
|
|
30
30
|
}[]>;
|
|
31
|
+
export declare const EmployeesFractionSchemaFrontEnd: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
32
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
33
|
+
percentage: z.ZodNumber;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
percentage: number;
|
|
36
|
+
countryCode?: string | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
percentage: number;
|
|
39
|
+
countryCode?: string | undefined;
|
|
40
|
+
}>, "many">, {
|
|
41
|
+
percentage: number;
|
|
42
|
+
countryCode?: string | undefined;
|
|
43
|
+
}[], {
|
|
44
|
+
percentage: number;
|
|
45
|
+
countryCode?: string | undefined;
|
|
46
|
+
}[]>;
|
|
31
47
|
export declare const IndustrySectorSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
32
48
|
industryCode: z.ZodOptional<z.ZodString>;
|
|
33
49
|
amountOfTotalTurnover: z.ZodNumber;
|
|
@@ -49,6 +65,27 @@ export declare const IndustrySectorSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
|
49
65
|
description?: string | undefined;
|
|
50
66
|
industryCode?: string | undefined;
|
|
51
67
|
}[]>;
|
|
68
|
+
export declare const IndustrySectorSchemaFrontEnd: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
69
|
+
industryCode: z.ZodOptional<z.ZodString>;
|
|
70
|
+
amountOfTotalTurnover: z.ZodNumber;
|
|
71
|
+
description: z.ZodDefault<z.ZodString>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
description: string;
|
|
74
|
+
amountOfTotalTurnover: number;
|
|
75
|
+
industryCode?: string | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
amountOfTotalTurnover: number;
|
|
78
|
+
description?: string | undefined;
|
|
79
|
+
industryCode?: string | undefined;
|
|
80
|
+
}>, "many">, {
|
|
81
|
+
description: string;
|
|
82
|
+
amountOfTotalTurnover: number;
|
|
83
|
+
industryCode?: string | undefined;
|
|
84
|
+
}[], {
|
|
85
|
+
amountOfTotalTurnover: number;
|
|
86
|
+
description?: string | undefined;
|
|
87
|
+
industryCode?: string | undefined;
|
|
88
|
+
}[]>;
|
|
52
89
|
export declare const CompanyFactsCreateRequestBodySchema: z.ZodObject<{
|
|
53
90
|
totalPurchaseFromSuppliers: z.ZodDefault<z.ZodNumber>;
|
|
54
91
|
totalStaffCosts: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompanyFactsResponseBodySchema = exports.CompanyFactsPatchRequestBodySchema = exports.CompanyFactsCreateRequestBodySchema = exports.IndustrySectorSchema = exports.EmployeesFractionSchema = exports.SupplyFractionSchema = void 0;
|
|
3
|
+
exports.CompanyFactsResponseBodySchema = exports.CompanyFactsPatchRequestBodySchema = exports.CompanyFactsCreateRequestBodySchema = exports.IndustrySectorSchemaFrontEnd = exports.IndustrySectorSchema = exports.EmployeesFractionSchemaFrontEnd = exports.EmployeesFractionSchema = exports.SupplyFractionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const shared_schemas_1 = require("./shared.schemas");
|
|
6
6
|
function isSumGreaterThan(array, value) {
|
|
@@ -26,6 +26,15 @@ exports.EmployeesFractionSchema = zod_1.z
|
|
|
26
26
|
.refine((efs) => !isSumGreaterThan(efs.map((ef) => ef.percentage), 100), {
|
|
27
27
|
message: sumOfPercentagesSmallerEqual100Msg,
|
|
28
28
|
});
|
|
29
|
+
exports.EmployeesFractionSchemaFrontEnd = zod_1.z
|
|
30
|
+
.object({
|
|
31
|
+
countryCode: shared_schemas_1.isCountryCode.optional(),
|
|
32
|
+
percentage: shared_schemas_1.isPercentageNotZero,
|
|
33
|
+
})
|
|
34
|
+
.array()
|
|
35
|
+
.refine((efs) => !isSumGreaterThan(efs.map((ef) => ef.percentage), 100), {
|
|
36
|
+
message: sumOfPercentagesSmallerEqual100Msg,
|
|
37
|
+
});
|
|
29
38
|
exports.IndustrySectorSchema = zod_1.z
|
|
30
39
|
.object({
|
|
31
40
|
industryCode: shared_schemas_1.isIndustryCode.optional(),
|
|
@@ -36,6 +45,16 @@ exports.IndustrySectorSchema = zod_1.z
|
|
|
36
45
|
.refine((is) => !isSumGreaterThan(is.map((is) => is.amountOfTotalTurnover), 100), {
|
|
37
46
|
message: sumOfPercentagesSmallerEqual100Msg,
|
|
38
47
|
});
|
|
48
|
+
exports.IndustrySectorSchemaFrontEnd = zod_1.z
|
|
49
|
+
.object({
|
|
50
|
+
industryCode: shared_schemas_1.isIndustryCode.optional(),
|
|
51
|
+
amountOfTotalTurnover: shared_schemas_1.isPercentageNotZero,
|
|
52
|
+
description: zod_1.z.string().default(''),
|
|
53
|
+
})
|
|
54
|
+
.array()
|
|
55
|
+
.refine((is) => !isSumGreaterThan(is.map((is) => is.amountOfTotalTurnover), 100), {
|
|
56
|
+
message: sumOfPercentagesSmallerEqual100Msg,
|
|
57
|
+
});
|
|
39
58
|
const CompanyFactsRequestBodySchema = zod_1.z.object({
|
|
40
59
|
totalPurchaseFromSuppliers: shared_schemas_1.isPositiveNumber,
|
|
41
60
|
totalStaffCosts: shared_schemas_1.isPositiveNumber,
|
package/package.json
CHANGED