feat(customers): add dashboard and customer management
This commit is contained in:
parent
694b7bd09a
commit
92cb8d1286
28 changed files with 2521 additions and 13 deletions
89
frontend/athena/types/customer.ts
Normal file
89
frontend/athena/types/customer.ts
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
export type CustomerStatus = "lead" | "active" | "inactive" | "blocked" | "archived";
|
||||
export type CustomerType = "company" | "private" | "public_sector" | "partner" | "supplier";
|
||||
export type AddressType = "billing" | "shipping" | "primary" | "other";
|
||||
|
||||
export interface CustomerAddress {
|
||||
id: number;
|
||||
customer_id: number;
|
||||
type: AddressType;
|
||||
street: string;
|
||||
postal_code: string;
|
||||
city: string;
|
||||
state: string;
|
||||
country: string;
|
||||
is_primary: boolean;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface CustomerContact {
|
||||
id: number;
|
||||
customer_id: number;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
position: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
mobile: string;
|
||||
is_primary: boolean;
|
||||
notes: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface Customer {
|
||||
id: number;
|
||||
customer_number: string;
|
||||
company_name: string;
|
||||
legal_name: string;
|
||||
customer_type: CustomerType;
|
||||
status: CustomerStatus;
|
||||
industry: string;
|
||||
website: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
tax_number: string;
|
||||
vat_id: string;
|
||||
notes: string;
|
||||
addresses: CustomerAddress[];
|
||||
contacts: CustomerContact[];
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export type CustomerPayload = {
|
||||
customer_number: string;
|
||||
company_name: string;
|
||||
legal_name: string;
|
||||
customer_type: CustomerType;
|
||||
status: CustomerStatus;
|
||||
industry: string;
|
||||
website?: string | null;
|
||||
email?: string | null;
|
||||
phone: string;
|
||||
tax_number: string;
|
||||
vat_id: string;
|
||||
notes: string;
|
||||
addresses: CustomerAddressPayload[];
|
||||
};
|
||||
|
||||
export type CustomerAddressPayload = {
|
||||
type: AddressType;
|
||||
street: string;
|
||||
postal_code: string;
|
||||
city: string;
|
||||
state: string;
|
||||
country: string;
|
||||
is_primary: boolean;
|
||||
};
|
||||
|
||||
export type CustomerContactPayload = {
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
position: string;
|
||||
email?: string | null;
|
||||
phone: string;
|
||||
mobile: string;
|
||||
is_primary: boolean;
|
||||
notes: string;
|
||||
};
|
||||
22
frontend/athena/types/dashboard.ts
Normal file
22
frontend/athena/types/dashboard.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import type { Customer } from "@/types/customer";
|
||||
|
||||
export interface MetricCard {
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface EmptyWidget {
|
||||
title: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface DashboardSummary {
|
||||
customers: MetricCard[];
|
||||
latest_customers: Customer[];
|
||||
users: MetricCard[];
|
||||
roles: MetricCard[];
|
||||
activities: EmptyWidget;
|
||||
tasks: EmptyWidget;
|
||||
tickets: EmptyWidget;
|
||||
projects: EmptyWidget;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue