Skip to content

[SSF-212] Filter for approved pantry & FM Backend#182

Open
jiang-h-y wants to merge 23 commits into
mainfrom
hj/SSF-212-filter-approved-pantry-FM
Open

[SSF-212] Filter for approved pantry & FM Backend#182
jiang-h-y wants to merge 23 commits into
mainfrom
hj/SSF-212-filter-approved-pantry-FM

Conversation

@jiang-h-y
Copy link
Copy Markdown

@jiang-h-y jiang-h-y commented May 24, 2026

ℹ️ Issue

Closes SSF-212

📝 Description

  • Ensured that backend queries filtered for approved pantries at FMs at applicable call sites

✔️ Verification

  • Added tests for each modified query

🏕️ (Optional) Future Work / Notes

  • No already-existing tests for updateFoodManufacturerApplication in apps/backend/src/foodManufacturers/manufacturers.service.spec.ts
  • ThrewBadRequestException or ConflictException for non-approved pantries/FMs based on neighboring code
  • Got approval to branch off of SSF-213 to avoid tricky merge conflicts

jiang-h-y added 23 commits May 20, 2026 10:19
Copy link
Copy Markdown

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some very small things, looks great though!

@InjectRepository(Pantry) private pantryRepo: Repository<Pantry>,
@InjectRepository(Donation) private donationRepo: Repository<Donation>,
@InjectRepository(DonationItem)
private donationItemRepo: Repository<DonationItem>,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we delete this since it's no longer used?

);
}

if (pantry.status !== ApplicationStatus.APPROVED) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this one. Technically speaking, assuming we are doing proper checks for creating requests and orders, we should never have an unapproved pantry attached to request

throw new NotFoundException(`Order ${orderId} not found`);
}

if (order.request.pantry.status !== ApplicationStatus.APPROVED) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

throw new NotFoundException(`Order ${orderId} not found`);
}

if (order.foodManufacturer.status !== ApplicationStatus.APPROVED) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@dburkhart07 dburkhart07 self-assigned this May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants