@defra/fcp-sfd-frontend-engine 0.2.7 → 0.2.8
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/index.cjs
CHANGED
|
@@ -72,9 +72,23 @@ var businessSchemas = {
|
|
|
72
72
|
sbi: businessSbiSchema
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
+
// src/schemas/customer/customer-crn-schema.js
|
|
76
|
+
var import_joi2 = __toESM(require("joi"), 1);
|
|
77
|
+
var customerCrnSchema = import_joi2.default.object({
|
|
78
|
+
crn: import_joi2.default.string().pattern(/^\d{10}$/).allow("").optional().messages({
|
|
79
|
+
"string.pattern.base": "Enter the full CRN"
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// src/schemas/customer/customer-schemas.js
|
|
84
|
+
var customerSchemas = {
|
|
85
|
+
crn: customerCrnSchema
|
|
86
|
+
};
|
|
87
|
+
|
|
75
88
|
// src/schemas/schemas.js
|
|
76
89
|
var schemas = {
|
|
77
|
-
business: businessSchemas
|
|
90
|
+
business: businessSchemas,
|
|
91
|
+
customer: customerSchemas
|
|
78
92
|
};
|
|
79
93
|
|
|
80
94
|
// src/utils/format-validation-errors.js
|
package/dist/index.js
CHANGED
|
@@ -35,9 +35,23 @@ var businessSchemas = {
|
|
|
35
35
|
sbi: businessSbiSchema
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
// src/schemas/customer/customer-crn-schema.js
|
|
39
|
+
import Joi2 from "joi";
|
|
40
|
+
var customerCrnSchema = Joi2.object({
|
|
41
|
+
crn: Joi2.string().pattern(/^\d{10}$/).allow("").optional().messages({
|
|
42
|
+
"string.pattern.base": "Enter the full CRN"
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// src/schemas/customer/customer-schemas.js
|
|
47
|
+
var customerSchemas = {
|
|
48
|
+
crn: customerCrnSchema
|
|
49
|
+
};
|
|
50
|
+
|
|
38
51
|
// src/schemas/schemas.js
|
|
39
52
|
var schemas = {
|
|
40
|
-
business: businessSchemas
|
|
53
|
+
business: businessSchemas,
|
|
54
|
+
customer: customerSchemas
|
|
41
55
|
};
|
|
42
56
|
|
|
43
57
|
// src/utils/format-validation-errors.js
|
package/package.json
CHANGED
package/src/schemas/schemas.js
CHANGED