877c7be84b
Release package / release (push) Failing after 8m34s
Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: #39
175 lines
3.3 KiB
TypeScript
175 lines
3.3 KiB
TypeScript
// ===== USER TYPES =====
|
|
export type UserRole = "manager" | "staff" | "customer";
|
|
|
|
export interface User {
|
|
id: number;
|
|
name: string;
|
|
role: UserRole;
|
|
avatar: string | null;
|
|
phone?: string;
|
|
}
|
|
|
|
// ===== 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;
|
|
}
|
|
|
|
// ===== 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;
|
|
}
|
|
|
|
// ===== 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
|
|
}
|
|
|
|
export interface MenuItemEntity {
|
|
id?: string;
|
|
name: string;
|
|
price: number;
|
|
eatery?: EateryEntity;
|
|
imageUrl: string;
|
|
available: boolean;
|
|
description: string;
|
|
}
|
|
|
|
export interface ShiftEntity {}
|
|
|
|
export interface EateryEntity {
|
|
id: string;
|
|
ownerId: string;
|
|
name: string;
|
|
menuItems: MenuItemEntity[];
|
|
shifts: ShiftEntity[];
|
|
}
|
|
|
|
export interface allEateriesQuery {
|
|
allEateries: EateryEntity[];
|
|
}
|
|
|
|
export interface addMenuItemMutation {
|
|
addMenuItem: MenuItemEntity;
|
|
}
|
|
|
|
export interface updateMenuItemMutation {
|
|
updateMenuItem: MenuItemEntity;
|
|
}
|
|
|
|
export interface deleteMenuItemMutation {
|
|
deleteMenuItem: boolean;
|
|
}
|
|
|
|
export interface CartItemEntity {
|
|
productId: string;
|
|
quantity: number;
|
|
priceAtTimeOfAdding?: number;
|
|
}
|
|
|
|
export interface CartEntity {
|
|
Id: string;
|
|
items: CartItemEntity[];
|
|
totalAmount: number;
|
|
paymentQrUrl: string;
|
|
}
|
|
|
|
export interface getCartQuery {
|
|
getCart: CartEntity;
|
|
}
|
|
|
|
export interface createCartMutation {
|
|
createCart: string;
|
|
}
|
|
|
|
export interface addMenuItemMutation {
|
|
addItem: CartEntity;
|
|
}
|