refactor: replace InventoryModel with ProductModel across the application, removing unused inventory model files and updating related repository and UI components

This commit is contained in:
2025-12-03 09:15:44 +03:30
parent ac2d8da95e
commit 8c9517b529
23 changed files with 296 additions and 728 deletions

View File

@@ -5,7 +5,6 @@ import 'package:flutter/widgets.dart';
import 'package:rasadyar_chicken/data/data_source/local/chicken_local.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/data/models/response/steward_remain_weight/steward_remain_weight.dart';
@@ -53,7 +52,7 @@ class StewardRootLogic extends GetxController {
RxList<ErrorLocationType> errorLocationType = RxList();
RxMap<int, dynamic> inventoryExpandedList = RxMap();
Rxn<InventoryModel> inventoryModel = Rxn<InventoryModel>();
Rxn<ProductModel> inventoryModel = Rxn<ProductModel>();
RxList<IranProvinceCityModel> provinces = <IranProvinceCityModel>[].obs;
// Cancel tokens for API calls
@@ -123,7 +122,7 @@ class StewardRootLogic extends GetxController {
_inventoryCancelToken?.cancel();
_inventoryCancelToken = CancelToken();
await safeCall<List<InventoryModel>?>(
await safeCall<List<ProductModel>?>(
call: () async => await chickenRepository.getInventory(
token: tokenService.accessToken.value!,
cancelToken: _inventoryCancelToken,

View File

@@ -561,7 +561,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
);
}
Widget inventoryItem({required bool isExpanded, required int index, required InventoryModel model}) {
Widget inventoryItem({required bool isExpanded, required int index, required ProductModel model}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 8,