c2afb3d3b5
Release package / release (push) Successful in 7m28s
Co-authored-by: Thanh Quy - wolf <524H0124@student.tdtu.edu.vn> Reviewed-on: #37 Co-authored-by: TaNguyenThanhQuy <tanguyenthanhquy@noreply.localhost> Co-committed-by: TaNguyenThanhQuy <tanguyenthanhquy@noreply.localhost>
156 lines
3.0 KiB
TypeScript
156 lines
3.0 KiB
TypeScript
// ===== USER TYPES =====
|
|
export type UserRole = "manager" | "staff" | "customer";
|
|
|
|
export interface User {
|
|
id: number;
|
|
name: string;
|
|
role: UserRole;
|
|
avatar: string | null;
|
|
phone?: string;
|
|
}
|
|
|
|
// ===== MENU TYPES =====
|
|
export interface MenuCategory {
|
|
id: string;
|
|
name: string;
|
|
icon: string; // FontAwesome class e.g. "fa-solid fa-mug-hot"
|
|
}
|
|
|
|
// ===== PRODUCT TYPES =====
|
|
export interface Product {
|
|
id: number;
|
|
name: string;
|
|
category: string; // matches MenuCategory.id
|
|
price: number;
|
|
image: string;
|
|
description: string;
|
|
available?: boolean;
|
|
}
|
|
|
|
// ===== SHOP INFO TYPES =====
|
|
export interface WifiInfo {
|
|
name: string;
|
|
password: string;
|
|
}
|
|
|
|
export interface ShopInfo {
|
|
name: string;
|
|
tagline: string;
|
|
logo: string;
|
|
address: string;
|
|
phone: string;
|
|
managerPhone: string;
|
|
email: string;
|
|
wifi: WifiInfo;
|
|
openHours: string;
|
|
}
|
|
|
|
// ===== SOCIAL LINKS TYPES =====
|
|
export interface SocialLinks {
|
|
facebook: string;
|
|
tiktok: string;
|
|
website: string;
|
|
}
|
|
|
|
// ===== EATERY (GRAPHQL) TYPES =====
|
|
export interface Eatery {
|
|
id: string;
|
|
ownerId: string;
|
|
name: string;
|
|
isVerified: boolean;
|
|
}
|
|
|
|
// ===== SHOP (QUÁN NƯỚC) TYPES =====
|
|
export interface Shop {
|
|
id: number;
|
|
name: string;
|
|
address: string;
|
|
image: string;
|
|
}
|
|
|
|
// ===== FINANCIAL ANALYTICS TYPES =====
|
|
export type AnalyticsPeriod = "day" | "week" | "month" | "year";
|
|
|
|
export interface RevenueDataPoint {
|
|
label: string; // e.g. "01/04", "Tuần 1", "Tháng 1"
|
|
revenue: number;
|
|
orders: number;
|
|
}
|
|
|
|
export interface ProductSalesStats {
|
|
productId: number;
|
|
name: string;
|
|
category: string;
|
|
unitsSold: number;
|
|
revenue: number;
|
|
costPrice: number; // giá nhập
|
|
sellingPrice: number; // giá bán
|
|
profit: number;
|
|
profitMargin: number; // %
|
|
}
|
|
|
|
export interface PeriodComparison {
|
|
current: number;
|
|
previous: number;
|
|
change: number; // absolute
|
|
changePercent: number; // %
|
|
isPositive: boolean;
|
|
}
|
|
|
|
export interface FinancialSummary {
|
|
totalRevenue: number;
|
|
totalOrders: number;
|
|
totalProfit: number;
|
|
averageOrderValue: number;
|
|
revenueComparison: PeriodComparison;
|
|
ordersComparison: PeriodComparison;
|
|
profitComparison: PeriodComparison;
|
|
}
|
|
|
|
// ===== COMBO TYPES =====
|
|
export interface ComboItem {
|
|
productId: number;
|
|
quantity: number;
|
|
}
|
|
|
|
export interface Combo {
|
|
id: number;
|
|
name: string;
|
|
description: string;
|
|
price: number;
|
|
image: string;
|
|
items: ComboItem[]; // list of products + quantities in this combo
|
|
available: boolean;
|
|
}
|
|
|
|
// ===== SHIFT / SCHEDULE TYPES =====
|
|
export type ShiftStatus =
|
|
| "available"
|
|
| "registered"
|
|
| "approved_leave"
|
|
| "absent";
|
|
|
|
export interface RegisteredStaff {
|
|
id: number;
|
|
name: string;
|
|
}
|
|
|
|
export interface ShiftSlot {
|
|
id: string;
|
|
date: string; // ISO date string "YYYY-MM-DD"
|
|
startTime: string; // "HH:mm"
|
|
endTime: string; // "HH:mm"
|
|
durationHours: number;
|
|
wage: number; // VND per shift
|
|
department: string;
|
|
maxStaff: number;
|
|
registeredStaff: RegisteredStaff[];
|
|
status: ShiftStatus;
|
|
}
|
|
|
|
export interface Department {
|
|
id: string;
|
|
name: string;
|
|
icon: string; // FontAwesome class
|
|
}
|