diff --git a/src/controllers/user_roles.ts b/src/controllers/user_roles.ts index 9a5516b..b03cb8c 100644 --- a/src/controllers/user_roles.ts +++ b/src/controllers/user_roles.ts @@ -248,6 +248,8 @@ export class UserRoleController { .required() .label("Status"), application: Joi.string().required().label("Application"), + is_doctor: Joi.bool().optional().label("Is Doctor"), + is_nurse: Joi.bool().optional().label("Is Nurse"), }) const param: UserRole & { application: string } = await schema.validateAsync(req.body) @@ -259,6 +261,8 @@ export class UserRoleController { data.roles = param.roles data.status = param.status data.application = await repo_app.findOneBy({ id: param.application }) + data.is_doctor = param.is_doctor + data.is_nurse = param.is_nurse data.created_by = req.auth.data.name data.created_at = new Date() @@ -309,6 +313,8 @@ export class UserRoleController { .required() .label("Status"), application: Joi.string().required().label("Application"), + is_doctor: Joi.bool().optional().label("Is Doctor"), + is_nurse: Joi.bool().optional().label("Is Nurse"), }) req.body.id = req.params["id"] @@ -326,6 +332,8 @@ export class UserRoleController { data.roles = param.roles data.status = param.status data.application = await repo_app.findOneBy({ id: param.application }) + data.is_doctor = param.is_doctor + data.is_nurse = param.is_nurse data.updated_by = req.auth.data.name data.updated_at = new Date() diff --git a/src/swagger/builder.js b/src/swagger/builder.js index adfafd7..270b1e8 100644 --- a/src/swagger/builder.js +++ b/src/swagger/builder.js @@ -47,7 +47,9 @@ const doc = { $name: "Administrator", $roles: ["4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8", "1a1221b6-78a0-4b3b-bf5c-fa0af5f69be8"], $status: "Y", - $application: "ukln" + $application: "ukln", + is_doctor: false, + is_nurse: false, }, user_activity: { $id_user: "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8",