feat : chicken root page , inventory , sale in province

This commit is contained in:
MrM
2025-06-05 23:26:44 +03:30
parent 5849466e3b
commit 1cfcf9fa8f
68 changed files with 16615 additions and 126 deletions

View File

@@ -0,0 +1,14 @@
enum ApiEnvironment {
dam(url: 'https://api.dam.rasadyar.net/');
const ApiEnvironment({required this.url});
final String url;
String get baseUrl {
switch (this) {
case ApiEnvironment.dam:
return url;
}
}
}

View File

@@ -0,0 +1,58 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class DioErrorHandler {
void handle(DioException error) {
switch (error.response?.statusCode) {
case 401:
_handleGeneric(error);
break;
case 403:
_handleGeneric(error);
break;
case 410:
_handle410();
break;
default:
_handleGeneric(error);
}
}
//wrong password/user name => "detail": "No active account found with the given credentials" - 401
void _handle410() {
Get.showSnackbar(_errorSnackBar('نام کاربری یا رمز عبور اشتباه است'));
}
//wrong captcha => "detail": "Captcha code is incorrect" - 403
void _handle403() {}
void _handleGeneric(DioException error) {
Get.showSnackbar(
_errorSnackBar(
error.response?.data.keys.first == 'is_user'
? 'کاربر با این شماره تلفن وجود ندارد'
: error.response?.data[error.response?.data.keys.first] ??
'خطا در برقراری ارتباط با سرور',
),
);
}
GetSnackBar _errorSnackBar(String message) {
return GetSnackBar(
titleText: Text(
'خطا',
style: AppFonts.yekan14.copyWith(color: Colors.white),
),
messageText: Text(
message,
style: AppFonts.yekan12.copyWith(color: Colors.white),
),
backgroundColor: AppColor.error,
margin: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
borderRadius: 12,
duration: Duration(milliseconds: 3500),
snackPosition: SnackPosition.TOP,
);
}
}

View File

@@ -0,0 +1,33 @@
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
import 'package:rasadyar_core/core.dart';
import '../di/chicken_di.dart';
import 'constant.dart';
class DioRemoteManager {
DioRemote? _currentClient;
ApiEnvironment? _currentEnv;
Future<DioRemote> setEnvironment([
ApiEnvironment env = ApiEnvironment.dam,
]) async {
if (_currentEnv != env) {
_currentClient = DioRemote(baseUrl: env.baseUrl);
await _currentClient?.init();
_currentEnv = env;
}
return _currentClient!;
}
DioRemote get currentClient {
if (_currentClient == null) {
throw Exception('Call setEnvironment() before accessing DioRemote.');
}
return _currentClient!;
}
ApiEnvironment? get currentEnv => _currentEnv;
}

View File

@@ -0,0 +1,19 @@
import 'package:rasadyar_auth/data/di/auth_di.dart';
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart';
import 'package:rasadyar_core/core.dart';
GetIt diChicken = GetIt.instance;
Future<void> setupChickenDI() async {
var tokenService = Get.find<TokenStorageService>();
diAuth.registerLazySingleton<DioRemote>(
() => DioRemote(baseUrl: tokenService.baseurl.value),
);
final dioRemote = diAuth.get<DioRemote>();
await dioRemote.init();
diAuth.registerLazySingleton<ChickenRepositoryImpl>(
() => ChickenRepositoryImpl(dioRemote),
);
}

View File

@@ -0,0 +1,18 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'conform_allocation.freezed.dart';
part 'conform_allocation.g.dart';
@freezed
abstract class ConformAllocation with _$ConformAllocation {
factory ConformAllocation({
String? allocation_key,
int? number_of_carcasses,
int? weight_of_carcasses,
int? amount,
int? total_amount,
}) = _ConformAllocation;
factory ConformAllocation.fromJson(Map<String, dynamic> json) =>
_$ConformAllocationFromJson(json);
}

View File

@@ -0,0 +1,160 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'conform_allocation.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ConformAllocation {
String? get allocation_key; int? get number_of_carcasses; int? get weight_of_carcasses; int? get amount; int? get total_amount;
/// Create a copy of ConformAllocation
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ConformAllocationCopyWith<ConformAllocation> get copyWith => _$ConformAllocationCopyWithImpl<ConformAllocation>(this as ConformAllocation, _$identity);
/// Serializes this ConformAllocation to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ConformAllocation&&(identical(other.allocation_key, allocation_key) || other.allocation_key == allocation_key)&&(identical(other.number_of_carcasses, number_of_carcasses) || other.number_of_carcasses == number_of_carcasses)&&(identical(other.weight_of_carcasses, weight_of_carcasses) || other.weight_of_carcasses == weight_of_carcasses)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.total_amount, total_amount) || other.total_amount == total_amount));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,allocation_key,number_of_carcasses,weight_of_carcasses,amount,total_amount);
@override
String toString() {
return 'ConformAllocation(allocation_key: $allocation_key, number_of_carcasses: $number_of_carcasses, weight_of_carcasses: $weight_of_carcasses, amount: $amount, total_amount: $total_amount)';
}
}
/// @nodoc
abstract mixin class $ConformAllocationCopyWith<$Res> {
factory $ConformAllocationCopyWith(ConformAllocation value, $Res Function(ConformAllocation) _then) = _$ConformAllocationCopyWithImpl;
@useResult
$Res call({
String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount
});
}
/// @nodoc
class _$ConformAllocationCopyWithImpl<$Res>
implements $ConformAllocationCopyWith<$Res> {
_$ConformAllocationCopyWithImpl(this._self, this._then);
final ConformAllocation _self;
final $Res Function(ConformAllocation) _then;
/// Create a copy of ConformAllocation
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? allocation_key = freezed,Object? number_of_carcasses = freezed,Object? weight_of_carcasses = freezed,Object? amount = freezed,Object? total_amount = freezed,}) {
return _then(_self.copyWith(
allocation_key: freezed == allocation_key ? _self.allocation_key : allocation_key // ignore: cast_nullable_to_non_nullable
as String?,number_of_carcasses: freezed == number_of_carcasses ? _self.number_of_carcasses : number_of_carcasses // ignore: cast_nullable_to_non_nullable
as int?,weight_of_carcasses: freezed == weight_of_carcasses ? _self.weight_of_carcasses : weight_of_carcasses // ignore: cast_nullable_to_non_nullable
as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
as int?,total_amount: freezed == total_amount ? _self.total_amount : total_amount // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
@JsonSerializable()
class _ConformAllocation implements ConformAllocation {
_ConformAllocation({this.allocation_key, this.number_of_carcasses, this.weight_of_carcasses, this.amount, this.total_amount});
factory _ConformAllocation.fromJson(Map<String, dynamic> json) => _$ConformAllocationFromJson(json);
@override final String? allocation_key;
@override final int? number_of_carcasses;
@override final int? weight_of_carcasses;
@override final int? amount;
@override final int? total_amount;
/// Create a copy of ConformAllocation
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ConformAllocationCopyWith<_ConformAllocation> get copyWith => __$ConformAllocationCopyWithImpl<_ConformAllocation>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ConformAllocationToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConformAllocation&&(identical(other.allocation_key, allocation_key) || other.allocation_key == allocation_key)&&(identical(other.number_of_carcasses, number_of_carcasses) || other.number_of_carcasses == number_of_carcasses)&&(identical(other.weight_of_carcasses, weight_of_carcasses) || other.weight_of_carcasses == weight_of_carcasses)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.total_amount, total_amount) || other.total_amount == total_amount));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,allocation_key,number_of_carcasses,weight_of_carcasses,amount,total_amount);
@override
String toString() {
return 'ConformAllocation(allocation_key: $allocation_key, number_of_carcasses: $number_of_carcasses, weight_of_carcasses: $weight_of_carcasses, amount: $amount, total_amount: $total_amount)';
}
}
/// @nodoc
abstract mixin class _$ConformAllocationCopyWith<$Res> implements $ConformAllocationCopyWith<$Res> {
factory _$ConformAllocationCopyWith(_ConformAllocation value, $Res Function(_ConformAllocation) _then) = __$ConformAllocationCopyWithImpl;
@override @useResult
$Res call({
String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount
});
}
/// @nodoc
class __$ConformAllocationCopyWithImpl<$Res>
implements _$ConformAllocationCopyWith<$Res> {
__$ConformAllocationCopyWithImpl(this._self, this._then);
final _ConformAllocation _self;
final $Res Function(_ConformAllocation) _then;
/// Create a copy of ConformAllocation
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? allocation_key = freezed,Object? number_of_carcasses = freezed,Object? weight_of_carcasses = freezed,Object? amount = freezed,Object? total_amount = freezed,}) {
return _then(_ConformAllocation(
allocation_key: freezed == allocation_key ? _self.allocation_key : allocation_key // ignore: cast_nullable_to_non_nullable
as String?,number_of_carcasses: freezed == number_of_carcasses ? _self.number_of_carcasses : number_of_carcasses // ignore: cast_nullable_to_non_nullable
as int?,weight_of_carcasses: freezed == weight_of_carcasses ? _self.weight_of_carcasses : weight_of_carcasses // ignore: cast_nullable_to_non_nullable
as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
as int?,total_amount: freezed == total_amount ? _self.total_amount : total_amount // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
// dart format on

View File

@@ -0,0 +1,25 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'conform_allocation.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_ConformAllocation _$ConformAllocationFromJson(Map<String, dynamic> json) =>
_ConformAllocation(
allocation_key: json['allocation_key'] as String?,
number_of_carcasses: (json['number_of_carcasses'] as num?)?.toInt(),
weight_of_carcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
amount: (json['amount'] as num?)?.toInt(),
total_amount: (json['total_amount'] as num?)?.toInt(),
);
Map<String, dynamic> _$ConformAllocationToJson(_ConformAllocation instance) =>
<String, dynamic>{
'allocation_key': instance.allocation_key,
'number_of_carcasses': instance.number_of_carcasses,
'weight_of_carcasses': instance.weight_of_carcasses,
'amount': instance.amount,
'total_amount': instance.total_amount,
};

View File

@@ -0,0 +1,20 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'steward_allocation_request.freezed.dart';
part 'steward_allocation_request.g.dart';
@freezed
abstract class StewardAllocationRequest with _$StewardAllocationRequest {
const factory StewardAllocationRequest({
bool? checkAllocation,
String? allocationKey,
String? state,
int? registrationCode,
int? receiverRealNumberOfCarcasses,
int? receiverRealWeightOfCarcasses,
int? weightLossOfCarcasses,
}) = _StewardAllocationRequest;
factory StewardAllocationRequest.fromJson(Map<String, dynamic> json) =>
_$StewardAllocationRequestFromJson(json);
}

View File

@@ -0,0 +1,166 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'steward_allocation_request.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$StewardAllocationRequest {
bool? get checkAllocation; String? get allocationKey; String? get state; int? get registrationCode; int? get receiverRealNumberOfCarcasses; int? get receiverRealWeightOfCarcasses; int? get weightLossOfCarcasses;
/// Create a copy of StewardAllocationRequest
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StewardAllocationRequestCopyWith<StewardAllocationRequest> get copyWith => _$StewardAllocationRequestCopyWithImpl<StewardAllocationRequest>(this as StewardAllocationRequest, _$identity);
/// Serializes this StewardAllocationRequest to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardAllocationRequest&&(identical(other.checkAllocation, checkAllocation) || other.checkAllocation == checkAllocation)&&(identical(other.allocationKey, allocationKey) || other.allocationKey == allocationKey)&&(identical(other.state, state) || other.state == state)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,checkAllocation,allocationKey,state,registrationCode,receiverRealNumberOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses);
@override
String toString() {
return 'StewardAllocationRequest(checkAllocation: $checkAllocation, allocationKey: $allocationKey, state: $state, registrationCode: $registrationCode, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses)';
}
}
/// @nodoc
abstract mixin class $StewardAllocationRequestCopyWith<$Res> {
factory $StewardAllocationRequestCopyWith(StewardAllocationRequest value, $Res Function(StewardAllocationRequest) _then) = _$StewardAllocationRequestCopyWithImpl;
@useResult
$Res call({
bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses
});
}
/// @nodoc
class _$StewardAllocationRequestCopyWithImpl<$Res>
implements $StewardAllocationRequestCopyWith<$Res> {
_$StewardAllocationRequestCopyWithImpl(this._self, this._then);
final StewardAllocationRequest _self;
final $Res Function(StewardAllocationRequest) _then;
/// Create a copy of StewardAllocationRequest
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? checkAllocation = freezed,Object? allocationKey = freezed,Object? state = freezed,Object? registrationCode = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,}) {
return _then(_self.copyWith(
checkAllocation: freezed == checkAllocation ? _self.checkAllocation : checkAllocation // ignore: cast_nullable_to_non_nullable
as bool?,allocationKey: freezed == allocationKey ? _self.allocationKey : allocationKey // ignore: cast_nullable_to_non_nullable
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable
as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StewardAllocationRequest implements StewardAllocationRequest {
const _StewardAllocationRequest({this.checkAllocation, this.allocationKey, this.state, this.registrationCode, this.receiverRealNumberOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses});
factory _StewardAllocationRequest.fromJson(Map<String, dynamic> json) => _$StewardAllocationRequestFromJson(json);
@override final bool? checkAllocation;
@override final String? allocationKey;
@override final String? state;
@override final int? registrationCode;
@override final int? receiverRealNumberOfCarcasses;
@override final int? receiverRealWeightOfCarcasses;
@override final int? weightLossOfCarcasses;
/// Create a copy of StewardAllocationRequest
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StewardAllocationRequestCopyWith<_StewardAllocationRequest> get copyWith => __$StewardAllocationRequestCopyWithImpl<_StewardAllocationRequest>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StewardAllocationRequestToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardAllocationRequest&&(identical(other.checkAllocation, checkAllocation) || other.checkAllocation == checkAllocation)&&(identical(other.allocationKey, allocationKey) || other.allocationKey == allocationKey)&&(identical(other.state, state) || other.state == state)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,checkAllocation,allocationKey,state,registrationCode,receiverRealNumberOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses);
@override
String toString() {
return 'StewardAllocationRequest(checkAllocation: $checkAllocation, allocationKey: $allocationKey, state: $state, registrationCode: $registrationCode, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses)';
}
}
/// @nodoc
abstract mixin class _$StewardAllocationRequestCopyWith<$Res> implements $StewardAllocationRequestCopyWith<$Res> {
factory _$StewardAllocationRequestCopyWith(_StewardAllocationRequest value, $Res Function(_StewardAllocationRequest) _then) = __$StewardAllocationRequestCopyWithImpl;
@override @useResult
$Res call({
bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses
});
}
/// @nodoc
class __$StewardAllocationRequestCopyWithImpl<$Res>
implements _$StewardAllocationRequestCopyWith<$Res> {
__$StewardAllocationRequestCopyWithImpl(this._self, this._then);
final _StewardAllocationRequest _self;
final $Res Function(_StewardAllocationRequest) _then;
/// Create a copy of StewardAllocationRequest
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? checkAllocation = freezed,Object? allocationKey = freezed,Object? state = freezed,Object? registrationCode = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,}) {
return _then(_StewardAllocationRequest(
checkAllocation: freezed == checkAllocation ? _self.checkAllocation : checkAllocation // ignore: cast_nullable_to_non_nullable
as bool?,allocationKey: freezed == allocationKey ? _self.allocationKey : allocationKey // ignore: cast_nullable_to_non_nullable
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable
as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
// dart format on

View File

@@ -0,0 +1,33 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'steward_allocation_request.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_StewardAllocationRequest _$StewardAllocationRequestFromJson(
Map<String, dynamic> json,
) => _StewardAllocationRequest(
checkAllocation: json['check_allocation'] as bool?,
allocationKey: json['allocation_key'] as String?,
state: json['state'] as String?,
registrationCode: (json['registration_code'] as num?)?.toInt(),
receiverRealNumberOfCarcasses:
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
receiverRealWeightOfCarcasses:
(json['receiver_real_weight_of_carcasses'] as num?)?.toInt(),
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
);
Map<String, dynamic> _$StewardAllocationRequestToJson(
_StewardAllocationRequest instance,
) => <String, dynamic>{
'check_allocation': instance.checkAllocation,
'allocation_key': instance.allocationKey,
'state': instance.state,
'registration_code': instance.registrationCode,
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
};

View File

@@ -0,0 +1,26 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'submit_steward_allocation.freezed.dart';
part 'submit_steward_allocation.g.dart';
@freezed
abstract class SubmitStewardAllocation with _$SubmitStewardAllocation {
const factory SubmitStewardAllocation({
String? sellerType,
String? buyerType,
String? guildKey,
String? productKey,
String? type,
String? allocationType,
int? numberOfCarcasses,
int? weightOfCarcasses,
String? sellType,
int? amount,
int? totalAmount,
bool? approvedPriceStatus,
String? date,
}) = _SubmitStewardAllocation;
factory SubmitStewardAllocation.fromJson(Map<String, dynamic> json) =>
_$SubmitStewardAllocationFromJson(json);
}

View File

@@ -0,0 +1,184 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'submit_steward_allocation.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$SubmitStewardAllocation {
String? get sellerType; String? get buyerType; String? get guildKey; String? get productKey; String? get type; String? get allocationType; int? get numberOfCarcasses; int? get weightOfCarcasses; String? get sellType; int? get amount; int? get totalAmount; bool? get approvedPriceStatus; String? get date;
/// Create a copy of SubmitStewardAllocation
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SubmitStewardAllocationCopyWith<SubmitStewardAllocation> get copyWith => _$SubmitStewardAllocationCopyWithImpl<SubmitStewardAllocation>(this as SubmitStewardAllocation, _$identity);
/// Serializes this SubmitStewardAllocation to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date);
@override
String toString() {
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
}
}
/// @nodoc
abstract mixin class $SubmitStewardAllocationCopyWith<$Res> {
factory $SubmitStewardAllocationCopyWith(SubmitStewardAllocation value, $Res Function(SubmitStewardAllocation) _then) = _$SubmitStewardAllocationCopyWithImpl;
@useResult
$Res call({
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date
});
}
/// @nodoc
class _$SubmitStewardAllocationCopyWithImpl<$Res>
implements $SubmitStewardAllocationCopyWith<$Res> {
_$SubmitStewardAllocationCopyWithImpl(this._self, this._then);
final SubmitStewardAllocation _self;
final $Res Function(SubmitStewardAllocation) _then;
/// Create a copy of SubmitStewardAllocation
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
return _then(_self.copyWith(
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable
as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable
as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _SubmitStewardAllocation implements SubmitStewardAllocation {
const _SubmitStewardAllocation({this.sellerType, this.buyerType, this.guildKey, this.productKey, this.type, this.allocationType, this.numberOfCarcasses, this.weightOfCarcasses, this.sellType, this.amount, this.totalAmount, this.approvedPriceStatus, this.date});
factory _SubmitStewardAllocation.fromJson(Map<String, dynamic> json) => _$SubmitStewardAllocationFromJson(json);
@override final String? sellerType;
@override final String? buyerType;
@override final String? guildKey;
@override final String? productKey;
@override final String? type;
@override final String? allocationType;
@override final int? numberOfCarcasses;
@override final int? weightOfCarcasses;
@override final String? sellType;
@override final int? amount;
@override final int? totalAmount;
@override final bool? approvedPriceStatus;
@override final String? date;
/// Create a copy of SubmitStewardAllocation
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SubmitStewardAllocationCopyWith<_SubmitStewardAllocation> get copyWith => __$SubmitStewardAllocationCopyWithImpl<_SubmitStewardAllocation>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$SubmitStewardAllocationToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date);
@override
String toString() {
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
}
}
/// @nodoc
abstract mixin class _$SubmitStewardAllocationCopyWith<$Res> implements $SubmitStewardAllocationCopyWith<$Res> {
factory _$SubmitStewardAllocationCopyWith(_SubmitStewardAllocation value, $Res Function(_SubmitStewardAllocation) _then) = __$SubmitStewardAllocationCopyWithImpl;
@override @useResult
$Res call({
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date
});
}
/// @nodoc
class __$SubmitStewardAllocationCopyWithImpl<$Res>
implements _$SubmitStewardAllocationCopyWith<$Res> {
__$SubmitStewardAllocationCopyWithImpl(this._self, this._then);
final _SubmitStewardAllocation _self;
final $Res Function(_SubmitStewardAllocation) _then;
/// Create a copy of SubmitStewardAllocation
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
return _then(_SubmitStewardAllocation(
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable
as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable
as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,43 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'submit_steward_allocation.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_SubmitStewardAllocation _$SubmitStewardAllocationFromJson(
Map<String, dynamic> json,
) => _SubmitStewardAllocation(
sellerType: json['seller_type'] as String?,
buyerType: json['buyer_type'] as String?,
guildKey: json['guild_key'] as String?,
productKey: json['product_key'] as String?,
type: json['type'] as String?,
allocationType: json['allocation_type'] as String?,
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
sellType: json['sell_type'] as String?,
amount: (json['amount'] as num?)?.toInt(),
totalAmount: (json['total_amount'] as num?)?.toInt(),
approvedPriceStatus: json['approved_price_status'] as bool?,
date: json['date'] as String?,
);
Map<String, dynamic> _$SubmitStewardAllocationToJson(
_SubmitStewardAllocation instance,
) => <String, dynamic>{
'seller_type': instance.sellerType,
'buyer_type': instance.buyerType,
'guild_key': instance.guildKey,
'product_key': instance.productKey,
'type': instance.type,
'allocation_type': instance.allocationType,
'number_of_carcasses': instance.numberOfCarcasses,
'weight_of_carcasses': instance.weightOfCarcasses,
'sell_type': instance.sellType,
'amount': instance.amount,
'total_amount': instance.totalAmount,
'approved_price_status': instance.approvedPriceStatus,
'date': instance.date,
};

View File

@@ -0,0 +1,227 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'allocated_made.freezed.dart';
part 'allocated_made.g.dart';
@freezed
abstract class AllocatedMadeModel with _$AllocatedMadeModel {
factory AllocatedMadeModel({
int? count,
String? next,
String? previous,
List<AllocatedMadeResult>? results,
}) = _AllocatedMadeModel;
factory AllocatedMadeModel.fromJson(Map<String, dynamic> json) =>
_$AllocatedMadeModelFromJson(json);
}
@freezed
abstract class AllocatedMadeResult with _$AllocatedMadeResult {
factory AllocatedMadeResult({
int? id,
Product? product,
dynamic kill_house,
dynamic to_kill_house,
Steward? steward,
dynamic to_steward,
dynamic guilds,
Steward? to_guilds,
dynamic to_cold_house,
int? index_weight,
int? date_timestamp,
int? new_state,
int? new_receiver_state,
int? new_allocation_state,
String? key,
String? create_date,
String? modify_date,
bool? trash,
int? number_of_carcasses,
int? real_number_of_carcasses,
int? receiver_real_number_of_carcasses,
int? weight_of_carcasses,
int? real_weight_of_carcasses,
int? receiver_real_weight_of_carcasses,
int? weight_loss_of_carcasses,
bool? final_registration,
String? sell_type,
String? product_name,
String? seller_type,
String? type,
String? sale_type,
String? allocation_type,
bool? system_registration_code,
int? registration_code,
int? amount,
int? total_amount,
int? total_amount_paid,
int? total_amount_remain,
String? logged_registration_code,
String? state,
String? receiver_state,
String? allocation_state,
String? date,
String? role,
String? steward_temp_key,
bool? approved_price_status,
bool? calculate_status,
bool? temporary_trash,
bool? temporary_deleted,
String? created_by,
String? modified_by,
dynamic ware_house,
dynamic steward_ware_house,
dynamic car,
dynamic dispenser,
}) = _AllocatedMadeResult;
factory AllocatedMadeResult.fromJson(Map<String, dynamic> json) =>
_$AllocatedMadeResultFromJson(json);
}
@freezed
abstract class Product with _$Product {
factory Product({
int? weight_average,
}) = _Product;
factory Product.fromJson(Map<String, dynamic> json) =>
_$ProductFromJson(json);
}
@freezed
abstract class Steward with _$Steward {
factory Steward({
int? id,
User? user,
Address? address,
Activity? guild_area_activity,
Activity? guild_type_activity,
List<dynamic>? kill_house,
List<dynamic>? steward_kill_house,
List<dynamic>? stewards,
PosStatus? get_pos_status,
String? key,
String? create_date,
String? modify_date,
bool? trash,
dynamic user_id_foreign_key,
dynamic address_id_foreign_key,
dynamic user_bank_id_foreign_key,
dynamic wallet_id_foreign_key,
dynamic provincial_government_id_key,
dynamic identity_documents,
bool? active,
int? city_number,
String? city_name,
String? guilds_id,
String? license_number,
String? guilds_name,
String? phone,
String? type_activity,
String? area_activity,
int? province_number,
String? province_name,
bool? steward,
bool? has_pos,
dynamic centers_allocation,
dynamic kill_house_centers_allocation,
dynamic allocation_limit,
bool? limitation_allocation,
String? registerar_role,
String? registerar_fullname,
String? registerar_mobile,
bool? kill_house_register,
bool? steward_register,
bool? guilds_room_register,
bool? pos_company_register,
String? province_accept_state,
String? province_message,
String? condition,
String? description_condition,
bool? steward_active,
dynamic steward_allocation_limit,
bool? steward_limitation_allocation,
bool? license,
dynamic license_form,
dynamic license_file,
String? reviewer_role,
String? reviewer_fullname,
String? reviewer_mobile,
String? checker_message,
bool? final_accept,
bool? temporary_registration,
String? created_by,
String? modified_by,
dynamic user_bank_info,
int? wallet,
List<dynamic>? cars,
List<dynamic>? user_level,
}) = _Steward;
factory Steward.fromJson(Map<String, dynamic> json) =>
_$StewardFromJson(json);
}
@freezed
abstract class User with _$User {
factory User({
String? fullname,
String? first_name,
String? last_name,
String? mobile,
String? national_id,
String? city,
}) = _User;
factory User.fromJson(Map<String, dynamic> json) =>
_$UserFromJson(json);
}
@freezed
abstract class Address with _$Address {
factory Address({
Province? province,
Province? city,
String? address,
String? postal_code,
}) = _Address;
factory Address.fromJson(Map<String, dynamic> json) =>
_$AddressFromJson(json);
}
@freezed
abstract class Province with _$Province {
factory Province({
String? key,
String? name,
}) = _Province;
factory Province.fromJson(Map<String, dynamic> json) =>
_$ProvinceFromJson(json);
}
@freezed
abstract class Activity with _$Activity {
factory Activity({
String? key,
String? title,
}) = _Activity;
factory Activity.fromJson(Map<String, dynamic> json) =>
_$ActivityFromJson(json);
}
@freezed
abstract class PosStatus with _$PosStatus {
factory PosStatus({
int? len_active_sessions,
bool? has_pons,
bool? has_active_pons,
}) = _PosStatus;
factory PosStatus.fromJson(Map<String, dynamic> json) =>
_$PosStatusFromJson(json);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,373 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'allocated_made.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_AllocatedMadeModel _$AllocatedMadeModelFromJson(Map<String, dynamic> json) =>
_AllocatedMadeModel(
count: (json['count'] as num?)?.toInt(),
next: json['next'] as String?,
previous: json['previous'] as String?,
results: (json['results'] as List<dynamic>?)
?.map((e) => AllocatedMadeResult.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$AllocatedMadeModelToJson(_AllocatedMadeModel instance) =>
<String, dynamic>{
'count': instance.count,
'next': instance.next,
'previous': instance.previous,
'results': instance.results,
};
_AllocatedMadeResult _$AllocatedMadeResultFromJson(
Map<String, dynamic> json,
) => _AllocatedMadeResult(
id: (json['id'] as num?)?.toInt(),
product: json['product'] == null
? null
: Product.fromJson(json['product'] as Map<String, dynamic>),
kill_house: json['kill_house'],
to_kill_house: json['to_kill_house'],
steward: json['steward'] == null
? null
: Steward.fromJson(json['steward'] as Map<String, dynamic>),
to_steward: json['to_steward'],
guilds: json['guilds'],
to_guilds: json['to_guilds'] == null
? null
: Steward.fromJson(json['to_guilds'] as Map<String, dynamic>),
to_cold_house: json['to_cold_house'],
index_weight: (json['index_weight'] as num?)?.toInt(),
date_timestamp: (json['date_timestamp'] as num?)?.toInt(),
new_state: (json['new_state'] as num?)?.toInt(),
new_receiver_state: (json['new_receiver_state'] as num?)?.toInt(),
new_allocation_state: (json['new_allocation_state'] as num?)?.toInt(),
key: json['key'] as String?,
create_date: json['create_date'] as String?,
modify_date: json['modify_date'] as String?,
trash: json['trash'] as bool?,
number_of_carcasses: (json['number_of_carcasses'] as num?)?.toInt(),
real_number_of_carcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
receiver_real_number_of_carcasses:
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
weight_of_carcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
real_weight_of_carcasses: (json['real_weight_of_carcasses'] as num?)?.toInt(),
receiver_real_weight_of_carcasses:
(json['receiver_real_weight_of_carcasses'] as num?)?.toInt(),
weight_loss_of_carcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
final_registration: json['final_registration'] as bool?,
sell_type: json['sell_type'] as String?,
product_name: json['product_name'] as String?,
seller_type: json['seller_type'] as String?,
type: json['type'] as String?,
sale_type: json['sale_type'] as String?,
allocation_type: json['allocation_type'] as String?,
system_registration_code: json['system_registration_code'] as bool?,
registration_code: (json['registration_code'] as num?)?.toInt(),
amount: (json['amount'] as num?)?.toInt(),
total_amount: (json['total_amount'] as num?)?.toInt(),
total_amount_paid: (json['total_amount_paid'] as num?)?.toInt(),
total_amount_remain: (json['total_amount_remain'] as num?)?.toInt(),
logged_registration_code: json['logged_registration_code'] as String?,
state: json['state'] as String?,
receiver_state: json['receiver_state'] as String?,
allocation_state: json['allocation_state'] as String?,
date: json['date'] as String?,
role: json['role'] as String?,
steward_temp_key: json['steward_temp_key'] as String?,
approved_price_status: json['approved_price_status'] as bool?,
calculate_status: json['calculate_status'] as bool?,
temporary_trash: json['temporary_trash'] as bool?,
temporary_deleted: json['temporary_deleted'] as bool?,
created_by: json['created_by'] as String?,
modified_by: json['modified_by'] as String?,
ware_house: json['ware_house'],
steward_ware_house: json['steward_ware_house'],
car: json['car'],
dispenser: json['dispenser'],
);
Map<String, dynamic> _$AllocatedMadeResultToJson(
_AllocatedMadeResult instance,
) => <String, dynamic>{
'id': instance.id,
'product': instance.product,
'kill_house': instance.kill_house,
'to_kill_house': instance.to_kill_house,
'steward': instance.steward,
'to_steward': instance.to_steward,
'guilds': instance.guilds,
'to_guilds': instance.to_guilds,
'to_cold_house': instance.to_cold_house,
'index_weight': instance.index_weight,
'date_timestamp': instance.date_timestamp,
'new_state': instance.new_state,
'new_receiver_state': instance.new_receiver_state,
'new_allocation_state': instance.new_allocation_state,
'key': instance.key,
'create_date': instance.create_date,
'modify_date': instance.modify_date,
'trash': instance.trash,
'number_of_carcasses': instance.number_of_carcasses,
'real_number_of_carcasses': instance.real_number_of_carcasses,
'receiver_real_number_of_carcasses':
instance.receiver_real_number_of_carcasses,
'weight_of_carcasses': instance.weight_of_carcasses,
'real_weight_of_carcasses': instance.real_weight_of_carcasses,
'receiver_real_weight_of_carcasses':
instance.receiver_real_weight_of_carcasses,
'weight_loss_of_carcasses': instance.weight_loss_of_carcasses,
'final_registration': instance.final_registration,
'sell_type': instance.sell_type,
'product_name': instance.product_name,
'seller_type': instance.seller_type,
'type': instance.type,
'sale_type': instance.sale_type,
'allocation_type': instance.allocation_type,
'system_registration_code': instance.system_registration_code,
'registration_code': instance.registration_code,
'amount': instance.amount,
'total_amount': instance.total_amount,
'total_amount_paid': instance.total_amount_paid,
'total_amount_remain': instance.total_amount_remain,
'logged_registration_code': instance.logged_registration_code,
'state': instance.state,
'receiver_state': instance.receiver_state,
'allocation_state': instance.allocation_state,
'date': instance.date,
'role': instance.role,
'steward_temp_key': instance.steward_temp_key,
'approved_price_status': instance.approved_price_status,
'calculate_status': instance.calculate_status,
'temporary_trash': instance.temporary_trash,
'temporary_deleted': instance.temporary_deleted,
'created_by': instance.created_by,
'modified_by': instance.modified_by,
'ware_house': instance.ware_house,
'steward_ware_house': instance.steward_ware_house,
'car': instance.car,
'dispenser': instance.dispenser,
};
_Product _$ProductFromJson(Map<String, dynamic> json) =>
_Product(weight_average: (json['weight_average'] as num?)?.toInt());
Map<String, dynamic> _$ProductToJson(_Product instance) => <String, dynamic>{
'weight_average': instance.weight_average,
};
_Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
id: (json['id'] as num?)?.toInt(),
user: json['user'] == null
? null
: User.fromJson(json['user'] as Map<String, dynamic>),
address: json['address'] == null
? null
: Address.fromJson(json['address'] as Map<String, dynamic>),
guild_area_activity: json['guild_area_activity'] == null
? null
: Activity.fromJson(json['guild_area_activity'] as Map<String, dynamic>),
guild_type_activity: json['guild_type_activity'] == null
? null
: Activity.fromJson(json['guild_type_activity'] as Map<String, dynamic>),
kill_house: json['kill_house'] as List<dynamic>?,
steward_kill_house: json['steward_kill_house'] as List<dynamic>?,
stewards: json['stewards'] as List<dynamic>?,
get_pos_status: json['get_pos_status'] == null
? null
: PosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
key: json['key'] as String?,
create_date: json['create_date'] as String?,
modify_date: json['modify_date'] as String?,
trash: json['trash'] as bool?,
user_id_foreign_key: json['user_id_foreign_key'],
address_id_foreign_key: json['address_id_foreign_key'],
user_bank_id_foreign_key: json['user_bank_id_foreign_key'],
wallet_id_foreign_key: json['wallet_id_foreign_key'],
provincial_government_id_key: json['provincial_government_id_key'],
identity_documents: json['identity_documents'],
active: json['active'] as bool?,
city_number: (json['city_number'] as num?)?.toInt(),
city_name: json['city_name'] as String?,
guilds_id: json['guilds_id'] as String?,
license_number: json['license_number'] as String?,
guilds_name: json['guilds_name'] as String?,
phone: json['phone'] as String?,
type_activity: json['type_activity'] as String?,
area_activity: json['area_activity'] as String?,
province_number: (json['province_number'] as num?)?.toInt(),
province_name: json['province_name'] as String?,
steward: json['steward'] as bool?,
has_pos: json['has_pos'] as bool?,
centers_allocation: json['centers_allocation'],
kill_house_centers_allocation: json['kill_house_centers_allocation'],
allocation_limit: json['allocation_limit'],
limitation_allocation: json['limitation_allocation'] as bool?,
registerar_role: json['registerar_role'] as String?,
registerar_fullname: json['registerar_fullname'] as String?,
registerar_mobile: json['registerar_mobile'] as String?,
kill_house_register: json['kill_house_register'] as bool?,
steward_register: json['steward_register'] as bool?,
guilds_room_register: json['guilds_room_register'] as bool?,
pos_company_register: json['pos_company_register'] as bool?,
province_accept_state: json['province_accept_state'] as String?,
province_message: json['province_message'] as String?,
condition: json['condition'] as String?,
description_condition: json['description_condition'] as String?,
steward_active: json['steward_active'] as bool?,
steward_allocation_limit: json['steward_allocation_limit'],
steward_limitation_allocation: json['steward_limitation_allocation'] as bool?,
license: json['license'] as bool?,
license_form: json['license_form'],
license_file: json['license_file'],
reviewer_role: json['reviewer_role'] as String?,
reviewer_fullname: json['reviewer_fullname'] as String?,
reviewer_mobile: json['reviewer_mobile'] as String?,
checker_message: json['checker_message'] as String?,
final_accept: json['final_accept'] as bool?,
temporary_registration: json['temporary_registration'] as bool?,
created_by: json['created_by'] as String?,
modified_by: json['modified_by'] as String?,
user_bank_info: json['user_bank_info'],
wallet: (json['wallet'] as num?)?.toInt(),
cars: json['cars'] as List<dynamic>?,
user_level: json['user_level'] as List<dynamic>?,
);
Map<String, dynamic> _$StewardToJson(_Steward instance) => <String, dynamic>{
'id': instance.id,
'user': instance.user,
'address': instance.address,
'guild_area_activity': instance.guild_area_activity,
'guild_type_activity': instance.guild_type_activity,
'kill_house': instance.kill_house,
'steward_kill_house': instance.steward_kill_house,
'stewards': instance.stewards,
'get_pos_status': instance.get_pos_status,
'key': instance.key,
'create_date': instance.create_date,
'modify_date': instance.modify_date,
'trash': instance.trash,
'user_id_foreign_key': instance.user_id_foreign_key,
'address_id_foreign_key': instance.address_id_foreign_key,
'user_bank_id_foreign_key': instance.user_bank_id_foreign_key,
'wallet_id_foreign_key': instance.wallet_id_foreign_key,
'provincial_government_id_key': instance.provincial_government_id_key,
'identity_documents': instance.identity_documents,
'active': instance.active,
'city_number': instance.city_number,
'city_name': instance.city_name,
'guilds_id': instance.guilds_id,
'license_number': instance.license_number,
'guilds_name': instance.guilds_name,
'phone': instance.phone,
'type_activity': instance.type_activity,
'area_activity': instance.area_activity,
'province_number': instance.province_number,
'province_name': instance.province_name,
'steward': instance.steward,
'has_pos': instance.has_pos,
'centers_allocation': instance.centers_allocation,
'kill_house_centers_allocation': instance.kill_house_centers_allocation,
'allocation_limit': instance.allocation_limit,
'limitation_allocation': instance.limitation_allocation,
'registerar_role': instance.registerar_role,
'registerar_fullname': instance.registerar_fullname,
'registerar_mobile': instance.registerar_mobile,
'kill_house_register': instance.kill_house_register,
'steward_register': instance.steward_register,
'guilds_room_register': instance.guilds_room_register,
'pos_company_register': instance.pos_company_register,
'province_accept_state': instance.province_accept_state,
'province_message': instance.province_message,
'condition': instance.condition,
'description_condition': instance.description_condition,
'steward_active': instance.steward_active,
'steward_allocation_limit': instance.steward_allocation_limit,
'steward_limitation_allocation': instance.steward_limitation_allocation,
'license': instance.license,
'license_form': instance.license_form,
'license_file': instance.license_file,
'reviewer_role': instance.reviewer_role,
'reviewer_fullname': instance.reviewer_fullname,
'reviewer_mobile': instance.reviewer_mobile,
'checker_message': instance.checker_message,
'final_accept': instance.final_accept,
'temporary_registration': instance.temporary_registration,
'created_by': instance.created_by,
'modified_by': instance.modified_by,
'user_bank_info': instance.user_bank_info,
'wallet': instance.wallet,
'cars': instance.cars,
'user_level': instance.user_level,
};
_User _$UserFromJson(Map<String, dynamic> json) => _User(
fullname: json['fullname'] as String?,
first_name: json['first_name'] as String?,
last_name: json['last_name'] as String?,
mobile: json['mobile'] as String?,
national_id: json['national_id'] as String?,
city: json['city'] as String?,
);
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.first_name,
'last_name': instance.last_name,
'mobile': instance.mobile,
'national_id': instance.national_id,
'city': instance.city,
};
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
province: json['province'] == null
? null
: Province.fromJson(json['province'] as Map<String, dynamic>),
city: json['city'] == null
? null
: Province.fromJson(json['city'] as Map<String, dynamic>),
address: json['address'] as String?,
postal_code: json['postal_code'] as String?,
);
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
'province': instance.province,
'city': instance.city,
'address': instance.address,
'postal_code': instance.postal_code,
};
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
_Province(key: json['key'] as String?, name: json['name'] as String?);
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
'key': instance.key,
'name': instance.name,
};
_Activity _$ActivityFromJson(Map<String, dynamic> json) =>
_Activity(key: json['key'] as String?, title: json['title'] as String?);
Map<String, dynamic> _$ActivityToJson(_Activity instance) => <String, dynamic>{
'key': instance.key,
'title': instance.title,
};
_PosStatus _$PosStatusFromJson(Map<String, dynamic> json) => _PosStatus(
len_active_sessions: (json['len_active_sessions'] as num?)?.toInt(),
has_pons: json['has_pons'] as bool?,
has_active_pons: json['has_active_pons'] as bool?,
);
Map<String, dynamic> _$PosStatusToJson(_PosStatus instance) =>
<String, dynamic>{
'len_active_sessions': instance.len_active_sessions,
'has_pons': instance.has_pons,
'has_active_pons': instance.has_active_pons,
};

View File

@@ -0,0 +1,25 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'bar_information.freezed.dart';
part 'bar_information.g.dart';
@freezed
abstract class BarInformation with _$BarInformation {
const factory BarInformation({
int? totalBars,
int? totalBarsQuantity,
double? totalBarsWeight,
int? totalEnteredBars,
int? totalEnteredBarsQuantity,
double? totalEnteredBarsWeight,
int? totalNotEnteredBars,
int? totalNotEnteredBarsQuantity,
double? totalNotEnteredKillHouseRequestsWeight,
int? totalRejectedBars,
int? totalRejectedBarsQuantity,
double? totalRejectedBarsWeight,
}) = _BarInformation;
factory BarInformation.fromJson(Map<String, dynamic> json) =>
_$BarInformationFromJson(json);
}

View File

@@ -0,0 +1,181 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'bar_information.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$BarInformation {
int? get totalBars; int? get totalBarsQuantity; double? get totalBarsWeight; int? get totalEnteredBars; int? get totalEnteredBarsQuantity; double? get totalEnteredBarsWeight; int? get totalNotEnteredBars; int? get totalNotEnteredBarsQuantity; double? get totalNotEnteredKillHouseRequestsWeight; int? get totalRejectedBars; int? get totalRejectedBarsQuantity; double? get totalRejectedBarsWeight;
/// Create a copy of BarInformation
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$BarInformationCopyWith<BarInformation> get copyWith => _$BarInformationCopyWithImpl<BarInformation>(this as BarInformation, _$identity);
/// Serializes this BarInformation to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is BarInformation&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsWeight, totalBarsWeight) || other.totalBarsWeight == totalBarsWeight)&&(identical(other.totalEnteredBars, totalEnteredBars) || other.totalEnteredBars == totalEnteredBars)&&(identical(other.totalEnteredBarsQuantity, totalEnteredBarsQuantity) || other.totalEnteredBarsQuantity == totalEnteredBarsQuantity)&&(identical(other.totalEnteredBarsWeight, totalEnteredBarsWeight) || other.totalEnteredBarsWeight == totalEnteredBarsWeight)&&(identical(other.totalNotEnteredBars, totalNotEnteredBars) || other.totalNotEnteredBars == totalNotEnteredBars)&&(identical(other.totalNotEnteredBarsQuantity, totalNotEnteredBarsQuantity) || other.totalNotEnteredBarsQuantity == totalNotEnteredBarsQuantity)&&(identical(other.totalNotEnteredKillHouseRequestsWeight, totalNotEnteredKillHouseRequestsWeight) || other.totalNotEnteredKillHouseRequestsWeight == totalNotEnteredKillHouseRequestsWeight)&&(identical(other.totalRejectedBars, totalRejectedBars) || other.totalRejectedBars == totalRejectedBars)&&(identical(other.totalRejectedBarsQuantity, totalRejectedBarsQuantity) || other.totalRejectedBarsQuantity == totalRejectedBarsQuantity)&&(identical(other.totalRejectedBarsWeight, totalRejectedBarsWeight) || other.totalRejectedBarsWeight == totalRejectedBarsWeight));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsWeight,totalEnteredBars,totalEnteredBarsQuantity,totalEnteredBarsWeight,totalNotEnteredBars,totalNotEnteredBarsQuantity,totalNotEnteredKillHouseRequestsWeight,totalRejectedBars,totalRejectedBarsQuantity,totalRejectedBarsWeight);
@override
String toString() {
return 'BarInformation(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsWeight: $totalBarsWeight, totalEnteredBars: $totalEnteredBars, totalEnteredBarsQuantity: $totalEnteredBarsQuantity, totalEnteredBarsWeight: $totalEnteredBarsWeight, totalNotEnteredBars: $totalNotEnteredBars, totalNotEnteredBarsQuantity: $totalNotEnteredBarsQuantity, totalNotEnteredKillHouseRequestsWeight: $totalNotEnteredKillHouseRequestsWeight, totalRejectedBars: $totalRejectedBars, totalRejectedBarsQuantity: $totalRejectedBarsQuantity, totalRejectedBarsWeight: $totalRejectedBarsWeight)';
}
}
/// @nodoc
abstract mixin class $BarInformationCopyWith<$Res> {
factory $BarInformationCopyWith(BarInformation value, $Res Function(BarInformation) _then) = _$BarInformationCopyWithImpl;
@useResult
$Res call({
int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight
});
}
/// @nodoc
class _$BarInformationCopyWithImpl<$Res>
implements $BarInformationCopyWith<$Res> {
_$BarInformationCopyWithImpl(this._self, this._then);
final BarInformation _self;
final $Res Function(BarInformation) _then;
/// Create a copy of BarInformation
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsWeight = freezed,Object? totalEnteredBars = freezed,Object? totalEnteredBarsQuantity = freezed,Object? totalEnteredBarsWeight = freezed,Object? totalNotEnteredBars = freezed,Object? totalNotEnteredBarsQuantity = freezed,Object? totalNotEnteredKillHouseRequestsWeight = freezed,Object? totalRejectedBars = freezed,Object? totalRejectedBarsQuantity = freezed,Object? totalRejectedBarsWeight = freezed,}) {
return _then(_self.copyWith(
totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable
as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable
as int?,totalBarsWeight: freezed == totalBarsWeight ? _self.totalBarsWeight : totalBarsWeight // ignore: cast_nullable_to_non_nullable
as double?,totalEnteredBars: freezed == totalEnteredBars ? _self.totalEnteredBars : totalEnteredBars // ignore: cast_nullable_to_non_nullable
as int?,totalEnteredBarsQuantity: freezed == totalEnteredBarsQuantity ? _self.totalEnteredBarsQuantity : totalEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
as int?,totalEnteredBarsWeight: freezed == totalEnteredBarsWeight ? _self.totalEnteredBarsWeight : totalEnteredBarsWeight // ignore: cast_nullable_to_non_nullable
as double?,totalNotEnteredBars: freezed == totalNotEnteredBars ? _self.totalNotEnteredBars : totalNotEnteredBars // ignore: cast_nullable_to_non_nullable
as int?,totalNotEnteredBarsQuantity: freezed == totalNotEnteredBarsQuantity ? _self.totalNotEnteredBarsQuantity : totalNotEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
as int?,totalNotEnteredKillHouseRequestsWeight: freezed == totalNotEnteredKillHouseRequestsWeight ? _self.totalNotEnteredKillHouseRequestsWeight : totalNotEnteredKillHouseRequestsWeight // ignore: cast_nullable_to_non_nullable
as double?,totalRejectedBars: freezed == totalRejectedBars ? _self.totalRejectedBars : totalRejectedBars // ignore: cast_nullable_to_non_nullable
as int?,totalRejectedBarsQuantity: freezed == totalRejectedBarsQuantity ? _self.totalRejectedBarsQuantity : totalRejectedBarsQuantity // ignore: cast_nullable_to_non_nullable
as int?,totalRejectedBarsWeight: freezed == totalRejectedBarsWeight ? _self.totalRejectedBarsWeight : totalRejectedBarsWeight // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
/// @nodoc
@JsonSerializable()
class _BarInformation implements BarInformation {
const _BarInformation({this.totalBars, this.totalBarsQuantity, this.totalBarsWeight, this.totalEnteredBars, this.totalEnteredBarsQuantity, this.totalEnteredBarsWeight, this.totalNotEnteredBars, this.totalNotEnteredBarsQuantity, this.totalNotEnteredKillHouseRequestsWeight, this.totalRejectedBars, this.totalRejectedBarsQuantity, this.totalRejectedBarsWeight});
factory _BarInformation.fromJson(Map<String, dynamic> json) => _$BarInformationFromJson(json);
@override final int? totalBars;
@override final int? totalBarsQuantity;
@override final double? totalBarsWeight;
@override final int? totalEnteredBars;
@override final int? totalEnteredBarsQuantity;
@override final double? totalEnteredBarsWeight;
@override final int? totalNotEnteredBars;
@override final int? totalNotEnteredBarsQuantity;
@override final double? totalNotEnteredKillHouseRequestsWeight;
@override final int? totalRejectedBars;
@override final int? totalRejectedBarsQuantity;
@override final double? totalRejectedBarsWeight;
/// Create a copy of BarInformation
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$BarInformationCopyWith<_BarInformation> get copyWith => __$BarInformationCopyWithImpl<_BarInformation>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$BarInformationToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _BarInformation&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsWeight, totalBarsWeight) || other.totalBarsWeight == totalBarsWeight)&&(identical(other.totalEnteredBars, totalEnteredBars) || other.totalEnteredBars == totalEnteredBars)&&(identical(other.totalEnteredBarsQuantity, totalEnteredBarsQuantity) || other.totalEnteredBarsQuantity == totalEnteredBarsQuantity)&&(identical(other.totalEnteredBarsWeight, totalEnteredBarsWeight) || other.totalEnteredBarsWeight == totalEnteredBarsWeight)&&(identical(other.totalNotEnteredBars, totalNotEnteredBars) || other.totalNotEnteredBars == totalNotEnteredBars)&&(identical(other.totalNotEnteredBarsQuantity, totalNotEnteredBarsQuantity) || other.totalNotEnteredBarsQuantity == totalNotEnteredBarsQuantity)&&(identical(other.totalNotEnteredKillHouseRequestsWeight, totalNotEnteredKillHouseRequestsWeight) || other.totalNotEnteredKillHouseRequestsWeight == totalNotEnteredKillHouseRequestsWeight)&&(identical(other.totalRejectedBars, totalRejectedBars) || other.totalRejectedBars == totalRejectedBars)&&(identical(other.totalRejectedBarsQuantity, totalRejectedBarsQuantity) || other.totalRejectedBarsQuantity == totalRejectedBarsQuantity)&&(identical(other.totalRejectedBarsWeight, totalRejectedBarsWeight) || other.totalRejectedBarsWeight == totalRejectedBarsWeight));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsWeight,totalEnteredBars,totalEnteredBarsQuantity,totalEnteredBarsWeight,totalNotEnteredBars,totalNotEnteredBarsQuantity,totalNotEnteredKillHouseRequestsWeight,totalRejectedBars,totalRejectedBarsQuantity,totalRejectedBarsWeight);
@override
String toString() {
return 'BarInformation(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsWeight: $totalBarsWeight, totalEnteredBars: $totalEnteredBars, totalEnteredBarsQuantity: $totalEnteredBarsQuantity, totalEnteredBarsWeight: $totalEnteredBarsWeight, totalNotEnteredBars: $totalNotEnteredBars, totalNotEnteredBarsQuantity: $totalNotEnteredBarsQuantity, totalNotEnteredKillHouseRequestsWeight: $totalNotEnteredKillHouseRequestsWeight, totalRejectedBars: $totalRejectedBars, totalRejectedBarsQuantity: $totalRejectedBarsQuantity, totalRejectedBarsWeight: $totalRejectedBarsWeight)';
}
}
/// @nodoc
abstract mixin class _$BarInformationCopyWith<$Res> implements $BarInformationCopyWith<$Res> {
factory _$BarInformationCopyWith(_BarInformation value, $Res Function(_BarInformation) _then) = __$BarInformationCopyWithImpl;
@override @useResult
$Res call({
int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight
});
}
/// @nodoc
class __$BarInformationCopyWithImpl<$Res>
implements _$BarInformationCopyWith<$Res> {
__$BarInformationCopyWithImpl(this._self, this._then);
final _BarInformation _self;
final $Res Function(_BarInformation) _then;
/// Create a copy of BarInformation
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsWeight = freezed,Object? totalEnteredBars = freezed,Object? totalEnteredBarsQuantity = freezed,Object? totalEnteredBarsWeight = freezed,Object? totalNotEnteredBars = freezed,Object? totalNotEnteredBarsQuantity = freezed,Object? totalNotEnteredKillHouseRequestsWeight = freezed,Object? totalRejectedBars = freezed,Object? totalRejectedBarsQuantity = freezed,Object? totalRejectedBarsWeight = freezed,}) {
return _then(_BarInformation(
totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable
as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable
as int?,totalBarsWeight: freezed == totalBarsWeight ? _self.totalBarsWeight : totalBarsWeight // ignore: cast_nullable_to_non_nullable
as double?,totalEnteredBars: freezed == totalEnteredBars ? _self.totalEnteredBars : totalEnteredBars // ignore: cast_nullable_to_non_nullable
as int?,totalEnteredBarsQuantity: freezed == totalEnteredBarsQuantity ? _self.totalEnteredBarsQuantity : totalEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
as int?,totalEnteredBarsWeight: freezed == totalEnteredBarsWeight ? _self.totalEnteredBarsWeight : totalEnteredBarsWeight // ignore: cast_nullable_to_non_nullable
as double?,totalNotEnteredBars: freezed == totalNotEnteredBars ? _self.totalNotEnteredBars : totalNotEnteredBars // ignore: cast_nullable_to_non_nullable
as int?,totalNotEnteredBarsQuantity: freezed == totalNotEnteredBarsQuantity ? _self.totalNotEnteredBarsQuantity : totalNotEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
as int?,totalNotEnteredKillHouseRequestsWeight: freezed == totalNotEnteredKillHouseRequestsWeight ? _self.totalNotEnteredKillHouseRequestsWeight : totalNotEnteredKillHouseRequestsWeight // ignore: cast_nullable_to_non_nullable
as double?,totalRejectedBars: freezed == totalRejectedBars ? _self.totalRejectedBars : totalRejectedBars // ignore: cast_nullable_to_non_nullable
as int?,totalRejectedBarsQuantity: freezed == totalRejectedBarsQuantity ? _self.totalRejectedBarsQuantity : totalRejectedBarsQuantity // ignore: cast_nullable_to_non_nullable
as int?,totalRejectedBarsWeight: freezed == totalRejectedBarsWeight ? _self.totalRejectedBarsWeight : totalRejectedBarsWeight // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
// dart format on

View File

@@ -0,0 +1,47 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'bar_information.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_BarInformation _$BarInformationFromJson(Map<String, dynamic> json) =>
_BarInformation(
totalBars: (json['total_bars'] as num?)?.toInt(),
totalBarsQuantity: (json['total_bars_quantity'] as num?)?.toInt(),
totalBarsWeight: (json['total_bars_weight'] as num?)?.toDouble(),
totalEnteredBars: (json['total_entered_bars'] as num?)?.toInt(),
totalEnteredBarsQuantity: (json['total_entered_bars_quantity'] as num?)
?.toInt(),
totalEnteredBarsWeight: (json['total_entered_bars_weight'] as num?)
?.toDouble(),
totalNotEnteredBars: (json['total_not_entered_bars'] as num?)?.toInt(),
totalNotEnteredBarsQuantity:
(json['total_not_entered_bars_quantity'] as num?)?.toInt(),
totalNotEnteredKillHouseRequestsWeight:
(json['total_not_entered_kill_house_requests_weight'] as num?)
?.toDouble(),
totalRejectedBars: (json['total_rejected_bars'] as num?)?.toInt(),
totalRejectedBarsQuantity: (json['total_rejected_bars_quantity'] as num?)
?.toInt(),
totalRejectedBarsWeight: (json['total_rejected_bars_weight'] as num?)
?.toDouble(),
);
Map<String, dynamic> _$BarInformationToJson(_BarInformation instance) =>
<String, dynamic>{
'total_bars': instance.totalBars,
'total_bars_quantity': instance.totalBarsQuantity,
'total_bars_weight': instance.totalBarsWeight,
'total_entered_bars': instance.totalEnteredBars,
'total_entered_bars_quantity': instance.totalEnteredBarsQuantity,
'total_entered_bars_weight': instance.totalEnteredBarsWeight,
'total_not_entered_bars': instance.totalNotEnteredBars,
'total_not_entered_bars_quantity': instance.totalNotEnteredBarsQuantity,
'total_not_entered_kill_house_requests_weight':
instance.totalNotEnteredKillHouseRequestsWeight,
'total_rejected_bars': instance.totalRejectedBars,
'total_rejected_bars_quantity': instance.totalRejectedBarsQuantity,
'total_rejected_bars_weight': instance.totalRejectedBarsWeight,
};

View File

@@ -0,0 +1,28 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'guild_model.freezed.dart';
part 'guild_model.g.dart';
@freezed
abstract class GuildModel with _$GuildModel {
const factory GuildModel({
String? key,
String? guildsName,
bool? steward,
User? user,
}) = _GuildModel;
factory GuildModel.fromJson(Map<String, dynamic> json) =>
_$GuildModelFromJson(json);
}
@freezed
abstract class User with _$User {
const factory User({
String? fullname,
String? mobile,
String? city,
}) = _User;
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
}

View File

@@ -0,0 +1,320 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'guild_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$GuildModel {
String? get key; String? get guildsName; bool? get steward; User? get user;
/// Create a copy of GuildModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$GuildModelCopyWith<GuildModel> get copyWith => _$GuildModelCopyWithImpl<GuildModel>(this as GuildModel, _$identity);
/// Serializes this GuildModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is GuildModel&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,key,guildsName,steward,user);
@override
String toString() {
return 'GuildModel(key: $key, guildsName: $guildsName, steward: $steward, user: $user)';
}
}
/// @nodoc
abstract mixin class $GuildModelCopyWith<$Res> {
factory $GuildModelCopyWith(GuildModel value, $Res Function(GuildModel) _then) = _$GuildModelCopyWithImpl;
@useResult
$Res call({
String? key, String? guildsName, bool? steward, User? user
});
$UserCopyWith<$Res>? get user;
}
/// @nodoc
class _$GuildModelCopyWithImpl<$Res>
implements $GuildModelCopyWith<$Res> {
_$GuildModelCopyWithImpl(this._self, this._then);
final GuildModel _self;
final $Res Function(GuildModel) _then;
/// Create a copy of GuildModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? user = freezed,}) {
return _then(_self.copyWith(
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable
as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as User?,
));
}
/// Create a copy of GuildModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$UserCopyWith<$Res>? get user {
if (_self.user == null) {
return null;
}
return $UserCopyWith<$Res>(_self.user!, (value) {
return _then(_self.copyWith(user: value));
});
}
}
/// @nodoc
@JsonSerializable()
class _GuildModel implements GuildModel {
const _GuildModel({this.key, this.guildsName, this.steward, this.user});
factory _GuildModel.fromJson(Map<String, dynamic> json) => _$GuildModelFromJson(json);
@override final String? key;
@override final String? guildsName;
@override final bool? steward;
@override final User? user;
/// Create a copy of GuildModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$GuildModelCopyWith<_GuildModel> get copyWith => __$GuildModelCopyWithImpl<_GuildModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$GuildModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GuildModel&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,key,guildsName,steward,user);
@override
String toString() {
return 'GuildModel(key: $key, guildsName: $guildsName, steward: $steward, user: $user)';
}
}
/// @nodoc
abstract mixin class _$GuildModelCopyWith<$Res> implements $GuildModelCopyWith<$Res> {
factory _$GuildModelCopyWith(_GuildModel value, $Res Function(_GuildModel) _then) = __$GuildModelCopyWithImpl;
@override @useResult
$Res call({
String? key, String? guildsName, bool? steward, User? user
});
@override $UserCopyWith<$Res>? get user;
}
/// @nodoc
class __$GuildModelCopyWithImpl<$Res>
implements _$GuildModelCopyWith<$Res> {
__$GuildModelCopyWithImpl(this._self, this._then);
final _GuildModel _self;
final $Res Function(_GuildModel) _then;
/// Create a copy of GuildModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? user = freezed,}) {
return _then(_GuildModel(
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable
as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as User?,
));
}
/// Create a copy of GuildModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$UserCopyWith<$Res>? get user {
if (_self.user == null) {
return null;
}
return $UserCopyWith<$Res>(_self.user!, (value) {
return _then(_self.copyWith(user: value));
});
}
}
/// @nodoc
mixin _$User {
String? get fullname; String? get mobile; String? get city;
/// Create a copy of User
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$UserCopyWith<User> get copyWith => _$UserCopyWithImpl<User>(this as User, _$identity);
/// Serializes this User to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.city, city) || other.city == city));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,fullname,mobile,city);
@override
String toString() {
return 'User(fullname: $fullname, mobile: $mobile, city: $city)';
}
}
/// @nodoc
abstract mixin class $UserCopyWith<$Res> {
factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl;
@useResult
$Res call({
String? fullname, String? mobile, String? city
});
}
/// @nodoc
class _$UserCopyWithImpl<$Res>
implements $UserCopyWith<$Res> {
_$UserCopyWithImpl(this._self, this._then);
final User _self;
final $Res Function(User) _then;
/// Create a copy of User
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? city = freezed,}) {
return _then(_self.copyWith(
fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _User implements User {
const _User({this.fullname, this.mobile, this.city});
factory _User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
@override final String? fullname;
@override final String? mobile;
@override final String? city;
/// Create a copy of User
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$UserToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.city, city) || other.city == city));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,fullname,mobile,city);
@override
String toString() {
return 'User(fullname: $fullname, mobile: $mobile, city: $city)';
}
}
/// @nodoc
abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> {
factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl;
@override @useResult
$Res call({
String? fullname, String? mobile, String? city
});
}
/// @nodoc
class __$UserCopyWithImpl<$Res>
implements _$UserCopyWith<$Res> {
__$UserCopyWithImpl(this._self, this._then);
final _User _self;
final $Res Function(_User) _then;
/// Create a copy of User
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? city = freezed,}) {
return _then(_User(
fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,36 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'guild_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_GuildModel _$GuildModelFromJson(Map<String, dynamic> json) => _GuildModel(
key: json['key'] as String?,
guildsName: json['guilds_name'] as String?,
steward: json['steward'] as bool?,
user: json['user'] == null
? null
: User.fromJson(json['user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$GuildModelToJson(_GuildModel instance) =>
<String, dynamic>{
'key': instance.key,
'guilds_name': instance.guildsName,
'steward': instance.steward,
'user': instance.user,
};
_User _$UserFromJson(Map<String, dynamic> json) => _User(
fullname: json['fullname'] as String?,
mobile: json['mobile'] as String?,
city: json['city'] as String?,
);
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
'fullname': instance.fullname,
'mobile': instance.mobile,
'city': instance.city,
};

View File

@@ -0,0 +1,160 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'guild_profile.freezed.dart';
part 'guild_profile.g.dart';
@freezed
abstract class GuildProfile with _$GuildProfile {
const factory GuildProfile({
int? id,
User? user,
Address? address,
GuildAreaActivity? guild_area_activity,
GuildTypeActivity? guild_type_activity,
List<dynamic>? kill_house,
List<dynamic>? steward_kill_house,
List<dynamic>? stewards,
GetPosStatus? get_pos_status,
String? key,
String? create_date,
String? modify_date,
bool? trash,
String? user_id_foreign_key,
String? address_id_foreign_key,
String? user_bank_id_foreign_key,
String? wallet_id_foreign_key,
String? provincial_government_id_key,
dynamic identity_documents,
bool? active,
int? city_number,
String? city_name,
String? guilds_id,
String? license_number,
String? guilds_name,
String? phone,
String? type_activity,
String? area_activity,
int? province_number,
String? province_name,
bool? steward,
bool? has_pos,
dynamic centers_allocation,
dynamic kill_house_centers_allocation,
dynamic allocation_limit,
bool? limitation_allocation,
String? registerar_role,
String? registerar_fullname,
String? registerar_mobile,
bool? kill_house_register,
bool? steward_register,
bool? guilds_room_register,
bool? pos_company_register,
String? province_accept_state,
String? province_message,
String? condition,
String? description_condition,
bool? steward_active,
dynamic steward_allocation_limit,
bool? steward_limitation_allocation,
bool? license,
dynamic license_form,
dynamic license_file,
String? reviewer_role,
String? reviewer_fullname,
String? reviewer_mobile,
String? checker_message,
bool? final_accept,
bool? temporary_registration,
String? created_by,
String? modified_by,
dynamic user_bank_info,
int? wallet,
List<dynamic>? cars,
List<dynamic>? user_level,
}) = _GuildProfile;
factory GuildProfile.fromJson(Map<String, dynamic> json) =>
_$GuildProfileFromJson(json);
}
@freezed
abstract class User with _$User {
const factory User({
String? fullname,
String? first_name,
String? last_name,
String? mobile,
String? national_id,
String? city,
}) = _User;
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
}
@freezed
abstract class Address with _$Address {
const factory Address({
Province? province,
City? city,
String? address,
String? postal_code,
}) = _Address;
factory Address.fromJson(Map<String, dynamic> json) =>
_$AddressFromJson(json);
}
@freezed
abstract class Province with _$Province {
const factory Province({
String? key,
String? name,
}) = _Province;
factory Province.fromJson(Map<String, dynamic> json) =>
_$ProvinceFromJson(json);
}
@freezed
abstract class City with _$City {
const factory City({
String? key,
String? name,
}) = _City;
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
}
@freezed
abstract class GuildAreaActivity with _$GuildAreaActivity {
const factory GuildAreaActivity({
String? key,
String? title,
}) = _GuildAreaActivity;
factory GuildAreaActivity.fromJson(Map<String, dynamic> json) =>
_$GuildAreaActivityFromJson(json);
}
@freezed
abstract class GuildTypeActivity with _$GuildTypeActivity {
const factory GuildTypeActivity({
String? key,
String? title,
}) = _GuildTypeActivity;
factory GuildTypeActivity.fromJson(Map<String, dynamic> json) =>
_$GuildTypeActivityFromJson(json);
}
@freezed
abstract class GetPosStatus with _$GetPosStatus {
const factory GetPosStatus({
int? len_active_sessions,
bool? has_pons,
bool? has_active_pons,
}) = _GetPosStatus;
factory GetPosStatus.fromJson(Map<String, dynamic> json) =>
_$GetPosStatusFromJson(json);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,244 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'guild_profile.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_GuildProfile _$GuildProfileFromJson(
Map<String, dynamic> json,
) => _GuildProfile(
id: (json['id'] as num?)?.toInt(),
user: json['user'] == null
? null
: User.fromJson(json['user'] as Map<String, dynamic>),
address: json['address'] == null
? null
: Address.fromJson(json['address'] as Map<String, dynamic>),
guild_area_activity: json['guild_area_activity'] == null
? null
: GuildAreaActivity.fromJson(
json['guild_area_activity'] as Map<String, dynamic>,
),
guild_type_activity: json['guild_type_activity'] == null
? null
: GuildTypeActivity.fromJson(
json['guild_type_activity'] as Map<String, dynamic>,
),
kill_house: json['kill_house'] as List<dynamic>?,
steward_kill_house: json['steward_kill_house'] as List<dynamic>?,
stewards: json['stewards'] as List<dynamic>?,
get_pos_status: json['get_pos_status'] == null
? null
: GetPosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
key: json['key'] as String?,
create_date: json['create_date'] as String?,
modify_date: json['modify_date'] as String?,
trash: json['trash'] as bool?,
user_id_foreign_key: json['user_id_foreign_key'] as String?,
address_id_foreign_key: json['address_id_foreign_key'] as String?,
user_bank_id_foreign_key: json['user_bank_id_foreign_key'] as String?,
wallet_id_foreign_key: json['wallet_id_foreign_key'] as String?,
provincial_government_id_key: json['provincial_government_id_key'] as String?,
identity_documents: json['identity_documents'],
active: json['active'] as bool?,
city_number: (json['city_number'] as num?)?.toInt(),
city_name: json['city_name'] as String?,
guilds_id: json['guilds_id'] as String?,
license_number: json['license_number'] as String?,
guilds_name: json['guilds_name'] as String?,
phone: json['phone'] as String?,
type_activity: json['type_activity'] as String?,
area_activity: json['area_activity'] as String?,
province_number: (json['province_number'] as num?)?.toInt(),
province_name: json['province_name'] as String?,
steward: json['steward'] as bool?,
has_pos: json['has_pos'] as bool?,
centers_allocation: json['centers_allocation'],
kill_house_centers_allocation: json['kill_house_centers_allocation'],
allocation_limit: json['allocation_limit'],
limitation_allocation: json['limitation_allocation'] as bool?,
registerar_role: json['registerar_role'] as String?,
registerar_fullname: json['registerar_fullname'] as String?,
registerar_mobile: json['registerar_mobile'] as String?,
kill_house_register: json['kill_house_register'] as bool?,
steward_register: json['steward_register'] as bool?,
guilds_room_register: json['guilds_room_register'] as bool?,
pos_company_register: json['pos_company_register'] as bool?,
province_accept_state: json['province_accept_state'] as String?,
province_message: json['province_message'] as String?,
condition: json['condition'] as String?,
description_condition: json['description_condition'] as String?,
steward_active: json['steward_active'] as bool?,
steward_allocation_limit: json['steward_allocation_limit'],
steward_limitation_allocation: json['steward_limitation_allocation'] as bool?,
license: json['license'] as bool?,
license_form: json['license_form'],
license_file: json['license_file'],
reviewer_role: json['reviewer_role'] as String?,
reviewer_fullname: json['reviewer_fullname'] as String?,
reviewer_mobile: json['reviewer_mobile'] as String?,
checker_message: json['checker_message'] as String?,
final_accept: json['final_accept'] as bool?,
temporary_registration: json['temporary_registration'] as bool?,
created_by: json['created_by'] as String?,
modified_by: json['modified_by'] as String?,
user_bank_info: json['user_bank_info'],
wallet: (json['wallet'] as num?)?.toInt(),
cars: json['cars'] as List<dynamic>?,
user_level: json['user_level'] as List<dynamic>?,
);
Map<String, dynamic> _$GuildProfileToJson(_GuildProfile instance) =>
<String, dynamic>{
'id': instance.id,
'user': instance.user,
'address': instance.address,
'guild_area_activity': instance.guild_area_activity,
'guild_type_activity': instance.guild_type_activity,
'kill_house': instance.kill_house,
'steward_kill_house': instance.steward_kill_house,
'stewards': instance.stewards,
'get_pos_status': instance.get_pos_status,
'key': instance.key,
'create_date': instance.create_date,
'modify_date': instance.modify_date,
'trash': instance.trash,
'user_id_foreign_key': instance.user_id_foreign_key,
'address_id_foreign_key': instance.address_id_foreign_key,
'user_bank_id_foreign_key': instance.user_bank_id_foreign_key,
'wallet_id_foreign_key': instance.wallet_id_foreign_key,
'provincial_government_id_key': instance.provincial_government_id_key,
'identity_documents': instance.identity_documents,
'active': instance.active,
'city_number': instance.city_number,
'city_name': instance.city_name,
'guilds_id': instance.guilds_id,
'license_number': instance.license_number,
'guilds_name': instance.guilds_name,
'phone': instance.phone,
'type_activity': instance.type_activity,
'area_activity': instance.area_activity,
'province_number': instance.province_number,
'province_name': instance.province_name,
'steward': instance.steward,
'has_pos': instance.has_pos,
'centers_allocation': instance.centers_allocation,
'kill_house_centers_allocation': instance.kill_house_centers_allocation,
'allocation_limit': instance.allocation_limit,
'limitation_allocation': instance.limitation_allocation,
'registerar_role': instance.registerar_role,
'registerar_fullname': instance.registerar_fullname,
'registerar_mobile': instance.registerar_mobile,
'kill_house_register': instance.kill_house_register,
'steward_register': instance.steward_register,
'guilds_room_register': instance.guilds_room_register,
'pos_company_register': instance.pos_company_register,
'province_accept_state': instance.province_accept_state,
'province_message': instance.province_message,
'condition': instance.condition,
'description_condition': instance.description_condition,
'steward_active': instance.steward_active,
'steward_allocation_limit': instance.steward_allocation_limit,
'steward_limitation_allocation': instance.steward_limitation_allocation,
'license': instance.license,
'license_form': instance.license_form,
'license_file': instance.license_file,
'reviewer_role': instance.reviewer_role,
'reviewer_fullname': instance.reviewer_fullname,
'reviewer_mobile': instance.reviewer_mobile,
'checker_message': instance.checker_message,
'final_accept': instance.final_accept,
'temporary_registration': instance.temporary_registration,
'created_by': instance.created_by,
'modified_by': instance.modified_by,
'user_bank_info': instance.user_bank_info,
'wallet': instance.wallet,
'cars': instance.cars,
'user_level': instance.user_level,
};
_User _$UserFromJson(Map<String, dynamic> json) => _User(
fullname: json['fullname'] as String?,
first_name: json['first_name'] as String?,
last_name: json['last_name'] as String?,
mobile: json['mobile'] as String?,
national_id: json['national_id'] as String?,
city: json['city'] as String?,
);
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.first_name,
'last_name': instance.last_name,
'mobile': instance.mobile,
'national_id': instance.national_id,
'city': instance.city,
};
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
province: json['province'] == null
? null
: Province.fromJson(json['province'] as Map<String, dynamic>),
city: json['city'] == null
? null
: City.fromJson(json['city'] as Map<String, dynamic>),
address: json['address'] as String?,
postal_code: json['postal_code'] as String?,
);
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
'province': instance.province,
'city': instance.city,
'address': instance.address,
'postal_code': instance.postal_code,
};
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
_Province(key: json['key'] as String?, name: json['name'] as String?);
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
'key': instance.key,
'name': instance.name,
};
_City _$CityFromJson(Map<String, dynamic> json) =>
_City(key: json['key'] as String?, name: json['name'] as String?);
Map<String, dynamic> _$CityToJson(_City instance) => <String, dynamic>{
'key': instance.key,
'name': instance.name,
};
_GuildAreaActivity _$GuildAreaActivityFromJson(Map<String, dynamic> json) =>
_GuildAreaActivity(
key: json['key'] as String?,
title: json['title'] as String?,
);
Map<String, dynamic> _$GuildAreaActivityToJson(_GuildAreaActivity instance) =>
<String, dynamic>{'key': instance.key, 'title': instance.title};
_GuildTypeActivity _$GuildTypeActivityFromJson(Map<String, dynamic> json) =>
_GuildTypeActivity(
key: json['key'] as String?,
title: json['title'] as String?,
);
Map<String, dynamic> _$GuildTypeActivityToJson(_GuildTypeActivity instance) =>
<String, dynamic>{'key': instance.key, 'title': instance.title};
_GetPosStatus _$GetPosStatusFromJson(Map<String, dynamic> json) =>
_GetPosStatus(
len_active_sessions: (json['len_active_sessions'] as num?)?.toInt(),
has_pons: json['has_pons'] as bool?,
has_active_pons: json['has_active_pons'] as bool?,
);
Map<String, dynamic> _$GetPosStatusToJson(_GetPosStatus instance) =>
<String, dynamic>{
'len_active_sessions': instance.len_active_sessions,
'has_pons': instance.has_pons,
'has_active_pons': instance.has_active_pons,
};

View File

@@ -0,0 +1,311 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'imported_loads_model.freezed.dart';
part 'imported_loads_model.g.dart';
@freezed
abstract class ImportedLoadsModel with _$ImportedLoadsModel {
const factory ImportedLoadsModel({
int? count,
String? next,
String? previous,
List<ImportedLoad>? results,
}) = _ImportedLoadsModel;
factory ImportedLoadsModel.fromJson(Map<String, dynamic> json) =>
_$ImportedLoadsModelFromJson(json);
}
@freezed
abstract class ImportedLoad with _$ImportedLoad {
const factory ImportedLoad({
int? id,
Product? product,
KillHouse? killHouse,
dynamic toKillHouse,
dynamic steward,
ToSteward? toSteward,
dynamic guilds,
dynamic toGuilds,
dynamic toColdHouse,
int? indexWeight,
int? dateTimestamp,
int? newState,
int? newReceiverState,
int? newAllocationState,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
int? numberOfCarcasses,
int? realNumberOfCarcasses,
int? receiverRealNumberOfCarcasses,
double? weightOfCarcasses,
double? realWeightOfCarcasses,
double? receiverRealWeightOfCarcasses,
double? weightLossOfCarcasses,
bool? finalRegistration,
String? sellType,
String? productName,
String? sellerType,
String? type,
String? saleType,
String? allocationType,
bool? systemRegistrationCode,
int? registrationCode,
int? amount,
int? totalAmount,
int? totalAmountPaid,
int? totalAmountRemain,
dynamic loggedRegistrationCode,
String? state,
String? receiverState,
String? allocationState,
String? date,
dynamic role,
dynamic stewardTempKey,
bool? approvedPriceStatus,
bool? calculateStatus,
bool? temporaryTrash,
bool? temporaryDeleted,
dynamic createdBy,
dynamic modifiedBy,
dynamic wareHouse,
dynamic stewardWareHouse,
dynamic car,
dynamic dispenser,
}) = _ImportedLoad;
factory ImportedLoad.fromJson(Map<String, dynamic> json) =>
_$ImportedLoadFromJson(json);
}
@freezed
abstract class Product with _$Product {
const factory Product({
double? weightAverage,
}) = _Product;
factory Product.fromJson(Map<String, dynamic> json) =>
_$ProductFromJson(json);
}
@freezed
abstract class KillHouse with _$KillHouse {
const factory KillHouse({
String? key,
KillHouseOperator? killHouseOperator,
String? name,
bool? killer,
}) = _KillHouse;
factory KillHouse.fromJson(Map<String, dynamic> json) =>
_$KillHouseFromJson(json);
}
@freezed
abstract class KillHouseOperator with _$KillHouseOperator {
const factory KillHouseOperator({
User? user,
}) = _KillHouseOperator;
factory KillHouseOperator.fromJson(Map<String, dynamic> json) =>
_$KillHouseOperatorFromJson(json);
}
@freezed
abstract class User with _$User {
const factory User({
String? fullname,
String? firstName,
String? lastName,
int? baseOrder,
String? mobile,
String? nationalId,
String? nationalCode,
String? key,
City? city,
String? unitName,
String? unitNationalId,
String? unitRegistrationNumber,
String? unitEconomicalNumber,
String? unitProvince,
String? unitCity,
String? unitPostalCode,
String? unitAddress,
}) = _User;
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
}
@freezed
abstract class City with _$City {
const factory City({
int? id,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
int? provinceIdForeignKey,
int? cityIdKey,
String? name,
double? productPrice,
bool? provinceCenter,
int? cityNumber,
String? cityName,
int? provinceNumber,
String? provinceName,
dynamic createdBy,
dynamic modifiedBy,
int? province,
}) = _City;
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
}
@freezed
abstract class ToSteward with _$ToSteward {
const factory ToSteward({
int? id,
ToStewardUser? user,
Address? address,
Activity? guildAreaActivity,
Activity? guildTypeActivity,
List<dynamic>? killHouse,
List<dynamic>? stewardKillHouse,
List<dynamic>? stewards,
PosStatus? getPosStatus,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
dynamic userIdForeignKey,
dynamic addressIdForeignKey,
dynamic userBankIdForeignKey,
dynamic walletIdForeignKey,
dynamic provincialGovernmentIdKey,
dynamic identityDocuments,
bool? active,
int? cityNumber,
String? cityName,
String? guildsId,
String? licenseNumber,
String? guildsName,
dynamic phone,
String? typeActivity,
String? areaActivity,
int? provinceNumber,
String? provinceName,
bool? steward,
bool? hasPos,
dynamic centersAllocation,
dynamic killHouseCentersAllocation,
dynamic allocationLimit,
bool? limitationAllocation,
dynamic registerarRole,
dynamic registerarFullname,
dynamic registerarMobile,
bool? killHouseRegister,
bool? stewardRegister,
bool? guildsRoomRegister,
bool? posCompanyRegister,
String? provinceAcceptState,
dynamic provinceMessage,
dynamic condition,
dynamic descriptionCondition,
bool? stewardActive,
dynamic stewardAllocationLimit,
bool? stewardLimitationAllocation,
bool? license,
dynamic licenseForm,
dynamic licenseFile,
dynamic reviewerRole,
dynamic reviewerFullname,
dynamic reviewerMobile,
dynamic checkerMessage,
bool? finalAccept,
bool? temporaryRegistration,
dynamic createdBy,
dynamic modifiedBy,
dynamic userBankInfo,
int? wallet,
List<dynamic>? cars,
List<dynamic>? userLevel,
}) = _ToSteward;
factory ToSteward.fromJson(Map<String, dynamic> json) =>
_$ToStewardFromJson(json);
}
@freezed
abstract class ToStewardUser with _$ToStewardUser {
const factory ToStewardUser({
String? fullname,
String? firstName,
String? lastName,
String? mobile,
String? nationalId,
String? city,
}) = _ToStewardUser;
factory ToStewardUser.fromJson(Map<String, dynamic> json) =>
_$ToStewardUserFromJson(json);
}
@freezed
abstract class Address with _$Address {
const factory Address({
Province? province,
CitySimple? city,
String? address,
String? postalCode,
}) = _Address;
factory Address.fromJson(Map<String, dynamic> json) =>
_$AddressFromJson(json);
}
@freezed
abstract class Province with _$Province {
const factory Province({
String? key,
String? name,
}) = _Province;
factory Province.fromJson(Map<String, dynamic> json) =>
_$ProvinceFromJson(json);
}
@freezed
abstract class CitySimple with _$CitySimple {
const factory CitySimple({
String? key,
String? name,
}) = _CitySimple;
factory CitySimple.fromJson(Map<String, dynamic> json) =>
_$CitySimpleFromJson(json);
}
@freezed
abstract class Activity with _$Activity {
const factory Activity({
String? key,
String? title,
}) = _Activity;
factory Activity.fromJson(Map<String, dynamic> json) =>
_$ActivityFromJson(json);
}
@freezed
abstract class PosStatus with _$PosStatus {
const factory PosStatus({
int? lenActiveSessions,
bool? hasPons,
bool? hasActivePons,
}) = _PosStatus;
factory PosStatus.fromJson(Map<String, dynamic> json) =>
_$PosStatusFromJson(json);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,491 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'imported_loads_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_ImportedLoadsModel _$ImportedLoadsModelFromJson(Map<String, dynamic> json) =>
_ImportedLoadsModel(
count: (json['count'] as num?)?.toInt(),
next: json['next'] as String?,
previous: json['previous'] as String?,
results: (json['results'] as List<dynamic>?)
?.map((e) => ImportedLoad.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$ImportedLoadsModelToJson(_ImportedLoadsModel instance) =>
<String, dynamic>{
'count': instance.count,
'next': instance.next,
'previous': instance.previous,
'results': instance.results,
};
_ImportedLoad _$ImportedLoadFromJson(
Map<String, dynamic> json,
) => _ImportedLoad(
id: (json['id'] as num?)?.toInt(),
product: json['product'] == null
? null
: Product.fromJson(json['product'] as Map<String, dynamic>),
killHouse: json['kill_house'] == null
? null
: KillHouse.fromJson(json['kill_house'] as Map<String, dynamic>),
toKillHouse: json['to_kill_house'],
steward: json['steward'],
toSteward: json['to_steward'] == null
? null
: ToSteward.fromJson(json['to_steward'] as Map<String, dynamic>),
guilds: json['guilds'],
toGuilds: json['to_guilds'],
toColdHouse: json['to_cold_house'],
indexWeight: (json['index_weight'] as num?)?.toInt(),
dateTimestamp: (json['date_timestamp'] as num?)?.toInt(),
newState: (json['new_state'] as num?)?.toInt(),
newReceiverState: (json['new_receiver_state'] as num?)?.toInt(),
newAllocationState: (json['new_allocation_state'] as num?)?.toInt(),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
receiverRealNumberOfCarcasses:
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(),
realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toDouble(),
receiverRealWeightOfCarcasses:
(json['receiver_real_weight_of_carcasses'] as num?)?.toDouble(),
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toDouble(),
finalRegistration: json['final_registration'] as bool?,
sellType: json['sell_type'] as String?,
productName: json['product_name'] as String?,
sellerType: json['seller_type'] as String?,
type: json['type'] as String?,
saleType: json['sale_type'] as String?,
allocationType: json['allocation_type'] as String?,
systemRegistrationCode: json['system_registration_code'] as bool?,
registrationCode: (json['registration_code'] as num?)?.toInt(),
amount: (json['amount'] as num?)?.toInt(),
totalAmount: (json['total_amount'] as num?)?.toInt(),
totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(),
totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(),
loggedRegistrationCode: json['logged_registration_code'],
state: json['state'] as String?,
receiverState: json['receiver_state'] as String?,
allocationState: json['allocation_state'] as String?,
date: json['date'] as String?,
role: json['role'],
stewardTempKey: json['steward_temp_key'],
approvedPriceStatus: json['approved_price_status'] as bool?,
calculateStatus: json['calculate_status'] as bool?,
temporaryTrash: json['temporary_trash'] as bool?,
temporaryDeleted: json['temporary_deleted'] as bool?,
createdBy: json['created_by'],
modifiedBy: json['modified_by'],
wareHouse: json['ware_house'],
stewardWareHouse: json['steward_ware_house'],
car: json['car'],
dispenser: json['dispenser'],
);
Map<String, dynamic> _$ImportedLoadToJson(
_ImportedLoad instance,
) => <String, dynamic>{
'id': instance.id,
'product': instance.product,
'kill_house': instance.killHouse,
'to_kill_house': instance.toKillHouse,
'steward': instance.steward,
'to_steward': instance.toSteward,
'guilds': instance.guilds,
'to_guilds': instance.toGuilds,
'to_cold_house': instance.toColdHouse,
'index_weight': instance.indexWeight,
'date_timestamp': instance.dateTimestamp,
'new_state': instance.newState,
'new_receiver_state': instance.newReceiverState,
'new_allocation_state': instance.newAllocationState,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'number_of_carcasses': instance.numberOfCarcasses,
'real_number_of_carcasses': instance.realNumberOfCarcasses,
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
'weight_of_carcasses': instance.weightOfCarcasses,
'real_weight_of_carcasses': instance.realWeightOfCarcasses,
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
'final_registration': instance.finalRegistration,
'sell_type': instance.sellType,
'product_name': instance.productName,
'seller_type': instance.sellerType,
'type': instance.type,
'sale_type': instance.saleType,
'allocation_type': instance.allocationType,
'system_registration_code': instance.systemRegistrationCode,
'registration_code': instance.registrationCode,
'amount': instance.amount,
'total_amount': instance.totalAmount,
'total_amount_paid': instance.totalAmountPaid,
'total_amount_remain': instance.totalAmountRemain,
'logged_registration_code': instance.loggedRegistrationCode,
'state': instance.state,
'receiver_state': instance.receiverState,
'allocation_state': instance.allocationState,
'date': instance.date,
'role': instance.role,
'steward_temp_key': instance.stewardTempKey,
'approved_price_status': instance.approvedPriceStatus,
'calculate_status': instance.calculateStatus,
'temporary_trash': instance.temporaryTrash,
'temporary_deleted': instance.temporaryDeleted,
'created_by': instance.createdBy,
'modified_by': instance.modifiedBy,
'ware_house': instance.wareHouse,
'steward_ware_house': instance.stewardWareHouse,
'car': instance.car,
'dispenser': instance.dispenser,
};
_Product _$ProductFromJson(Map<String, dynamic> json) =>
_Product(weightAverage: (json['weight_average'] as num?)?.toDouble());
Map<String, dynamic> _$ProductToJson(_Product instance) => <String, dynamic>{
'weight_average': instance.weightAverage,
};
_KillHouse _$KillHouseFromJson(Map<String, dynamic> json) => _KillHouse(
key: json['key'] as String?,
killHouseOperator: json['kill_house_operator'] == null
? null
: KillHouseOperator.fromJson(
json['kill_house_operator'] as Map<String, dynamic>,
),
name: json['name'] as String?,
killer: json['killer'] as bool?,
);
Map<String, dynamic> _$KillHouseToJson(_KillHouse instance) =>
<String, dynamic>{
'key': instance.key,
'kill_house_operator': instance.killHouseOperator,
'name': instance.name,
'killer': instance.killer,
};
_KillHouseOperator _$KillHouseOperatorFromJson(Map<String, dynamic> json) =>
_KillHouseOperator(
user: json['user'] == null
? null
: User.fromJson(json['user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$KillHouseOperatorToJson(_KillHouseOperator instance) =>
<String, dynamic>{'user': instance.user};
_User _$UserFromJson(Map<String, dynamic> json) => _User(
fullname: json['fullname'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
baseOrder: (json['base_order'] as num?)?.toInt(),
mobile: json['mobile'] as String?,
nationalId: json['national_id'] as String?,
nationalCode: json['national_code'] as String?,
key: json['key'] as String?,
city: json['city'] == null
? null
: City.fromJson(json['city'] as Map<String, dynamic>),
unitName: json['unit_name'] as String?,
unitNationalId: json['unit_national_id'] as String?,
unitRegistrationNumber: json['unit_registration_number'] as String?,
unitEconomicalNumber: json['unit_economical_number'] as String?,
unitProvince: json['unit_province'] as String?,
unitCity: json['unit_city'] as String?,
unitPostalCode: json['unit_postal_code'] as String?,
unitAddress: json['unit_address'] as String?,
);
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.firstName,
'last_name': instance.lastName,
'base_order': instance.baseOrder,
'mobile': instance.mobile,
'national_id': instance.nationalId,
'national_code': instance.nationalCode,
'key': instance.key,
'city': instance.city,
'unit_name': instance.unitName,
'unit_national_id': instance.unitNationalId,
'unit_registration_number': instance.unitRegistrationNumber,
'unit_economical_number': instance.unitEconomicalNumber,
'unit_province': instance.unitProvince,
'unit_city': instance.unitCity,
'unit_postal_code': instance.unitPostalCode,
'unit_address': instance.unitAddress,
};
_City _$CityFromJson(Map<String, dynamic> json) => _City(
id: (json['id'] as num?)?.toInt(),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
provinceIdForeignKey: (json['province_id_foreign_key'] as num?)?.toInt(),
cityIdKey: (json['city_id_key'] as num?)?.toInt(),
name: json['name'] as String?,
productPrice: (json['product_price'] as num?)?.toDouble(),
provinceCenter: json['province_center'] as bool?,
cityNumber: (json['city_number'] as num?)?.toInt(),
cityName: json['city_name'] as String?,
provinceNumber: (json['province_number'] as num?)?.toInt(),
provinceName: json['province_name'] as String?,
createdBy: json['created_by'],
modifiedBy: json['modified_by'],
province: (json['province'] as num?)?.toInt(),
);
Map<String, dynamic> _$CityToJson(_City instance) => <String, dynamic>{
'id': instance.id,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'province_id_foreign_key': instance.provinceIdForeignKey,
'city_id_key': instance.cityIdKey,
'name': instance.name,
'product_price': instance.productPrice,
'province_center': instance.provinceCenter,
'city_number': instance.cityNumber,
'city_name': instance.cityName,
'province_number': instance.provinceNumber,
'province_name': instance.provinceName,
'created_by': instance.createdBy,
'modified_by': instance.modifiedBy,
'province': instance.province,
};
_ToSteward _$ToStewardFromJson(Map<String, dynamic> json) => _ToSteward(
id: (json['id'] as num?)?.toInt(),
user: json['user'] == null
? null
: ToStewardUser.fromJson(json['user'] as Map<String, dynamic>),
address: json['address'] == null
? null
: Address.fromJson(json['address'] as Map<String, dynamic>),
guildAreaActivity: json['guild_area_activity'] == null
? null
: Activity.fromJson(json['guild_area_activity'] as Map<String, dynamic>),
guildTypeActivity: json['guild_type_activity'] == null
? null
: Activity.fromJson(json['guild_type_activity'] as Map<String, dynamic>),
killHouse: json['kill_house'] as List<dynamic>?,
stewardKillHouse: json['steward_kill_house'] as List<dynamic>?,
stewards: json['stewards'] as List<dynamic>?,
getPosStatus: json['get_pos_status'] == null
? null
: PosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
userIdForeignKey: json['user_id_foreign_key'],
addressIdForeignKey: json['address_id_foreign_key'],
userBankIdForeignKey: json['user_bank_id_foreign_key'],
walletIdForeignKey: json['wallet_id_foreign_key'],
provincialGovernmentIdKey: json['provincial_government_id_key'],
identityDocuments: json['identity_documents'],
active: json['active'] as bool?,
cityNumber: (json['city_number'] as num?)?.toInt(),
cityName: json['city_name'] as String?,
guildsId: json['guilds_id'] as String?,
licenseNumber: json['license_number'] as String?,
guildsName: json['guilds_name'] as String?,
phone: json['phone'],
typeActivity: json['type_activity'] as String?,
areaActivity: json['area_activity'] as String?,
provinceNumber: (json['province_number'] as num?)?.toInt(),
provinceName: json['province_name'] as String?,
steward: json['steward'] as bool?,
hasPos: json['has_pos'] as bool?,
centersAllocation: json['centers_allocation'],
killHouseCentersAllocation: json['kill_house_centers_allocation'],
allocationLimit: json['allocation_limit'],
limitationAllocation: json['limitation_allocation'] as bool?,
registerarRole: json['registerar_role'],
registerarFullname: json['registerar_fullname'],
registerarMobile: json['registerar_mobile'],
killHouseRegister: json['kill_house_register'] as bool?,
stewardRegister: json['steward_register'] as bool?,
guildsRoomRegister: json['guilds_room_register'] as bool?,
posCompanyRegister: json['pos_company_register'] as bool?,
provinceAcceptState: json['province_accept_state'] as String?,
provinceMessage: json['province_message'],
condition: json['condition'],
descriptionCondition: json['description_condition'],
stewardActive: json['steward_active'] as bool?,
stewardAllocationLimit: json['steward_allocation_limit'],
stewardLimitationAllocation: json['steward_limitation_allocation'] as bool?,
license: json['license'] as bool?,
licenseForm: json['license_form'],
licenseFile: json['license_file'],
reviewerRole: json['reviewer_role'],
reviewerFullname: json['reviewer_fullname'],
reviewerMobile: json['reviewer_mobile'],
checkerMessage: json['checker_message'],
finalAccept: json['final_accept'] as bool?,
temporaryRegistration: json['temporary_registration'] as bool?,
createdBy: json['created_by'],
modifiedBy: json['modified_by'],
userBankInfo: json['user_bank_info'],
wallet: (json['wallet'] as num?)?.toInt(),
cars: json['cars'] as List<dynamic>?,
userLevel: json['user_level'] as List<dynamic>?,
);
Map<String, dynamic> _$ToStewardToJson(_ToSteward instance) =>
<String, dynamic>{
'id': instance.id,
'user': instance.user,
'address': instance.address,
'guild_area_activity': instance.guildAreaActivity,
'guild_type_activity': instance.guildTypeActivity,
'kill_house': instance.killHouse,
'steward_kill_house': instance.stewardKillHouse,
'stewards': instance.stewards,
'get_pos_status': instance.getPosStatus,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'user_id_foreign_key': instance.userIdForeignKey,
'address_id_foreign_key': instance.addressIdForeignKey,
'user_bank_id_foreign_key': instance.userBankIdForeignKey,
'wallet_id_foreign_key': instance.walletIdForeignKey,
'provincial_government_id_key': instance.provincialGovernmentIdKey,
'identity_documents': instance.identityDocuments,
'active': instance.active,
'city_number': instance.cityNumber,
'city_name': instance.cityName,
'guilds_id': instance.guildsId,
'license_number': instance.licenseNumber,
'guilds_name': instance.guildsName,
'phone': instance.phone,
'type_activity': instance.typeActivity,
'area_activity': instance.areaActivity,
'province_number': instance.provinceNumber,
'province_name': instance.provinceName,
'steward': instance.steward,
'has_pos': instance.hasPos,
'centers_allocation': instance.centersAllocation,
'kill_house_centers_allocation': instance.killHouseCentersAllocation,
'allocation_limit': instance.allocationLimit,
'limitation_allocation': instance.limitationAllocation,
'registerar_role': instance.registerarRole,
'registerar_fullname': instance.registerarFullname,
'registerar_mobile': instance.registerarMobile,
'kill_house_register': instance.killHouseRegister,
'steward_register': instance.stewardRegister,
'guilds_room_register': instance.guildsRoomRegister,
'pos_company_register': instance.posCompanyRegister,
'province_accept_state': instance.provinceAcceptState,
'province_message': instance.provinceMessage,
'condition': instance.condition,
'description_condition': instance.descriptionCondition,
'steward_active': instance.stewardActive,
'steward_allocation_limit': instance.stewardAllocationLimit,
'steward_limitation_allocation': instance.stewardLimitationAllocation,
'license': instance.license,
'license_form': instance.licenseForm,
'license_file': instance.licenseFile,
'reviewer_role': instance.reviewerRole,
'reviewer_fullname': instance.reviewerFullname,
'reviewer_mobile': instance.reviewerMobile,
'checker_message': instance.checkerMessage,
'final_accept': instance.finalAccept,
'temporary_registration': instance.temporaryRegistration,
'created_by': instance.createdBy,
'modified_by': instance.modifiedBy,
'user_bank_info': instance.userBankInfo,
'wallet': instance.wallet,
'cars': instance.cars,
'user_level': instance.userLevel,
};
_ToStewardUser _$ToStewardUserFromJson(Map<String, dynamic> json) =>
_ToStewardUser(
fullname: json['fullname'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
mobile: json['mobile'] as String?,
nationalId: json['national_id'] as String?,
city: json['city'] as String?,
);
Map<String, dynamic> _$ToStewardUserToJson(_ToStewardUser instance) =>
<String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.firstName,
'last_name': instance.lastName,
'mobile': instance.mobile,
'national_id': instance.nationalId,
'city': instance.city,
};
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
province: json['province'] == null
? null
: Province.fromJson(json['province'] as Map<String, dynamic>),
city: json['city'] == null
? null
: CitySimple.fromJson(json['city'] as Map<String, dynamic>),
address: json['address'] as String?,
postalCode: json['postal_code'] as String?,
);
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
'province': instance.province,
'city': instance.city,
'address': instance.address,
'postal_code': instance.postalCode,
};
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
_Province(key: json['key'] as String?, name: json['name'] as String?);
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
'key': instance.key,
'name': instance.name,
};
_CitySimple _$CitySimpleFromJson(Map<String, dynamic> json) =>
_CitySimple(key: json['key'] as String?, name: json['name'] as String?);
Map<String, dynamic> _$CitySimpleToJson(_CitySimple instance) =>
<String, dynamic>{'key': instance.key, 'name': instance.name};
_Activity _$ActivityFromJson(Map<String, dynamic> json) =>
_Activity(key: json['key'] as String?, title: json['title'] as String?);
Map<String, dynamic> _$ActivityToJson(_Activity instance) => <String, dynamic>{
'key': instance.key,
'title': instance.title,
};
_PosStatus _$PosStatusFromJson(Map<String, dynamic> json) => _PosStatus(
lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(),
hasPons: json['has_pons'] as bool?,
hasActivePons: json['has_active_pons'] as bool?,
);
Map<String, dynamic> _$PosStatusToJson(_PosStatus instance) =>
<String, dynamic>{
'len_active_sessions': instance.lenActiveSessions,
'has_pons': instance.hasPons,
'has_active_pons': instance.hasActivePons,
};

View File

@@ -0,0 +1,56 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'inventory_model.freezed.dart';
part 'inventory_model.g.dart';
@freezed
abstract class InventoryModel with _$InventoryModel {
const factory InventoryModel({
int? id,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
String? name,
int? provinceGovernmentalCarcassesQuantity,
int? provinceGovernmentalCarcassesWeight,
int? provinceFreeCarcassesQuantity,
int? provinceFreeCarcassesWeight,
int? receiveGovernmentalCarcassesQuantity,
int? receiveGovernmentalCarcassesWeight,
int? receiveFreeCarcassesQuantity,
int? receiveFreeCarcassesWeight,
int? freeBuyingCarcassesQuantity,
int? freeBuyingCarcassesWeight,
int? totalGovernmentalCarcassesQuantity,
int? totalGovernmentalCarcassesWeight,
int? totalFreeBarsCarcassesQuantity,
int? totalFreeBarsCarcassesWeight,
double? weightAverage,
int? totalCarcassesQuantity,
int? totalCarcassesWeight,
int? freezingQuantity,
int? freezingWeight,
int? lossWeight,
int? outProvinceAllocatedQuantity,
int? outProvinceAllocatedWeight,
int? provinceAllocatedQuantity,
int? provinceAllocatedWeight,
int? realAllocatedQuantity,
int? realAllocatedWeight,
int? coldHouseAllocatedWeight,
int? posAllocatedWeight,
int? segmentationWeight,
int? totalRemainQuantity,
int? totalRemainWeight,
int? freePrice,
int? approvedPrice,
bool? approvedPriceStatus,
int? parentProduct,
int? killHouse,
int? guild,
}) = _InventoryModel; // Changed to _InventoryModel
factory InventoryModel.fromJson(Map<String, dynamic> json) =>
_$InventoryModelFromJson(json);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,127 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'inventory_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_InventoryModel _$InventoryModelFromJson(
Map<String, dynamic> json,
) => _InventoryModel(
id: (json['id'] as num?)?.toInt(),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
name: json['name'] as String?,
provinceGovernmentalCarcassesQuantity:
(json['province_governmental_carcasses_quantity'] as num?)?.toInt(),
provinceGovernmentalCarcassesWeight:
(json['province_governmental_carcasses_weight'] as num?)?.toInt(),
provinceFreeCarcassesQuantity:
(json['province_free_carcasses_quantity'] as num?)?.toInt(),
provinceFreeCarcassesWeight: (json['province_free_carcasses_weight'] as num?)
?.toInt(),
receiveGovernmentalCarcassesQuantity:
(json['receive_governmental_carcasses_quantity'] as num?)?.toInt(),
receiveGovernmentalCarcassesWeight:
(json['receive_governmental_carcasses_weight'] as num?)?.toInt(),
receiveFreeCarcassesQuantity:
(json['receive_free_carcasses_quantity'] as num?)?.toInt(),
receiveFreeCarcassesWeight: (json['receive_free_carcasses_weight'] as num?)
?.toInt(),
freeBuyingCarcassesQuantity: (json['free_buying_carcasses_quantity'] as num?)
?.toInt(),
freeBuyingCarcassesWeight: (json['free_buying_carcasses_weight'] as num?)
?.toInt(),
totalGovernmentalCarcassesQuantity:
(json['total_governmental_carcasses_quantity'] as num?)?.toInt(),
totalGovernmentalCarcassesWeight:
(json['total_governmental_carcasses_weight'] as num?)?.toInt(),
totalFreeBarsCarcassesQuantity:
(json['total_free_bars_carcasses_quantity'] as num?)?.toInt(),
totalFreeBarsCarcassesWeight:
(json['total_free_bars_carcasses_weight'] as num?)?.toInt(),
weightAverage: (json['weight_average'] as num?)?.toDouble(),
totalCarcassesQuantity: (json['total_carcasses_quantity'] as num?)?.toInt(),
totalCarcassesWeight: (json['total_carcasses_weight'] as num?)?.toInt(),
freezingQuantity: (json['freezing_quantity'] as num?)?.toInt(),
freezingWeight: (json['freezing_weight'] as num?)?.toInt(),
lossWeight: (json['loss_weight'] as num?)?.toInt(),
outProvinceAllocatedQuantity:
(json['out_province_allocated_quantity'] as num?)?.toInt(),
outProvinceAllocatedWeight: (json['out_province_allocated_weight'] as num?)
?.toInt(),
provinceAllocatedQuantity: (json['province_allocated_quantity'] as num?)
?.toInt(),
provinceAllocatedWeight: (json['province_allocated_weight'] as num?)?.toInt(),
realAllocatedQuantity: (json['real_allocated_quantity'] as num?)?.toInt(),
realAllocatedWeight: (json['real_allocated_weight'] as num?)?.toInt(),
coldHouseAllocatedWeight: (json['cold_house_allocated_weight'] as num?)
?.toInt(),
posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toInt(),
segmentationWeight: (json['segmentation_weight'] as num?)?.toInt(),
totalRemainQuantity: (json['total_remain_quantity'] as num?)?.toInt(),
totalRemainWeight: (json['total_remain_weight'] as num?)?.toInt(),
freePrice: (json['free_price'] as num?)?.toInt(),
approvedPrice: (json['approved_price'] as num?)?.toInt(),
approvedPriceStatus: json['approved_price_status'] as bool?,
parentProduct: (json['parent_product'] as num?)?.toInt(),
killHouse: (json['kill_house'] as num?)?.toInt(),
guild: (json['guild'] as num?)?.toInt(),
);
Map<String, dynamic> _$InventoryModelToJson(
_InventoryModel instance,
) => <String, dynamic>{
'id': instance.id,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'name': instance.name,
'province_governmental_carcasses_quantity':
instance.provinceGovernmentalCarcassesQuantity,
'province_governmental_carcasses_weight':
instance.provinceGovernmentalCarcassesWeight,
'province_free_carcasses_quantity': instance.provinceFreeCarcassesQuantity,
'province_free_carcasses_weight': instance.provinceFreeCarcassesWeight,
'receive_governmental_carcasses_quantity':
instance.receiveGovernmentalCarcassesQuantity,
'receive_governmental_carcasses_weight':
instance.receiveGovernmentalCarcassesWeight,
'receive_free_carcasses_quantity': instance.receiveFreeCarcassesQuantity,
'receive_free_carcasses_weight': instance.receiveFreeCarcassesWeight,
'free_buying_carcasses_quantity': instance.freeBuyingCarcassesQuantity,
'free_buying_carcasses_weight': instance.freeBuyingCarcassesWeight,
'total_governmental_carcasses_quantity':
instance.totalGovernmentalCarcassesQuantity,
'total_governmental_carcasses_weight':
instance.totalGovernmentalCarcassesWeight,
'total_free_bars_carcasses_quantity': instance.totalFreeBarsCarcassesQuantity,
'total_free_bars_carcasses_weight': instance.totalFreeBarsCarcassesWeight,
'weight_average': instance.weightAverage,
'total_carcasses_quantity': instance.totalCarcassesQuantity,
'total_carcasses_weight': instance.totalCarcassesWeight,
'freezing_quantity': instance.freezingQuantity,
'freezing_weight': instance.freezingWeight,
'loss_weight': instance.lossWeight,
'out_province_allocated_quantity': instance.outProvinceAllocatedQuantity,
'out_province_allocated_weight': instance.outProvinceAllocatedWeight,
'province_allocated_quantity': instance.provinceAllocatedQuantity,
'province_allocated_weight': instance.provinceAllocatedWeight,
'real_allocated_quantity': instance.realAllocatedQuantity,
'real_allocated_weight': instance.realAllocatedWeight,
'cold_house_allocated_weight': instance.coldHouseAllocatedWeight,
'pos_allocated_weight': instance.posAllocatedWeight,
'segmentation_weight': instance.segmentationWeight,
'total_remain_quantity': instance.totalRemainQuantity,
'total_remain_weight': instance.totalRemainWeight,
'free_price': instance.freePrice,
'approved_price': instance.approvedPrice,
'approved_price_status': instance.approvedPriceStatus,
'parent_product': instance.parentProduct,
'kill_house': instance.killHouse,
'guild': instance.guild,
};

View File

@@ -0,0 +1,15 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_house_distribution_info.freezed.dart';
part 'kill_house_distribution_info.g.dart';
@freezed
abstract class KillHouseDistributionInfo with _$KillHouseDistributionInfo {
const factory KillHouseDistributionInfo({
double? stewardAllocationsWeight,
double? freeSalesWeight,
}) = _KillHouseDistributionInfo;
factory KillHouseDistributionInfo.fromJson(Map<String, dynamic> json) =>
_$KillHouseDistributionInfoFromJson(json);
}

View File

@@ -0,0 +1,151 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'kill_house_distribution_info.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$KillHouseDistributionInfo {
double? get stewardAllocationsWeight; double? get freeSalesWeight;
/// Create a copy of KillHouseDistributionInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$KillHouseDistributionInfoCopyWith<KillHouseDistributionInfo> get copyWith => _$KillHouseDistributionInfoCopyWithImpl<KillHouseDistributionInfo>(this as KillHouseDistributionInfo, _$identity);
/// Serializes this KillHouseDistributionInfo to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseDistributionInfo&&(identical(other.stewardAllocationsWeight, stewardAllocationsWeight) || other.stewardAllocationsWeight == stewardAllocationsWeight)&&(identical(other.freeSalesWeight, freeSalesWeight) || other.freeSalesWeight == freeSalesWeight));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,stewardAllocationsWeight,freeSalesWeight);
@override
String toString() {
return 'KillHouseDistributionInfo(stewardAllocationsWeight: $stewardAllocationsWeight, freeSalesWeight: $freeSalesWeight)';
}
}
/// @nodoc
abstract mixin class $KillHouseDistributionInfoCopyWith<$Res> {
factory $KillHouseDistributionInfoCopyWith(KillHouseDistributionInfo value, $Res Function(KillHouseDistributionInfo) _then) = _$KillHouseDistributionInfoCopyWithImpl;
@useResult
$Res call({
double? stewardAllocationsWeight, double? freeSalesWeight
});
}
/// @nodoc
class _$KillHouseDistributionInfoCopyWithImpl<$Res>
implements $KillHouseDistributionInfoCopyWith<$Res> {
_$KillHouseDistributionInfoCopyWithImpl(this._self, this._then);
final KillHouseDistributionInfo _self;
final $Res Function(KillHouseDistributionInfo) _then;
/// Create a copy of KillHouseDistributionInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? stewardAllocationsWeight = freezed,Object? freeSalesWeight = freezed,}) {
return _then(_self.copyWith(
stewardAllocationsWeight: freezed == stewardAllocationsWeight ? _self.stewardAllocationsWeight : stewardAllocationsWeight // ignore: cast_nullable_to_non_nullable
as double?,freeSalesWeight: freezed == freeSalesWeight ? _self.freeSalesWeight : freeSalesWeight // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
/// @nodoc
@JsonSerializable()
class _KillHouseDistributionInfo implements KillHouseDistributionInfo {
const _KillHouseDistributionInfo({this.stewardAllocationsWeight, this.freeSalesWeight});
factory _KillHouseDistributionInfo.fromJson(Map<String, dynamic> json) => _$KillHouseDistributionInfoFromJson(json);
@override final double? stewardAllocationsWeight;
@override final double? freeSalesWeight;
/// Create a copy of KillHouseDistributionInfo
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$KillHouseDistributionInfoCopyWith<_KillHouseDistributionInfo> get copyWith => __$KillHouseDistributionInfoCopyWithImpl<_KillHouseDistributionInfo>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$KillHouseDistributionInfoToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseDistributionInfo&&(identical(other.stewardAllocationsWeight, stewardAllocationsWeight) || other.stewardAllocationsWeight == stewardAllocationsWeight)&&(identical(other.freeSalesWeight, freeSalesWeight) || other.freeSalesWeight == freeSalesWeight));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,stewardAllocationsWeight,freeSalesWeight);
@override
String toString() {
return 'KillHouseDistributionInfo(stewardAllocationsWeight: $stewardAllocationsWeight, freeSalesWeight: $freeSalesWeight)';
}
}
/// @nodoc
abstract mixin class _$KillHouseDistributionInfoCopyWith<$Res> implements $KillHouseDistributionInfoCopyWith<$Res> {
factory _$KillHouseDistributionInfoCopyWith(_KillHouseDistributionInfo value, $Res Function(_KillHouseDistributionInfo) _then) = __$KillHouseDistributionInfoCopyWithImpl;
@override @useResult
$Res call({
double? stewardAllocationsWeight, double? freeSalesWeight
});
}
/// @nodoc
class __$KillHouseDistributionInfoCopyWithImpl<$Res>
implements _$KillHouseDistributionInfoCopyWith<$Res> {
__$KillHouseDistributionInfoCopyWithImpl(this._self, this._then);
final _KillHouseDistributionInfo _self;
final $Res Function(_KillHouseDistributionInfo) _then;
/// Create a copy of KillHouseDistributionInfo
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? stewardAllocationsWeight = freezed,Object? freeSalesWeight = freezed,}) {
return _then(_KillHouseDistributionInfo(
stewardAllocationsWeight: freezed == stewardAllocationsWeight ? _self.stewardAllocationsWeight : stewardAllocationsWeight // ignore: cast_nullable_to_non_nullable
as double?,freeSalesWeight: freezed == freeSalesWeight ? _self.freeSalesWeight : freeSalesWeight // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
// dart format on

View File

@@ -0,0 +1,22 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_house_distribution_info.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillHouseDistributionInfo _$KillHouseDistributionInfoFromJson(
Map<String, dynamic> json,
) => _KillHouseDistributionInfo(
stewardAllocationsWeight: (json['steward_allocations_weight'] as num?)
?.toDouble(),
freeSalesWeight: (json['free_sales_weight'] as num?)?.toDouble(),
);
Map<String, dynamic> _$KillHouseDistributionInfoToJson(
_KillHouseDistributionInfo instance,
) => <String, dynamic>{
'steward_allocations_weight': instance.stewardAllocationsWeight,
'free_sales_weight': instance.freeSalesWeight,
};

View File

@@ -0,0 +1,67 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'roles_products.freezed.dart';
part 'roles_products.g.dart';
@freezed
abstract class RolesProductsModel with _$RolesProductsModel {
factory RolesProductsModel({
required List<ProductModel> products,
}) = _RolesProductsModel;
factory RolesProductsModel.fromJson(Map<String, dynamic> json) => _$RolesProductsModelFromJson(json);
}
@freezed
abstract class ProductModel with _$ProductModel {
factory ProductModel({
int? id,
String? key,
String? create_date, // Changed from createDate, removed @JsonKey
String? modify_date, // Changed from modifyDate, removed @JsonKey
bool? trash,
String? name,
int? provinceGovernmentalCarcassesQuantity,
int? provinceGovernmentalCarcassesWeight,
int? provinceFreeCarcassesQuantity,
int? provinceFreeCarcassesWeight,
int? receiveGovernmentalCarcassesQuantity,
int? receiveGovernmentalCarcassesWeight,
int? receiveFreeCarcassesQuantity,
int? receiveFreeCarcassesWeight,
int? freeBuyingCarcassesQuantity,
int? freeBuyingCarcassesWeight,
int? totalGovernmentalCarcassesQuantity,
int? totalGovernmentalCarcassesWeight,
int? totalFreeBarsCarcassesQuantity,
int? totalFreeBarsCarcassesWeight,
double? weightAverage,
int? totalCarcassesQuantity,
int? totalCarcassesWeight,
int? freezingQuantity,
int? freezingWeight,
int? lossWeight,
int? outProvinceAllocatedQuantity,
int? outProvinceAllocatedWeight,
int? provinceAllocatedQuantity,
int? provinceAllocatedWeight,
int? realAllocatedQuantity,
int? realAllocatedWeight,
int? coldHouseAllocatedWeight,
int? posAllocatedWeight,
int? segmentationWeight,
int? totalRemainQuantity,
int? totalRemainWeight,
int? freePrice,
int? approvedPrice,
bool? approvedPriceStatus,
dynamic createdBy,
dynamic modifiedBy,
int? parentProduct,
dynamic killHouse,
int? guild,
}) = _ProductModel;
factory ProductModel.fromJson(Map<String, dynamic> json) => _$ProductModelFromJson(json);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,141 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'roles_products.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_RolesProductsModel _$RolesProductsModelFromJson(Map<String, dynamic> json) =>
_RolesProductsModel(
products: (json['products'] as List<dynamic>)
.map((e) => ProductModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$RolesProductsModelToJson(_RolesProductsModel instance) =>
<String, dynamic>{'products': instance.products};
_ProductModel _$ProductModelFromJson(
Map<String, dynamic> json,
) => _ProductModel(
id: (json['id'] as num?)?.toInt(),
key: json['key'] as String?,
create_date: json['create_date'] as String?,
modify_date: json['modify_date'] as String?,
trash: json['trash'] as bool?,
name: json['name'] as String?,
provinceGovernmentalCarcassesQuantity:
(json['province_governmental_carcasses_quantity'] as num?)?.toInt(),
provinceGovernmentalCarcassesWeight:
(json['province_governmental_carcasses_weight'] as num?)?.toInt(),
provinceFreeCarcassesQuantity:
(json['province_free_carcasses_quantity'] as num?)?.toInt(),
provinceFreeCarcassesWeight: (json['province_free_carcasses_weight'] as num?)
?.toInt(),
receiveGovernmentalCarcassesQuantity:
(json['receive_governmental_carcasses_quantity'] as num?)?.toInt(),
receiveGovernmentalCarcassesWeight:
(json['receive_governmental_carcasses_weight'] as num?)?.toInt(),
receiveFreeCarcassesQuantity:
(json['receive_free_carcasses_quantity'] as num?)?.toInt(),
receiveFreeCarcassesWeight: (json['receive_free_carcasses_weight'] as num?)
?.toInt(),
freeBuyingCarcassesQuantity: (json['free_buying_carcasses_quantity'] as num?)
?.toInt(),
freeBuyingCarcassesWeight: (json['free_buying_carcasses_weight'] as num?)
?.toInt(),
totalGovernmentalCarcassesQuantity:
(json['total_governmental_carcasses_quantity'] as num?)?.toInt(),
totalGovernmentalCarcassesWeight:
(json['total_governmental_carcasses_weight'] as num?)?.toInt(),
totalFreeBarsCarcassesQuantity:
(json['total_free_bars_carcasses_quantity'] as num?)?.toInt(),
totalFreeBarsCarcassesWeight:
(json['total_free_bars_carcasses_weight'] as num?)?.toInt(),
weightAverage: (json['weight_average'] as num?)?.toDouble(),
totalCarcassesQuantity: (json['total_carcasses_quantity'] as num?)?.toInt(),
totalCarcassesWeight: (json['total_carcasses_weight'] as num?)?.toInt(),
freezingQuantity: (json['freezing_quantity'] as num?)?.toInt(),
freezingWeight: (json['freezing_weight'] as num?)?.toInt(),
lossWeight: (json['loss_weight'] as num?)?.toInt(),
outProvinceAllocatedQuantity:
(json['out_province_allocated_quantity'] as num?)?.toInt(),
outProvinceAllocatedWeight: (json['out_province_allocated_weight'] as num?)
?.toInt(),
provinceAllocatedQuantity: (json['province_allocated_quantity'] as num?)
?.toInt(),
provinceAllocatedWeight: (json['province_allocated_weight'] as num?)?.toInt(),
realAllocatedQuantity: (json['real_allocated_quantity'] as num?)?.toInt(),
realAllocatedWeight: (json['real_allocated_weight'] as num?)?.toInt(),
coldHouseAllocatedWeight: (json['cold_house_allocated_weight'] as num?)
?.toInt(),
posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toInt(),
segmentationWeight: (json['segmentation_weight'] as num?)?.toInt(),
totalRemainQuantity: (json['total_remain_quantity'] as num?)?.toInt(),
totalRemainWeight: (json['total_remain_weight'] as num?)?.toInt(),
freePrice: (json['free_price'] as num?)?.toInt(),
approvedPrice: (json['approved_price'] as num?)?.toInt(),
approvedPriceStatus: json['approved_price_status'] as bool?,
createdBy: json['created_by'],
modifiedBy: json['modified_by'],
parentProduct: (json['parent_product'] as num?)?.toInt(),
killHouse: json['kill_house'],
guild: (json['guild'] as num?)?.toInt(),
);
Map<String, dynamic> _$ProductModelToJson(
_ProductModel instance,
) => <String, dynamic>{
'id': instance.id,
'key': instance.key,
'create_date': instance.create_date,
'modify_date': instance.modify_date,
'trash': instance.trash,
'name': instance.name,
'province_governmental_carcasses_quantity':
instance.provinceGovernmentalCarcassesQuantity,
'province_governmental_carcasses_weight':
instance.provinceGovernmentalCarcassesWeight,
'province_free_carcasses_quantity': instance.provinceFreeCarcassesQuantity,
'province_free_carcasses_weight': instance.provinceFreeCarcassesWeight,
'receive_governmental_carcasses_quantity':
instance.receiveGovernmentalCarcassesQuantity,
'receive_governmental_carcasses_weight':
instance.receiveGovernmentalCarcassesWeight,
'receive_free_carcasses_quantity': instance.receiveFreeCarcassesQuantity,
'receive_free_carcasses_weight': instance.receiveFreeCarcassesWeight,
'free_buying_carcasses_quantity': instance.freeBuyingCarcassesQuantity,
'free_buying_carcasses_weight': instance.freeBuyingCarcassesWeight,
'total_governmental_carcasses_quantity':
instance.totalGovernmentalCarcassesQuantity,
'total_governmental_carcasses_weight':
instance.totalGovernmentalCarcassesWeight,
'total_free_bars_carcasses_quantity': instance.totalFreeBarsCarcassesQuantity,
'total_free_bars_carcasses_weight': instance.totalFreeBarsCarcassesWeight,
'weight_average': instance.weightAverage,
'total_carcasses_quantity': instance.totalCarcassesQuantity,
'total_carcasses_weight': instance.totalCarcassesWeight,
'freezing_quantity': instance.freezingQuantity,
'freezing_weight': instance.freezingWeight,
'loss_weight': instance.lossWeight,
'out_province_allocated_quantity': instance.outProvinceAllocatedQuantity,
'out_province_allocated_weight': instance.outProvinceAllocatedWeight,
'province_allocated_quantity': instance.provinceAllocatedQuantity,
'province_allocated_weight': instance.provinceAllocatedWeight,
'real_allocated_quantity': instance.realAllocatedQuantity,
'real_allocated_weight': instance.realAllocatedWeight,
'cold_house_allocated_weight': instance.coldHouseAllocatedWeight,
'pos_allocated_weight': instance.posAllocatedWeight,
'segmentation_weight': instance.segmentationWeight,
'total_remain_quantity': instance.totalRemainQuantity,
'total_remain_weight': instance.totalRemainWeight,
'free_price': instance.freePrice,
'approved_price': instance.approvedPrice,
'approved_price_status': instance.approvedPriceStatus,
'created_by': instance.createdBy,
'modified_by': instance.modifiedBy,
'parent_product': instance.parentProduct,
'kill_house': instance.killHouse,
'guild': instance.guild,
};

View File

@@ -0,0 +1,266 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'waiting_arrival.freezed.dart';
part 'waiting_arrival.g.dart';
@freezed
abstract class WaitingArrivalModel with _$WaitingArrivalModel {
factory WaitingArrivalModel({
required int count,
String? next,
String? previous,
required List<ResultModel> results,
}) = _WaitingArrivalModel;
factory WaitingArrivalModel.fromJson(Map<String, dynamic> json) => _$WaitingArrivalModelFromJson(json);
}
@freezed
abstract class ResultModel with _$ResultModel {
factory ResultModel({
int? id,
ProductModel? product,
KillHouseModel? killHouse,
dynamic toKillHouse,
dynamic steward,
@JsonKey(name: 'to_steward') ToStewardModel? toSteward,
dynamic guilds,
dynamic toGuilds,
dynamic toColdHouse,
int? indexWeight,
int? dateTimestamp,
int? newState,
int? newReceiverState,
int? newAllocationState,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
int? numberOfCarcasses,
int? realNumberOfCarcasses,
int? receiverRealNumberOfCarcasses,
double? weightOfCarcasses,
double? realWeightOfCarcasses,
double? receiverRealWeightOfCarcasses,
double? weightLossOfCarcasses,
bool? finalRegistration,
String? sellType,
String? productName,
String? sellerType,
String? type,
String? saleType,
String? allocationType,
bool? systemRegistrationCode,
int? registrationCode,
int? amount,
int? totalAmount,
int? totalAmountPaid,
int? totalAmountRemain,
dynamic loggedRegistrationCode,
String? state,
String? receiverState,
String? allocationState,
String? date,
dynamic role,
dynamic stewardTempKey,
bool? approvedPriceStatus,
bool? calculateStatus,
bool? temporaryTrash,
bool? temporaryDeleted,
dynamic createdBy,
dynamic modifiedBy,
dynamic wareHouse,
dynamic stewardWareHouse,
dynamic car,
dynamic dispenser,
}) = _ResultModel;
factory ResultModel.fromJson(Map<String, dynamic> json) => _$ResultModelFromJson(json);
}
@freezed
abstract class ProductModel with _$ProductModel {
factory ProductModel({
double? weightAverage,
}) = _ProductModel;
factory ProductModel.fromJson(Map<String, dynamic> json) => _$ProductModelFromJson(json);
}
@freezed
abstract class ToStewardModel with _$ToStewardModel {
factory ToStewardModel({
int? id,
ToStewardUserModel? user,
AddressModel? address,
GuildAreaActivityModel? guildAreaActivity,
GuildTypeActivityModel? guildTypeActivity,
List<dynamic>? killHouse,
List<dynamic>? stewardKillHouse,
List<dynamic>? stewards,
GetPosStatusModel? getPosStatus,
String? key,
@JsonKey(name: 'create_date') String? createDate,
@JsonKey(name: 'modify_date') String? modifyDate,
bool? trash,
bool? active,
String? guildsId,
String? licenseNumber,
String? guildsName,
String? typeActivity,
String? areaActivity,
bool? steward,
bool? hasPos,
String? provinceAcceptState,
}) = _ToStewardModel;
factory ToStewardModel.fromJson(Map<String, dynamic> json) => _$ToStewardModelFromJson(json);
}
@freezed
abstract class ToStewardUserModel with _$ToStewardUserModel {
factory ToStewardUserModel({
String? fullname,
@JsonKey(name: 'first_name') String? firstName,
@JsonKey(name: 'last_name') String? lastName,
String? mobile,
@JsonKey(name: 'national_id') String? nationalId,
String? city,
}) = _ToStewardUserModel;
factory ToStewardUserModel.fromJson(Map<String, dynamic> json) => _$ToStewardUserModelFromJson(json);
}
@freezed
abstract class ToStewardCityModel with _$ToStewardCityModel {
factory ToStewardCityModel({
String? key,
@JsonKey(name: 'name') String? title,
}) = _ToStewardCityModel;
factory ToStewardCityModel.fromJson(Map<String, dynamic> json) => _$ToStewardCityModelFromJson(json);
}
@freezed
abstract class ToStewardProvinceModel with _$ToStewardProvinceModel {
factory ToStewardProvinceModel({
String? key,
@JsonKey(name: 'name') String? title,
}) = _ToStewardProvinceModel;
factory ToStewardProvinceModel.fromJson(Map<String, dynamic> json) => _$ToStewardProvinceModelFromJson(json);
}
@freezed
abstract class AddressModel with _$AddressModel {
factory AddressModel({
ToStewardProvinceModel? province,
ToStewardCityModel? city,
String? address,
String? postalCode,
}) = _AddressModel;
factory AddressModel.fromJson(Map<String, dynamic> json) => _$AddressModelFromJson(json);
}
@freezed
abstract class GuildAreaActivityModel with _$GuildAreaActivityModel {
factory GuildAreaActivityModel({
String? key,
String? title,
}) = _GuildAreaActivityModel;
factory GuildAreaActivityModel.fromJson(Map<String, dynamic> json) => _$GuildAreaActivityModelFromJson(json);
}
@freezed
abstract class GuildTypeActivityModel with _$GuildTypeActivityModel {
factory GuildTypeActivityModel({
String? key,
String? title,
}) = _GuildTypeActivityModel;
factory GuildTypeActivityModel.fromJson(Map<String, dynamic> json) => _$GuildTypeActivityModelFromJson(json);
}
@freezed
abstract class GetPosStatusModel with _$GetPosStatusModel {
factory GetPosStatusModel({
int? lenActiveSessions,
bool? hasPons,
bool? hasActivePons,
}) = _GetPosStatusModel;
factory GetPosStatusModel.fromJson(Map<String, dynamic> json) => _$GetPosStatusModelFromJson(json);
}
@freezed
abstract class KillHouseModel with _$KillHouseModel {
factory KillHouseModel({
String? key,
@JsonKey(name: 'kill_house_operator') KillHouseOperatorModel? operator,
String? name,
bool? killer,
}) = _KillHouseModel;
factory KillHouseModel.fromJson(Map<String, dynamic> json) => _$KillHouseModelFromJson(json);
}
@freezed
abstract class KillHouseOperatorModel with _$KillHouseOperatorModel {
factory KillHouseOperatorModel({
UserModel? user,
}) = _KillHouseOperatorModel;
factory KillHouseOperatorModel.fromJson(Map<String, dynamic> json) => _$KillHouseOperatorModelFromJson(json);
}
@freezed
abstract class UserModel with _$UserModel {
factory UserModel({
String? fullname,
String? firstName,
String? lastName,
int? baseOrder,
String? mobile,
String? nationalId,
String? nationalCode,
String? key,
CityModel? city,
String? unitName,
String? unitNationalId,
String? unitRegistrationNumber,
String? unitEconomicalNumber,
String? unitProvince,
String? unitCity,
String? unitPostalCode,
String? unitAddress,
}) = _UserModel;
factory UserModel.fromJson(Map<String, dynamic> json) => _$UserModelFromJson(json);
}
@freezed
abstract class CityModel with _$CityModel {
factory CityModel({
int? id,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
int? provinceIdForeignKey,
int? cityIdKey,
String? name,
double? productPrice,
bool? provinceCenter,
int? cityNumber,
String? cityName,
int? provinceNumber,
String? provinceName,
dynamic createdBy,
dynamic modifiedBy,
int? province,
}) = _CityModel;
factory CityModel.fromJson(Map<String, dynamic> json) => _$CityModelFromJson(json);
}

View File

@@ -0,0 +1,440 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'waiting_arrival.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_WaitingArrivalModel _$WaitingArrivalModelFromJson(Map<String, dynamic> json) =>
_WaitingArrivalModel(
count: (json['count'] as num).toInt(),
next: json['next'] as String?,
previous: json['previous'] as String?,
results: (json['results'] as List<dynamic>)
.map((e) => ResultModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$WaitingArrivalModelToJson(
_WaitingArrivalModel instance,
) => <String, dynamic>{
'count': instance.count,
'next': instance.next,
'previous': instance.previous,
'results': instance.results,
};
_ResultModel _$ResultModelFromJson(Map<String, dynamic> json) => _ResultModel(
id: (json['id'] as num?)?.toInt(),
product: json['product'] == null
? null
: ProductModel.fromJson(json['product'] as Map<String, dynamic>),
killHouse: json['kill_house'] == null
? null
: KillHouseModel.fromJson(json['kill_house'] as Map<String, dynamic>),
toKillHouse: json['to_kill_house'],
steward: json['steward'],
toSteward: json['to_steward'] == null
? null
: ToStewardModel.fromJson(json['to_steward'] as Map<String, dynamic>),
guilds: json['guilds'],
toGuilds: json['to_guilds'],
toColdHouse: json['to_cold_house'],
indexWeight: (json['index_weight'] as num?)?.toInt(),
dateTimestamp: (json['date_timestamp'] as num?)?.toInt(),
newState: (json['new_state'] as num?)?.toInt(),
newReceiverState: (json['new_receiver_state'] as num?)?.toInt(),
newAllocationState: (json['new_allocation_state'] as num?)?.toInt(),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
receiverRealNumberOfCarcasses:
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(),
realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toDouble(),
receiverRealWeightOfCarcasses:
(json['receiver_real_weight_of_carcasses'] as num?)?.toDouble(),
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toDouble(),
finalRegistration: json['final_registration'] as bool?,
sellType: json['sell_type'] as String?,
productName: json['product_name'] as String?,
sellerType: json['seller_type'] as String?,
type: json['type'] as String?,
saleType: json['sale_type'] as String?,
allocationType: json['allocation_type'] as String?,
systemRegistrationCode: json['system_registration_code'] as bool?,
registrationCode: (json['registration_code'] as num?)?.toInt(),
amount: (json['amount'] as num?)?.toInt(),
totalAmount: (json['total_amount'] as num?)?.toInt(),
totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(),
totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(),
loggedRegistrationCode: json['logged_registration_code'],
state: json['state'] as String?,
receiverState: json['receiver_state'] as String?,
allocationState: json['allocation_state'] as String?,
date: json['date'] as String?,
role: json['role'],
stewardTempKey: json['steward_temp_key'],
approvedPriceStatus: json['approved_price_status'] as bool?,
calculateStatus: json['calculate_status'] as bool?,
temporaryTrash: json['temporary_trash'] as bool?,
temporaryDeleted: json['temporary_deleted'] as bool?,
createdBy: json['created_by'],
modifiedBy: json['modified_by'],
wareHouse: json['ware_house'],
stewardWareHouse: json['steward_ware_house'],
car: json['car'],
dispenser: json['dispenser'],
);
Map<String, dynamic> _$ResultModelToJson(
_ResultModel instance,
) => <String, dynamic>{
'id': instance.id,
'product': instance.product,
'kill_house': instance.killHouse,
'to_kill_house': instance.toKillHouse,
'steward': instance.steward,
'to_steward': instance.toSteward,
'guilds': instance.guilds,
'to_guilds': instance.toGuilds,
'to_cold_house': instance.toColdHouse,
'index_weight': instance.indexWeight,
'date_timestamp': instance.dateTimestamp,
'new_state': instance.newState,
'new_receiver_state': instance.newReceiverState,
'new_allocation_state': instance.newAllocationState,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'number_of_carcasses': instance.numberOfCarcasses,
'real_number_of_carcasses': instance.realNumberOfCarcasses,
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
'weight_of_carcasses': instance.weightOfCarcasses,
'real_weight_of_carcasses': instance.realWeightOfCarcasses,
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
'final_registration': instance.finalRegistration,
'sell_type': instance.sellType,
'product_name': instance.productName,
'seller_type': instance.sellerType,
'type': instance.type,
'sale_type': instance.saleType,
'allocation_type': instance.allocationType,
'system_registration_code': instance.systemRegistrationCode,
'registration_code': instance.registrationCode,
'amount': instance.amount,
'total_amount': instance.totalAmount,
'total_amount_paid': instance.totalAmountPaid,
'total_amount_remain': instance.totalAmountRemain,
'logged_registration_code': instance.loggedRegistrationCode,
'state': instance.state,
'receiver_state': instance.receiverState,
'allocation_state': instance.allocationState,
'date': instance.date,
'role': instance.role,
'steward_temp_key': instance.stewardTempKey,
'approved_price_status': instance.approvedPriceStatus,
'calculate_status': instance.calculateStatus,
'temporary_trash': instance.temporaryTrash,
'temporary_deleted': instance.temporaryDeleted,
'created_by': instance.createdBy,
'modified_by': instance.modifiedBy,
'ware_house': instance.wareHouse,
'steward_ware_house': instance.stewardWareHouse,
'car': instance.car,
'dispenser': instance.dispenser,
};
_ProductModel _$ProductModelFromJson(Map<String, dynamic> json) =>
_ProductModel(weightAverage: (json['weight_average'] as num?)?.toDouble());
Map<String, dynamic> _$ProductModelToJson(_ProductModel instance) =>
<String, dynamic>{'weight_average': instance.weightAverage};
_ToStewardModel _$ToStewardModelFromJson(Map<String, dynamic> json) =>
_ToStewardModel(
id: (json['id'] as num?)?.toInt(),
user: json['user'] == null
? null
: ToStewardUserModel.fromJson(json['user'] as Map<String, dynamic>),
address: json['address'] == null
? null
: AddressModel.fromJson(json['address'] as Map<String, dynamic>),
guildAreaActivity: json['guild_area_activity'] == null
? null
: GuildAreaActivityModel.fromJson(
json['guild_area_activity'] as Map<String, dynamic>,
),
guildTypeActivity: json['guild_type_activity'] == null
? null
: GuildTypeActivityModel.fromJson(
json['guild_type_activity'] as Map<String, dynamic>,
),
killHouse: json['kill_house'] as List<dynamic>?,
stewardKillHouse: json['steward_kill_house'] as List<dynamic>?,
stewards: json['stewards'] as List<dynamic>?,
getPosStatus: json['get_pos_status'] == null
? null
: GetPosStatusModel.fromJson(
json['get_pos_status'] as Map<String, dynamic>,
),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
active: json['active'] as bool?,
guildsId: json['guilds_id'] as String?,
licenseNumber: json['license_number'] as String?,
guildsName: json['guilds_name'] as String?,
typeActivity: json['type_activity'] as String?,
areaActivity: json['area_activity'] as String?,
steward: json['steward'] as bool?,
hasPos: json['has_pos'] as bool?,
provinceAcceptState: json['province_accept_state'] as String?,
);
Map<String, dynamic> _$ToStewardModelToJson(_ToStewardModel instance) =>
<String, dynamic>{
'id': instance.id,
'user': instance.user,
'address': instance.address,
'guild_area_activity': instance.guildAreaActivity,
'guild_type_activity': instance.guildTypeActivity,
'kill_house': instance.killHouse,
'steward_kill_house': instance.stewardKillHouse,
'stewards': instance.stewards,
'get_pos_status': instance.getPosStatus,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'active': instance.active,
'guilds_id': instance.guildsId,
'license_number': instance.licenseNumber,
'guilds_name': instance.guildsName,
'type_activity': instance.typeActivity,
'area_activity': instance.areaActivity,
'steward': instance.steward,
'has_pos': instance.hasPos,
'province_accept_state': instance.provinceAcceptState,
};
_ToStewardUserModel _$ToStewardUserModelFromJson(Map<String, dynamic> json) =>
_ToStewardUserModel(
fullname: json['fullname'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
mobile: json['mobile'] as String?,
nationalId: json['national_id'] as String?,
city: json['city'] as String?,
);
Map<String, dynamic> _$ToStewardUserModelToJson(_ToStewardUserModel instance) =>
<String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.firstName,
'last_name': instance.lastName,
'mobile': instance.mobile,
'national_id': instance.nationalId,
'city': instance.city,
};
_ToStewardCityModel _$ToStewardCityModelFromJson(Map<String, dynamic> json) =>
_ToStewardCityModel(
key: json['key'] as String?,
title: json['name'] as String?,
);
Map<String, dynamic> _$ToStewardCityModelToJson(_ToStewardCityModel instance) =>
<String, dynamic>{'key': instance.key, 'name': instance.title};
_ToStewardProvinceModel _$ToStewardProvinceModelFromJson(
Map<String, dynamic> json,
) => _ToStewardProvinceModel(
key: json['key'] as String?,
title: json['name'] as String?,
);
Map<String, dynamic> _$ToStewardProvinceModelToJson(
_ToStewardProvinceModel instance,
) => <String, dynamic>{'key': instance.key, 'name': instance.title};
_AddressModel _$AddressModelFromJson(Map<String, dynamic> json) =>
_AddressModel(
province: json['province'] == null
? null
: ToStewardProvinceModel.fromJson(
json['province'] as Map<String, dynamic>,
),
city: json['city'] == null
? null
: ToStewardCityModel.fromJson(json['city'] as Map<String, dynamic>),
address: json['address'] as String?,
postalCode: json['postal_code'] as String?,
);
Map<String, dynamic> _$AddressModelToJson(_AddressModel instance) =>
<String, dynamic>{
'province': instance.province,
'city': instance.city,
'address': instance.address,
'postal_code': instance.postalCode,
};
_GuildAreaActivityModel _$GuildAreaActivityModelFromJson(
Map<String, dynamic> json,
) => _GuildAreaActivityModel(
key: json['key'] as String?,
title: json['title'] as String?,
);
Map<String, dynamic> _$GuildAreaActivityModelToJson(
_GuildAreaActivityModel instance,
) => <String, dynamic>{'key': instance.key, 'title': instance.title};
_GuildTypeActivityModel _$GuildTypeActivityModelFromJson(
Map<String, dynamic> json,
) => _GuildTypeActivityModel(
key: json['key'] as String?,
title: json['title'] as String?,
);
Map<String, dynamic> _$GuildTypeActivityModelToJson(
_GuildTypeActivityModel instance,
) => <String, dynamic>{'key': instance.key, 'title': instance.title};
_GetPosStatusModel _$GetPosStatusModelFromJson(Map<String, dynamic> json) =>
_GetPosStatusModel(
lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(),
hasPons: json['has_pons'] as bool?,
hasActivePons: json['has_active_pons'] as bool?,
);
Map<String, dynamic> _$GetPosStatusModelToJson(_GetPosStatusModel instance) =>
<String, dynamic>{
'len_active_sessions': instance.lenActiveSessions,
'has_pons': instance.hasPons,
'has_active_pons': instance.hasActivePons,
};
_KillHouseModel _$KillHouseModelFromJson(Map<String, dynamic> json) =>
_KillHouseModel(
key: json['key'] as String?,
operator: json['kill_house_operator'] == null
? null
: KillHouseOperatorModel.fromJson(
json['kill_house_operator'] as Map<String, dynamic>,
),
name: json['name'] as String?,
killer: json['killer'] as bool?,
);
Map<String, dynamic> _$KillHouseModelToJson(_KillHouseModel instance) =>
<String, dynamic>{
'key': instance.key,
'kill_house_operator': instance.operator,
'name': instance.name,
'killer': instance.killer,
};
_KillHouseOperatorModel _$KillHouseOperatorModelFromJson(
Map<String, dynamic> json,
) => _KillHouseOperatorModel(
user: json['user'] == null
? null
: UserModel.fromJson(json['user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$KillHouseOperatorModelToJson(
_KillHouseOperatorModel instance,
) => <String, dynamic>{'user': instance.user};
_UserModel _$UserModelFromJson(Map<String, dynamic> json) => _UserModel(
fullname: json['fullname'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
baseOrder: (json['base_order'] as num?)?.toInt(),
mobile: json['mobile'] as String?,
nationalId: json['national_id'] as String?,
nationalCode: json['national_code'] as String?,
key: json['key'] as String?,
city: json['city'] == null
? null
: CityModel.fromJson(json['city'] as Map<String, dynamic>),
unitName: json['unit_name'] as String?,
unitNationalId: json['unit_national_id'] as String?,
unitRegistrationNumber: json['unit_registration_number'] as String?,
unitEconomicalNumber: json['unit_economical_number'] as String?,
unitProvince: json['unit_province'] as String?,
unitCity: json['unit_city'] as String?,
unitPostalCode: json['unit_postal_code'] as String?,
unitAddress: json['unit_address'] as String?,
);
Map<String, dynamic> _$UserModelToJson(_UserModel instance) =>
<String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.firstName,
'last_name': instance.lastName,
'base_order': instance.baseOrder,
'mobile': instance.mobile,
'national_id': instance.nationalId,
'national_code': instance.nationalCode,
'key': instance.key,
'city': instance.city,
'unit_name': instance.unitName,
'unit_national_id': instance.unitNationalId,
'unit_registration_number': instance.unitRegistrationNumber,
'unit_economical_number': instance.unitEconomicalNumber,
'unit_province': instance.unitProvince,
'unit_city': instance.unitCity,
'unit_postal_code': instance.unitPostalCode,
'unit_address': instance.unitAddress,
};
_CityModel _$CityModelFromJson(Map<String, dynamic> json) => _CityModel(
id: (json['id'] as num?)?.toInt(),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
provinceIdForeignKey: (json['province_id_foreign_key'] as num?)?.toInt(),
cityIdKey: (json['city_id_key'] as num?)?.toInt(),
name: json['name'] as String?,
productPrice: (json['product_price'] as num?)?.toDouble(),
provinceCenter: json['province_center'] as bool?,
cityNumber: (json['city_number'] as num?)?.toInt(),
cityName: json['city_name'] as String?,
provinceNumber: (json['province_number'] as num?)?.toInt(),
provinceName: json['province_name'] as String?,
createdBy: json['created_by'],
modifiedBy: json['modified_by'],
province: (json['province'] as num?)?.toInt(),
);
Map<String, dynamic> _$CityModelToJson(_CityModel instance) =>
<String, dynamic>{
'id': instance.id,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'province_id_foreign_key': instance.provinceIdForeignKey,
'city_id_key': instance.cityIdKey,
'name': instance.name,
'product_price': instance.productPrice,
'province_center': instance.provinceCenter,
'city_number': instance.cityNumber,
'city_name': instance.cityName,
'province_number': instance.provinceNumber,
'province_name': instance.provinceName,
'created_by': instance.createdBy,
'modified_by': instance.modifiedBy,
'province': instance.province,
};

View File

@@ -0,0 +1,60 @@
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart';
import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart';
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' hide ProductModel;
abstract class ChickenRepository {
Future<List<InventoryModel>?> getInventory({required String token});
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({
required String token,
});
Future<BarInformation?> getGeneralBarInformation({required String token});
Future<WaitingArrivalModel?> getWaitingArrivals({
required String token,
int? page,
});
Future<void> setSateForArrivals({
required String token,
required Map<String, dynamic> request,
});
Future<ImportedLoadsModel?> getImportedLoadsModel({
required String token,
required int page,
});
Future<AllocatedMadeModel?> getAllocatedMade({
required String token,
required int page,
});
Future<void> confirmAllocation({
required String token,
required Map<String, dynamic> allocation,
});
Future<void> denyAllocation({
required String token,
required String allocationToken,
});
Future<void> confirmAllAllocation({
required String token,
required List<String> allocationTokens,
});
Future<List<ProductModel>?> getRolesProducts({required String token});
Future<List<GuildModel>?> getGuilds({required String token,required bool isFree});
Future<GuildProfile?> getProfile({required String token});
Future<void> postSubmitStewardAllocation({required String token,required SubmitStewardAllocation request});
}

View File

@@ -0,0 +1,194 @@
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart';
import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart';
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
hide ProductModel;
import 'package:rasadyar_core/core.dart';
import 'chicken_repository.dart';
class ChickenRepositoryImpl implements ChickenRepository {
final DioRemote _httpClient;
ChickenRepositoryImpl(this._httpClient);
@override
Future<List<InventoryModel>?> getInventory({required String token}) async {
var res = await _httpClient.get(
'/roles-products/?role=Steward',
headers: {'Authorization': 'Bearer $token'},
fromJsonList: (json) => (json)
.map((item) => InventoryModel.fromJson(item as Map<String, dynamic>))
.toList(),
);
return res.data;
}
@override
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({
required String token,
}) async {
var res = await _httpClient.get(
'/kill-house-distribution-info/?role=Steward',
headers: {'Authorization': 'Bearer $token'},
fromJson: KillHouseDistributionInfo.fromJson,
);
return res.data;
}
@override
Future<BarInformation?> getGeneralBarInformation({
required String token,
}) async {
var res = await _httpClient.get(
'/bars_for_kill_house_dashboard/?role=Steward',
headers: {'Authorization': 'Bearer $token'},
fromJson: BarInformation.fromJson,
);
return res.data;
}
@override
Future<WaitingArrivalModel?> getWaitingArrivals({
required String token,
int? page,
}) async {
var res = await _httpClient.get(
'/steward-allocation/?search=filter&value=&role=Steward&page=${page ?? 1}&page_size=10&type=not_entered',
headers: {'Authorization': 'Bearer $token'},
fromJson: WaitingArrivalModel.fromJson,
);
return res.data;
}
@override
Future<void> setSateForArrivals({
required String token,
required Map<String, dynamic> request,
}) async {
await _httpClient.put(
'/steward-allocation/0/',
headers: {'Authorization': 'Bearer $token'},
data: request,
);
}
@override
Future<ImportedLoadsModel?> getImportedLoadsModel({
required String token,
required int page,
}) async {
var res = await _httpClient.get(
'/steward-allocation/?role=Steward&search=filter&page=${page}&page_size=10&value=&type=entered',
headers: {'Authorization': 'Bearer $token'},
fromJson: ImportedLoadsModel.fromJson,
);
return res.data;
}
@override
Future<AllocatedMadeModel?> getAllocatedMade({
required String token,
required int page,
}) async {
var res = await _httpClient.get(
'/steward-allocation/?search=filter&value=&role=Steward&page=$page&page_size=100',
headers: {'Authorization': 'Bearer $token'},
fromJson: AllocatedMadeModel.fromJson,
);
return res.data;
}
@override
Future<void> confirmAllocation({
required String token,
required Map<String, dynamic> allocation,
}) async {
var res = await _httpClient.put(
'/steward-allocation/0/',
headers: {'Authorization': 'Bearer $token'},
data: allocation,
);
}
@override
Future<void> denyAllocation({
required String token,
required String allocationToken,
}) async {
await _httpClient.delete(
'/steward-allocation/0/?steward_allocation_key=$allocationToken',
headers: {'Authorization': 'Bearer $token'},
);
}
@override
Future<void> confirmAllAllocation({
required String token,
required List<String> allocationTokens,
}) async {
await _httpClient.put(
'/steward-allocation/0/',
headers: {'Authorization': 'Bearer $token'},
data: {'steward_allocation_list': allocationTokens},
);
}
@override
Future<List<ProductModel>?> getRolesProducts({required String token}) async {
var res = await _httpClient.get(
'/roles-products/?role=Steward',
headers: {'Authorization': 'Bearer $token'},
fromJsonList: (json) => json
.map((item) => ProductModel.fromJson(item as Map<String, dynamic>))
.toList(),
);
return res.data;
}
@override
Future<List<GuildModel>?> getGuilds({
required String token,
required bool isFree,
}) async {
var res = await _httpClient.get(
'/guilds/?role=Steward&free=$isFree',
headers: {'Authorization': 'Bearer $token'},
fromJsonList: (json) => json
.map((item) => GuildModel.fromJson(item as Map<String, dynamic>))
.toList(),
);
return res.data;
}
@override
Future<GuildProfile?> getProfile({required String token}) async {
var res = await _httpClient.get(
'/guilds/0/?profile',
headers: {'Authorization': 'Bearer $token'},
fromJson: GuildProfile.fromJson,
);
return res.data;
}
@override
Future<void> postSubmitStewardAllocation({
required String token,
required SubmitStewardAllocation request,
}) async {
await _httpClient.post(
'/steward-allocation/',
headers: {'Authorization': 'Bearer $token'},
data: request.toJson(),
);
}
}