Skip to content

Overdue inbound dashboard card (spec-driven UI feature) - #7

Open
matthewguerra-cog wants to merge 3 commits into
spec-driven-developmentfrom
devin/1787585427-overdue-inbound-card
Open

matthewguerra-cog wants to merge 3 commits into
spec-driven-developmentfrom
devin/1787585427-overdue-inbound-card

Conversation

@matthewguerra-cog

@matthewguerra-cog matthewguerra-cog commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

✨ Description of Change

Link to GitHub issue or Jira ticket: spec at docs/demo/ui-spec-prompt.md on spec-driven-development

Description:

Adds an "Overdue inbound" card to the warehouse dashboard, backed by the existing GET /api/shipments/exceptions/overdue data path (ShipmentExceptionService.getOverdueInboundShipments) — no new backend query, no schema change.

  • IndicatorDataService.getOverdueInbound(location): cached indicator (@Cacheable dashboardCache, like the sibling widgets) that calls the existing service with fixed defaults (minDaysLate=1, sort=daysLate desc, 10 rows) and maps rows to the dashboard table wire shape: GraphData(Table("Shipment", "Origin", "Days late", [TableData(shipmentNumber, origin.name, "1 day"/"N days", link -> /stockMovement/show/<id>)]))
  • DashboardApiController.getOverdueInbound: thin action taking only locationId (400 when missing/unknown), rendering the indicator as JSON
  • New URL mapping /api/dashboard/overdueInbound
  • Widget declared in openboxes.dashboardConfig (graphType = "table", modeled on discrepancy) and added to every dashboard section that includes delayedShipments
  • New i18n keys react.dashboard.overdueInbound.title.label / .info.label

No frontend changes needed — GraphCard already renders graphType "table" via TableCard, so the card participates in drag-to-reorder and per-user layout persistence like every other widget.


📷 Screenshots & Recordings (optional)

UI test recording to follow.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/c143e35b65c14c1390e288061142674f
Requested by: @matthewguerra-cog


Devin Review

Status Commit
🟢 Reviewed 9874b9b
Devin Review (Staging)

Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

staging-devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

…bound card

Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
devin-ai-integration[bot]

This comment was marked as resolved.

…arams

Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

@devin-ai-integration

Copy link
Copy Markdown

Runtime UI test — "Overdue inbound" dashboard card ✅

Tested locally at commit 9874b9b80 (MariaDB + npm run bundle, app restarted after the latest commits so the cached IndicatorDataService.getOverdueInbound, "1 day" pluralization, and locationId validation are all included). App startup succeeded, which also served as the compile check for the new controller/service code.

Seed data on Central Warehouse (NYC): OVD-A (5 days late), OVD-B (1 day late), plus OVD-C (overdue but RECEIVED — negative control).

Card renders with correct columns, rows, sort, and pluralization
  • ✅ Card titled "Overdue inbound" (i18n resolved, not a raw key)
  • ✅ Columns: Shipment / Origin / Days late
  • ✅ OVD-A / Toyota USA / 5 days above OVD-B / Amazon.com / 1 day → most-overdue-first sort and correct singular/plural
  • ✅ Received shipment OVD-C excluded

Overdue inbound card

Dashboard with card

Info tooltip

✅ "Inbound shipments past their expected delivery date that have not been received"

Tooltip

Row click → stock movement page

✅ Clicking the OVD-A row opens /openboxes/stockMovement/show/seed-ship-late5 (status Shipped, destination Central Warehouse (NYC)) — no 404/500.

Stock movement detail

Empty state (Boston Warehouse) + Warehouse Management section

✅ Boston Warehouse: card present with all 3 headers, zero rows, no error/retry card, no console errors.
✅ The widget also appears in the Warehouse Management dashboard section per runtime.groovy.

Empty state

Warehouse Management section

API sanity — GET /api/dashboard/overdueInbound?locationId=…
{"data":{"number":"Shipment","name":"Origin","value":"Days late","body":[
 {"number":"OVD-A","name":"Toyota USA","value":"5 days","link":"/openboxes/stockMovement/show/seed-ship-late5"},
 {"number":"OVD-B","name":"Amazon.com","value":"1 day","link":"/openboxes/stockMovement/show/seed-ship-late1"}]},"link":null}

✅ Missing/unknown locationId → HTTP 400 with {"errorCode":400,"errorMessage":"Validation error. A warehouse must be selected…"} for AJAX requests (the path the dashboard JS uses).

⚠️ Note: for a non-AJAX request (no X-Requested-With header) the same validation failure yields 302 → /openboxes/errors/showError rather than a 400, because ErrorsController.handleValidationErrors only renders JSON 400 for AJAX. Pre-existing framework behavior, not introduced here.

Recording preview (full recording attached in the Devin session):

recording preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant