2.2 KiB
2.2 KiB
Clients View & NavRail Reorganization Design
Goal: Add a Clients management view and reorder the NavRail into a logical workflow.
NavRail Reorder
Current: Dashboard, Timer, Projects, Entries, Reports, Invoices, Settings
New order (workflow flow):
- Dashboard (
LayoutDashboard) — Overview - Timer (
Clock) — Primary action - Clients (
Users) — NEW — Set up clients first - Projects (
FolderKanban) — Projects belong to clients - Entries (
List) — Time entries belong to projects - Invoices (
FileText) — Bill clients for entries - Reports (
BarChart3) — Analytics across everything - Settings (
Settings) — Utility, always last
Files: src/components/NavRail.vue, src/router/index.ts
Clients View
Layout
- Header: "Clients" title + "+ Add" button (top right)
- Card grid: 1-3 columns responsive (same as Projects.vue)
- Each card: name (bold), company subtitle (if set), email (tertiary)
- Hover reveals edit/delete icons (same pattern as Projects)
- Empty state:
Usersicon + "No clients yet" + "Create Client" CTA
Create/Edit Dialog
Two sections in the form:
Contact Info:
- Name (text, required)
- Email (text, optional)
- Phone (text, optional)
- Address (textarea, optional)
Billing Details (collapsible section — collapsed on create, open if data exists on edit):
- Company (text) — Business name for invoice header
- Tax ID (text) — VAT/Tax number shown on invoices
- Payment Terms (text) — e.g. "Net 30", "Due on receipt"
- Notes (textarea) — Internal notes
Delete Confirmation
Same pattern as Projects — "Delete Client" with warning text.
Backend Changes
Database Migration
Add columns to clients table via ALTER TABLE ADD COLUMN statements in init_db:
company TEXTphone TEXTtax_id TEXTpayment_terms TEXTnotes TEXT
Rust Changes
- Expand
Clientstruct with new fields (allOption<String>) - Update
get_clientsSELECT to include new columns - Update
create_clientINSERT to include new columns - Update
update_clientUPDATE to include new columns - Update
export_dataclient query to include new columns
Store Changes
- Expand
Clientinterface insrc/stores/clients.tswith new optional fields