Skip to content

feat: purchase orders + tasks APIs, restocking, and dashboard fixes#162

Open
adrien-monte wants to merge 2 commits into
beck-source:mainfrom
adrien-monte:feat/po-tasks-restocking-and-dashboard-fixes
Open

feat: purchase orders + tasks APIs, restocking, and dashboard fixes#162
adrien-monte wants to merge 2 commits into
beck-source:mainfrom
adrien-monte:feat/po-tasks-restocking-and-dashboard-fixes

Conversation

@adrien-monte

Copy link
Copy Markdown

Summary

Implements the Tasks and Purchase Orders features end-to-end, adds the Restocking view, and fixes 5 issues surfaced during Playwright testing of the app.

Backend (server/main.py)

  • Tasks APIGET/POST/PATCH/DELETE /api/tasks backed by an in-memory store with string task-N ids (so they never collide with the frontend mock task ids). Fixes the /api/tasks 404 fired on every page load.
  • Purchase Orders APIPOST /api/purchase-orders and GET /api/purchase-orders/{backlog_item_id}.
  • BacklogItem.purchase_order_id is now populated in get_backlog() so the dashboard Create/View PO button state persists across reloads.
  • Restocking endpoints and models.

Frontend

  • PurchaseOrderModal.vue (create + view modes), imported and registered in Dashboard.vue → resolves the Failed to resolve component: PurchaseOrderModal warning. Matches the existing slate modal design system.
  • New Restocking view.
  • Demand — remove the doubled + on increasing-demand cards (++50.0%+50.0%).
  • Reports — remove ~13 leftover debug console.* statements that fired on every render.
  • index.html — inline SVG favicon → fixes the /favicon.ico 404.
  • Tasks UI wiring, en/ja locales, dashboard/orders updates.

Tests

  • tests/backend/test_tasks_and_purchase_orders.py (15 tests). Full backend suite: 55 passing.

Verification

  • Backend: 55/55 pytest passing.
  • UI (Playwright): dashboard console clean (0 errors / 0 warnings); the Create PO flow creates PO-0001 end-to-end (order total $4,375.00).

Note: per request, this branch bundles the entire current working tree, which includes concurrent work on this app (Restocking view, docs/architecture.html, locales) alongside the bug-fix/feature work above.

🤖 Generated with Claude Code

Adrien Monte and others added 2 commits June 23, 2026 11:17
Backend (server/main.py)
- Tasks API: GET/POST/PATCH/DELETE /api/tasks backed by an in-memory store
  with string ids ("task-N") so they never collide with the frontend mock
  task ids; fixes the /api/tasks 404 on every page load.
- Purchase Orders API: POST /api/purchase-orders and
  GET /api/purchase-orders/{backlog_item_id}.
- Add purchase_order_id to BacklogItem and populate it in get_backlog() so the
  dashboard Create/View PO button state persists across reloads.
- Restocking endpoints and models.

Frontend
- New PurchaseOrderModal.vue (create + view modes), imported and registered in
  Dashboard; resolves the "Failed to resolve component: PurchaseOrderModal" warning.
- New Restocking view.
- Fix doubled "+" on increasing-demand cards (Demand.vue).
- Remove leftover debug console.* statements (Reports.vue).
- Add inline SVG favicon (index.html); fixes /favicon.ico 404.
- Tasks UI wiring, en/ja locales, dashboard/orders updates.

Tests
- tests/backend/test_tasks_and_purchase_orders.py (15 tests). Full backend
  suite: 55 passing.

Docs
- docs/architecture.html system-architecture page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rewrites the Reports page to match the rest of the app:
- i18n: all strings via t() with new reports.* keys (en/ja) + nav.reports;
  App.vue nav label now uses t('nav.reports'); month labels localized.
- Global filters: Reports reads useFilters, passes them to the API, and reloads
  on change. Backend get_quarterly_reports / get_monthly_trends now accept
  warehouse/category/status/month and mirror /api/orders filtering.
- Currency: use formatCurrency(amount, currentCurrency) (USD/JPY + conversion)
  instead of a hand-rolled USD-only formatter that crashed on undefined.
- Composition API (<script setup>) instead of Options API.
- Centralized api.js calls (getQuarterlyReports/getMonthlyTrends) instead of
  direct axios + hardcoded URLs.
- Unique v-for keys; maxRevenue as a computed (was recomputed O(n^2) per render).
- Drop divergent local styles (.card/.stat-card/.badge/.loading/.error) in favor
  of the global system; bar chart uses the app accent #2563eb (no gradient);
  add an empty/no-data state; reduce-motion safe.

The debug console.* statements were already removed in the earlier commit.

Backend suite: 55 passing. Filtering verified via the API (e.g. quarterly
totals drop from 62/64/62/62 to London 20/18/28/24).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant