feat : sale out of Province
This commit is contained in:
@@ -8,12 +8,10 @@ GetIt diChicken = GetIt.instance;
|
||||
Future<void> setupChickenDI() async {
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
|
||||
diAuth.registerLazySingleton<DioRemote>(
|
||||
() => DioRemote(baseUrl: tokenService.baseurl.value),
|
||||
);
|
||||
diAuth.registerLazySingleton<DioRemote>(() => DioRemote(baseUrl: tokenService.baseurl.value));
|
||||
final dioRemote = diAuth.get<DioRemote>();
|
||||
await dioRemote.init();
|
||||
diAuth.registerLazySingleton<ChickenRepositoryImpl>(
|
||||
() => ChickenRepositoryImpl(dioRemote),
|
||||
);
|
||||
diAuth.registerLazySingleton<ChickenRepositoryImpl>(() => ChickenRepositoryImpl(dioRemote));
|
||||
|
||||
diChicken.registerSingleton(ImagePicker());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'create_steward_free_bar.freezed.dart';
|
||||
part 'create_steward_free_bar.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class CreateStewardFreeBar with _$CreateStewardFreeBar {
|
||||
const factory CreateStewardFreeBar({
|
||||
String? productKey,
|
||||
String? killHouseName,
|
||||
String? killHouseMobile,
|
||||
String? province,
|
||||
String? city,
|
||||
int? weightOfCarcasses,
|
||||
String? date,
|
||||
String? barImage,
|
||||
}) = _CreateStewardFreeBar;
|
||||
|
||||
factory CreateStewardFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$CreateStewardFreeBarFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'iran_province_city_model.freezed.dart';
|
||||
part 'iran_province_city_model.g.dart';
|
||||
|
||||
|
||||
@freezed
|
||||
abstract class IranProvinceCityModel with _$IranProvinceCityModel {
|
||||
const factory IranProvinceCityModel({
|
||||
int? id,
|
||||
String? name,
|
||||
}) = _IranProvinceCityModel;
|
||||
|
||||
factory IranProvinceCityModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$IranProvinceCityModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'pagination_model.freezed.dart';
|
||||
part 'pagination_model.g.dart';
|
||||
|
||||
@Freezed(genericArgumentFactories: true)
|
||||
abstract class PaginationModel<T> with _$PaginationModel<T> {
|
||||
const factory PaginationModel({
|
||||
int? count,
|
||||
String? next,
|
||||
String? previous,
|
||||
List<T>? results,
|
||||
}) = _PaginationModel<T>;
|
||||
|
||||
factory PaginationModel.fromJson(
|
||||
Map<String, dynamic> json,
|
||||
T Function(Object?) fromJsonT,
|
||||
) => _$PaginationModelFromJson(json, fromJsonT);
|
||||
}
|
||||
@@ -6,19 +6,6 @@ part 'steward_free_bar.g.dart';
|
||||
@freezed
|
||||
abstract class StewardFreeBar with _$StewardFreeBar {
|
||||
const factory StewardFreeBar({
|
||||
int? count,
|
||||
String? next,
|
||||
String? previous,
|
||||
List<Result>? results,
|
||||
}) = _StewardFreeBar;
|
||||
|
||||
factory StewardFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$StewardFreeBarFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Result with _$Result {
|
||||
const factory Result({
|
||||
int? id,
|
||||
Steward? steward,
|
||||
dynamic guild,
|
||||
@@ -45,9 +32,10 @@ abstract class Result with _$Result {
|
||||
bool? temporaryDeleted,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
}) = _Result;
|
||||
}) = _StewardFreeBar;
|
||||
|
||||
factory Result.fromJson(Map<String, dynamic> json) => _$ResultFromJson(json);
|
||||
factory StewardFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$StewardFreeBarFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
|
||||
@@ -16,7 +16,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$StewardFreeBar {
|
||||
|
||||
int? get count; String? get next; String? get previous; List<Result>? get results;
|
||||
int? get id; Steward? get steward; dynamic get guild; Product? get product; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get killHouseName; String? get killHouseMobile; String? get killHouseVetName; String? get killHouseVetMobile; String? get province; String? get city; String? get driverName; String? get driverMobile; dynamic get car; String? get pelak; int? get numberOfCarcasses; double? get weightOfCarcasses; String? get barImage; String? get date; bool? get temporaryTrash; bool? get temporaryDeleted; String? get createdBy; String? get modifiedBy;
|
||||
/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -29,16 +29,16 @@ $StewardFreeBarCopyWith<StewardFreeBar> get copyWith => _$StewardFreeBarCopyWith
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeBar&&(identical(other.count, count) || other.count == count)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)&&const DeepCollectionEquality().equals(other.results, results));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeBar&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,count,next,previous,const DeepCollectionEquality().hash(results));
|
||||
int get hashCode => Object.hashAll([runtimeType,id,steward,const DeepCollectionEquality().hash(guild),product,key,createDate,modifyDate,trash,killHouseName,killHouseMobile,killHouseVetName,killHouseVetMobile,province,city,driverName,driverMobile,const DeepCollectionEquality().hash(car),pelak,numberOfCarcasses,weightOfCarcasses,barImage,date,temporaryTrash,temporaryDeleted,createdBy,modifiedBy]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StewardFreeBar(count: $count, next: $next, previous: $previous, results: $results)';
|
||||
return 'StewardFreeBar(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)';
|
||||
}
|
||||
|
||||
|
||||
@@ -49,11 +49,11 @@ abstract mixin class $StewardFreeBarCopyWith<$Res> {
|
||||
factory $StewardFreeBarCopyWith(StewardFreeBar value, $Res Function(StewardFreeBar) _then) = _$StewardFreeBarCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? count, String? next, String? previous, List<Result>? results
|
||||
int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy
|
||||
});
|
||||
|
||||
|
||||
|
||||
$StewardCopyWith<$Res>? get steward;$ProductCopyWith<$Res>? get product;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -66,156 +66,6 @@ class _$StewardFreeBarCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? count = freezed,Object? next = freezed,Object? previous = freezed,Object? results = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
count: freezed == count ? _self.count : count // ignore: cast_nullable_to_non_nullable
|
||||
as int?,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable
|
||||
as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable
|
||||
as String?,results: freezed == results ? _self.results : results // ignore: cast_nullable_to_non_nullable
|
||||
as List<Result>?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _StewardFreeBar implements StewardFreeBar {
|
||||
const _StewardFreeBar({this.count, this.next, this.previous, final List<Result>? results}): _results = results;
|
||||
factory _StewardFreeBar.fromJson(Map<String, dynamic> json) => _$StewardFreeBarFromJson(json);
|
||||
|
||||
@override final int? count;
|
||||
@override final String? next;
|
||||
@override final String? previous;
|
||||
final List<Result>? _results;
|
||||
@override List<Result>? get results {
|
||||
final value = _results;
|
||||
if (value == null) return null;
|
||||
if (_results is EqualUnmodifiableListView) return _results;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$StewardFreeBarCopyWith<_StewardFreeBar> get copyWith => __$StewardFreeBarCopyWithImpl<_StewardFreeBar>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$StewardFreeBarToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeBar&&(identical(other.count, count) || other.count == count)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)&&const DeepCollectionEquality().equals(other._results, _results));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,count,next,previous,const DeepCollectionEquality().hash(_results));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StewardFreeBar(count: $count, next: $next, previous: $previous, results: $results)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$StewardFreeBarCopyWith<$Res> implements $StewardFreeBarCopyWith<$Res> {
|
||||
factory _$StewardFreeBarCopyWith(_StewardFreeBar value, $Res Function(_StewardFreeBar) _then) = __$StewardFreeBarCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? count, String? next, String? previous, List<Result>? results
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$StewardFreeBarCopyWithImpl<$Res>
|
||||
implements _$StewardFreeBarCopyWith<$Res> {
|
||||
__$StewardFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _StewardFreeBar _self;
|
||||
final $Res Function(_StewardFreeBar) _then;
|
||||
|
||||
/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? count = freezed,Object? next = freezed,Object? previous = freezed,Object? results = freezed,}) {
|
||||
return _then(_StewardFreeBar(
|
||||
count: freezed == count ? _self.count : count // ignore: cast_nullable_to_non_nullable
|
||||
as int?,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable
|
||||
as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable
|
||||
as String?,results: freezed == results ? _self._results : results // ignore: cast_nullable_to_non_nullable
|
||||
as List<Result>?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Result {
|
||||
|
||||
int? get id; Steward? get steward; dynamic get guild; Product? get product; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get killHouseName; String? get killHouseMobile; String? get killHouseVetName; String? get killHouseVetMobile; String? get province; String? get city; String? get driverName; String? get driverMobile; dynamic get car; String? get pelak; int? get numberOfCarcasses; double? get weightOfCarcasses; String? get barImage; String? get date; bool? get temporaryTrash; bool? get temporaryDeleted; String? get createdBy; String? get modifiedBy;
|
||||
/// Create a copy of Result
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$ResultCopyWith<Result> get copyWith => _$ResultCopyWithImpl<Result>(this as Result, _$identity);
|
||||
|
||||
/// Serializes this Result to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is Result&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,steward,const DeepCollectionEquality().hash(guild),product,key,createDate,modifyDate,trash,killHouseName,killHouseMobile,killHouseVetName,killHouseVetMobile,province,city,driverName,driverMobile,const DeepCollectionEquality().hash(car),pelak,numberOfCarcasses,weightOfCarcasses,barImage,date,temporaryTrash,temporaryDeleted,createdBy,modifiedBy]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Result(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $ResultCopyWith<$Res> {
|
||||
factory $ResultCopyWith(Result value, $Res Function(Result) _then) = _$ResultCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy
|
||||
});
|
||||
|
||||
|
||||
$StewardCopyWith<$Res>? get steward;$ProductCopyWith<$Res>? get product;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$ResultCopyWithImpl<$Res>
|
||||
implements $ResultCopyWith<$Res> {
|
||||
_$ResultCopyWithImpl(this._self, this._then);
|
||||
|
||||
final Result _self;
|
||||
final $Res Function(Result) _then;
|
||||
|
||||
/// Create a copy of Result
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? steward = freezed,Object? guild = freezed,Object? product = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? killHouseVetName = freezed,Object? killHouseVetMobile = freezed,Object? province = freezed,Object? city = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? pelak = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? barImage = freezed,Object? date = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
@@ -247,7 +97,7 @@ as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy //
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of Result
|
||||
/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
@@ -259,7 +109,7 @@ $StewardCopyWith<$Res>? get steward {
|
||||
return $StewardCopyWith<$Res>(_self.steward!, (value) {
|
||||
return _then(_self.copyWith(steward: value));
|
||||
});
|
||||
}/// Create a copy of Result
|
||||
}/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
@@ -278,9 +128,9 @@ $ProductCopyWith<$Res>? get product {
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _Result implements Result {
|
||||
const _Result({this.id, this.steward, this.guild, this.product, this.key, this.createDate, this.modifyDate, this.trash, this.killHouseName, this.killHouseMobile, this.killHouseVetName, this.killHouseVetMobile, this.province, this.city, this.driverName, this.driverMobile, this.car, this.pelak, this.numberOfCarcasses, this.weightOfCarcasses, this.barImage, this.date, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy});
|
||||
factory _Result.fromJson(Map<String, dynamic> json) => _$ResultFromJson(json);
|
||||
class _StewardFreeBar implements StewardFreeBar {
|
||||
const _StewardFreeBar({this.id, this.steward, this.guild, this.product, this.key, this.createDate, this.modifyDate, this.trash, this.killHouseName, this.killHouseMobile, this.killHouseVetName, this.killHouseVetMobile, this.province, this.city, this.driverName, this.driverMobile, this.car, this.pelak, this.numberOfCarcasses, this.weightOfCarcasses, this.barImage, this.date, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy});
|
||||
factory _StewardFreeBar.fromJson(Map<String, dynamic> json) => _$StewardFreeBarFromJson(json);
|
||||
|
||||
@override final int? id;
|
||||
@override final Steward? steward;
|
||||
@@ -309,20 +159,20 @@ class _Result implements Result {
|
||||
@override final String? createdBy;
|
||||
@override final String? modifiedBy;
|
||||
|
||||
/// Create a copy of Result
|
||||
/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$ResultCopyWith<_Result> get copyWith => __$ResultCopyWithImpl<_Result>(this, _$identity);
|
||||
_$StewardFreeBarCopyWith<_StewardFreeBar> get copyWith => __$StewardFreeBarCopyWithImpl<_StewardFreeBar>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$ResultToJson(this, );
|
||||
return _$StewardFreeBarToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Result&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeBar&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -331,15 +181,15 @@ int get hashCode => Object.hashAll([runtimeType,id,steward,const DeepCollectionE
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Result(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)';
|
||||
return 'StewardFreeBar(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$ResultCopyWith<$Res> implements $ResultCopyWith<$Res> {
|
||||
factory _$ResultCopyWith(_Result value, $Res Function(_Result) _then) = __$ResultCopyWithImpl;
|
||||
abstract mixin class _$StewardFreeBarCopyWith<$Res> implements $StewardFreeBarCopyWith<$Res> {
|
||||
factory _$StewardFreeBarCopyWith(_StewardFreeBar value, $Res Function(_StewardFreeBar) _then) = __$StewardFreeBarCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy
|
||||
@@ -350,17 +200,17 @@ $Res call({
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$ResultCopyWithImpl<$Res>
|
||||
implements _$ResultCopyWith<$Res> {
|
||||
__$ResultCopyWithImpl(this._self, this._then);
|
||||
class __$StewardFreeBarCopyWithImpl<$Res>
|
||||
implements _$StewardFreeBarCopyWith<$Res> {
|
||||
__$StewardFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _Result _self;
|
||||
final $Res Function(_Result) _then;
|
||||
final _StewardFreeBar _self;
|
||||
final $Res Function(_StewardFreeBar) _then;
|
||||
|
||||
/// Create a copy of Result
|
||||
/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? steward = freezed,Object? guild = freezed,Object? product = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? killHouseVetName = freezed,Object? killHouseVetMobile = freezed,Object? province = freezed,Object? city = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? pelak = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? barImage = freezed,Object? date = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,}) {
|
||||
return _then(_Result(
|
||||
return _then(_StewardFreeBar(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
|
||||
as Steward?,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable
|
||||
@@ -391,7 +241,7 @@ as String?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of Result
|
||||
/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
@@ -403,7 +253,7 @@ $StewardCopyWith<$Res>? get steward {
|
||||
return $StewardCopyWith<$Res>(_self.steward!, (value) {
|
||||
return _then(_self.copyWith(steward: value));
|
||||
});
|
||||
}/// Create a copy of Result
|
||||
}/// Create a copy of StewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
|
||||
@@ -8,84 +8,68 @@ part of 'steward_free_bar.dart';
|
||||
|
||||
_StewardFreeBar _$StewardFreeBarFromJson(Map<String, dynamic> json) =>
|
||||
_StewardFreeBar(
|
||||
count: (json['count'] as num?)?.toInt(),
|
||||
next: json['next'] as String?,
|
||||
previous: json['previous'] as String?,
|
||||
results: (json['results'] as List<dynamic>?)
|
||||
?.map((e) => Result.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
steward: json['steward'] == null
|
||||
? null
|
||||
: Steward.fromJson(json['steward'] as Map<String, dynamic>),
|
||||
guild: json['guild'],
|
||||
product: json['product'] == null
|
||||
? null
|
||||
: Product.fromJson(json['product'] 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?,
|
||||
killHouseName: json['kill_house_name'] as String?,
|
||||
killHouseMobile: json['kill_house_mobile'] as String?,
|
||||
killHouseVetName: json['kill_house_vet_name'] as String?,
|
||||
killHouseVetMobile: json['kill_house_vet_mobile'] as String?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
driverName: json['driver_name'] as String?,
|
||||
driverMobile: json['driver_mobile'] as String?,
|
||||
car: json['car'],
|
||||
pelak: json['pelak'] as String?,
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(),
|
||||
barImage: json['bar_image'] as String?,
|
||||
date: json['date'] as String?,
|
||||
temporaryTrash: json['temporary_trash'] as bool?,
|
||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$StewardFreeBarToJson(_StewardFreeBar instance) =>
|
||||
<String, dynamic>{
|
||||
'count': instance.count,
|
||||
'next': instance.next,
|
||||
'previous': instance.previous,
|
||||
'results': instance.results,
|
||||
'id': instance.id,
|
||||
'steward': instance.steward,
|
||||
'guild': instance.guild,
|
||||
'product': instance.product,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'kill_house_name': instance.killHouseName,
|
||||
'kill_house_mobile': instance.killHouseMobile,
|
||||
'kill_house_vet_name': instance.killHouseVetName,
|
||||
'kill_house_vet_mobile': instance.killHouseVetMobile,
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'driver_name': instance.driverName,
|
||||
'driver_mobile': instance.driverMobile,
|
||||
'car': instance.car,
|
||||
'pelak': instance.pelak,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'bar_image': instance.barImage,
|
||||
'date': instance.date,
|
||||
'temporary_trash': instance.temporaryTrash,
|
||||
'temporary_deleted': instance.temporaryDeleted,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
};
|
||||
|
||||
_Result _$ResultFromJson(Map<String, dynamic> json) => _Result(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
steward: json['steward'] == null
|
||||
? null
|
||||
: Steward.fromJson(json['steward'] as Map<String, dynamic>),
|
||||
guild: json['guild'],
|
||||
product: json['product'] == null
|
||||
? null
|
||||
: Product.fromJson(json['product'] 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?,
|
||||
killHouseName: json['kill_house_name'] as String?,
|
||||
killHouseMobile: json['kill_house_mobile'] as String?,
|
||||
killHouseVetName: json['kill_house_vet_name'] as String?,
|
||||
killHouseVetMobile: json['kill_house_vet_mobile'] as String?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
driverName: json['driver_name'] as String?,
|
||||
driverMobile: json['driver_mobile'] as String?,
|
||||
car: json['car'],
|
||||
pelak: json['pelak'] as String?,
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(),
|
||||
barImage: json['bar_image'] as String?,
|
||||
date: json['date'] as String?,
|
||||
temporaryTrash: json['temporary_trash'] as bool?,
|
||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ResultToJson(_Result instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'steward': instance.steward,
|
||||
'guild': instance.guild,
|
||||
'product': instance.product,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'kill_house_name': instance.killHouseName,
|
||||
'kill_house_mobile': instance.killHouseMobile,
|
||||
'kill_house_vet_name': instance.killHouseVetName,
|
||||
'kill_house_vet_mobile': instance.killHouseVetMobile,
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'driver_name': instance.driverName,
|
||||
'driver_mobile': instance.driverMobile,
|
||||
'car': instance.car,
|
||||
'pelak': instance.pelak,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'bar_image': instance.barImage,
|
||||
'date': instance.date,
|
||||
'temporary_trash': instance.temporaryTrash,
|
||||
'temporary_deleted': instance.temporaryDeleted,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
};
|
||||
|
||||
_Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
|
||||
user: json['user'] == null
|
||||
? null
|
||||
|
||||
@@ -6,79 +6,67 @@ 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/iran_province_city/iran_province_city_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/pagination_model/pagination_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' hide ProductModel;
|
||||
|
||||
import '../models/request/create_steward_free_bar/create_steward_free_bar.dart';
|
||||
|
||||
abstract class ChickenRepository {
|
||||
Future<List<InventoryModel>?> getInventory({required String token});
|
||||
|
||||
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({
|
||||
required String token,
|
||||
});
|
||||
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({required String token});
|
||||
|
||||
Future<BarInformation?> getGeneralBarInformation({required String token,Map<String, dynamic>? queryParameters});
|
||||
Future<BarInformation?> getGeneralBarInformation({required String token, Map<String, dynamic>? queryParameters});
|
||||
|
||||
Future<WaitingArrivalModel?> getWaitingArrivals({
|
||||
required String token,
|
||||
int? page,
|
||||
});
|
||||
Future<WaitingArrivalModel?> getWaitingArrivals({required String token, int? page});
|
||||
|
||||
Future<void> setSateForArrivals({
|
||||
required String token,
|
||||
required Map<String, dynamic> request,
|
||||
});
|
||||
Future<void> setSateForArrivals({required String token, required Map<String, dynamic> request});
|
||||
|
||||
Future<ImportedLoadsModel?> getImportedLoadsModel({
|
||||
required String token,
|
||||
required int page,
|
||||
});
|
||||
Future<ImportedLoadsModel?> getImportedLoadsModel({required String token, required int page});
|
||||
|
||||
Future<AllocatedMadeModel?> getAllocatedMade({
|
||||
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> confirmAllocation({required String token, required Map<String, dynamic> allocation});
|
||||
|
||||
Future<void> denyAllocation({
|
||||
required String token,
|
||||
required String allocationToken,
|
||||
});
|
||||
Future<void> denyAllocation({required String token, required String allocationToken});
|
||||
|
||||
Future<void> confirmAllAllocation({
|
||||
required String token,
|
||||
required List<String> allocationTokens,
|
||||
});
|
||||
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<List<GuildModel>?> getGuilds({required String token, required bool isFree});
|
||||
|
||||
Future<GuildProfile?> getProfile({required String token});
|
||||
|
||||
Future<void> postSubmitStewardAllocation({
|
||||
required String token,
|
||||
required SubmitStewardAllocation request,
|
||||
});
|
||||
Future<void> postSubmitStewardAllocation({required String token, required SubmitStewardAllocation request});
|
||||
|
||||
Future<StewardFreeBarDashboard?> getStewardDashboard({
|
||||
Future<StewardFreeBarDashboard?> getStewardDashboard({
|
||||
required String token,
|
||||
required String stratDate,
|
||||
required String endDate,
|
||||
});
|
||||
|
||||
Future<DashboardKillHouseFreeBar?> getDashboardKillHouseFreeBar({
|
||||
Future<DashboardKillHouseFreeBar?> getDashboardKillHouseFreeBar({
|
||||
required String token,
|
||||
required String stratDate,
|
||||
required String endDate,
|
||||
});
|
||||
|
||||
Future<PaginationModel<StewardFreeBar>?> getStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> createStewardPurchasesOutSideOfTheProvince({required String token, required CreateStewardFreeBar body});
|
||||
|
||||
Future<void> deleteStewardPurchasesOutSideOfTheProvince({required String token, required String stewardFreeBarKey});
|
||||
|
||||
Future<List<IranProvinceCityModel>?> getProvince();
|
||||
|
||||
Future<List<IranProvinceCityModel>?> getCity({required String provinceName});
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart';
|
||||
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';
|
||||
@@ -6,11 +7,13 @@ 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/iran_province_city/iran_province_city_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/pagination_model/pagination_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' hide ProductModel;
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'chicken_repository.dart';
|
||||
@@ -25,18 +28,14 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
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(),
|
||||
fromJsonList: (json) => (json).map((item) => InventoryModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({
|
||||
required String token,
|
||||
}) async {
|
||||
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/kill-house-distribution-info/?role=Steward',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
@@ -49,7 +48,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
@override
|
||||
Future<BarInformation?> getGeneralBarInformation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/bars_for_kill_house_dashboard/?role=Steward',
|
||||
@@ -61,10 +60,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<WaitingArrivalModel?> getWaitingArrivals({
|
||||
required String token,
|
||||
int? page,
|
||||
}) async {
|
||||
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'},
|
||||
@@ -74,22 +70,12 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
}
|
||||
|
||||
@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,
|
||||
);
|
||||
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 {
|
||||
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'},
|
||||
@@ -99,10 +85,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AllocatedMadeModel?> getAllocatedMade({
|
||||
required String token,
|
||||
required int page,
|
||||
}) async {
|
||||
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'},
|
||||
@@ -112,10 +95,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> confirmAllocation({
|
||||
required String token,
|
||||
required Map<String, dynamic> allocation,
|
||||
}) async {
|
||||
Future<void> confirmAllocation({required String token, required Map<String, dynamic> allocation}) async {
|
||||
var res = await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
@@ -124,10 +104,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> denyAllocation({
|
||||
required String token,
|
||||
required String allocationToken,
|
||||
}) async {
|
||||
Future<void> denyAllocation({required String token, required String allocationToken}) async {
|
||||
await _httpClient.delete(
|
||||
'/steward-allocation/0/?steward_allocation_key=$allocationToken',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
@@ -135,10 +112,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> confirmAllAllocation({
|
||||
required String token,
|
||||
required List<String> allocationTokens,
|
||||
}) async {
|
||||
Future<void> confirmAllAllocation({required String token, required List<String> allocationTokens}) async {
|
||||
await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
@@ -151,25 +125,18 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
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(),
|
||||
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 {
|
||||
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(),
|
||||
fromJsonList: (json) => json.map((item) => GuildModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
@@ -185,15 +152,8 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> postSubmitStewardAllocation({
|
||||
required String token,
|
||||
required SubmitStewardAllocation request,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/steward-allocation/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: request.toJson(),
|
||||
);
|
||||
Future<void> postSubmitStewardAllocation({required String token, required SubmitStewardAllocation request}) async {
|
||||
await _httpClient.post('/steward-allocation/', headers: {'Authorization': 'Bearer $token'}, data: request.toJson());
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -223,4 +183,64 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<StewardFreeBar>?> getStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward_free_bar/?',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => PaginationModel<StewardFreeBar>.fromJson(
|
||||
json,
|
||||
(json) => StewardFreeBar.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<IranProvinceCityModel>?> getCity({required String provinceName}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/iran_city/?',
|
||||
queryParameters: {'name': provinceName},
|
||||
fromJsonList: (json) => json.map((item) => IranProvinceCityModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<IranProvinceCityModel>?> getProvince() async {
|
||||
var res = await _httpClient.get(
|
||||
'/iran_province/',
|
||||
fromJsonList: (json) => json.map((item) => IranProvinceCityModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
required CreateStewardFreeBar body,
|
||||
}) async {
|
||||
var res = await _httpClient.post(
|
||||
'/steward_free_bar/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: body.toJson(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
required String stewardFreeBarKey,
|
||||
}) async {
|
||||
await _httpClient.delete(
|
||||
'/steward_free_bar/0/?',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: {'key': stewardFreeBarKey},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user