Repository navigation
Conversation
Sellers adding Zelle/cash orders were saved under their own name and NetID. The manual order form now asks for the real buyer, stored as buyer_name/buyer_net_id on the order, and the seller orders table, filter, CSV export, and order detail page show them.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Emir icyer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Summary
When a seller used Add order for a Zelle or cash sale, the order was saved under the seller's own name and NetID, so the orders list (which clubs like Project Hope use as a mailing list) showed the admin instead of the real buyer. The manual order form now asks for the buyer's name and NetID, and the seller views show them.
Task: Add buyer name and NetID fields to manual orders (merged with "Add buyer NetID to manual orders", Oct 19)
Storage decision: the buyer is stored as free text on the order (
buyer_name,buyer_net_id).buyerIdstill points at the seller who entered it. Linking to aPendingUserwould mean makingOrder.buyerIdnullable, which ripples through emails, access checks, analytics, and the shared schemas. The trade-off: a manual order won't appear in the real buyer's account if they sign in later. The stored NetID makes that a straightforward follow-up if we want it.Changes
backend
buyer_nameandbuyer_net_idtoorders. Existing rows stayNULLand keep showing the account holder, so no backfill is needed.createOrdersaves the two fields.createOrderHandlerreturns 403 if a non-admin sends buyer details, so buyers can't put a different name on their own orders.common
CreateOrderBodyaccepts optionalbuyerNameandbuyerNetId. They must be sent together, and the NetID is trimmed, lowercased, and must look likeabc123.BasicOrderSchemaincludes the two fields.frontend
ManualOrderModal: a required "Buyer" section with Name and NetID. A pastedabc123@cornell.eduis accepted.lib/order-buyer.tshelper prefers the entered buyer and falls back to the account holder. It's used by the orders table name/NetID columns (and therefore the name/NetID filter), the CSV export, and the seller order detail page.<netid>@cornell.edu.Not in this PR: the order confirmation email for manual orders still goes to the seller. That's the separate "skip confirmation email for admin-created orders" ticket, which is still needed because orders aren't linked to the buyer's account.
How to test
pnpm assemble, thencd backend && pnpm migrate:dev.jd@xshows the NetID error.cd backend && pnpm testcovers saving the fields and the request validation.Screenshots
Orders table: the manual order shows the entered buyer instead of the admin.
Add order form: new Buyer section, filled in.
NetID validation:
Order detail page: Customer and Buyer Info use the entered buyer.