create submission
This commit is contained in:
@@ -289,6 +289,25 @@ class ApiConstants {
|
||||
static const String getProjectList =
|
||||
'/building_material.building_material.api.project.get_list';
|
||||
|
||||
/// Save (create/update) project submission
|
||||
/// POST /api/method/building_material.building_material.api.project.save
|
||||
/// Body: {
|
||||
/// "name": "...", // optional for new, required for update
|
||||
/// "designed_area": "Project Name",
|
||||
/// "address_of_project": "...",
|
||||
/// "project_owner": "...",
|
||||
/// "design_firm": "...",
|
||||
/// "contruction_contractor": "...",
|
||||
/// "design_area": 350.5,
|
||||
/// "products_included_in_the_design": "...",
|
||||
/// "project_progress": "progress_id", // from ProjectProgress.id
|
||||
/// "expected_commencement_date": "2026-01-15",
|
||||
/// "description": "...",
|
||||
/// "request_date": "2025-11-26 09:30:00"
|
||||
/// }
|
||||
static const String saveProject =
|
||||
'/building_material.building_material.api.project.save';
|
||||
|
||||
/// Create new project (legacy endpoint - may be deprecated)
|
||||
/// POST /projects
|
||||
static const String createProject = '/projects';
|
||||
|
||||
@@ -67,6 +67,9 @@ class HiveBoxNames {
|
||||
/// Project status list cache
|
||||
static const String projectStatusBox = 'project_status_box';
|
||||
|
||||
/// Project progress list cache (construction stages)
|
||||
static const String projectProgressBox = 'project_progress_box';
|
||||
|
||||
/// Get all box names for initialization
|
||||
static List<String> get allBoxes => [
|
||||
userBox,
|
||||
@@ -81,6 +84,7 @@ class HiveBoxNames {
|
||||
wardBox,
|
||||
orderStatusBox,
|
||||
projectStatusBox,
|
||||
projectProgressBox,
|
||||
settingsBox,
|
||||
cacheBox,
|
||||
syncStateBox,
|
||||
@@ -144,6 +148,7 @@ class HiveTypeIds {
|
||||
static const int wardModel = 32;
|
||||
static const int orderStatusModel = 62;
|
||||
static const int projectStatusModel = 63;
|
||||
static const int projectProgressModel = 64;
|
||||
|
||||
// Enums (33-61)
|
||||
static const int userRole = 33;
|
||||
|
||||
@@ -111,6 +111,9 @@ class HiveService {
|
||||
debugPrint(
|
||||
'HiveService: ${Hive.isAdapterRegistered(HiveTypeIds.projectStatusModel) ? "✓" : "✗"} ProjectStatusModel adapter',
|
||||
);
|
||||
debugPrint(
|
||||
'HiveService: ${Hive.isAdapterRegistered(HiveTypeIds.projectProgressModel) ? "✓" : "✗"} ProjectProgressModel adapter',
|
||||
);
|
||||
debugPrint(
|
||||
'HiveService: ${Hive.isAdapterRegistered(HiveTypeIds.entryType) ? "✓" : "✗"} EntryType adapter',
|
||||
);
|
||||
@@ -180,6 +183,9 @@ class HiveService {
|
||||
|
||||
// Project status box (non-sensitive) - caches project status list from API
|
||||
Hive.openBox<dynamic>(HiveBoxNames.projectStatusBox),
|
||||
|
||||
// Project progress box (non-sensitive) - caches construction progress stages from API
|
||||
Hive.openBox<dynamic>(HiveBoxNames.projectProgressBox),
|
||||
]);
|
||||
|
||||
// Open potentially encrypted boxes (sensitive data)
|
||||
|
||||
@@ -569,7 +569,7 @@ Future<AuthInterceptor> authInterceptor(Ref ref, Dio dio) async {
|
||||
@riverpod
|
||||
LoggingInterceptor loggingInterceptor(Ref ref) {
|
||||
// Only enable logging in debug mode
|
||||
const bool isDebug = false; // TODO: Replace with kDebugMode from Flutter
|
||||
const bool isDebug = true; // TODO: Replace with kDebugMode from Flutter
|
||||
|
||||
return LoggingInterceptor(
|
||||
enableRequestLogging: false,
|
||||
|
||||
Reference in New Issue
Block a user