diff --git a/app/data/jsonSchemaForm/contactSchema.ts b/app/data/jsonSchemaForm/contactSchema.ts index 69b3eb4e1d..35cbc25df1 100644 --- a/app/data/jsonSchemaForm/contactSchema.ts +++ b/app/data/jsonSchemaForm/contactSchema.ts @@ -23,20 +23,24 @@ const contactSchema = { "^(\\+?\\d{1,2}[\\s,-]?)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$", }, phoneExt: { - type: "string", + type: [null, "string"], title: "Phone Extension", + default: undefined, }, companyName: { - type: "string", + type: [null, "string"], title: "Company Name", + default: undefined, }, contactPosition: { - type: "string", + type: [null, "string"], title: "Position", + default: undefined, }, comments: { - type: "string", + type: [null, "string"], title: "Comments", + default: undefined, }, }, }; diff --git a/app/data/jsonSchemaForm/projectSchema.ts b/app/data/jsonSchemaForm/projectSchema.ts index df8ef9c9a0..d01a9491c4 100644 --- a/app/data/jsonSchemaForm/projectSchema.ts +++ b/app/data/jsonSchemaForm/projectSchema.ts @@ -23,14 +23,15 @@ const projectSchema = { default: undefined, }, summary: { type: "string", title: "Project Description" }, - projectType: { type: "string", title: "Project Type" }, + projectType: { + type: [null, "string"], + title: "Project Type", + default: undefined, + }, score: { - type: "number", + type: [null, "number"], title: "Score", - }, - rank: { - type: "number", - title: "Rank", + default: undefined, }, operatorId: { type: "number", @@ -56,14 +57,20 @@ const projectSchema = { anyOf: undefined, }, additionalSectorInformation: { - type: "string", + type: [null, "string"], title: "Additional Sector Information", + default: undefined, }, contractNumber: { - type: "string", + type: [null, "string"], title: "Contract Number", + default: undefined, + }, + comments: { + type: [null, "string"], + title: "General Comments", + default: undefined, }, - comments: { type: "string", title: "General Comments" }, }, }; diff --git a/schema/data/prod/json_schema/contact.json b/schema/data/prod/json_schema/contact.json index fdd47f64c7..ef93b6ebdb 100644 --- a/schema/data/prod/json_schema/contact.json +++ b/schema/data/prod/json_schema/contact.json @@ -2,7 +2,7 @@ "schema": { "$schema": "http://json-schema.org/draft-07/schema", "type": "object", - "required": ["givenName", "familyName", "email", "phone"], + "required": ["givenName", "familyName", "email"], "properties": { "givenName": { "type": "string", @@ -14,27 +14,33 @@ }, "email": { "type": "string", - "title": "Email" + "title": "Email", + "pattern": "^[\\.\\w-]+@([\\w-]+\\.)+[\\w-]{2,4}$" }, "phone": { "type": "string", - "title": "Phone" + "title": "Phone", + "pattern": "^(\\+?\\d{1,2}[\\s,-]?)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$" }, "phoneExt": { - "type": "string", - "title": "Phone Extension" + "type": ["null", "string"], + "title": "Phone Extension", + "default": "undefined" }, "companyName": { - "type": "string", - "title": "Company Name" + "type": ["null", "string"], + "title": "Company Name", + "default": "undefined" }, "contactPosition": { - "type": "string", - "title": "Position" + "type": ["null", "string"], + "title": "Position", + "default": "undefined" }, "comments": { - "type": "string", - "title": "Comments" + "type": ["null", "string"], + "title": "Comments", + "default": "undefined" } } } diff --git a/schema/data/prod/json_schema/emission_intensity_report.json b/schema/data/prod/json_schema/emission_intensity_report.json index 613a5d29f3..3538e60991 100644 --- a/schema/data/prod/json_schema/emission_intensity_report.json +++ b/schema/data/prod/json_schema/emission_intensity_report.json @@ -23,7 +23,7 @@ "comments": { "type": ["null", "string"], "title": "General Comments", - "default": "null" + "default": null }, "measurementPeriodStartDate": { "title": "TEIMP Start Date", @@ -40,7 +40,7 @@ "productionFunctionalUnit": { "title": "Production Functional Unit", "type": ["null", "string"], - "default": "null" + "default": null }, "baselineEmissionIntensity": { "title": "Baseline Emission Intensity (BEI)", diff --git a/schema/data/prod/json_schema/milestone.json b/schema/data/prod/json_schema/milestone.json index 32eb2823e5..0431eab37f 100644 --- a/schema/data/prod/json_schema/milestone.json +++ b/schema/data/prod/json_schema/milestone.json @@ -26,19 +26,21 @@ "title": "Report Due Date" }, "submittedDate": { - "type": "string", - "title": "Report Received Date" + "type": ["null", "string"], + "title": "Report Received Date", + "default": "undefined" }, "substantialCompletionDate": { "type": "string", "title": "Substantial Completion Date" }, "certifiedBy": { - "type": "string", - "title": "Certifier" + "type": ["null", "string"], + "title": "Certifier", + "default": "undefined" }, "certifierProfessionalDesignation": { - "type": "string", + "type": ["null", "string"], "title": "Professional Designation", "default": "Professional Engineer", "anyOf": [ @@ -80,20 +82,23 @@ "title": "Maximum Amount This Milestone" }, "adjustedGrossAmount": { - "type": "number", - "title": "Gross Payment Amount This Milestone" + "type": ["null", "number"], + "title": "Gross Payment Amount This Milestone", + "default": "undefined" }, "adjustedHoldbackAmount": { "type": "number", "title": "Holdback Amount This Milestone" }, "adjustedNetAmount": { - "type": "number", - "title": "Net Payment Amount This Milestone" + "type": ["null", "number"], + "title": "Net Payment Amount This Milestone", + "default": "undefined" }, "dateSentToCsnr": { - "type": "string", - "title": "Date Invoice Sent to CSNR" + "type": ["null", "string"], + "title": "Date Invoice Sent to CSNR", + "default": "undefined" } }, "required": ["maximumAmount"] @@ -117,8 +122,9 @@ "title": "Milestone Type" }, "totalEligibleExpenses": { - "type": "number", - "title": "Total Eligible Expenses" + "type": ["null", "number"], + "title": "Total Eligible Expenses", + "default": "undefined" } } } diff --git a/schema/data/prod/json_schema/operator.json b/schema/data/prod/json_schema/operator.json index 34c3eb22d1..5026951e54 100644 --- a/schema/data/prod/json_schema/operator.json +++ b/schema/data/prod/json_schema/operator.json @@ -14,14 +14,16 @@ "title": "Trade Name" }, "bcRegistryId": { - "type": "string", + "type": ["null", "string"], "title": "BC Registry ID", - "pattern": "^[a-zA-Z]{1,3}[0-9]{7}$" + "pattern": "^[a-zA-Z]{1,3}[0-9]{7}$", + "default": "undefined" }, "operatorCode": { - "type": "string", + "type": ["null", "string"], "title": "Operator Code", - "pattern": "^[A-Z]{4}$" + "pattern": "^[A-Z]{4}$", + "default": "undefined" } } } diff --git a/schema/data/prod/json_schema/project.json b/schema/data/prod/json_schema/project.json index 21a3d68dba..75755cf476 100644 --- a/schema/data/prod/json_schema/project.json +++ b/schema/data/prod/json_schema/project.json @@ -31,12 +31,14 @@ "title": "Project Description" }, "projectType": { - "type": "string", - "title": "Project Type" + "type": ["null", "string"], + "title": "Project Type", + "default": "undefined" }, "score": { - "type": "number", - "title": "Score" + "type": ["null", "number"], + "title": "Score", + "default": "undefined" }, "operatorId": { "type": "number", @@ -62,16 +64,19 @@ "anyOf": "undefined" }, "additionalSectorInformation": { - "type": "string", - "title": "Additional Sector Information" + "type": ["null", "string"], + "title": "Additional Sector Information", + "default": "undefined" }, "contractNumber": { - "type": "string", - "title": "Contract Number" + "type": ["null", "string"], + "title": "Contract Number", + "default": "undefined" }, "comments": { - "type": "string", - "title": "General Comments" + "type": ["null", "string"], + "title": "General Comments", + "default": "undefined" } } } diff --git a/schema/data/prod/json_schema/project_contact.json b/schema/data/prod/json_schema/project_contact.json index d952a07af9..f06101a8c5 100644 --- a/schema/data/prod/json_schema/project_contact.json +++ b/schema/data/prod/json_schema/project_contact.json @@ -6,7 +6,8 @@ "properties": { "contactId": { "title": "Contact", - "type": "number" + "type": ["null", "number"], + "default": "undefined" } } } diff --git a/schema/data/prod/json_schema/project_manager.json b/schema/data/prod/json_schema/project_manager.json index 9b4ef52638..7cad5a9067 100644 --- a/schema/data/prod/json_schema/project_manager.json +++ b/schema/data/prod/json_schema/project_manager.json @@ -5,8 +5,9 @@ "title": "Project Manager", "properties": { "cifUserId": { - "type": "number", - "title": "Project Manager" + "type": ["null", "number"], + "title": "Project Manager", + "default": "undefined" } } } diff --git a/schema/data/prod/json_schema/project_summary_report.json b/schema/data/prod/json_schema/project_summary_report.json index c97d056f2a..77a6181a96 100644 --- a/schema/data/prod/json_schema/project_summary_report.json +++ b/schema/data/prod/json_schema/project_summary_report.json @@ -10,24 +10,29 @@ "title": "Report Due Date" }, "submittedDate": { - "type": "string", - "title": "Received Date" + "type": ["null", "string"], + "title": "Received Date", + "default": "undefined" }, "comments": { - "type": "string", - "title": "General Comments" + "type": ["null", "string"], + "title": "General Comments", + "default": "undefined" }, "projectSummaryReportPayment": { "title": "Project Summary Report Payment", - "type": "number" + "type": ["null", "number"], + "default": "undefined" }, "paymentNotes": { "title": "Notes for the Payment", - "type": "string" + "type": ["null", "string"], + "default": "undefined" }, "dateSentToCsnr": { "title": "Date Invoice Sent to CSNR", - "type": "string" + "type": ["null", "string"], + "default": "undefined" } } }