Skip to content

Commit

Permalink
fixed schema
Browse files Browse the repository at this point in the history
  • Loading branch information
wafimohamed committed Feb 21, 2025
1 parent 91618c1 commit afb3024
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 75 deletions.
77 changes: 36 additions & 41 deletions dist/22-10216-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,49 @@
"type": "string"
}
},
"required": [
"certifyingOfficial",
"institutionDetails",
"statementOfTruthSignature",
"dateSigned"
],
"properties": {
"certifyingOfficial": {
"type": "object",
"required": [
"first",
"last",
"title"
],
"properties": {
"first": {
"type": "string"
},
"last": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"institutionDetails": {
"type": "object",
"required": [
"certifyingOfficial",
"institutionDetails",
"statementOfTruthSignature",
"dateSigned"
"institutionName",
"facilityCode",
"termStartDate"
],
"properties": {
"certifyingOfficial": {
"type": "object",
"required": [
"first",
"last",
"title"
],
"properties": {
"first": {
"type": "string"
},
"last": {
"type": "string"
},
"title": {
"type": "string"
}
}
"institutionName": {
"type": "string"
},
"institutionDetails": {
"type": "object",
"required": [
"institutionName",
"facilityCode",
"termStartDate"
],
"properties": {
"institutionName": {
"type": "string"
},
"facilityCode": {
"type": "string",
"pattern": "^[a-zA-Z0-9]{8}$"
},
"termStartDate": {
"$ref": "#/definitions/date"
}
}
"facilityCode": {
"type": "string",
"pattern": "^[a-zA-Z0-9]{8}$"
},
"termStartDate": {
"$ref": "#/definitions/date"
}
}
},
Expand Down
56 changes: 26 additions & 30 deletions src/schemas/22-10216/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,36 @@ const schema = {
type: 'object',
additionalProperties: false,
definitions: pickedDefinitions,
required: ['certifyingOfficial', 'institutionDetails', 'statementOfTruthSignature', 'dateSigned'],
properties: {
certifyingOfficial: {
type: 'object',
required: ['first', 'last', 'title'],
properties: {
first: {
type: 'string',
},
last: {
type: 'string',
},
title: {
type: 'string',
},
},
},
institutionDetails: {
type: 'object',
required: ['certifyingOfficial', 'institutionDetails', 'statementOfTruthSignature', 'dateSigned'],
required: ['institutionName', 'facilityCode', 'termStartDate'],
properties: {
certifyingOfficial: {
type: 'object',
required: ['first', 'last', 'title'],
properties: {
first: {
type: 'string',
},
last: {
type: 'string',
},
title: {
type: 'string',
},
},
institutionName: {
type: 'string',
},
institutionDetails: {
type: 'object',
required: ['institutionName', 'facilityCode', 'termStartDate'],
properties: {
institutionName: {
type: 'string',
},
facilityCode: {
type: 'string',
pattern: '^[a-zA-Z0-9]{8}$',
},
termStartDate: {
$ref: '#/definitions/date',
},
},
facilityCode: {
type: 'string',
pattern: '^[a-zA-Z0-9]{8}$',
},
termStartDate: {
$ref: '#/definitions/date',
},
},
},
Expand Down Expand Up @@ -75,4 +70,5 @@ const schema = {
},
},
};

export default schema;
8 changes: 4 additions & 4 deletions test/schemas/22-10216/schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ const testData = {
};
describe('10216 schema', () => {
it('should have required fields', () => {
expect(schema.properties.certifyingOfficial.required).to.deep.equal(['first', 'last', 'title']);
expect(schema.properties.institutionDetails.required).to.deep.equal([
'certifyingOfficial',
'institutionDetails',
'statementOfTruthSignature',
'dateSigned',
'institutionName',
'facilityCode',
'termStartDate',
]);
expect(schema.properties.studentRatioCalcChapter.required).to.deep.equal([
'beneficiaryStudent',
Expand Down

0 comments on commit afb3024

Please sign in to comment.