@ecogood/e-calculator-schemas 2.7.13 → 2.7.15
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 +20 -20
- package/README.md +26 -26
- package/dist/balance.sheet.dto.d.ts +237 -0
- package/dist/balance.sheet.dto.js +4 -0
- package/dist/general.information.dto.d.ts +54 -0
- package/dist/general.information.dto.js +23 -0
- package/dist/organization.dto.js +7 -10
- package/dist/shared.schemas.d.ts +1 -0
- package/dist/shared.schemas.js +5 -1
- package/package.json +52 -52
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Michael Rudolph
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Michael Rudolph
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# E-Calculator Schemas
|
|
2
|
-
|
|
3
|
-
This project contains the data transfer objects which are used by the [E-Calculator REST API](https://git.ecogood.org/services/balance-sheet-calculator)
|
|
4
|
-
and the [E-Calculator Frontend](https://git.ecogood.org/services/e-calculator-frontend).
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
npm install e-calculator-schemas
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
```typescript
|
|
15
|
-
import { RegionResponseBodySchema } from 'e-calculator-schemas/dist/region.dto';
|
|
16
|
-
const regionJson = {
|
|
17
|
-
countryCode: 'DEU',
|
|
18
|
-
countryName: 'Germany',
|
|
19
|
-
};
|
|
20
|
-
RegionResponseBodySchema.parse(regionJson);
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Publish
|
|
24
|
-
```bash
|
|
25
|
-
npm publish
|
|
26
|
-
```
|
|
1
|
+
# E-Calculator Schemas
|
|
2
|
+
|
|
3
|
+
This project contains the data transfer objects which are used by the [E-Calculator REST API](https://git.ecogood.org/services/balance-sheet-calculator)
|
|
4
|
+
and the [E-Calculator Frontend](https://git.ecogood.org/services/e-calculator-frontend).
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install e-calculator-schemas
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { RegionResponseBodySchema } from 'e-calculator-schemas/dist/region.dto';
|
|
16
|
+
const regionJson = {
|
|
17
|
+
countryCode: 'DEU',
|
|
18
|
+
countryName: 'Germany',
|
|
19
|
+
};
|
|
20
|
+
RegionResponseBodySchema.parse(regionJson);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Publish
|
|
24
|
+
```bash
|
|
25
|
+
npm publish
|
|
26
|
+
```
|
|
@@ -150,6 +150,59 @@ export declare const BalanceSheetCreateRequestBodySchema: z.ZodObject<{
|
|
|
150
150
|
shortName: string;
|
|
151
151
|
weight: number;
|
|
152
152
|
}>, "many">>;
|
|
153
|
+
generalInformation: z.ZodObject<{
|
|
154
|
+
company: z.ZodObject<{
|
|
155
|
+
name: z.ZodString;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
name: string;
|
|
158
|
+
}, {
|
|
159
|
+
name: string;
|
|
160
|
+
}>;
|
|
161
|
+
contactPerson: z.ZodObject<{
|
|
162
|
+
email: z.ZodString;
|
|
163
|
+
name: z.ZodString;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
name: string;
|
|
166
|
+
email: string;
|
|
167
|
+
}, {
|
|
168
|
+
name: string;
|
|
169
|
+
email: string;
|
|
170
|
+
}>;
|
|
171
|
+
period: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
start: z.ZodString;
|
|
173
|
+
end: z.ZodString;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
end: string;
|
|
176
|
+
start: string;
|
|
177
|
+
}, {
|
|
178
|
+
end: string;
|
|
179
|
+
start: string;
|
|
180
|
+
}>>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
company: {
|
|
183
|
+
name: string;
|
|
184
|
+
};
|
|
185
|
+
contactPerson: {
|
|
186
|
+
name: string;
|
|
187
|
+
email: string;
|
|
188
|
+
};
|
|
189
|
+
period?: {
|
|
190
|
+
end: string;
|
|
191
|
+
start: string;
|
|
192
|
+
} | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
company: {
|
|
195
|
+
name: string;
|
|
196
|
+
};
|
|
197
|
+
contactPerson: {
|
|
198
|
+
name: string;
|
|
199
|
+
email: string;
|
|
200
|
+
};
|
|
201
|
+
period?: {
|
|
202
|
+
end: string;
|
|
203
|
+
start: string;
|
|
204
|
+
} | undefined;
|
|
205
|
+
}>;
|
|
153
206
|
}, "strip", z.ZodTypeAny, {
|
|
154
207
|
type: BalanceSheetType;
|
|
155
208
|
version: BalanceSheetVersion;
|
|
@@ -192,9 +245,35 @@ export declare const BalanceSheetCreateRequestBodySchema: z.ZodObject<{
|
|
|
192
245
|
shortName: string;
|
|
193
246
|
weight: number;
|
|
194
247
|
}[];
|
|
248
|
+
generalInformation: {
|
|
249
|
+
company: {
|
|
250
|
+
name: string;
|
|
251
|
+
};
|
|
252
|
+
contactPerson: {
|
|
253
|
+
name: string;
|
|
254
|
+
email: string;
|
|
255
|
+
};
|
|
256
|
+
period?: {
|
|
257
|
+
end: string;
|
|
258
|
+
start: string;
|
|
259
|
+
} | undefined;
|
|
260
|
+
};
|
|
195
261
|
}, {
|
|
196
262
|
type: BalanceSheetType;
|
|
197
263
|
version: BalanceSheetVersion;
|
|
264
|
+
generalInformation: {
|
|
265
|
+
company: {
|
|
266
|
+
name: string;
|
|
267
|
+
};
|
|
268
|
+
contactPerson: {
|
|
269
|
+
name: string;
|
|
270
|
+
email: string;
|
|
271
|
+
};
|
|
272
|
+
period?: {
|
|
273
|
+
end: string;
|
|
274
|
+
start: string;
|
|
275
|
+
} | undefined;
|
|
276
|
+
};
|
|
198
277
|
companyFacts?: {
|
|
199
278
|
totalPurchaseFromSuppliers?: number | undefined;
|
|
200
279
|
totalStaffCosts?: number | undefined;
|
|
@@ -383,6 +462,59 @@ export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
|
|
|
383
462
|
shortName: string;
|
|
384
463
|
weight: number;
|
|
385
464
|
}>, "many">>;
|
|
465
|
+
generalInformation: z.ZodOptional<z.ZodObject<{
|
|
466
|
+
company: z.ZodObject<{
|
|
467
|
+
name: z.ZodString;
|
|
468
|
+
}, "strip", z.ZodTypeAny, {
|
|
469
|
+
name: string;
|
|
470
|
+
}, {
|
|
471
|
+
name: string;
|
|
472
|
+
}>;
|
|
473
|
+
contactPerson: z.ZodObject<{
|
|
474
|
+
email: z.ZodString;
|
|
475
|
+
name: z.ZodString;
|
|
476
|
+
}, "strip", z.ZodTypeAny, {
|
|
477
|
+
name: string;
|
|
478
|
+
email: string;
|
|
479
|
+
}, {
|
|
480
|
+
name: string;
|
|
481
|
+
email: string;
|
|
482
|
+
}>;
|
|
483
|
+
period: z.ZodOptional<z.ZodObject<{
|
|
484
|
+
start: z.ZodString;
|
|
485
|
+
end: z.ZodString;
|
|
486
|
+
}, "strip", z.ZodTypeAny, {
|
|
487
|
+
end: string;
|
|
488
|
+
start: string;
|
|
489
|
+
}, {
|
|
490
|
+
end: string;
|
|
491
|
+
start: string;
|
|
492
|
+
}>>;
|
|
493
|
+
}, "strip", z.ZodTypeAny, {
|
|
494
|
+
company: {
|
|
495
|
+
name: string;
|
|
496
|
+
};
|
|
497
|
+
contactPerson: {
|
|
498
|
+
name: string;
|
|
499
|
+
email: string;
|
|
500
|
+
};
|
|
501
|
+
period?: {
|
|
502
|
+
end: string;
|
|
503
|
+
start: string;
|
|
504
|
+
} | undefined;
|
|
505
|
+
}, {
|
|
506
|
+
company: {
|
|
507
|
+
name: string;
|
|
508
|
+
};
|
|
509
|
+
contactPerson: {
|
|
510
|
+
name: string;
|
|
511
|
+
email: string;
|
|
512
|
+
};
|
|
513
|
+
period?: {
|
|
514
|
+
end: string;
|
|
515
|
+
start: string;
|
|
516
|
+
} | undefined;
|
|
517
|
+
}>>;
|
|
386
518
|
}, "strip", z.ZodTypeAny, {
|
|
387
519
|
ratings: {
|
|
388
520
|
shortName: string;
|
|
@@ -423,6 +555,19 @@ export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
|
|
|
423
555
|
shortName: string;
|
|
424
556
|
weight: number;
|
|
425
557
|
}[] | undefined;
|
|
558
|
+
generalInformation?: {
|
|
559
|
+
company: {
|
|
560
|
+
name: string;
|
|
561
|
+
};
|
|
562
|
+
contactPerson: {
|
|
563
|
+
name: string;
|
|
564
|
+
email: string;
|
|
565
|
+
};
|
|
566
|
+
period?: {
|
|
567
|
+
end: string;
|
|
568
|
+
start: string;
|
|
569
|
+
} | undefined;
|
|
570
|
+
} | undefined;
|
|
426
571
|
}, {
|
|
427
572
|
companyFacts?: {
|
|
428
573
|
totalPurchaseFromSuppliers?: number | undefined;
|
|
@@ -463,6 +608,19 @@ export declare const BalanceSheetPatchRequestBodySchema: z.ZodObject<{
|
|
|
463
608
|
shortName: string;
|
|
464
609
|
weight: number;
|
|
465
610
|
}[] | undefined;
|
|
611
|
+
generalInformation?: {
|
|
612
|
+
company: {
|
|
613
|
+
name: string;
|
|
614
|
+
};
|
|
615
|
+
contactPerson: {
|
|
616
|
+
name: string;
|
|
617
|
+
email: string;
|
|
618
|
+
};
|
|
619
|
+
period?: {
|
|
620
|
+
end: string;
|
|
621
|
+
start: string;
|
|
622
|
+
} | undefined;
|
|
623
|
+
} | undefined;
|
|
466
624
|
}>;
|
|
467
625
|
export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
|
|
468
626
|
id: z.ZodNumber;
|
|
@@ -658,6 +816,59 @@ export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
|
|
|
658
816
|
hasCanteen?: boolean | undefined;
|
|
659
817
|
averageJourneyToWorkForStaffInKm?: number | undefined;
|
|
660
818
|
}>;
|
|
819
|
+
generalInformation: z.ZodObject<{
|
|
820
|
+
company: z.ZodObject<{
|
|
821
|
+
name: z.ZodString;
|
|
822
|
+
}, "strip", z.ZodTypeAny, {
|
|
823
|
+
name: string;
|
|
824
|
+
}, {
|
|
825
|
+
name: string;
|
|
826
|
+
}>;
|
|
827
|
+
contactPerson: z.ZodObject<{
|
|
828
|
+
email: z.ZodString;
|
|
829
|
+
name: z.ZodString;
|
|
830
|
+
}, "strip", z.ZodTypeAny, {
|
|
831
|
+
name: string;
|
|
832
|
+
email: string;
|
|
833
|
+
}, {
|
|
834
|
+
name: string;
|
|
835
|
+
email: string;
|
|
836
|
+
}>;
|
|
837
|
+
period: z.ZodOptional<z.ZodObject<{
|
|
838
|
+
start: z.ZodString;
|
|
839
|
+
end: z.ZodString;
|
|
840
|
+
}, "strip", z.ZodTypeAny, {
|
|
841
|
+
end: string;
|
|
842
|
+
start: string;
|
|
843
|
+
}, {
|
|
844
|
+
end: string;
|
|
845
|
+
start: string;
|
|
846
|
+
}>>;
|
|
847
|
+
}, "strip", z.ZodTypeAny, {
|
|
848
|
+
company: {
|
|
849
|
+
name: string;
|
|
850
|
+
};
|
|
851
|
+
contactPerson: {
|
|
852
|
+
name: string;
|
|
853
|
+
email: string;
|
|
854
|
+
};
|
|
855
|
+
period?: {
|
|
856
|
+
end: string;
|
|
857
|
+
start: string;
|
|
858
|
+
} | undefined;
|
|
859
|
+
}, {
|
|
860
|
+
company: {
|
|
861
|
+
name: string;
|
|
862
|
+
};
|
|
863
|
+
contactPerson: {
|
|
864
|
+
name: string;
|
|
865
|
+
email: string;
|
|
866
|
+
};
|
|
867
|
+
period?: {
|
|
868
|
+
end: string;
|
|
869
|
+
start: string;
|
|
870
|
+
} | undefined;
|
|
871
|
+
}>;
|
|
661
872
|
stakeholderWeights: z.ZodArray<z.ZodObject<{
|
|
662
873
|
shortName: z.ZodEffects<z.ZodString, string, string>;
|
|
663
874
|
weight: z.ZodEffects<z.ZodNumber, number, number>;
|
|
@@ -720,6 +931,19 @@ export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
|
|
|
720
931
|
shortName: string;
|
|
721
932
|
weight: number;
|
|
722
933
|
}[];
|
|
934
|
+
generalInformation: {
|
|
935
|
+
company: {
|
|
936
|
+
name: string;
|
|
937
|
+
};
|
|
938
|
+
contactPerson: {
|
|
939
|
+
name: string;
|
|
940
|
+
email: string;
|
|
941
|
+
};
|
|
942
|
+
period?: {
|
|
943
|
+
end: string;
|
|
944
|
+
start: string;
|
|
945
|
+
} | undefined;
|
|
946
|
+
};
|
|
723
947
|
}, {
|
|
724
948
|
type: BalanceSheetType;
|
|
725
949
|
id: number;
|
|
@@ -772,6 +996,19 @@ export declare const BalanceSheetResponseBodySchema: z.ZodObject<{
|
|
|
772
996
|
shortName: string;
|
|
773
997
|
weight: number;
|
|
774
998
|
}[];
|
|
999
|
+
generalInformation: {
|
|
1000
|
+
company: {
|
|
1001
|
+
name: string;
|
|
1002
|
+
};
|
|
1003
|
+
contactPerson: {
|
|
1004
|
+
name: string;
|
|
1005
|
+
email: string;
|
|
1006
|
+
};
|
|
1007
|
+
period?: {
|
|
1008
|
+
end: string;
|
|
1009
|
+
start: string;
|
|
1010
|
+
} | undefined;
|
|
1011
|
+
};
|
|
775
1012
|
}>;
|
|
776
1013
|
export declare const BalanceSheetItemResponseSchema: z.ZodObject<{
|
|
777
1014
|
id: z.ZodNumber;
|
|
@@ -6,17 +6,20 @@ const zod_1 = require("zod");
|
|
|
6
6
|
const company_facts_dto_1 = require("./company.facts.dto");
|
|
7
7
|
const rating_dto_1 = require("./rating.dto");
|
|
8
8
|
const stakeholder_weight_dto_1 = require("./stakeholder.weight.dto");
|
|
9
|
+
const general_information_dto_1 = require("./general.information.dto");
|
|
9
10
|
exports.BalanceSheetCreateRequestBodySchema = zod_1.z.object({
|
|
10
11
|
type: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetType),
|
|
11
12
|
version: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetVersion),
|
|
12
13
|
companyFacts: company_facts_dto_1.CompanyFactsCreateRequestBodySchema.default({}),
|
|
13
14
|
ratings: rating_dto_1.RatingRequestBodySchema.array().default([]),
|
|
14
15
|
stakeholderWeights: stakeholder_weight_dto_1.StakeholderWeightSchema.array().default([]),
|
|
16
|
+
generalInformation: general_information_dto_1.GeneralInformationSchema,
|
|
15
17
|
});
|
|
16
18
|
exports.BalanceSheetPatchRequestBodySchema = zod_1.z.object({
|
|
17
19
|
companyFacts: company_facts_dto_1.CompanyFactsPatchRequestBodySchema.optional(),
|
|
18
20
|
ratings: rating_dto_1.RatingRequestBodySchema.array().default([]),
|
|
19
21
|
stakeholderWeights: stakeholder_weight_dto_1.StakeholderWeightSchema.array().optional(),
|
|
22
|
+
generalInformation: general_information_dto_1.GeneralInformationSchema.optional(),
|
|
20
23
|
});
|
|
21
24
|
exports.BalanceSheetResponseBodySchema = zod_1.z.object({
|
|
22
25
|
id: zod_1.z.number(),
|
|
@@ -24,6 +27,7 @@ exports.BalanceSheetResponseBodySchema = zod_1.z.object({
|
|
|
24
27
|
version: zod_1.z.nativeEnum(shared_schemas_1.BalanceSheetVersion),
|
|
25
28
|
ratings: rating_dto_1.RatingResponseBodySchema.array(),
|
|
26
29
|
companyFacts: company_facts_dto_1.CompanyFactsResponseBodySchema,
|
|
30
|
+
generalInformation: general_information_dto_1.GeneralInformationSchema,
|
|
27
31
|
stakeholderWeights: stakeholder_weight_dto_1.StakeholderWeightSchema.array(),
|
|
28
32
|
});
|
|
29
33
|
exports.BalanceSheetItemResponseSchema = zod_1.z.object({
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeneralInformationSchema: z.ZodObject<{
|
|
3
|
+
company: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
name: string;
|
|
7
|
+
}, {
|
|
8
|
+
name: string;
|
|
9
|
+
}>;
|
|
10
|
+
contactPerson: z.ZodObject<{
|
|
11
|
+
email: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
name: string;
|
|
15
|
+
email: string;
|
|
16
|
+
}, {
|
|
17
|
+
name: string;
|
|
18
|
+
email: string;
|
|
19
|
+
}>;
|
|
20
|
+
period: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
start: z.ZodString;
|
|
22
|
+
end: z.ZodString;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
end: string;
|
|
25
|
+
start: string;
|
|
26
|
+
}, {
|
|
27
|
+
end: string;
|
|
28
|
+
start: string;
|
|
29
|
+
}>>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
company: {
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
contactPerson: {
|
|
35
|
+
name: string;
|
|
36
|
+
email: string;
|
|
37
|
+
};
|
|
38
|
+
period?: {
|
|
39
|
+
end: string;
|
|
40
|
+
start: string;
|
|
41
|
+
} | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
company: {
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
46
|
+
contactPerson: {
|
|
47
|
+
name: string;
|
|
48
|
+
email: string;
|
|
49
|
+
};
|
|
50
|
+
period?: {
|
|
51
|
+
end: string;
|
|
52
|
+
start: string;
|
|
53
|
+
} | undefined;
|
|
54
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GeneralInformationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_schemas_1 = require("./shared.schemas");
|
|
6
|
+
const CompanySchema = zod_1.z.object({
|
|
7
|
+
name: shared_schemas_1.isNonEmptyString,
|
|
8
|
+
});
|
|
9
|
+
const isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;
|
|
10
|
+
const IsoDateString = zod_1.z.string().regex(isoDateRegex, 'Invalid ISO date format');
|
|
11
|
+
const PeriodSchema = zod_1.z.object({
|
|
12
|
+
start: IsoDateString,
|
|
13
|
+
end: IsoDateString,
|
|
14
|
+
});
|
|
15
|
+
const ContactPersonSchema = zod_1.z.object({
|
|
16
|
+
email: zod_1.z.string().email(),
|
|
17
|
+
name: shared_schemas_1.isNonEmptyString,
|
|
18
|
+
});
|
|
19
|
+
exports.GeneralInformationSchema = zod_1.z.object({
|
|
20
|
+
company: CompanySchema,
|
|
21
|
+
contactPerson: ContactPersonSchema,
|
|
22
|
+
period: PeriodSchema.optional(),
|
|
23
|
+
});
|
package/dist/organization.dto.js
CHANGED
|
@@ -2,17 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrganizationItemsResponseSchema = exports.OrganizationResponseSchema = exports.OrganizationRequestSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const isNonEmptyString = zod_1.z
|
|
7
|
-
.string({ required_error: errorMsg })
|
|
8
|
-
.min(1, { message: errorMsg });
|
|
5
|
+
const shared_schemas_1 = require("./shared.schemas");
|
|
9
6
|
exports.OrganizationRequestSchema = zod_1.z.object({
|
|
10
|
-
name: isNonEmptyString,
|
|
7
|
+
name: shared_schemas_1.isNonEmptyString,
|
|
11
8
|
address: zod_1.z.object({
|
|
12
|
-
city: isNonEmptyString,
|
|
13
|
-
houseNumber: isNonEmptyString,
|
|
14
|
-
street: isNonEmptyString,
|
|
15
|
-
zip: isNonEmptyString,
|
|
9
|
+
city: shared_schemas_1.isNonEmptyString,
|
|
10
|
+
houseNumber: shared_schemas_1.isNonEmptyString,
|
|
11
|
+
street: shared_schemas_1.isNonEmptyString,
|
|
12
|
+
zip: shared_schemas_1.isNonEmptyString,
|
|
16
13
|
}),
|
|
17
14
|
});
|
|
18
15
|
exports.OrganizationResponseSchema = exports.OrganizationRequestSchema.extend({
|
|
@@ -20,5 +17,5 @@ exports.OrganizationResponseSchema = exports.OrganizationRequestSchema.extend({
|
|
|
20
17
|
invitations: zod_1.z.string().email().array(),
|
|
21
18
|
});
|
|
22
19
|
exports.OrganizationItemsResponseSchema = zod_1.z
|
|
23
|
-
.object({ id: zod_1.z.number(), name: isNonEmptyString })
|
|
20
|
+
.object({ id: zod_1.z.number(), name: shared_schemas_1.isNonEmptyString })
|
|
24
21
|
.array();
|
package/dist/shared.schemas.d.ts
CHANGED
|
@@ -19,3 +19,4 @@ export declare const isPositiveNumber: z.ZodDefault<z.ZodNumber>;
|
|
|
19
19
|
export declare const isPositiveNumberNotZero: z.ZodDefault<z.ZodNumber>;
|
|
20
20
|
export declare const isPercentage: z.ZodNumber;
|
|
21
21
|
export declare const isPercentageNotZero: z.ZodNumber;
|
|
22
|
+
export declare const isNonEmptyString: z.ZodString;
|
package/dist/shared.schemas.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPercentageNotZero = exports.isPercentage = exports.isPositiveNumberNotZero = exports.isPositiveNumber = exports.isNumberWithDefaultZero = exports.isWeightOptional = exports.isWeight = exports.WEIGHT_VALUES = exports.BalanceSheetVersion = exports.BalanceSheetType = exports.isIndustryCode = exports.isCountryCode = void 0;
|
|
3
|
+
exports.isNonEmptyString = exports.isPercentageNotZero = exports.isPercentage = exports.isPositiveNumberNotZero = exports.isPositiveNumber = exports.isNumberWithDefaultZero = exports.isWeightOptional = exports.isWeight = exports.WEIGHT_VALUES = exports.BalanceSheetVersion = exports.BalanceSheetType = exports.isIndustryCode = exports.isCountryCode = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.isCountryCode = zod_1.z.string().min(3).max(3);
|
|
6
6
|
exports.isIndustryCode = zod_1.z.string().min(1).max(4);
|
|
@@ -48,3 +48,7 @@ exports.isPercentageNotZero = zod_1.z
|
|
|
48
48
|
})
|
|
49
49
|
.min(1, 'Percentage should be between 1 and 100')
|
|
50
50
|
.max(100, 'Percentage should be between 0 and 100');
|
|
51
|
+
const errorMsg = 'Must not be blank';
|
|
52
|
+
exports.isNonEmptyString = zod_1.z
|
|
53
|
+
.string({ required_error: errorMsg })
|
|
54
|
+
.min(1, { message: errorMsg });
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ecogood/e-calculator-schemas",
|
|
3
|
-
"version": "2.7.
|
|
4
|
-
"description": "A package providing the schemas for the e-calculator application.",
|
|
5
|
-
"main": "dist/e-calculator-schemas",
|
|
6
|
-
"types": "dist/e-calculator-schemas",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"test": "jest --watch --runInBand",
|
|
10
|
-
"test:ci": "jest --runInBand",
|
|
11
|
-
"format": "prettier --write .",
|
|
12
|
-
"lint": "eslint .",
|
|
13
|
-
"lint-fix": "eslint . --fix",
|
|
14
|
-
"update:to:latest": "ncu -u && yarn update && yarn install && yarn audit fix",
|
|
15
|
-
"prepare": "rm -r dist || true && yarn run build && yarn run test:ci && yarn run lint"
|
|
16
|
-
},
|
|
17
|
-
"publishConfig": {
|
|
18
|
-
"access": "public"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"LICENSE",
|
|
23
|
-
"README.md"
|
|
24
|
-
],
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "https://git.ecogood.org/services/e-calculator-schemas"
|
|
28
|
-
},
|
|
29
|
-
"keywords": [
|
|
30
|
-
"version",
|
|
31
|
-
"compare"
|
|
32
|
-
],
|
|
33
|
-
"author": "Michael Rudolph",
|
|
34
|
-
"license": "MIT",
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://git.ecogood.org/services/e-calculator-schemas/issues"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@eslint/js": "^9.4.0",
|
|
40
|
-
"@types/eslint__js": "^8.42.3",
|
|
41
|
-
"@types/jest": "^28.1.6",
|
|
42
|
-
"eslint": "^9.4.0",
|
|
43
|
-
"jest": "^29.5.0",
|
|
44
|
-
"prettier": "2.3.2",
|
|
45
|
-
"ts-jest": "^29.0.5",
|
|
46
|
-
"typescript": "^5.4.5",
|
|
47
|
-
"typescript-eslint": "^7.13.0"
|
|
48
|
-
},
|
|
49
|
-
"dependencies": {
|
|
50
|
-
"zod": "^3.23.8"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ecogood/e-calculator-schemas",
|
|
3
|
+
"version": "2.7.15",
|
|
4
|
+
"description": "A package providing the schemas for the e-calculator application.",
|
|
5
|
+
"main": "dist/e-calculator-schemas",
|
|
6
|
+
"types": "dist/e-calculator-schemas",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"test": "jest --watch --runInBand",
|
|
10
|
+
"test:ci": "jest --runInBand",
|
|
11
|
+
"format": "prettier --write .",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"lint-fix": "eslint . --fix",
|
|
14
|
+
"update:to:latest": "ncu -u && yarn update && yarn install && yarn audit fix",
|
|
15
|
+
"prepare": "rm -r dist || true && yarn run build && yarn run test:ci && yarn run lint"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://git.ecogood.org/services/e-calculator-schemas"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"version",
|
|
31
|
+
"compare"
|
|
32
|
+
],
|
|
33
|
+
"author": "Michael Rudolph",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://git.ecogood.org/services/e-calculator-schemas/issues"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@eslint/js": "^9.4.0",
|
|
40
|
+
"@types/eslint__js": "^8.42.3",
|
|
41
|
+
"@types/jest": "^28.1.6",
|
|
42
|
+
"eslint": "^9.4.0",
|
|
43
|
+
"jest": "^29.5.0",
|
|
44
|
+
"prettier": "2.3.2",
|
|
45
|
+
"ts-jest": "^29.0.5",
|
|
46
|
+
"typescript": "^5.4.5",
|
|
47
|
+
"typescript-eslint": "^7.13.0"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"zod": "^3.23.8"
|
|
51
|
+
}
|
|
52
|
+
}
|