add:internal order notes #10

Open
cq0622 wants to merge 1 commits from order-internal-notes into master
Collaborator

Summary

Adds employee-only internal notes to orders so staff can save follow-up context on the order record.

Ticket / Assignment

  • Ticket: Assignment 2 - Order internal notes

What changed

  • Added a persisted notes field to orders.
  • Added employee-only API support for saving notes with validation.
  • Added an Internal Notes section to the order detail page.

How to test

List exact commands and manual checks.

bun run test
bun run build:web

Manual checks:

  • Log in as an employee, edit and save an order note, then refresh and confirm it persists.
  • Confirm blank notes and notes over 1000 characters are rejected.

Screenshots or recordings

image.png

Risks / follow-ups

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 Adds employee-only internal notes to orders so staff can save follow-up context on the order record. ## Ticket / Assignment - Ticket: Assignment 2 - Order internal notes ## What changed - Added a persisted `notes` field to orders. - Added employee-only API support for saving notes with validation. - Added an Internal Notes section to the order detail page. ## How to test List exact commands and manual checks. ```bash bun run test bun run build:web ``` Manual checks: - Log in as an employee, edit and save an order note, then refresh and confirm it persists. - Confirm blank notes and notes over 1000 characters are rejected. ## Screenshots or recordings <img width="960" alt="image.png" src="attachments/ab66fe68-9b0e-4636-96c8-0a9365d723c7"> ## Risks / follow-ups - - ## 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
cq0622 added 1 commit 2026-09-21 10:22:50 +00:00
add:internal order notes
Runner Test / test (push) Successful in 17s
Runner Test / test (pull_request) Successful in 16s
2c3353db19
cq0622 requested review from derrick 2026-09-21 10:23:29 +00:00
@@ -4,2 +4,4 @@
import type { OrderStatus } from "./order-status";
// Shared so the API and the notes panel describe the same limit.
export const orderNotesMaxLength = 1000;
Owner

This is fine for sharing a simple value across frontend and backend. I think a better way to make it more explicit is to encapsulate it by relation, so make it so that you can use it like: orderConstraints.notes.maxLength or similar, this way we can also easily add any other constraints when needed.

This is fine for sharing a simple value across frontend and backend. I think a better way to make it more explicit is to encapsulate it by relation, so make it so that you can use it like: `orderConstraints.notes.maxLength` or similar, this way we can also easily add any other constraints when needed.
Owner

Everything looks fine, this should easily pass as a simple feature addition at most places. Good job.

Everything looks fine, this should easily pass as a simple feature addition at most places. Good job.
@@ -0,0 +35,4 @@
>
<label className="block text-sm text-slate-700">
<span className="mb-1 block">Notes</span>
<textarea
Owner

Should add a maxLength to the textarea for UX

Should add a `maxLength` to the textarea for UX
All checks were successful
Runner Test / test (push) Successful in 17s
Runner Test / test (pull_request) Successful in 16s
This pull request has changes conflicting with the target branch.
  • apps/api/src/db/init-db.ts
  • apps/api/src/db/schema/orders.ts
  • apps/api/src/orders/order-routes.ts
  • apps/web/src/orders/order-detail-page.tsx
  • apps/web/src/orders/order-page.tsx
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin order-internal-notes:order-internal-notes
git checkout order-internal-notes
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: derrick/ai-wave-02#10