upd: add status column in service
This commit is contained in:
@ -87,6 +87,7 @@ export class ServiceController {
|
||||
name: Joi.string().max(256).required().label("Name"),
|
||||
service_type_id: Joi.string().uuid().required().label("Service Type ID"),
|
||||
room_ids: Joi.array().items(Joi.string().uuid()).optional().label("Room IDs"),
|
||||
status: Joi.string().required().label("Status"),
|
||||
});
|
||||
|
||||
let param: any = await schema.validateAsync(req.body);
|
||||
@ -106,6 +107,7 @@ export class ServiceController {
|
||||
service.name = param.name;
|
||||
service.serviceType = serviceType;
|
||||
service.rooms = rooms;
|
||||
service.status = param.status;
|
||||
service.created_by = req.auth.data.name;
|
||||
service.updated_by = req.auth.data.name;
|
||||
await queryRunner.manager.save(service);
|
||||
@ -170,6 +172,7 @@ export class ServiceController {
|
||||
name: Joi.string().max(256).required().label("Name"),
|
||||
service_type_id: Joi.string().uuid().required().label("Service Type ID"),
|
||||
room_ids: Joi.array().items(Joi.string().uuid()).optional().label("Room IDs"),
|
||||
status: Joi.string().required().label("Status"),
|
||||
});
|
||||
|
||||
let param: any = await schema.validateAsync(req.body);
|
||||
@ -193,6 +196,7 @@ export class ServiceController {
|
||||
service.name = param.name;
|
||||
service.serviceType = serviceType;
|
||||
service.rooms = rooms;
|
||||
service.status = param.status;
|
||||
service.updated_by = req.auth.data.name;
|
||||
await queryRunner.manager.save(service);
|
||||
|
||||
|
||||
@ -9,8 +9,9 @@ export class ServiceModel {
|
||||
let whereAttr: string[] = [];
|
||||
let whereVal: any = {};
|
||||
if (filter && Object.keys(filter).length > 0) {
|
||||
whereAttr = [...whereAttr, ...CommonHelper.handleQueryFilter(filter).whereAttr];
|
||||
whereVal = { ...whereVal, ...CommonHelper.handleQueryFilter(filter).whereVal };
|
||||
const filterResult = CommonHelper.handleQueryFilter(filter, "Service");
|
||||
whereAttr = [...whereAttr, ...filterResult.whereAttr];
|
||||
whereVal = { ...whereVal, ...filterResult.whereVal };
|
||||
}
|
||||
|
||||
var query = repo.createQueryBuilder("Service");
|
||||
|
||||
@ -123,7 +123,8 @@ const doc = {
|
||||
service: {
|
||||
$name: "e.g. ER Registration",
|
||||
$service_type_id: "uuid-string",
|
||||
$room_ids: ["uuid-string"]
|
||||
$room_ids: ["uuid-string"],
|
||||
$status: { "@enum": ["Y", "N"] }
|
||||
},
|
||||
servicetodepart: {
|
||||
$room_ids: ["uuid-string"]
|
||||
|
||||
Reference in New Issue
Block a user