Skip to content

Commit

Permalink
fix: shelter decay time and visible donation fields (#191)
Browse files Browse the repository at this point in the history
- changed time of supplies decay
- normalized response fields of donation order in `show` function
  • Loading branch information
rhuam authored Jun 7, 2024
2 parents 3bfb5af + 85c4d83 commit f819495
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
25 changes: 1 addition & 24 deletions src/donation-order/donation-order.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/shelter/shelter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -329,7 +329,7 @@ export class ShelterService implements OnModuleInit {
this.canDecayShelterSupply(
f,
[SupplyPriority.Needing, SupplyPriority.Remaining],
48,
72,
),
),
SupplyPriority.UnderControl,
Expand Down

0 comments on commit f819495

Please sign in to comment.