Allow Operations employees to attach internal notes to orders so teammates can retain context for follow-up work.
Ticket / Assignment
Ticket: Assignment 2
What changed
Added persistent order notes with session-derived authorship, timestamps, and readable author names.
Added an employee-only creation endpoint with non-empty validation and a maximum length of 1,999 characters.
Included notes in order details, newest first.
Added a notes panel with a composer, pending/error states, and long-text wrapping.
Added API tests for persistence, author resolution, access control, validation, ordering, and order isolation.
How to test
List exact commands and manual checks.
bun run test
bun run build:web
Manual checks:
Notes can be added and persist after reload.
Author names are readable.
Long note text wraps correctly.
Screenshots or recordings
Risks / follow-ups
bun run check: fails on the pre-existing error at order-search-assignment-1.test.ts:28, unrelated to this change.
Resolve the pre-existing typecheck error.
bun run test: all notes-related tests pass. The case-insensitive search test fails; its fix is on a separate branch pending merge.
Merge the separate search fix and rerun the suite.
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
Allow Operations employees to attach internal notes to orders so teammates can retain context for follow-up work.
## Ticket / Assignment
- Ticket: Assignment 2
## What changed
- Added persistent order notes with session-derived authorship, timestamps, and readable author names.
- Added an employee-only creation endpoint with non-empty validation and a maximum length of 1,999 characters.
- Included notes in order details, newest first.
- Added a notes panel with a composer, pending/error states, and long-text wrapping.
- Added API tests for persistence, author resolution, access control, validation, ordering, and order isolation.
## How to test
List exact commands and manual checks.
```bash
bun run test
bun run build:web
```
Manual checks:
- Notes can be added and persist after reload.
- Author names are readable.
- Long note text wraps correctly.
## Screenshots or recordings
<img width="1061" alt="image.png" src="attachments/1239551e-9335-4f5d-b39c-bb6c0ef64ee0">
## Risks / follow-ups
- bun run check: fails on the pre-existing error at order-search-assignment-1.test.ts:28, unrelated to this change.
- Resolve the pre-existing typecheck error.
- bun run test: all notes-related tests pass. The case-insensitive search test fails; its fix is on a separate branch pending merge.
- Merge the separate search fix and rerun the suite.
## 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
While a separate table has it's upsides for auditing, I think that the scope of the notes that was wanted by the ticket is simple enough to add it onto the orders table, instead of creating a new table for the notes specifically.
While a separate table has it's upsides for auditing, I think that the scope of the notes that was wanted by the ticket is simple enough to add it onto the orders table, instead of creating a new table for the notes specifically.
PR descriptions are good, should hyperlink the ticket for the reviewer next time. it's fine that assignment 1 is failing. Good job on getting the tests for 2 to pass.
PR descriptions are good, should hyperlink the ticket for the reviewer next time. it's fine that assignment 1 is failing. Good job on getting the tests for 2 to pass.
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
Allow Operations employees to attach internal notes to orders so teammates can retain context for follow-up work.
Ticket / Assignment
What changed
How to test
List exact commands and manual checks.
Manual checks:
Screenshots or recordings
Risks / follow-ups
bun run check: fails on the pre-existing error at order-search-assignment-1.test.ts:28, unrelated to this change.
Resolve the pre-existing typecheck error.
bun run test: all notes-related tests pass. The case-insensitive search test fails; its fix is on a separate branch pending merge.
Merge the separate search fix and rerun the suite.
PR checklist
@@ -102,6 +103,14 @@ export function initializeDatabase(sqlite: Database) {unit_price_cents INTEGER NOT NULL);CREATE TABLE IF NOT EXISTS order_notes (While a separate table has it's upsides for auditing, I think that the scope of the notes that was wanted by the ticket is simple enough to add it onto the orders table, instead of creating a new table for the notes specifically.
@@ -0,0 +9,4 @@body: string;}) {if (!input.body.trim() || input.body.length >= 2000) {It would be better to not hard code values here.
@@ -0,0 +62,4 @@<textareaclassName="w-full rounded-lg border border-slate-300 px-3 py-2 disabled:opacity-50"rows={4}maxLength={1999}It would be better to not hard code values here.
PR descriptions are good, should hyperlink the ticket for the reviewer next time. it's fine that assignment 1 is failing. Good job on getting the tests for 2 to pass.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.