Repository navigation
Conversation
…API (Delivery-Plus0#217) - order_status_history: one append-only row per transition, written in the same transaction as every status compare-and-set (and the creation row with the order); actorType CUSTOMER/RESTAURANT/DRIVER/SYSTEM/STAFF with the person behind it, and the reason when one was given. No backfill for orders before this ships. - GET /admin/orders/:id: the full staff view (items, fee split, drop-off snapshot, payment line), support.read - GET /admin/orders/:id/timeline: one merged, time-sorted list of the order history plus payment-, delivery- and notification-service slices over new internal SYSTEM routes (ADR 001); a source that doesn't answer is listed as unavailable, never made up. Internal notes arrive with Delivery-Plus0#219. Closes Delivery-Plus0#217
…tion on Windows) The Trivy image scan blocks every service image on the critical cross-spawn advisory; an override in the root package.json moves the lockfile to the fixed release. Build-only transitive dependency; no runtime behaviour change.
…relation mapped a second orderId column and broke inserts in the e2e seed The entity had both a @manytoone(() => Order) relation and an explicit orderId column; TypeORM mapped orderId twice, so every INSERT listed the column twice and failed with 'column "orderId" of relation "order_status_history" specified more than once'. The history is never loaded through an Order, so the FK lives in the migration only.
…urce The e2e stack boots the app through AppModule's forRoot, which still listed only [Order, OrderItem] — every history insert failed with EntityMetadataNotFoundError in the Integration workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #217: the order's status history and the staff Order 360 timeline API.
Related issue
Closes #217
Changes made
order-service
order_status_history(migration 009, entity): one append-only row per transition —orderId, from, to, actorType (CUSTOMER/RESTAURANT/DRIVER/SYSTEM/STAFF), actorId, reason, at— written in the same transaction as every status compare-and-set inorders.repository.ts(and the creation row increate), so every applied transition leaves exactly one row. Only the CAS winner writes. Backfill is not possible; documented in the migration and indocs/services/order-service.md.GET /admin/orders/:id(support.read): the full staff view — items and prices, the fee split, the drop-off snapshot, the payment line, without the internal fee-split columns.GET /admin/orders/:id/timeline(support.read): one merged, time-sorted list of{at, source, type, actor, details}from the order history plus three new internal slices. A source that doesn't answer is reported inunavailable, never made up. Internal notes (STAFF_NOTE) arrive with feat: support actions (cancel, refund, re-dispatch, internal notes) #219.historyActorFor): JWT role → actor type; SYSTEM callers carry no person (sub is a service identity); STAFF keeps the admin's id.payment-service —
GET /internal/payments/orders/:orderId/timeline(SYSTEM, caller-checked): every payment attempt with its outcome, and the refund with who asked.delivery-service —
GET /internal/deliveries/orders/:orderId/timeline(SYSTEM): created / assigned (with driver) / picked up / completed / cancelled from the compare-and-set timestamps.notification-service —
GET /internal/notifications/orders/:orderId/timeline(SYSTEM): the stage notifications as types and times only (matched onparams.orderId); no message bodies in staff views.Contract & docs — admin OpenAPI routes added and regenerated (
docs/openapi/admin.json);docs/services/{order,payment,delivery,notification}-service.md, env vars (PAYMENT_SERVICE_URL,DELIVERY_SERVICE_URL,NOTIFICATION_SERVICE_URL) and.project-context/16-current-state.mdupdated in the same PR.Testing performed
npm run verify(lint + all workspace tests + build) passes; 743 tests green.Breaking changes
None. Additive migration (009), additive admin routes, additive internal routes.
Documentation changes
Listed above; all in this PR.
Checklist