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

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/models/response/broadcast_price/broadcast_price.dart';
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
import 'package:rasadyar_chicken/presentation/pages/common/profile/view.dart';
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
@@ -13,6 +14,7 @@ class KillHouseRootLogic extends GetxController {
var tokenService = Get.find<TokenStorageService>();
late KillHouseRepository killHouseRepository;
Rxn<BroadcastPrice> broadcastPrice = Rxn<BroadcastPrice>();
@override
void onInit() {
@@ -26,8 +28,9 @@ class KillHouseRootLogic extends GetxController {
onGenerateRoute: (settings) {
final page = ChickenPages.pages.firstWhere(
(e) => e.name == settings.name,
orElse: () =>
ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.actionKillHouse),
orElse: () => ChickenPages.pages.firstWhere(
(e) => e.name == ChickenRoutes.actionKillHouse,
),
);
return buildRouteFromGetPage(page);
@@ -52,4 +55,16 @@ class KillHouseRootLogic extends GetxController {
void changePage(int i) {
currentPage.value = i;
}
Future<void> getBroadcastPrice() async {
safeCall(
call: () async => await killHouseRepository.getBroadcastPrice(
token: tokenService.accessToken.value!,
),
onSuccess: (result) {
broadcastPrice.value = result;
},
onError: (error, stacktrace) {},
);
}
}