110 lines
1.8 KiB
TypeScript
110 lines
1.8 KiB
TypeScript
// User and Auth types
|
|
export interface User {
|
|
id: string;
|
|
name: string;
|
|
phone: string;
|
|
role: 'owner' | 'employee';
|
|
}
|
|
|
|
export interface Tenant {
|
|
id: string;
|
|
name: string;
|
|
slug: string;
|
|
businessType: string;
|
|
subscriptionStatus: string;
|
|
}
|
|
|
|
export interface AuthState {
|
|
user: User | null;
|
|
tenant: Tenant | null;
|
|
accessToken: string | null;
|
|
refreshToken: string | null;
|
|
isAuthenticated: boolean;
|
|
isLoading: boolean;
|
|
}
|
|
|
|
// Product types
|
|
export interface Product {
|
|
id: string;
|
|
name: string;
|
|
description?: string;
|
|
sku?: string;
|
|
price: number;
|
|
cost?: number;
|
|
barcode?: string;
|
|
stock: number;
|
|
currentStock: number;
|
|
minStock: number;
|
|
categoryId?: string;
|
|
category?: Category;
|
|
imageUrl?: string;
|
|
isFavorite: boolean;
|
|
isActive: boolean;
|
|
}
|
|
|
|
export interface Category {
|
|
id: string;
|
|
name: string;
|
|
icon?: string;
|
|
color?: string;
|
|
}
|
|
|
|
// Sale types
|
|
export interface CartItem {
|
|
product: Product;
|
|
quantity: number;
|
|
subtotal: number;
|
|
}
|
|
|
|
export interface Sale {
|
|
id: string;
|
|
ticketNumber: string;
|
|
items: SaleItem[];
|
|
subtotal: number;
|
|
tax: number;
|
|
total: number;
|
|
paymentMethod: string;
|
|
status: 'pending' | 'completed' | 'cancelled';
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface SaleItem {
|
|
id: string;
|
|
productId: string;
|
|
productName: string;
|
|
quantity: number;
|
|
unitPrice: number;
|
|
subtotal: number;
|
|
}
|
|
|
|
// Customer types
|
|
export interface Customer {
|
|
id: string;
|
|
name: string;
|
|
phone?: string;
|
|
fiadoEnabled: boolean;
|
|
fiadoLimit: number;
|
|
currentFiadoBalance: number;
|
|
}
|
|
|
|
// Dashboard types
|
|
export interface DashboardStats {
|
|
totalSales: number;
|
|
totalRevenue: number;
|
|
totalTax: number;
|
|
avgTicket: number;
|
|
}
|
|
|
|
// API Response types
|
|
export interface ApiResponse<T> {
|
|
data: T;
|
|
message?: string;
|
|
}
|
|
|
|
export interface LoginResponse {
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
user: User;
|
|
tenant: Tenant;
|
|
}
|