enable public report

This commit is contained in:
Julian Krauser 2025-07-16 12:24:50 +02:00
parent 8f563d1058
commit 41c3093754
21 changed files with 307 additions and 19 deletions

View file

@ -58,6 +58,26 @@ export default abstract class EquipmentService {
});
}
/**
* @description get equipment by code
* @returns {Promise<Array<equipment>>}
*/
static async getAllByCode(code: string): Promise<Array<equipment>> {
return await dataSource
.getRepository(equipment)
.createQueryBuilder("equipment")
.leftJoinAndSelect("equipment.equipmentType", "equipmenttype")
.where({ code: Like(`%${code}%`) })
.orderBy("name", "ASC")
.getMany()
.then((res) => {
return res;
})
.catch((err) => {
throw new DatabaseActionException("SELECT", "equipment", err);
});
}
/**
* @description get equipment by id
* @returns {Promise<equipment>}