update : detail for registration fee
This commit is contained in:
@ -14,12 +14,32 @@ const log: Logger<ILogObj> = new Logger({
|
|||||||
type: "pretty",
|
type: "pretty",
|
||||||
});
|
});
|
||||||
|
|
||||||
const RegistrationFeeCreateAndUpdateSchema = {
|
const RegistrationFeeCreateAndUpdateSchema = {
|
||||||
service: Joi.array().items(Joi.string()).optional().label("Service"),
|
service: Joi.array().items(Joi.string()).optional().label("Service"),
|
||||||
type: Joi.string().valid("emergency", "outpatient").required().label("Type"),
|
type: Joi.string().valid("emergency", "outpatient").required().label("Type"),
|
||||||
};
|
};
|
||||||
|
|
||||||
export class RegistrationFeeController {
|
export class RegistrationFeeController {
|
||||||
|
static async detail(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
|
||||||
|
/*
|
||||||
|
#swagger.tags = ['Registration Fee']
|
||||||
|
#swagger.security = [{ "bearerAuth": [] }]
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
const result = await OrmHelper.DB.getRepository(RegistrationFee)
|
||||||
|
.createQueryBuilder("RegistrationFee")
|
||||||
|
.getMany();
|
||||||
|
|
||||||
|
if (!result || result.length === 0) throw { message: "Registration Fee " + Language.lang.failed_not_found };
|
||||||
|
|
||||||
|
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_view, result);
|
||||||
|
} catch (e: unknown) {
|
||||||
|
log.error(e);
|
||||||
|
const err = e as Error;
|
||||||
|
return ReturnHelper.errorResponse(res, 400, 401, Language.lang.failed_not_found, err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['Registration Fee']
|
#swagger.tags = ['Registration Fee']
|
||||||
|
|||||||
@ -478,6 +478,7 @@ export class RoutePrivate {
|
|||||||
app.delete('/api/payment-method/delete/:id/:hard', PaymentMethodController.delete)
|
app.delete('/api/payment-method/delete/:id/:hard', PaymentMethodController.delete)
|
||||||
app.put('/api/payment-method/restore/:id', PaymentMethodController.restore)
|
app.put('/api/payment-method/restore/:id', PaymentMethodController.restore)
|
||||||
|
|
||||||
|
app.get('/api/registration-fee/detail', RegistrationFeeController.detail)
|
||||||
app.post('/api/registration-fee/create', RegistrationFeeController.create)
|
app.post('/api/registration-fee/create', RegistrationFeeController.create)
|
||||||
app.put('/api/registration-fee/update/:id', RegistrationFeeController.update)
|
app.put('/api/registration-fee/update/:id', RegistrationFeeController.update)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user