Order search was case-sensitive, so uppercase searches such as JOHN did not return orders for customers such as John Smith. This caused valid orders to be missing depending on how staff entered the search query.
Assignment: Assignment 1 — case-insensitive order search
What changed
Normalized the incoming order search query to lowercase after trimming whitespace.
Normalized order number, customer name, and customer email during database search comparisons.
Kept the change scoped to the existing order repository search logic.
How to test
List exact commands and manual checks.
bun run check
bun run test
bun run build:web
Manual checks:
Logged in as an employee and searched JOHN, john, and John. John Smith's orders appeared for all three searches.
Cleared the search query and verified that the full order list returned.
Screenshots or recordings
N/A — no UI change.
Risks / follow-ups
bun run check reports an existing TypeScript error in order-search-assignment-1.test.ts where string | undefined is assigned to employeeCookie. This PR does not modify that test file.
SQLite lower() is used for the searchable database fields, so this change is focused on the existing order search behavior without changing the frontend or API route structure.
PR checklist
change is scoped to one ticket or one small reviewable concern
acceptance criteria were checked
code follows CONTRIBUTING.md
no unrelated refactor is mixed in
debug code and temporary logs are removed
relevant automated checks were run locally
changed behavior was manually tested when needed
known risks or follow-ups are called out
## Summary
Order search was case-sensitive, so uppercase searches such as `JOHN` did not return orders for customers such as John Smith. This caused valid orders to be missing depending on how staff entered the search query.
## Ticket / Assignment
- Ticket: #1
- Assignment: Assignment 1 — case-insensitive order search
## What changed
- Normalized the incoming order search query to lowercase after trimming whitespace.
- Normalized order number, customer name, and customer email during database search comparisons.
- Kept the change scoped to the existing order repository search logic.
## How to test
List exact commands and manual checks.
```bash
bun run check
bun run test
bun run build:web
```
Manual checks:
- Logged in as an employee and searched JOHN, john, and John. John Smith's orders appeared for all three searches.
- Cleared the search query and verified that the full order list returned.
## Screenshots or recordings
N/A — no UI change.
## Risks / follow-ups
- bun run check reports an existing TypeScript error in order-search-assignment-1.test.ts where string | undefined is assigned to employeeCookie. This PR does not modify that test file.
- SQLite lower() is used for the searchable database fields, so this change is focused on the existing order search behavior without changing the frontend or API route structure.
## PR checklist
- [x] change is scoped to one ticket or one small reviewable concern
- [x] acceptance criteria were checked
- [x] code follows `CONTRIBUTING.md`
- [x] no unrelated refactor is mixed in
- [x] debug code and temporary logs are removed
- [x] relevant automated checks were run locally
- [x] changed behavior was manually tested when needed
- [x] known risks or follow-ups are called out
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Order search was case-sensitive, so uppercase searches such as
JOHNdid not return orders for customers such as John Smith. This caused valid orders to be missing depending on how staff entered the search query.Ticket / Assignment
What changed
How to test
List exact commands and manual checks.
Manual checks:
Screenshots or recordings
N/A — no UI change.
Risks / follow-ups
PR checklist
CONTRIBUTING.mdCode is good. Summary should be about the PR, not the ticket. Otherwise, good job on getting the assignment test to pass.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.