eatci-file-validator 1.2.1 → 1.3.1

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.
Files changed (38) hide show
  1. package/dist/cjs/components/FileValidator/FileValidator.js +12 -1
  2. package/dist/cjs/components/FileValidator/FileValidator.js.map +1 -1
  3. package/dist/esm/components/FileValidator/FileValidator.js +12 -1
  4. package/dist/esm/components/FileValidator/FileValidator.js.map +1 -1
  5. package/package.json +2 -1
  6. package/dist/cjs/FileValidator.d.ts +0 -6
  7. package/dist/cjs/FileValidator.js +0 -31
  8. package/dist/cjs/FileValidator.js.map +0 -1
  9. package/dist/cjs/chakra-theme.d.ts +0 -2
  10. package/dist/cjs/chakra-theme.js +0 -27
  11. package/dist/cjs/chakra-theme.js.map +0 -1
  12. package/dist/cjs/rules.d.ts +0 -23
  13. package/dist/cjs/rules.js +0 -479
  14. package/dist/cjs/rules.js.map +0 -1
  15. package/dist/cjs/theme.d.ts +0 -18
  16. package/dist/cjs/theme.js +0 -20
  17. package/dist/cjs/theme.js.map +0 -1
  18. package/dist/cjs/translations.d.ts +0 -70
  19. package/dist/cjs/translations.js +0 -72
  20. package/dist/cjs/translations.js.map +0 -1
  21. package/dist/esm/FileValidator.d.ts +0 -6
  22. package/dist/esm/FileValidator.js +0 -27
  23. package/dist/esm/FileValidator.js.map +0 -1
  24. package/dist/esm/chakra-theme.d.ts +0 -2
  25. package/dist/esm/chakra-theme.js +0 -25
  26. package/dist/esm/chakra-theme.js.map +0 -1
  27. package/dist/esm/components/App.d.ts +0 -1
  28. package/dist/esm/components/App.js +0 -113
  29. package/dist/esm/components/App.js.map +0 -1
  30. package/dist/esm/rules.d.ts +0 -23
  31. package/dist/esm/rules.js +0 -477
  32. package/dist/esm/rules.js.map +0 -1
  33. package/dist/esm/theme.d.ts +0 -18
  34. package/dist/esm/theme.js +0 -18
  35. package/dist/esm/theme.js.map +0 -1
  36. package/dist/esm/translations.d.ts +0 -70
  37. package/dist/esm/translations.js +0 -70
  38. package/dist/esm/translations.js.map +0 -1
@@ -7,6 +7,7 @@ var react_spreadsheet_import_1 = require("react-spreadsheet-import");
7
7
  var rules_1 = tslib_1.__importDefault(require("./rules"));
8
8
  var translations_1 = tslib_1.__importDefault(require("./translations"));
9
9
  var theme_1 = tslib_1.__importDefault(require("./theme"));
10
+ var dayjs_1 = tslib_1.__importDefault(require("dayjs"));
10
11
  function FileValidator(_a) {
11
12
  var show = _a.show, onOpen = _a.onOpen, onClose = _a.onClose, onSubmit = _a.onSubmit;
12
13
  (0, react_1.useEffect)(function () {
@@ -19,7 +20,17 @@ function FileValidator(_a) {
19
20
  };
20
21
  return (react_1.default.createElement(react_1.default.Fragment, null,
21
22
  react_1.default.createElement(react_2.ChakraProvider, { theme: theme_1.default },
22
- react_1.default.createElement(react_spreadsheet_import_1.ReactSpreadsheetImport, { isOpen: show, onClose: onClose, onSubmit: handleOnSubmit, fields: rules_1.default.fields, dateFormat: 'dd/mm/yyyy', allowInvalidSubmit: false, customTheme: {
23
+ react_1.default.createElement(react_spreadsheet_import_1.ReactSpreadsheetImport, { isOpen: show, onClose: onClose, onSubmit: handleOnSubmit, fields: rules_1.default.fields, dateFormat: 'dd/mm/yyyy', allowInvalidSubmit: false, rowHook: function (data, addError) {
24
+ var subscriptionDate = (0, dayjs_1.default)(data.DATE_DE_SOUSCRIPTION_DU_CONTRAT);
25
+ // const effectDate = dayjs(data.DATE_EFFET_DU_CONTRAT as string);
26
+ if ((0, dayjs_1.default)().isBefore(subscriptionDate)) {
27
+ addError('DATE_DE_SOUSCRIPTION_DU_CONTRAT', {
28
+ message: 'La date de souscription ne doit pas etre supérieur a la date du jour',
29
+ level: 'error',
30
+ });
31
+ }
32
+ return data;
33
+ }, customTheme: {
23
34
  colors: {
24
35
  textColor: '#2D3748',
25
36
  subtitleColor: '#718096',
@@ -1 +1 @@
1
- {"version":3,"file":"FileValidator.js","sourceRoot":"","sources":["../../../../src/components/FileValidator/FileValidator.tsx"],"names":[],"mappings":";;;AAAA,qDAAwC;AACxC,0CAAiD;AACjD,qEAAiE;AACjE,0DAA2B;AAC3B,wEAAyC;AACzC,0DAA2B;AAS3B,SAAwB,aAAa,CAAC,EAA0C;QAAxC,IAAI,UAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAA;IACrE,IAAA,iBAAS,EAAC;QACR,IAAI,IAAI,EAAE;YACR,MAAM,EAAE,CAAA;SACT;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;IAElB,IAAM,cAAc,GAAG,UAAC,IAAS;QAC/B,QAAQ,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC,CAAA;IAED,OAAO,CACL;QACE,8BAAC,sBAAc,IAAC,KAAK,EAAE,eAAK;YAC1B,8BAAC,iDAAsB,IACrB,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,eAAK,CAAC,MAAM,EACpB,UAAU,EAAC,YAAY,EACvB,kBAAkB,EAAE,KAAK,EACzB,WAAW,EAAE;oBACX,MAAM,EAAE;wBACN,SAAS,EAAE,SAAS;wBACpB,aAAa,EAAE,SAAS;wBACxB,GAAG,EAAE;4BACH,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;yBACf;qBACF;iBACF,EACD,YAAY,EAAE,sBAAY,GAC1B,CACa,CAChB,CACJ,CAAA;AACH,CAAC;AA3CD,gCA2CC"}
1
+ {"version":3,"file":"FileValidator.js","sourceRoot":"","sources":["../../../../src/components/FileValidator/FileValidator.tsx"],"names":[],"mappings":";;;AAAA,qDAAwC;AACxC,0CAAiD;AACjD,qEAAiE;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EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;yBACf;qBACF;iBACF,EACD,YAAY,EAAE,sBAAY,GAC1B,CACa,CAChB,CACJ,CAAA;AACH,CAAC;AAvDD,gCAuDC"}
@@ -4,6 +4,7 @@ import { ReactSpreadsheetImport } from 'react-spreadsheet-import';
4
4
  import rules from './rules';
5
5
  import translations from './translations';
6
6
  import theme from './theme';
7
+ import dayjs from 'dayjs';
7
8
  export default function FileValidator(_a) {
8
9
  var show = _a.show, onOpen = _a.onOpen, onClose = _a.onClose, onSubmit = _a.onSubmit;
9
10
  useEffect(function () {
@@ -16,7 +17,17 @@ export default function FileValidator(_a) {
16
17
  };
17
18
  return (React.createElement(React.Fragment, null,
18
19
  React.createElement(ChakraProvider, { theme: theme },
19
- React.createElement(ReactSpreadsheetImport, { isOpen: show, onClose: onClose, onSubmit: handleOnSubmit, fields: rules.fields, dateFormat: 'dd/mm/yyyy', allowInvalidSubmit: false, customTheme: {
20
+ React.createElement(ReactSpreadsheetImport, { isOpen: show, onClose: onClose, onSubmit: handleOnSubmit, fields: rules.fields, dateFormat: 'dd/mm/yyyy', allowInvalidSubmit: false, rowHook: function (data, addError) {
21
+ var subscriptionDate = dayjs(data.DATE_DE_SOUSCRIPTION_DU_CONTRAT);
22
+ // const effectDate = dayjs(data.DATE_EFFET_DU_CONTRAT as string);
23
+ if (dayjs().isBefore(subscriptionDate)) {
24
+ addError('DATE_DE_SOUSCRIPTION_DU_CONTRAT', {
25
+ message: 'La date de souscription ne doit pas etre supérieur a la date du jour',
26
+ level: 'error',
27
+ });
28
+ }
29
+ return data;
30
+ }, customTheme: {
20
31
  colors: {
21
32
  textColor: '#2D3748',
22
33
  subtitleColor: '#718096',
@@ -1 +1 @@
1
- {"version":3,"file":"FileValidator.js","sourceRoot":"","sources":["../../../../src/components/FileValidator/FileValidator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA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AAO,EAAE,sEAAsE;4BAC/E,KAAK,EAAE,OAAO;yBACf,CAAC,CAAA;qBACH;oBAED,OAAO,IAAI,CAAA;gBACb,CAAC,EACD,WAAW,EAAE;oBACX,MAAM,EAAE;wBACN,SAAS,EAAE,SAAS;wBACpB,aAAa,EAAE,SAAS;wBACxB,GAAG,EAAE;4BACH,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;4BACd,GAAG,EAAE,SAAS;yBACf;qBACF;iBACF,EACD,YAAY,EAAE,YAAY,GAC1B,CACa,CAChB,CACJ,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eatci-file-validator",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "A package to allow validating imported files in eAtCI",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -54,6 +54,7 @@
54
54
  "typescript": "^5.0.4"
55
55
  },
56
56
  "dependencies": {
57
+ "dayjs": "^1.11.7",
57
58
  "react-spreadsheet-import": "^2.0.8"
58
59
  }
59
60
  }
@@ -1,6 +0,0 @@
1
- declare type Props = {
2
- onSubmit: (data: any) => unknown;
3
- show: boolean;
4
- };
5
- export default function FileValidator({ onSubmit, show }: Props): JSX.Element;
6
- export {};
@@ -1,31 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- var tslib_1 = require("tslib");
4
- var react_1 = tslib_1.__importStar(require("react"));
5
- var react_2 = require("@chakra-ui/react");
6
- var chakra_theme_1 = tslib_1.__importDefault(require("./chakra-theme"));
7
- var react_3 = require("@chakra-ui/react");
8
- var react_spreadsheet_import_1 = require("react-spreadsheet-import");
9
- var rules_1 = tslib_1.__importDefault(require("./rules"));
10
- var translations_1 = tslib_1.__importDefault(require("./translations"));
11
- var theme_1 = tslib_1.__importDefault(require("./theme"));
12
- function FileValidator(_a) {
13
- var onSubmit = _a.onSubmit, show = _a.show;
14
- var _b = (0, react_3.useDisclosure)(), isOpen = _b.isOpen, onOpen = _b.onOpen, onClose = _b.onClose;
15
- (0, react_1.useEffect)(function () {
16
- if (show) {
17
- onOpen();
18
- }
19
- });
20
- var handleOnSubmit = function (data) {
21
- onSubmit(data);
22
- };
23
- var handleOnClose = function () {
24
- onClose();
25
- };
26
- return (react_1["default"].createElement(react_1["default"].Fragment, null,
27
- react_1["default"].createElement(react_2.ChakraProvider, { theme: chakra_theme_1["default"] },
28
- react_1["default"].createElement(react_spreadsheet_import_1.ReactSpreadsheetImport, { isOpen: isOpen, onClose: handleOnClose, onSubmit: handleOnSubmit, fields: rules_1["default"].fields, dateFormat: 'dd/mm/yyyy', allowInvalidSubmit: false, customTheme: theme_1["default"], translations: translations_1["default"] }))));
29
- }
30
- exports["default"] = FileValidator;
31
- //# sourceMappingURL=FileValidator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileValidator.js","sourceRoot":"","sources":["../../src/FileValidator.tsx"],"names":[],"mappings":";;;AAAA,qDAAwC;AACxC,0CAAiD;AACjD,wEAAwC;AACxC,0CAAgD;AAChD,qEAAiE;AACjE,0DAA2B;AAC3B,wEAAyC;AACzC,0DAA2B;AAO3B,SAAwB,aAAa,CAAC,EAAyB;QAAvB,QAAQ,cAAA,EAAE,IAAI,UAAA;IAC9C,IAAA,KAA8B,IAAA,qBAAa,GAAE,EAA3C,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAoB,CAAA;IAEnD,IAAA,iBAAS,EAAC;QACR,IAAI,IAAI,EAAE;YACR,MAAM,EAAE,CAAA;SACT;IACH,CAAC,CAAC,CAAA;IAEF,IAAM,cAAc,GAAG,UAAC,IAAS;QAC/B,QAAQ,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC,CAAA;IAED,IAAM,aAAa,GAAG;QACpB,OAAO,EAAE,CAAA;IACX,CAAC,CAAA;IAED,OAAO,CACL;QACE,iCAAC,sBAAc,IAAC,KAAK,EAAE,yBAAW;YAChC,iCAAC,iDAAsB,IACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,kBAAK,CAAC,MAAM,EACpB,UAAU,EAAC,YAAY,EACvB,kBAAkB,EAAE,KAAK,EACzB,WAAW,EAAE,kBAAK,EAClB,YAAY,EAAE,yBAAY,GAC1B,CACa,CAChB,CACJ,CAAA;AACH,CAAC;AAjCD,mCAiCC"}
@@ -1,2 +0,0 @@
1
- declare const theme: import("@chakra-ui/utils").Dict<any>;
2
- export default theme;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- var react_1 = require("@chakra-ui/react");
4
- var theme = (0, react_1.extendTheme)({
5
- fonts: {
6
- heading: "'Nunito', sans-serif",
7
- body: "'Nunito', sans-serif"
8
- },
9
- colors: {
10
- brand: {
11
- 100: '#ff7800',
12
- 200: '#ff7800',
13
- 300: '#f7fafc',
14
- 400: '#f7fafc',
15
- 500: '#f7fafc',
16
- 600: '#ff7800',
17
- 700: '#e75b2a',
18
- 800: '#e75b2a',
19
- 900: '#e75b2a'
20
- }
21
- },
22
- config: {
23
- initialColorMode: 'light'
24
- }
25
- });
26
- exports["default"] = theme;
27
- //# sourceMappingURL=chakra-theme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chakra-theme.js","sourceRoot":"","sources":["../../src/chakra-theme.tsx"],"names":[],"mappings":";;AAAA,0CAA8C;AAE9C,IAAM,KAAK,GAAG,IAAA,mBAAW,EAAC;IACxB,KAAK,EAAE;QACL,OAAO,EAAE,sBAAsB;QAC/B,IAAI,EAAE,sBAAsB;KAC7B;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;SACf;KACF;IACD,MAAM,EAAE;QACN,gBAAgB,EAAE,OAAO;KAC1B;CACF,CAAC,CAAA;AAEF,qBAAe,KAAK,CAAA"}
@@ -1,23 +0,0 @@
1
- declare const _default: {
2
- fields: {
3
- label: string;
4
- key: string;
5
- alternateMatches: string[];
6
- fieldType: {
7
- type: string;
8
- };
9
- example: string;
10
- validations: ({
11
- rule: string;
12
- errorMessage: string;
13
- level: string;
14
- value?: undefined;
15
- } | {
16
- rule: string;
17
- value: string;
18
- errorMessage: string;
19
- level: string;
20
- })[];
21
- }[];
22
- };
23
- export default _default;
package/dist/cjs/rules.js DELETED
@@ -1,479 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports["default"] = {
4
- fields: [
5
- {
6
- label: 'Code compagnie',
7
- key: 'code_compagnie',
8
- alternateMatches: ['code_compagnie'],
9
- fieldType: {
10
- type: 'input'
11
- },
12
- example: 'ASACI_TEST',
13
- validations: [
14
- {
15
- rule: 'required',
16
- errorMessage: 'Le code compagnie est requis',
17
- level: 'error'
18
- },
19
- {
20
- rule: 'regex',
21
- value: '^ASACI_\\w+$',
22
- errorMessage: 'Le code doit commencer par ASACI_',
23
- level: 'error'
24
- },
25
- ]
26
- },
27
- {
28
- label: "Date d'effet",
29
- key: 'date_effet',
30
- alternateMatches: ['date_effet'],
31
- fieldType: {
32
- type: 'input'
33
- },
34
- example: '01/01/2023',
35
- validations: [
36
- {
37
- rule: 'required',
38
- errorMessage: "La date d'effet est requise",
39
- level: 'error'
40
- },
41
- {
42
- rule: 'regex',
43
- value: '^\\d{2}/\\d{2}/\\d{4}$',
44
- errorMessage: "Le format de la date d'effet est incorrect",
45
- level: 'error'
46
- },
47
- ]
48
- },
49
- {
50
- label: "Date d'expiration",
51
- key: 'date_expiration',
52
- alternateMatches: ['date_expiration'],
53
- fieldType: {
54
- type: 'input'
55
- },
56
- example: '01/01/2023',
57
- validations: [
58
- {
59
- rule: 'required',
60
- errorMessage: "La date d'expiration est requise",
61
- level: 'error'
62
- },
63
- {
64
- rule: 'regex',
65
- value: '^\\d{2}/\\d{2}/\\d{4}$',
66
- errorMessage: "Le format de la date d'échéance est incorrect",
67
- level: 'error'
68
- },
69
- ]
70
- },
71
- {
72
- label: 'Genre du vehicule',
73
- key: 'genre_vehicule',
74
- alternateMatches: ['genre_vehicule'],
75
- fieldType: {
76
- type: 'input'
77
- },
78
- example: 'GV01',
79
- validations: [
80
- {
81
- rule: 'required',
82
- errorMessage: 'Le genre du véhicule est requis',
83
- level: 'error'
84
- },
85
- {
86
- rule: 'regex',
87
- value: '^GV\\d{2}$',
88
- errorMessage: 'Le format du genre du véhicule est incorrect',
89
- level: 'error'
90
- },
91
- ]
92
- },
93
- {
94
- label: "Numéro d'immatriculation",
95
- key: 'numero_immatriculation',
96
- alternateMatches: ['numero_immatriculation'],
97
- fieldType: {
98
- type: 'input'
99
- },
100
- example: '0114AS01',
101
- validations: [
102
- {
103
- rule: 'required',
104
- errorMessage: "L'immatriculation est requis",
105
- level: 'error'
106
- },
107
- ]
108
- },
109
- {
110
- label: 'Type de véhicule',
111
- key: 'type_vehicule',
112
- alternateMatches: ['type_vehicule'],
113
- fieldType: {
114
- type: 'input'
115
- },
116
- example: 'TV01',
117
- validations: [
118
- {
119
- rule: 'required',
120
- errorMessage: 'Le type du véhicule est requis',
121
- level: 'error'
122
- },
123
- {
124
- rule: 'regex',
125
- value: '^TV\\d{2}$',
126
- errorMessage: 'Le format du type du véhicule est incorrect',
127
- level: 'error'
128
- },
129
- ]
130
- },
131
- {
132
- label: 'Modèle du véhicule',
133
- key: 'model_vehicule',
134
- alternateMatches: ['model_vehicule'],
135
- fieldType: {
136
- type: 'input'
137
- },
138
- example: 'X5',
139
- validations: [
140
- {
141
- rule: 'required',
142
- errorMessage: 'Le modèle du véhicule est requis',
143
- level: 'error'
144
- },
145
- ]
146
- },
147
- {
148
- label: 'Catégorie du véhicule',
149
- key: 'categorie_vehicule',
150
- alternateMatches: ['categorie_vehicule'],
151
- fieldType: {
152
- type: 'input'
153
- },
154
- example: '01',
155
- validations: [
156
- {
157
- rule: 'required',
158
- errorMessage: 'La catégorie est requise',
159
- level: 'error'
160
- },
161
- {
162
- rule: 'regex',
163
- value: '^\\d{1,2}$',
164
- errorMessage: 'Le format de la catégorie du véhicule est incorrect',
165
- level: 'error'
166
- },
167
- ]
168
- },
169
- {
170
- label: 'Usage du véhicule',
171
- key: 'usage_vehicule',
172
- alternateMatches: ['usage_vehicule'],
173
- fieldType: {
174
- type: 'input'
175
- },
176
- example: 'UV01',
177
- validations: [
178
- {
179
- rule: 'required',
180
- errorMessage: "L'usage est requis",
181
- level: 'error'
182
- },
183
- {
184
- rule: 'regex',
185
- value: '^UV\\d{2}$',
186
- errorMessage: 'Le format de la catégorie du véhicule est incorrect',
187
- level: 'error'
188
- },
189
- ]
190
- },
191
- {
192
- label: "Source d'énergie",
193
- key: 'source_energie',
194
- alternateMatches: ['source_energie'],
195
- fieldType: {
196
- type: 'input'
197
- },
198
- example: 'SEES',
199
- validations: [
200
- {
201
- rule: 'required',
202
- errorMessage: "La source d'energie est requise",
203
- level: 'error'
204
- },
205
- {
206
- rule: 'regex',
207
- value: '^(SEES|SEDI|SEHY|SEEL)$',
208
- errorMessage: "Le format de la source d'énergie est incorrect",
209
- level: 'error'
210
- },
211
- ]
212
- },
213
- {
214
- label: 'Nombre de place',
215
- key: 'nombre_place',
216
- alternateMatches: ['nombre_place'],
217
- fieldType: {
218
- type: 'input'
219
- },
220
- example: '5',
221
- validations: [
222
- {
223
- rule: 'required',
224
- errorMessage: 'Le nombre de place est requis',
225
- level: 'error'
226
- },
227
- {
228
- rule: 'regex',
229
- value: '^\\d+$',
230
- errorMessage: 'Le nombre de place doit être un nombre',
231
- level: 'error'
232
- },
233
- ]
234
- },
235
- {
236
- label: 'Marque du véhicule',
237
- key: 'marque_vehicule',
238
- alternateMatches: ['marque_vehicule'],
239
- fieldType: {
240
- type: 'input'
241
- },
242
- example: 'TOYOTA',
243
- validations: [
244
- {
245
- rule: 'required',
246
- errorMessage: 'La marque est requise',
247
- level: 'error'
248
- },
249
- ]
250
- },
251
- {
252
- label: 'Numéro de chassis',
253
- key: 'numero_chassis',
254
- alternateMatches: ['numero_chassis'],
255
- fieldType: {
256
- type: 'input'
257
- },
258
- example: '01A1',
259
- validations: [
260
- {
261
- rule: 'required',
262
- errorMessage: 'Le numéro de chassis est requis',
263
- level: 'error'
264
- },
265
- ]
266
- },
267
- {
268
- label: 'Nom du souscripteur',
269
- key: 'nom_souscripteur',
270
- alternateMatches: ['nom_souscripteur'],
271
- fieldType: {
272
- type: 'input'
273
- },
274
- example: 'DION DETY',
275
- validations: [
276
- {
277
- rule: 'required',
278
- errorMessage: 'Le nom du souscripteur est requis',
279
- level: 'error'
280
- },
281
- ]
282
- },
283
- {
284
- label: 'Type de souscripteur',
285
- key: 'type_souscripteur',
286
- alternateMatches: ['type_souscripteur'],
287
- fieldType: {
288
- type: 'input'
289
- },
290
- example: 'TAPP',
291
- validations: [
292
- {
293
- rule: 'required',
294
- errorMessage: 'Le type du souscripteur est requis',
295
- level: 'error'
296
- },
297
- {
298
- rule: 'regex',
299
- value: '^(TSPP|TSPM)$',
300
- errorMessage: 'Le type de souscripteur est incorrect',
301
- level: 'error'
302
- },
303
- ]
304
- },
305
- {
306
- label: 'E-mail souscripteur',
307
- key: 'adresse_mail_souscripteur',
308
- alternateMatches: ['adresse_mail_souscripteur'],
309
- fieldType: {
310
- type: 'input'
311
- },
312
- example: 'support@asacitechnologies.com',
313
- validations: [
314
- {
315
- rule: 'required',
316
- errorMessage: "L'email du souscripteur est requis",
317
- level: 'error'
318
- },
319
- ]
320
- },
321
- {
322
- label: 'Contact du souscripteur',
323
- key: 'numero_telephone_souscripteur',
324
- alternateMatches: ['numero_telephone_souscripteur'],
325
- fieldType: {
326
- type: 'input'
327
- },
328
- example: '0700000000',
329
- validations: [
330
- {
331
- rule: 'required',
332
- errorMessage: 'Le contact du souscripteur est requis',
333
- level: 'error'
334
- },
335
- ]
336
- },
337
- {
338
- label: 'Boite postale souscripteur',
339
- key: 'boite_postale_souscripteur',
340
- alternateMatches: ['boite_postale_souscripteur'],
341
- fieldType: {
342
- type: 'input'
343
- },
344
- example: '21 BP 5137 ABJ 21',
345
- validations: [
346
- {
347
- rule: 'required',
348
- errorMessage: 'La boite postale du souscripteur est requise',
349
- level: 'error'
350
- },
351
- ]
352
- },
353
- {
354
- label: "Nom de l'assuré",
355
- key: 'nom_assure',
356
- alternateMatches: ['nom_assure'],
357
- fieldType: {
358
- type: 'input'
359
- },
360
- example: 'GON SALOMON',
361
- validations: [
362
- {
363
- rule: 'required',
364
- errorMessage: "Le nom de l'assuré est requis",
365
- level: 'error'
366
- },
367
- ]
368
- },
369
- {
370
- label: "E-mail de l'assuré",
371
- key: 'adresse_mail_assure',
372
- alternateMatches: ['adresse_mail_assure'],
373
- fieldType: {
374
- type: 'input'
375
- },
376
- example: 'mon@assure.com',
377
- validations: [
378
- {
379
- rule: 'required',
380
- errorMessage: "L'email de l'assuré est requis",
381
- level: 'error'
382
- },
383
- ]
384
- },
385
- {
386
- label: "Boite postale de l'assuré",
387
- key: 'boite_postale_assure',
388
- alternateMatches: ['boite_postale_assure'],
389
- fieldType: {
390
- type: 'input'
391
- },
392
- example: '01 BP ABJ 01',
393
- validations: [
394
- {
395
- rule: 'required',
396
- errorMessage: "La boite postale de l'assuré est requise",
397
- level: 'error'
398
- },
399
- ]
400
- },
401
- {
402
- label: "Contact de l'assuré",
403
- key: 'numero_telephone_assure',
404
- alternateMatches: ['numero_telephone_assure'],
405
- fieldType: {
406
- type: 'input'
407
- },
408
- example: '0708000000',
409
- validations: [
410
- {
411
- rule: 'required',
412
- errorMessage: "Le contact de l'assuré est requis",
413
- level: 'error'
414
- },
415
- ]
416
- },
417
- {
418
- label: 'Numéro de police',
419
- key: 'numero_police',
420
- alternateMatches: ['numero_police'],
421
- fieldType: {
422
- type: 'input'
423
- },
424
- example: '01/2023',
425
- validations: [
426
- {
427
- rule: 'required',
428
- errorMessage: 'Le numéro de police est requis',
429
- level: 'error'
430
- },
431
- ]
432
- },
433
- {
434
- label: 'Montant de la RC',
435
- key: 'rc',
436
- alternateMatches: ['rc'],
437
- fieldType: {
438
- type: 'input'
439
- },
440
- example: '100',
441
- validations: [
442
- {
443
- rule: 'required',
444
- errorMessage: 'La RC est requise',
445
- level: 'error'
446
- },
447
- {
448
- rule: 'regex',
449
- value: '^\\d+$',
450
- errorMessage: 'La RC doit être un nombre',
451
- level: 'error'
452
- },
453
- ]
454
- },
455
- {
456
- label: "Nature de l'attestation",
457
- key: 'code_nature_attestation',
458
- alternateMatches: ['code_nature_attestation'],
459
- fieldType: {
460
- type: 'input'
461
- },
462
- example: 'JAUN',
463
- validations: [
464
- {
465
- rule: 'required',
466
- errorMessage: "La nature de l'attestation est requise",
467
- level: 'error'
468
- },
469
- {
470
- rule: 'regex',
471
- value: '^(JAUN|VERT)$',
472
- errorMessage: "La nature de l'attestation est incorrect",
473
- level: 'error'
474
- },
475
- ]
476
- },
477
- ]
478
- };
479
- //# sourceMappingURL=rules.js.map