feat: add get warranty detail

This commit is contained in:
morteza-mortezai
2025-09-28 11:32:16 +03:30
parent 521533dd04
commit 9155bcc762
2 changed files with 19 additions and 0 deletions
+9
View File
@@ -61,6 +61,15 @@ class WarrantyService {
async getPendingWarranties() {
return await this.warrantyRepo.pendingWarranties();
}
async getWarranty(id: number) {
const warranty = await this.warrantyRepo.model.findById(id);
if (!warranty) throw new BadRequestError(CommonMessage.NotValidId);
return {
warranty,
};
}
}
export { WarrantyService };