From 85c4d8366b65c4592e39cf8609ffcd9b9dd01c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fagundes?= Date: Fri, 7 Jun 2024 12:03:14 -0300 Subject: [PATCH] fix: shelter decay time and visible donation fields --- src/donation-order/donation-order.service.ts | 25 +------------------- src/shelter/shelter.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/donation-order/donation-order.service.ts b/src/donation-order/donation-order.service.ts index 73f93a4..6be7542 100644 --- a/src/donation-order/donation-order.service.ts +++ b/src/donation-order/donation-order.service.ts @@ -87,30 +87,7 @@ export class DonationOrderService { async show(id: string, userId: string) { const data = await this.prismaService.donationOrder.findUnique({ where: { id, userId }, - select: { - id: true, - status: true, - userId: true, - shelter: { - select: { - id: true, - name: true, - }, - }, - donationOrderSupplies: { - select: { - quantity: true, - supply: { - select: { - name: true, - measure: true, - }, - }, - }, - }, - createdAt: true, - updatedAt: true, - }, + select: this.donationOrderVisibleFields, }); return data; } diff --git a/src/shelter/shelter.service.ts b/src/shelter/shelter.service.ts index 757acdb..9aee0f0 100644 --- a/src/shelter/shelter.service.ts +++ b/src/shelter/shelter.service.ts @@ -316,7 +316,7 @@ export class ShelterService implements OnModuleInit { shelterSupplies .map(this.parseShelterSupply) .filter((f) => - this.canDecayShelterSupply(f, [SupplyPriority.Urgent], 12), + this.canDecayShelterSupply(f, [SupplyPriority.Urgent], 48), ), SupplyPriority.Needing, @@ -329,7 +329,7 @@ export class ShelterService implements OnModuleInit { this.canDecayShelterSupply( f, [SupplyPriority.Needing, SupplyPriority.Remaining], - 48, + 72, ), ), SupplyPriority.UnderControl,