HBT-software / src /types.ts
embedingHF's picture
Upload folder using huggingface_hub
46463e1 verified
Raw
History Blame Contribute Delete
2.39 kB
/**
* @license
* SPDX-License-Identifier: Apache-2.0
*/
export type StaffRole = 'owner' | 'manager' | 'cashier';
export interface StaffUser {
id: string;
name: string;
email: string;
role: StaffRole;
active: boolean;
}
export interface TireProduct {
id: string;
sku: string;
brand: string;
model: string;
size: string; // e.g., 195/65 R15
category: 'Passenger' | 'SUV' | 'Commercial' | 'Light Truck' | 'Truck/Bus';
stock: number;
minStock: number; // Alerts triggered when stock <= minStock
price: number; // Selling price
purchasePrice: number; // Cost price (for profit computation)
description?: string;
}
export interface StockHistoryItem {
id: string;
productId: string;
productLabel: string; // Saved snapshot for history search resilience
dateTime: string;
type: 'STOCK_IN' | 'STOCK_OUT' | 'MANUAL_ADJUSTMENT';
quantity: number; // Signed or unsigned change
resultingStock: number;
adjustedBy: string; // Staff user name/role
reason: string;
}
export interface InvoiceLineItem {
id: string;
productId: string;
brand: string;
model: string;
size: string;
quantity: number;
unitPrice: number;
totalPrice: number;
}
export interface Invoice {
id: string;
invoiceNumber: string; // e.g. HBT-2026-1001
dateTime: string;
customerName: string;
customerPhone: string;
customerVehicle?: string; // Car model / registration number (highly relevant for a tire shop!)
items: InvoiceLineItem[];
subtotal: number;
taxRate: number; // e.g., 17 for 17%
taxAmount: number;
discount: number;
total: number;
currencySymbol: string;
currencyCode: string;
paymentMethod: 'CASH' | 'CARD' | 'BANK_TRANSFER' | 'MOBILE_WALLET';
paymentStatus: 'PAID' | 'UNPAID' | 'PARTIAL';
amountPaid: number;
gatewayInfo?: {
gatewayName: 'Stripe' | 'PayPal' | 'EasyPaisa' | 'JazzCash' | 'Bank';
transactionId: string;
authTime: string;
};
cashierName: string;
notes?: string;
isOfflineCreated?: boolean; // Tracking for offline-first resilience
}
export interface SystemSettings {
shopName: string;
shopAddress: string;
shopPhone: string;
taxName: string; // e.g., "GST" or "VAT" or "Sales Tax"
taxRate: number; // Percentage
currencyCode: string; // PKR, USD, EUR etc.
currencySymbol: string; // ₨, $, € etc.
stripePublicKey?: string;
easyPaisaMerchantId?: string;
}