Skip to content

Commit

Permalink
fix: timestamp columns are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Jan 30, 2022
1 parent f3ab80a commit 27255bd
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/validations/co-benefits.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export const cobenefitSchema = Joi.object({
// warehouseProjectId - derived upon creation
id: Joi.string().optional(),
cobenefit: Joi.string().required(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
});
2 changes: 2 additions & 0 deletions src/validations/estimations.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ export const estimationSchema = Joi.object({
.min(Joi.ref('startDate'))
.required(),
unitCount: Joi.number().integer().required(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
});
2 changes: 2 additions & 0 deletions src/validations/issuances.validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ export const issuanceSchema = Joi.object({
verificationDate: Joi.date().required(),
verificationBody: Joi.string().required(),
verificationReportDate: Joi.date().required(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
});
2 changes: 2 additions & 0 deletions src/validations/labels.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export const labelSchema = Joi.object({
.required(),
unitQuantity: Joi.number().integer().required(),
labelLink: Joi.string().required(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
});
2 changes: 2 additions & 0 deletions src/validations/locations.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export const locationSchema = Joi.object({
inCountryRegion: Joi.string().required(),
// Please make 'inCountryRegion' optional.
geographicIdentifier: Joi.string().required(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
});
2 changes: 2 additions & 0 deletions src/validations/projects.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const baseSchema = {
projectLocations: Joi.array().items(locationSchema).min(1).optional(),
projectRatings: Joi.array().items(ratingSchema).min(1).optional(),
estimations: Joi.array().items(estimationSchema).min(1).optional(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
};

export const projectsGetQuerySchema = Joi.object()
Expand Down
2 changes: 2 additions & 0 deletions src/validations/ratings.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ export const ratingSchema = Joi.object({
.max(Joi.ref('ratingRangeHighest'))
.required(),
ratingLink: Joi.string().required(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
});
2 changes: 2 additions & 0 deletions src/validations/relatedProjects.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export const relatedProjectSchema = Joi.object({
// A project may not exist in the warehouse, so we need to list the project ID as it would appear in the associated registry.
relationshipType: Joi.string().optional(),
registry: Joi.string().optional(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
});
2 changes: 2 additions & 0 deletions src/validations/units.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const unitsBaseSchema = {
.required(),
issuance: issuanceSchema.optional(),
labels: Joi.array().items(labelSchema).optional(),
updatedAt: Joi.date().timestamp().optional(),
createdAt: Joi.date().timestamp().optional(),
};

export const unitsPostSchema = Joi.object({
Expand Down

0 comments on commit 27255bd

Please sign in to comment.