add
This commit is contained in:
@@ -272,31 +272,45 @@ class ApiConstants {
|
||||
static const String getPaymentDetails = '/payments';
|
||||
|
||||
// ============================================================================
|
||||
// Project Endpoints
|
||||
// Project Endpoints (Frappe ERPNext)
|
||||
// ============================================================================
|
||||
|
||||
/// Create new project
|
||||
/// Get project status list (requires sid and csrf_token)
|
||||
/// POST /api/method/building_material.building_material.api.project.get_project_status_list
|
||||
/// Body: { "limit_start": 0, "limit_page_length": 0 }
|
||||
/// Returns: { "message": [{ "status": "...", "label": "...", "color": "...", "index": 0 }] }
|
||||
static const String getProjectStatusList =
|
||||
'/building_material.building_material.api.project.get_project_status_list';
|
||||
|
||||
/// Get list of project submissions (requires sid and csrf_token)
|
||||
/// POST /api/method/building_material.building_material.api.project.get_list
|
||||
/// Body: { "limit_start": 0, "limit_page_length": 0 }
|
||||
/// Returns: { "message": [{ "name": "...", "designed_area": "...", "design_area": 0, ... }] }
|
||||
static const String getProjectList =
|
||||
'/building_material.building_material.api.project.get_list';
|
||||
|
||||
/// Create new project (legacy endpoint - may be deprecated)
|
||||
/// POST /projects
|
||||
static const String createProject = '/projects';
|
||||
|
||||
/// Get user's projects
|
||||
/// Get user's projects (legacy endpoint - may be deprecated)
|
||||
/// GET /projects?status={status}&page={page}&limit={limit}
|
||||
static const String getProjects = '/projects';
|
||||
|
||||
/// Get project details by ID
|
||||
/// Get project details by ID (legacy endpoint - may be deprecated)
|
||||
/// GET /projects/{projectId}
|
||||
static const String getProjectDetails = '/projects';
|
||||
|
||||
/// Update project
|
||||
/// Update project (legacy endpoint - may be deprecated)
|
||||
/// PUT /projects/{projectId}
|
||||
static const String updateProject = '/projects';
|
||||
|
||||
/// Update project progress
|
||||
/// Update project progress (legacy endpoint - may be deprecated)
|
||||
/// PATCH /projects/{projectId}/progress
|
||||
/// Body: { "progress": 75 }
|
||||
static const String updateProjectProgress = '/projects';
|
||||
|
||||
/// Delete project
|
||||
/// Delete project (legacy endpoint - may be deprecated)
|
||||
/// DELETE /projects/{projectId}
|
||||
static const String deleteProject = '/projects';
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@ class HiveBoxNames {
|
||||
/// Order status list cache
|
||||
static const String orderStatusBox = 'order_status_box';
|
||||
|
||||
/// Project status list cache
|
||||
static const String projectStatusBox = 'project_status_box';
|
||||
|
||||
/// Get all box names for initialization
|
||||
static List<String> get allBoxes => [
|
||||
userBox,
|
||||
@@ -77,6 +80,7 @@ class HiveBoxNames {
|
||||
cityBox,
|
||||
wardBox,
|
||||
orderStatusBox,
|
||||
projectStatusBox,
|
||||
settingsBox,
|
||||
cacheBox,
|
||||
syncStateBox,
|
||||
@@ -139,6 +143,7 @@ class HiveTypeIds {
|
||||
static const int cityModel = 31;
|
||||
static const int wardModel = 32;
|
||||
static const int orderStatusModel = 62;
|
||||
static const int projectStatusModel = 63;
|
||||
|
||||
// Enums (33-61)
|
||||
static const int userRole = 33;
|
||||
@@ -239,6 +244,37 @@ class OrderStatusIndex {
|
||||
static const int cancelled = 6;
|
||||
}
|
||||
|
||||
/// Project Status Indices
|
||||
///
|
||||
/// Index values for project statuses stored in Hive.
|
||||
/// These correspond to the index field in ProjectStatusModel.
|
||||
///
|
||||
/// 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 ProjectStatusIndex {
|
||||
// Private constructor to prevent instantiation
|
||||
ProjectStatusIndex._();
|
||||
|
||||
/// Pending approval - "Chờ phê duyệt"
|
||||
/// Color: Warning
|
||||
static const int pendingApproval = 1;
|
||||
|
||||
/// Approved - "Đã được phê duyệt"
|
||||
/// Color: Success
|
||||
static const int approved = 2;
|
||||
|
||||
/// Rejected - "Từ chối"
|
||||
/// Color: Danger
|
||||
static const int rejected = 3;
|
||||
|
||||
/// Cancelled - "HỦY BỎ"
|
||||
/// Color: Danger
|
||||
static const int cancelled = 4;
|
||||
}
|
||||
|
||||
/// Hive Keys (continued)
|
||||
extension HiveKeysContinued on HiveKeys {
|
||||
// Cache Box Keys
|
||||
|
||||
Reference in New Issue
Block a user