How laakmus/planning works
Planning is an internal transport-order planning and warehouse-reporting web application. The principal workflow is planner authentication, order-list browsing, opening and editing an order (including route stops), then saving changes or changing status; users can also generate order PDFs and prepare email drafts. Separate branches cover weekly warehouse operations and reports, administration, and ERP dictionary synchronization. The README documents these capabilities; sampled source confirms selected client/API, authentication, order-update, and PDF behavior, but not every route-to-service connection.
Main entry points: api-client.ts HTTP client · useOrderDrawer.ts Order editor · OrdersPage.tsx Order list · useOrderActions.ts Order actions
Components 30
Order planning
- Orders workspace
src/components/orders/OrdersApp.tsx - Order list
src/components/orders/OrdersPage.tsx - Order actions
src/hooks/useOrderActions.ts - Order editor
src/hooks/useOrderDrawer.ts - Route editor
src/components/orders/drawer/RouteSection.tsx - Order history
src/components/orders/history/HistoryPanel.tsx - Order PDF
src/lib/services/pdf/pdf-generator.service.ts
Warehouse reporting
- Warehouse workspace
src/components/warehouse/WarehouseApp.tsx - Weekly operations
src/hooks/useWarehouseWeek.ts - Report actions
src/components/warehouse/ReportActions.tsx - Warehouse PDF
src/lib/services/pdf/warehouse-pdf-generator.service.ts
Identity and admin
- Login
src/components/auth/LoginCard.tsx - Auth context
src/contexts/AuthContext.tsx - User administration
src/components/admin/AdminUsersApp.tsx - Admin API
src/pages/api/v1/admin/users/index.ts
Integrations
- Dictionary sync
src/hooks/useDictionarySync.ts - Dictionary API
src/pages/api/v1/dictionary-sync/run.ts
API and services
- HTTP client
src/lib/api-client.ts - Orders API
src/pages/api/v1/orders/index.ts - Order detail API
src/pages/api/v1/orders/[orderId]/index.ts - Warehouse API
src/pages/api/v1/warehouse/orders.ts - Auth API
src/pages/api/v1/auth/me.ts - Auth service
src/lib/services/auth.service.ts - Order update service
src/lib/services/order-update.service.ts - Warehouse service
src/lib/services/warehouse.service.ts - PostgreSQL / Supabase
src/db/supabase.client.ts - Email preparation
src/pages/api/v1/orders/[orderId]/prepare-email.ts
Other components
- Planner
- Company ERP
- Microsoft Graph
Connections 34
- Planner → Login: signs in
- Planner → Orders workspace: plans orders
- Orders workspace → Order list: shows list
- Order list → Order actions: dispatches actions
- Order list → Order editor: opens order
- Order editor → Route editor: edits stops
- Order actions → HTTP client: sends requests
- Order editor → HTTP client: loads and saves
- HTTP client → Orders API: requests list
- HTTP client → Order detail API: requests detail
- Order detail API → Order update service: updates order
- Order update service → PostgreSQL / Supabase: reads and writes
- Order actions → Order history: opens history
- Order editor → Order PDF: requests PDF
- Order editor → Email preparation: prepares email
- Planner → Warehouse workspace: reviews operations
- Warehouse workspace → Weekly operations: loads week
- Warehouse workspace → Report actions: requests report
- Weekly operations → HTTP client: fetches operations
- HTTP client → Warehouse API: requests week
- Warehouse API → Warehouse service: serves operations
- Warehouse service → PostgreSQL / Supabase: reads data
- Report actions → Warehouse PDF: generates report
- Login → HTTP client: submits credentials
- Auth context → HTTP client: checks session
- HTTP client → Auth API: requests identity
- Auth API → Auth service: gets current user
- Auth service → PostgreSQL / Supabase: checks session and profile
- Planner → User administration: manages users
- User administration → Admin API: sends requests
- Dictionary sync → HTTP client: starts sync
- HTTP client → Dictionary API: starts job
- Dictionary API → Company ERP: synchronizes dictionaries
- Email preparation → Microsoft Graph: uses Graph option