@sinet/validation
Advanced tools
Comparing version 1.2.4 to 1.2.5
{ | ||
"name": "@sinet/validation", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -53,3 +53,2 @@ 'use strict'; | ||
'score' : ( setScore() ), | ||
'isRequired' : Joi.boolean().default( false ).description( 'Whether the indicator requires an answer for observation completion' ), | ||
@@ -56,0 +55,0 @@ 'prescribedResources' : Joi.array().optional() |
@@ -6,3 +6,2 @@ 'use strict'; | ||
module.exports = { | ||
'id' : Joi.string().guid().required().description( 'The evidence id' ), | ||
@@ -9,0 +8,0 @@ 'type' : Joi.any().valid( [ 3, 4, 5, 6, 7, 8 ] ).required().description( 'The evidence type (e.g. 3 for file, 4 for comment, 5 for image, 6 for counter, 7 for timer, 8 for scripting' ), |
@@ -6,3 +6,2 @@ 'use strict'; | ||
module.exports = { | ||
'id' : Joi.string().guid().required().description( 'The resource id' ), | ||
@@ -16,3 +15,2 @@ 'resourceId' : Joi.number().integer().required().description( 'The id for the resource itself (e.g. contentId, groupId)' ), | ||
'completedDate' : Joi.date().optional().description( 'The completed date' ) | ||
}; |
@@ -5,95 +5,97 @@ 'use strict'; | ||
module.exports = { | ||
module.exports = function ( level ) { | ||
var schema = { | ||
// Observation id | ||
'id' : Joi.string().guid().required().description( 'The observation uuid' ), | ||
// Observation id | ||
'id' : Joi.string().guid().required().description( 'The observation uuid' ), | ||
// Observation name | ||
'name' : Joi.string().required().description( 'The name of the observation' ), | ||
// Observation name | ||
'name' : Joi.string().required().description( 'The name of the observation' ), | ||
// Observer details | ||
'observer' : Joi.object().required().keys( { | ||
'id' : Joi.number().integer().required().description( 'Observer should have id' ), | ||
'firstName' : Joi.forbidden(), | ||
'lastName' : Joi.forbidden() | ||
} ).description( 'The observer information' ), | ||
// Observer details | ||
'observer' : Joi.object().required().keys( { | ||
'id' : Joi.number().integer().required().description( 'Observer should have id' ), | ||
'firstName' : Joi.forbidden(), | ||
'lastName' : Joi.forbidden() | ||
} ).description( 'The observer information' ), | ||
// Observee details | ||
'observee' : Joi.object().required().keys( { | ||
'id' : Joi.number().integer().required().description( 'Observee should have id' ), | ||
'firstName' : Joi.forbidden(), | ||
'lastName' : Joi.forbidden() | ||
} ).description( 'The observee information' ), | ||
// Observee details | ||
'observee' : Joi.object().required().keys( { | ||
'id' : Joi.number().integer().required().description( 'Observee should have id' ), | ||
'firstName' : Joi.forbidden(), | ||
'lastName' : Joi.forbidden() | ||
} ).description( 'The observee information' ), | ||
// Location | ||
'location' : Joi.object().required().keys( { | ||
'observeeClientId' : Joi.number().required().description( 'The id of the location' ), | ||
'state' : Joi.forbidden(), | ||
'districtName' : Joi.forbidden(), | ||
'schoolName' : Joi.forbidden() | ||
} ).description( 'The location of the observation' ), | ||
// Location | ||
'location' : Joi.object().required().keys( { | ||
'observeeClientId' : Joi.number().required().description( 'The id of the location' ), | ||
'state' : Joi.forbidden(), | ||
'districtName' : Joi.forbidden(), | ||
'schoolName' : Joi.forbidden() | ||
} ).description( 'The location of the observation' ), | ||
// Dates portion | ||
'scheduledDate' : Joi.date().optional().description( 'The date the observation is scheduled for' ), | ||
'startDate' : Joi.date().required().description( 'The observation start date' ), | ||
'endDate' : Joi.date().optional().description( 'The observation due date' ), | ||
'submitDate' : Joi.date().optional().description( 'When the observation was submitted' ), | ||
// Dates portion | ||
'scheduledDate' : Joi.date().optional().description( 'The date the observation is scheduled for' ), | ||
'startDate' : Joi.date().required().description( 'The observation start date' ), | ||
'endDate' : Joi.date().optional().description( 'The observation due date' ), | ||
'submitDate' : Joi.date().optional().description( 'When the observation was submitted' ), | ||
'partialSubmission' : Joi.boolean().required().description( 'If observation is partially completed' ), | ||
'partialSubmission' : Joi.boolean().required().description( 'If observation is partially completed' ), | ||
/* | ||
* We were told there might be times where a user would want multiple types (e.g. a formal self assessment) | ||
*/ | ||
/* | ||
* We were told there might be times where a user would want multiple types (e.g. a formal self assessment) | ||
*/ | ||
'type' : Joi.array().optional().description( 'The type of the observation' ), | ||
'type' : Joi.array().optional().description( 'The type of the observation' ), | ||
/* | ||
* CONCERNS | ||
* | ||
* Iterate and validate the values inside the tags | ||
* Joi cant handle this but we can check for now if its and array or object | ||
*/ | ||
'tags' : Joi.array().optional().description( 'The tag information of the observation' ), | ||
/* | ||
* CONCERNS | ||
* | ||
* Iterate and validate the values inside the tags | ||
* Joi cant handle this but we can check for now if its and array or object | ||
*/ | ||
'tags' : Joi.array().optional().description( 'The tag information of the observation' ), | ||
// Get template schema this is separate so that it would be reusable for templates resources | ||
'template' : Joi | ||
.object() | ||
.optional() | ||
// Get common template schema | ||
.keys( require( './template-schema' )( level ) ) | ||
.description( 'The template data of the observation' ), | ||
// Get template schema this is separate so that it would be reusable for templates resources | ||
'template' : Joi | ||
.object() | ||
.optional() | ||
// Get common template schema | ||
.keys( require( './template' ) ) | ||
.description( 'The template data of the observation' ), | ||
// If the attributes are static this can be handled | ||
'evidences' : Joi.array().optional() | ||
.items( Joi.string().guid().required().description( 'The evidence uuid' ) ) | ||
.description( 'The evidence assigned at the observation level' ), | ||
// If the attributes are static this can be handled | ||
'evidences' : Joi.array().optional() | ||
.items( Joi.string().guid().required().description( 'The evidence uuid' ) ) | ||
.description( 'The evidence assigned at the observation level' ), | ||
'masterEvidences' : Joi | ||
.array() | ||
.optional() | ||
// Get common evidences schema | ||
.items( Joi.object().optional().keys( require( './master-evidences-schema' ) ) ) | ||
.description( 'All of the evidences assigned in the observation' ), | ||
'masterEvidences' : Joi | ||
.array() | ||
.optional() | ||
// Get common evidences schema | ||
.items( Joi.object().optional().keys( require( './master-evidence' ) ) ) | ||
.description( 'All of the evidences assigned in the observation' ), | ||
'prescribedResources' : Joi.array().optional() | ||
// Get common prescibed resources schema | ||
.items( Joi.string().guid().required().description( 'The observation uuid' ) ) | ||
.description( 'The prescribed resources assigned at the observation level' ), | ||
'prescribedResources' : Joi.array().optional() | ||
// Get common prescibed resources schema | ||
.items( Joi.string().guid().required().description( 'The observation uuid' ) ) | ||
.description( 'The prescribed resources assigned at the observation level' ), | ||
'masterPrescribedResources' : Joi | ||
.array() | ||
.optional() | ||
// Get common prescibed resources schema | ||
.items( Joi.object().optional().keys( require( './master-prescribed-resources-schema' ) ) ) | ||
.description( 'All of the prescribed resources assigned in the observation' ), | ||
'masterPrescribedResources' : Joi | ||
.array() | ||
.optional() | ||
// Get common prescibed resources schema | ||
.items( Joi.object().optional().keys( require( './master-prescribed-resource' ) ) ) | ||
.description( 'All of the prescribed resources assigned in the observation' ), | ||
// Not clear yet whats inside this archive | ||
'archive' : Joi.array().optional(), | ||
// Not clear yet whats inside this archive | ||
'archive' : Joi.array().optional(), | ||
/* | ||
* CONCERNS | ||
* Where did this come from? Its not in the wiki | ||
*/ | ||
'manualScore' : Joi.number().optional().description( 'The manually-assigned score of the observation' ) | ||
}; | ||
/* | ||
* CONCERNS | ||
* Where did this come from? Its not in the wiki | ||
*/ | ||
'manualScore' : Joi.number().optional().description( 'The manually-assigned score of the observation' ) | ||
return schema; | ||
}; |
@@ -6,3 +6,2 @@ 'use strict'; | ||
module.exports = { | ||
'title' : Joi.string().required().description( 'The rubric column name -- Sanitizes HTML' ), | ||
@@ -13,3 +12,2 @@ 'description' : Joi.string().required().description( 'The rubric column description -- Sanitizes HTML' ), | ||
'selected' : Joi.forbidden().description( 'Boolean to show whether a column is selected. We\'re not saving these, just calculating/returning on a get' ) | ||
}; |
@@ -6,7 +6,5 @@ 'use strict'; | ||
module.exports = { | ||
'id' : Joi.number().integer().required().description( 'The attachment id' ), | ||
'name' : Joi.string().required().description( 'The attachment name' ), | ||
'type' : Joi.number().integer().required().description( 'The attachment type' ) | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19535
372