fix : sale out of Province

This commit is contained in:
2025-06-22 16:51:22 +03:30
parent 97fe0f138f
commit 4c22d1666e
17 changed files with 536 additions and 1088 deletions

View File

@@ -7,7 +7,7 @@ import 'package:rasadyar_chicken/presentation/utils/utils.dart';
import 'package:rasadyar_core/core.dart';
class HomeLogic extends GetxController {
RootLogic root = Get.find<RootLogic>();
RootLogic rootLogic = Get.find<RootLogic>();
RxnInt totalWeightTodayBars = RxnInt();
Rxn<InventoryModel> inventoryModel = Rxn<InventoryModel>();
Rxn<KillHouseDistributionInfo> killHouseDistributionInfo = Rxn<KillHouseDistributionInfo>();
@@ -23,8 +23,8 @@ class HomeLogic extends GetxController {
Future<void> getTodayBars() async {
await safeCall<BarInformation?>(
call: () async => await root.chickenRepository.getGeneralBarInformation(
token: root.tokenService.accessToken.value!,
call: () async => await rootLogic.chickenRepository.getGeneralBarInformation(
token: rootLogic.tokenService.accessToken.value!,
queryParameters: buildQueryParams(fromDate: DateTime.now(), toDate: DateTime.now()),
),
onSuccess: (result) {
@@ -49,7 +49,7 @@ class HomeLogic extends GetxController {
Future<void> getInventory() async {
await safeCall<List<InventoryModel>?>(
call: () async => await root.chickenRepository.getInventory(token: root.tokenService.accessToken.value!),
call: () async => await rootLogic.chickenRepository.getInventory(token: rootLogic.tokenService.accessToken.value!),
onSuccess: (result) {
if (result != null) {
inventoryModel.value = result.first;
@@ -72,12 +72,10 @@ class HomeLogic extends GetxController {
Future<void> getDistributionInformation() async {
await safeCall<KillHouseDistributionInfo?>(
call: () async => await root.chickenRepository.getIKillHouseDistributionInfo(token: root.tokenService.accessToken.value!),
call: () async => await rootLogic.chickenRepository.getIKillHouseDistributionInfo(token: rootLogic.tokenService.accessToken.value!),
onSuccess: (result) {
if (result != null) {
iLog(result);
killHouseDistributionInfo.value = result;
iLog(killHouseDistributionInfo.value);
}
},
onError: (error, stackTrace) {},
@@ -87,7 +85,7 @@ class HomeLogic extends GetxController {
void errorHandler(DioException error) {
handleGeneric(error, () {
root.tokenService.deleteTokens();
rootLogic.tokenService.deleteTokens();
});
}