feat: purchase orders + tasks APIs, restocking, and dashboard fixes#162
Open
adrien-monte wants to merge 2 commits into
Open
feat: purchase orders + tasks APIs, restocking, and dashboard fixes#162adrien-monte wants to merge 2 commits into
adrien-monte wants to merge 2 commits into
Conversation
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>
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 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)GET/POST/PATCH/DELETE /api/tasksbacked by an in-memory store with stringtask-Nids (so they never collide with the frontend mock task ids). Fixes the/api/tasks404 fired on every page load.POST /api/purchase-ordersandGET /api/purchase-orders/{backlog_item_id}.BacklogItem.purchase_order_idis now populated inget_backlog()so the dashboard Create/View PO button state persists across reloads.Frontend
PurchaseOrderModal.vue(create + view modes), imported and registered inDashboard.vue→ resolves theFailed to resolve component: PurchaseOrderModalwarning. Matches the existing slate modal design system.+on increasing-demand cards (++50.0%→+50.0%).console.*statements that fired on every render.index.html— inline SVG favicon → fixes the/favicon.ico404.en/jalocales, dashboard/orders updates.Tests
tests/backend/test_tasks_and_purchase_orders.py(15 tests). Full backend suite: 55 passing.Verification
PO-0001end-to-end (order total$4,375.00).🤖 Generated with Claude Code