repair shift: schmea & db
This commit is contained in:
@@ -21,6 +21,7 @@ const getAllShiftDb = async (searchParams = {}) => {
|
||||
{ column: "a.shift_name", param: searchParams.name, type: "string" },
|
||||
{ column: "a.start_time", param: searchParams.start_time, type: "time" },
|
||||
{ column: "a.end_time", param: searchParams.end_time, type: "time" },
|
||||
{ column: "a.is_active", param: searchParams.status, type: "string" },
|
||||
],
|
||||
queryParams
|
||||
);
|
||||
|
||||
@@ -8,6 +8,7 @@ const timePattern = /^([01]\d|2[0-3]):([0-5]\d)(:[0-5]\d)?$/;
|
||||
|
||||
const insertShiftSchema = Joi.object({
|
||||
shift_name: Joi.string().max(100).required(),
|
||||
is_active:Joi.boolean().required(),
|
||||
start_time: Joi.string()
|
||||
.pattern(timePattern)
|
||||
.required()
|
||||
@@ -24,6 +25,7 @@ const insertShiftSchema = Joi.object({
|
||||
|
||||
const updateShiftSchema = Joi.object({
|
||||
shift_name: Joi.string().max(100),
|
||||
is_active:Joi.boolean(),
|
||||
start_time: Joi.string()
|
||||
.pattern(timePattern)
|
||||
.messages({
|
||||
|
||||
Reference in New Issue
Block a user