This commit is contained in:
Phuoc Nguyen
2025-11-25 18:00:01 +07:00
parent 84669ac89c
commit 5e9b0cb562
9 changed files with 337 additions and 167 deletions

View File

@@ -197,7 +197,50 @@ class HiveKeys {
static const String lastSyncTime = 'last_sync_time';
static const String schemaVersion = 'schema_version';
static const String encryptionEnabled = 'encryption_enabled';
}
/// Order Status Indices
///
/// Index values for order statuses stored in Hive.
/// These correspond to the index field in OrderStatusModel.
/// Use these constants to compare order status by index instead of hardcoded strings.
///
/// API Response Structure:
/// - status: "Pending approval" (English status name)
/// - label: "Chờ phê duyệt" (Vietnamese display label)
/// - color: "Warning" (Status color indicator)
/// - index: 1 (Unique identifier)
class OrderStatusIndex {
// Private constructor to prevent instantiation
OrderStatusIndex._();
/// Pending approval - "Chờ phê duyệt"
/// Color: Warning
static const int pendingApproval = 1;
/// Manager Review - "Manager Review"
/// Color: Warning
static const int managerReview = 2;
/// Processing - "Đang xử lý"
/// Color: Info
static const int processing = 3;
/// Completed - "Hoàn thành"
/// Color: Success
static const int completed = 4;
/// Rejected - "Từ chối"
/// Color: Danger
static const int rejected = 5;
/// Cancelled - "HỦY BỎ"
/// Color: Danger
static const int cancelled = 6;
}
/// Hive Keys (continued)
extension HiveKeysContinued on HiveKeys {
// Cache Box Keys
static const String productsCacheKey = 'products_cache';
static const String categoriesCacheKey = 'categories_cache';