feat : profile with logic

This commit is contained in:
2025-07-08 16:06:10 +03:30
parent a9b012b016
commit 146ea28e77
17 changed files with 1531 additions and 61 deletions

View File

@@ -0,0 +1,18 @@
import 'package:rasadyar_core/core.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'change_password_request_model.freezed.dart';
part 'change_password_request_model.g.dart';
@freezed
abstract class ChangePasswordRequestModel with _$ChangePasswordRequestModel {
const factory ChangePasswordRequestModel({
String? username,
String? password,
}) = _ChangePasswordRequestModel;
factory ChangePasswordRequestModel.fromJson(Map<String, dynamic> json) =>
_$ChangePasswordRequestModelFromJson(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 'change_password_request_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ChangePasswordRequestModel {
String? get username; String? get password;
/// Create a copy of ChangePasswordRequestModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ChangePasswordRequestModelCopyWith<ChangePasswordRequestModel> get copyWith => _$ChangePasswordRequestModelCopyWithImpl<ChangePasswordRequestModel>(this as ChangePasswordRequestModel, _$identity);
/// Serializes this ChangePasswordRequestModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChangePasswordRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,username,password);
@override
String toString() {
return 'ChangePasswordRequestModel(username: $username, password: $password)';
}
}
/// @nodoc
abstract mixin class $ChangePasswordRequestModelCopyWith<$Res> {
factory $ChangePasswordRequestModelCopyWith(ChangePasswordRequestModel value, $Res Function(ChangePasswordRequestModel) _then) = _$ChangePasswordRequestModelCopyWithImpl;
@useResult
$Res call({
String? username, String? password
});
}
/// @nodoc
class _$ChangePasswordRequestModelCopyWithImpl<$Res>
implements $ChangePasswordRequestModelCopyWith<$Res> {
_$ChangePasswordRequestModelCopyWithImpl(this._self, this._then);
final ChangePasswordRequestModel _self;
final $Res Function(ChangePasswordRequestModel) _then;
/// Create a copy of ChangePasswordRequestModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? username = freezed,Object? password = freezed,}) {
return _then(_self.copyWith(
username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _ChangePasswordRequestModel implements ChangePasswordRequestModel {
const _ChangePasswordRequestModel({this.username, this.password});
factory _ChangePasswordRequestModel.fromJson(Map<String, dynamic> json) => _$ChangePasswordRequestModelFromJson(json);
@override final String? username;
@override final String? password;
/// Create a copy of ChangePasswordRequestModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ChangePasswordRequestModelCopyWith<_ChangePasswordRequestModel> get copyWith => __$ChangePasswordRequestModelCopyWithImpl<_ChangePasswordRequestModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ChangePasswordRequestModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChangePasswordRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,username,password);
@override
String toString() {
return 'ChangePasswordRequestModel(username: $username, password: $password)';
}
}
/// @nodoc
abstract mixin class _$ChangePasswordRequestModelCopyWith<$Res> implements $ChangePasswordRequestModelCopyWith<$Res> {
factory _$ChangePasswordRequestModelCopyWith(_ChangePasswordRequestModel value, $Res Function(_ChangePasswordRequestModel) _then) = __$ChangePasswordRequestModelCopyWithImpl;
@override @useResult
$Res call({
String? username, String? password
});
}
/// @nodoc
class __$ChangePasswordRequestModelCopyWithImpl<$Res>
implements _$ChangePasswordRequestModelCopyWith<$Res> {
__$ChangePasswordRequestModelCopyWithImpl(this._self, this._then);
final _ChangePasswordRequestModel _self;
final $Res Function(_ChangePasswordRequestModel) _then;
/// Create a copy of ChangePasswordRequestModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? username = freezed,Object? password = freezed,}) {
return _then(_ChangePasswordRequestModel(
username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,21 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'change_password_request_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_ChangePasswordRequestModel _$ChangePasswordRequestModelFromJson(
Map<String, dynamic> json,
) => _ChangePasswordRequestModel(
username: json['username'] as String?,
password: json['password'] as String?,
);
Map<String, dynamic> _$ChangePasswordRequestModelToJson(
_ChangePasswordRequestModel instance,
) => <String, dynamic>{
'username': instance.username,
'password': instance.password,
};

View File

@@ -0,0 +1,65 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'user_profile.freezed.dart';
part 'user_profile.g.dart';
@freezed
abstract class UserProfile with _$UserProfile {
const factory UserProfile({
List<String>? role,
String? city,
String? province,
String? key,
String? userGateWayId,
dynamic userDjangoIdForeignKey,
dynamic provinceIdForeignKey,
dynamic cityIdForeignKey,
dynamic systemUserProfileIdKey,
String? fullname,
String? firstName,
String? lastName,
String? nationalCode,
String? nationalCodeImage,
String? nationalId,
String? mobile,
String? birthday,
String? image,
String? password,
bool? active,
UserState? state,
int? baseOrder,
int? cityNumber,
String? cityName,
int? provinceNumber,
String? provinceName,
String? unitName,
String? unitNationalId,
String? unitRegistrationNumber,
String? unitEconomicalNumber,
String? unitProvince,
String? unitCity,
String? unitPostalCode,
String? unitAddress,
String? personType,
String? type,
}) = _UserProfile;
factory UserProfile.fromJson(Map<String, dynamic> json) => _$UserProfileFromJson(json);
}
@freezed
abstract class UserState with _$UserState {
const factory UserState({
String? city,
String? image,
String? mobile,
String? birthday,
String? province,
String? lastName,
String? firstName,
String? nationalId,
String? nationalCode,
}) = _UserState;
factory UserState.fromJson(Map<String, dynamic> json) => _$UserStateFromJson(json);
}

View File

@@ -0,0 +1,442 @@
// 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 'user_profile.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$UserProfile {
List<String>? get role; String? get city; String? get province; String? get key; String? get userGateWayId; dynamic get userDjangoIdForeignKey; dynamic get provinceIdForeignKey; dynamic get cityIdForeignKey; dynamic get systemUserProfileIdKey; String? get fullname; String? get firstName; String? get lastName; String? get nationalCode; String? get nationalCodeImage; String? get nationalId; String? get mobile; String? get birthday; String? get image; String? get password; bool? get active; UserState? get state; int? get baseOrder; int? get cityNumber; String? get cityName; int? get provinceNumber; String? get provinceName; String? get unitName; String? get unitNationalId; String? get unitRegistrationNumber; String? get unitEconomicalNumber; String? get unitProvince; String? get unitCity; String? get unitPostalCode; String? get unitAddress; String? get personType; String? get type;
/// Create a copy of UserProfile
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$UserProfileCopyWith<UserProfile> get copyWith => _$UserProfileCopyWithImpl<UserProfile>(this as UserProfile, _$identity);
/// Serializes this UserProfile to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserProfile&&const DeepCollectionEquality().equals(other.role, role)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.key, key) || other.key == key)&&(identical(other.userGateWayId, userGateWayId) || other.userGateWayId == userGateWayId)&&const DeepCollectionEquality().equals(other.userDjangoIdForeignKey, userDjangoIdForeignKey)&&const DeepCollectionEquality().equals(other.provinceIdForeignKey, provinceIdForeignKey)&&const DeepCollectionEquality().equals(other.cityIdForeignKey, cityIdForeignKey)&&const DeepCollectionEquality().equals(other.systemUserProfileIdKey, systemUserProfileIdKey)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalCodeImage, nationalCodeImage) || other.nationalCodeImage == nationalCodeImage)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.password, password) || other.password == password)&&(identical(other.active, active) || other.active == active)&&(identical(other.state, state) || other.state == state)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)&&(identical(other.personType, personType) || other.personType == personType)&&(identical(other.type, type) || other.type == type));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,const DeepCollectionEquality().hash(role),city,province,key,userGateWayId,const DeepCollectionEquality().hash(userDjangoIdForeignKey),const DeepCollectionEquality().hash(provinceIdForeignKey),const DeepCollectionEquality().hash(cityIdForeignKey),const DeepCollectionEquality().hash(systemUserProfileIdKey),fullname,firstName,lastName,nationalCode,nationalCodeImage,nationalId,mobile,birthday,image,password,active,state,baseOrder,cityNumber,cityName,provinceNumber,provinceName,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress,personType,type]);
@override
String toString() {
return 'UserProfile(role: $role, city: $city, province: $province, key: $key, userGateWayId: $userGateWayId, userDjangoIdForeignKey: $userDjangoIdForeignKey, provinceIdForeignKey: $provinceIdForeignKey, cityIdForeignKey: $cityIdForeignKey, systemUserProfileIdKey: $systemUserProfileIdKey, fullname: $fullname, firstName: $firstName, lastName: $lastName, nationalCode: $nationalCode, nationalCodeImage: $nationalCodeImage, nationalId: $nationalId, mobile: $mobile, birthday: $birthday, image: $image, password: $password, active: $active, state: $state, baseOrder: $baseOrder, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress, personType: $personType, type: $type)';
}
}
/// @nodoc
abstract mixin class $UserProfileCopyWith<$Res> {
factory $UserProfileCopyWith(UserProfile value, $Res Function(UserProfile) _then) = _$UserProfileCopyWithImpl;
@useResult
$Res call({
List<String>? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type
});
$UserStateCopyWith<$Res>? get state;
}
/// @nodoc
class _$UserProfileCopyWithImpl<$Res>
implements $UserProfileCopyWith<$Res> {
_$UserProfileCopyWithImpl(this._self, this._then);
final UserProfile _self;
final $Res Function(UserProfile) _then;
/// Create a copy of UserProfile
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? role = freezed,Object? city = freezed,Object? province = freezed,Object? key = freezed,Object? userGateWayId = freezed,Object? userDjangoIdForeignKey = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdForeignKey = freezed,Object? systemUserProfileIdKey = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? nationalCode = freezed,Object? nationalCodeImage = freezed,Object? nationalId = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? image = freezed,Object? password = freezed,Object? active = freezed,Object? state = freezed,Object? baseOrder = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,Object? personType = freezed,Object? type = freezed,}) {
return _then(_self.copyWith(
role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as List<String>?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
as String?,userGateWayId: freezed == userGateWayId ? _self.userGateWayId : userGateWayId // ignore: cast_nullable_to_non_nullable
as String?,userDjangoIdForeignKey: freezed == userDjangoIdForeignKey ? _self.userDjangoIdForeignKey : userDjangoIdForeignKey // ignore: cast_nullable_to_non_nullable
as dynamic,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable
as dynamic,cityIdForeignKey: freezed == cityIdForeignKey ? _self.cityIdForeignKey : cityIdForeignKey // ignore: cast_nullable_to_non_nullable
as dynamic,systemUserProfileIdKey: freezed == systemUserProfileIdKey ? _self.systemUserProfileIdKey : systemUserProfileIdKey // ignore: cast_nullable_to_non_nullable
as dynamic,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
as String?,nationalCodeImage: freezed == nationalCodeImage ? _self.nationalCodeImage : nationalCodeImage // ignore: cast_nullable_to_non_nullable
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
as bool?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as UserState?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
as int?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable
as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable
as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable
as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable
as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable
as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable
as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable
as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable
as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable
as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable
as String?,personType: freezed == personType ? _self.personType : personType // ignore: cast_nullable_to_non_nullable
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of UserProfile
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$UserStateCopyWith<$Res>? get state {
if (_self.state == null) {
return null;
}
return $UserStateCopyWith<$Res>(_self.state!, (value) {
return _then(_self.copyWith(state: value));
});
}
}
/// @nodoc
@JsonSerializable()
class _UserProfile implements UserProfile {
const _UserProfile({final List<String>? role, this.city, this.province, this.key, this.userGateWayId, this.userDjangoIdForeignKey, this.provinceIdForeignKey, this.cityIdForeignKey, this.systemUserProfileIdKey, this.fullname, this.firstName, this.lastName, this.nationalCode, this.nationalCodeImage, this.nationalId, this.mobile, this.birthday, this.image, this.password, this.active, this.state, this.baseOrder, this.cityNumber, this.cityName, this.provinceNumber, this.provinceName, this.unitName, this.unitNationalId, this.unitRegistrationNumber, this.unitEconomicalNumber, this.unitProvince, this.unitCity, this.unitPostalCode, this.unitAddress, this.personType, this.type}): _role = role;
factory _UserProfile.fromJson(Map<String, dynamic> json) => _$UserProfileFromJson(json);
final List<String>? _role;
@override List<String>? get role {
final value = _role;
if (value == null) return null;
if (_role is EqualUnmodifiableListView) return _role;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
@override final String? city;
@override final String? province;
@override final String? key;
@override final String? userGateWayId;
@override final dynamic userDjangoIdForeignKey;
@override final dynamic provinceIdForeignKey;
@override final dynamic cityIdForeignKey;
@override final dynamic systemUserProfileIdKey;
@override final String? fullname;
@override final String? firstName;
@override final String? lastName;
@override final String? nationalCode;
@override final String? nationalCodeImage;
@override final String? nationalId;
@override final String? mobile;
@override final String? birthday;
@override final String? image;
@override final String? password;
@override final bool? active;
@override final UserState? state;
@override final int? baseOrder;
@override final int? cityNumber;
@override final String? cityName;
@override final int? provinceNumber;
@override final String? provinceName;
@override final String? unitName;
@override final String? unitNationalId;
@override final String? unitRegistrationNumber;
@override final String? unitEconomicalNumber;
@override final String? unitProvince;
@override final String? unitCity;
@override final String? unitPostalCode;
@override final String? unitAddress;
@override final String? personType;
@override final String? type;
/// Create a copy of UserProfile
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$UserProfileCopyWith<_UserProfile> get copyWith => __$UserProfileCopyWithImpl<_UserProfile>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$UserProfileToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserProfile&&const DeepCollectionEquality().equals(other._role, _role)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.key, key) || other.key == key)&&(identical(other.userGateWayId, userGateWayId) || other.userGateWayId == userGateWayId)&&const DeepCollectionEquality().equals(other.userDjangoIdForeignKey, userDjangoIdForeignKey)&&const DeepCollectionEquality().equals(other.provinceIdForeignKey, provinceIdForeignKey)&&const DeepCollectionEquality().equals(other.cityIdForeignKey, cityIdForeignKey)&&const DeepCollectionEquality().equals(other.systemUserProfileIdKey, systemUserProfileIdKey)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalCodeImage, nationalCodeImage) || other.nationalCodeImage == nationalCodeImage)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.password, password) || other.password == password)&&(identical(other.active, active) || other.active == active)&&(identical(other.state, state) || other.state == state)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)&&(identical(other.personType, personType) || other.personType == personType)&&(identical(other.type, type) || other.type == type));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,const DeepCollectionEquality().hash(_role),city,province,key,userGateWayId,const DeepCollectionEquality().hash(userDjangoIdForeignKey),const DeepCollectionEquality().hash(provinceIdForeignKey),const DeepCollectionEquality().hash(cityIdForeignKey),const DeepCollectionEquality().hash(systemUserProfileIdKey),fullname,firstName,lastName,nationalCode,nationalCodeImage,nationalId,mobile,birthday,image,password,active,state,baseOrder,cityNumber,cityName,provinceNumber,provinceName,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress,personType,type]);
@override
String toString() {
return 'UserProfile(role: $role, city: $city, province: $province, key: $key, userGateWayId: $userGateWayId, userDjangoIdForeignKey: $userDjangoIdForeignKey, provinceIdForeignKey: $provinceIdForeignKey, cityIdForeignKey: $cityIdForeignKey, systemUserProfileIdKey: $systemUserProfileIdKey, fullname: $fullname, firstName: $firstName, lastName: $lastName, nationalCode: $nationalCode, nationalCodeImage: $nationalCodeImage, nationalId: $nationalId, mobile: $mobile, birthday: $birthday, image: $image, password: $password, active: $active, state: $state, baseOrder: $baseOrder, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress, personType: $personType, type: $type)';
}
}
/// @nodoc
abstract mixin class _$UserProfileCopyWith<$Res> implements $UserProfileCopyWith<$Res> {
factory _$UserProfileCopyWith(_UserProfile value, $Res Function(_UserProfile) _then) = __$UserProfileCopyWithImpl;
@override @useResult
$Res call({
List<String>? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type
});
@override $UserStateCopyWith<$Res>? get state;
}
/// @nodoc
class __$UserProfileCopyWithImpl<$Res>
implements _$UserProfileCopyWith<$Res> {
__$UserProfileCopyWithImpl(this._self, this._then);
final _UserProfile _self;
final $Res Function(_UserProfile) _then;
/// Create a copy of UserProfile
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? role = freezed,Object? city = freezed,Object? province = freezed,Object? key = freezed,Object? userGateWayId = freezed,Object? userDjangoIdForeignKey = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdForeignKey = freezed,Object? systemUserProfileIdKey = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? nationalCode = freezed,Object? nationalCodeImage = freezed,Object? nationalId = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? image = freezed,Object? password = freezed,Object? active = freezed,Object? state = freezed,Object? baseOrder = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,Object? personType = freezed,Object? type = freezed,}) {
return _then(_UserProfile(
role: freezed == role ? _self._role : role // ignore: cast_nullable_to_non_nullable
as List<String>?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
as String?,userGateWayId: freezed == userGateWayId ? _self.userGateWayId : userGateWayId // ignore: cast_nullable_to_non_nullable
as String?,userDjangoIdForeignKey: freezed == userDjangoIdForeignKey ? _self.userDjangoIdForeignKey : userDjangoIdForeignKey // ignore: cast_nullable_to_non_nullable
as dynamic,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable
as dynamic,cityIdForeignKey: freezed == cityIdForeignKey ? _self.cityIdForeignKey : cityIdForeignKey // ignore: cast_nullable_to_non_nullable
as dynamic,systemUserProfileIdKey: freezed == systemUserProfileIdKey ? _self.systemUserProfileIdKey : systemUserProfileIdKey // ignore: cast_nullable_to_non_nullable
as dynamic,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
as String?,nationalCodeImage: freezed == nationalCodeImage ? _self.nationalCodeImage : nationalCodeImage // ignore: cast_nullable_to_non_nullable
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
as bool?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as UserState?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
as int?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable
as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable
as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable
as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable
as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable
as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable
as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable
as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable
as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable
as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable
as String?,personType: freezed == personType ? _self.personType : personType // ignore: cast_nullable_to_non_nullable
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of UserProfile
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$UserStateCopyWith<$Res>? get state {
if (_self.state == null) {
return null;
}
return $UserStateCopyWith<$Res>(_self.state!, (value) {
return _then(_self.copyWith(state: value));
});
}
}
/// @nodoc
mixin _$UserState {
String? get city; String? get image; String? get mobile; String? get birthday; String? get province; String? get lastName; String? get firstName; String? get nationalId; String? get nationalCode;
/// Create a copy of UserState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$UserStateCopyWith<UserState> get copyWith => _$UserStateCopyWithImpl<UserState>(this as UserState, _$identity);
/// Serializes this UserState to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserState&&(identical(other.city, city) || other.city == city)&&(identical(other.image, image) || other.image == image)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.province, province) || other.province == province)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,city,image,mobile,birthday,province,lastName,firstName,nationalId,nationalCode);
@override
String toString() {
return 'UserState(city: $city, image: $image, mobile: $mobile, birthday: $birthday, province: $province, lastName: $lastName, firstName: $firstName, nationalId: $nationalId, nationalCode: $nationalCode)';
}
}
/// @nodoc
abstract mixin class $UserStateCopyWith<$Res> {
factory $UserStateCopyWith(UserState value, $Res Function(UserState) _then) = _$UserStateCopyWithImpl;
@useResult
$Res call({
String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode
});
}
/// @nodoc
class _$UserStateCopyWithImpl<$Res>
implements $UserStateCopyWith<$Res> {
_$UserStateCopyWithImpl(this._self, this._then);
final UserState _self;
final $Res Function(UserState) _then;
/// Create a copy of UserState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? city = freezed,Object? image = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? province = freezed,Object? lastName = freezed,Object? firstName = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,}) {
return _then(_self.copyWith(
city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _UserState implements UserState {
const _UserState({this.city, this.image, this.mobile, this.birthday, this.province, this.lastName, this.firstName, this.nationalId, this.nationalCode});
factory _UserState.fromJson(Map<String, dynamic> json) => _$UserStateFromJson(json);
@override final String? city;
@override final String? image;
@override final String? mobile;
@override final String? birthday;
@override final String? province;
@override final String? lastName;
@override final String? firstName;
@override final String? nationalId;
@override final String? nationalCode;
/// Create a copy of UserState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$UserStateCopyWith<_UserState> get copyWith => __$UserStateCopyWithImpl<_UserState>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$UserStateToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserState&&(identical(other.city, city) || other.city == city)&&(identical(other.image, image) || other.image == image)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.province, province) || other.province == province)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,city,image,mobile,birthday,province,lastName,firstName,nationalId,nationalCode);
@override
String toString() {
return 'UserState(city: $city, image: $image, mobile: $mobile, birthday: $birthday, province: $province, lastName: $lastName, firstName: $firstName, nationalId: $nationalId, nationalCode: $nationalCode)';
}
}
/// @nodoc
abstract mixin class _$UserStateCopyWith<$Res> implements $UserStateCopyWith<$Res> {
factory _$UserStateCopyWith(_UserState value, $Res Function(_UserState) _then) = __$UserStateCopyWithImpl;
@override @useResult
$Res call({
String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode
});
}
/// @nodoc
class __$UserStateCopyWithImpl<$Res>
implements _$UserStateCopyWith<$Res> {
__$UserStateCopyWithImpl(this._self, this._then);
final _UserState _self;
final $Res Function(_UserState) _then;
/// Create a copy of UserState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? city = freezed,Object? image = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? province = freezed,Object? lastName = freezed,Object? firstName = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,}) {
return _then(_UserState(
city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,113 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_profile.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_UserProfile _$UserProfileFromJson(Map<String, dynamic> json) => _UserProfile(
role: (json['role'] as List<dynamic>?)?.map((e) => e as String).toList(),
city: json['city'] as String?,
province: json['province'] as String?,
key: json['key'] as String?,
userGateWayId: json['user_gate_way_id'] as String?,
userDjangoIdForeignKey: json['user_django_id_foreign_key'],
provinceIdForeignKey: json['province_id_foreign_key'],
cityIdForeignKey: json['city_id_foreign_key'],
systemUserProfileIdKey: json['system_user_profile_id_key'],
fullname: json['fullname'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
nationalCode: json['national_code'] as String?,
nationalCodeImage: json['national_code_image'] as String?,
nationalId: json['national_id'] as String?,
mobile: json['mobile'] as String?,
birthday: json['birthday'] as String?,
image: json['image'] as String?,
password: json['password'] as String?,
active: json['active'] as bool?,
state: json['state'] == null
? null
: UserState.fromJson(json['state'] as Map<String, dynamic>),
baseOrder: (json['base_order'] as num?)?.toInt(),
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?,
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?,
personType: json['person_type'] as String?,
type: json['type'] as String?,
);
Map<String, dynamic> _$UserProfileToJson(_UserProfile instance) =>
<String, dynamic>{
'role': instance.role,
'city': instance.city,
'province': instance.province,
'key': instance.key,
'user_gate_way_id': instance.userGateWayId,
'user_django_id_foreign_key': instance.userDjangoIdForeignKey,
'province_id_foreign_key': instance.provinceIdForeignKey,
'city_id_foreign_key': instance.cityIdForeignKey,
'system_user_profile_id_key': instance.systemUserProfileIdKey,
'fullname': instance.fullname,
'first_name': instance.firstName,
'last_name': instance.lastName,
'national_code': instance.nationalCode,
'national_code_image': instance.nationalCodeImage,
'national_id': instance.nationalId,
'mobile': instance.mobile,
'birthday': instance.birthday,
'image': instance.image,
'password': instance.password,
'active': instance.active,
'state': instance.state,
'base_order': instance.baseOrder,
'city_number': instance.cityNumber,
'city_name': instance.cityName,
'province_number': instance.provinceNumber,
'province_name': instance.provinceName,
'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,
'person_type': instance.personType,
'type': instance.type,
};
_UserState _$UserStateFromJson(Map<String, dynamic> json) => _UserState(
city: json['city'] as String?,
image: json['image'] as String?,
mobile: json['mobile'] as String?,
birthday: json['birthday'] as String?,
province: json['province'] as String?,
lastName: json['last_name'] as String?,
firstName: json['first_name'] as String?,
nationalId: json['national_id'] as String?,
nationalCode: json['national_code'] as String?,
);
Map<String, dynamic> _$UserStateToJson(_UserState instance) =>
<String, dynamic>{
'city': instance.city,
'image': instance.image,
'mobile': instance.mobile,
'birthday': instance.birthday,
'province': instance.province,
'last_name': instance.lastName,
'first_name': instance.firstName,
'national_id': instance.nationalId,
'national_code': instance.nationalCode,
};

View File

@@ -1,3 +1,4 @@
import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart';
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
@@ -15,33 +16,29 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ
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/steward_free_sale_bar/steward_free_sale_bar.dart';
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
hide ProductModel;
import 'package:rasadyar_core/core.dart';
import '../models/request/create_steward_free_bar/create_steward_free_bar.dart';
import '../models/request/create_steward_free_bar/create_steward_free_bar.dart';
abstract class ChickenRepository {
Future<List<InventoryModel>?> getInventory({required String token});
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({
required String token,
});
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({required String token});
Future<BarInformation?> getGeneralBarInformation({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<PaginationModel<WaitingArrivalModel>?> getWaitingArrivals({
Future<PaginationModel<WaitingArrivalModel>?> getWaitingArrivals({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> setSateForArrivals({
required String token,
required Map<String, dynamic> request,
});
Future<void> setSateForArrivals({required String token, required Map<String, dynamic> request});
Future<PaginationModel<ImportedLoadsModel>?> getImportedLoadsModel({
required String token,
@@ -53,15 +50,9 @@ abstract class ChickenRepository {
Map<String, dynamic>? queryParameters,
});
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,
@@ -87,13 +78,7 @@ abstract class ChickenRepository {
Map<String, dynamic>? queryParameters,
});
Future<void> updateStewardAllocation({
required String token,
required ConformAllocation request,
});
Future<void> updateStewardAllocation({required String token, required ConformAllocation request});
Future<StewardFreeBarDashboard?> getStewardDashboard({
required String token,
@@ -107,8 +92,7 @@ abstract class ChickenRepository {
required String endDate,
});
Future<PaginationModel<StewardFreeBar>?>
getStewardPurchasesOutSideOfTheProvince({
Future<PaginationModel<StewardFreeBar>?> getStewardPurchasesOutSideOfTheProvince({
required String token,
Map<String, dynamic>? queryParameters,
});
@@ -123,8 +107,7 @@ abstract class ChickenRepository {
required String stewardFreeBarKey,
});
Future<PaginationModel<OutProvinceCarcassesBuyer>?>
getOutProvinceCarcassesBuyer({
Future<PaginationModel<OutProvinceCarcassesBuyer>?> getOutProvinceCarcassesBuyer({
required String token,
Map<String, dynamic>? queryParameters,
});
@@ -153,4 +136,9 @@ abstract class ChickenRepository {
required StewardFreeSaleBarRequest body,
});
Future<UserProfile?> getUserProfile({required String token});
Future<void> updateUserProfile({required String token, required UserProfile userProfile});
Future<void> updatePassword({required String token, required ChangePasswordRequestModel model});
}

View File

@@ -1,3 +1,4 @@
import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart';
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart';
import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
@@ -16,6 +17,7 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ
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/steward_free_sale_bar/steward_free_sale_bar.dart';
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
hide ProductModel;
import 'package:rasadyar_core/core.dart';
@@ -176,7 +178,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/guilds/?',
'/guilds/',
queryParameters: queryParameters,
headers: {'Authorization': 'Bearer $token'},
fromJsonList: (json) =>
@@ -265,7 +267,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/steward_free_bar/?',
'/steward_free_bar/',
queryParameters: queryParameters,
headers: {'Authorization': 'Bearer $token'},
fromJson: (json) => PaginationModel<StewardFreeBar>.fromJson(
@@ -279,7 +281,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
@override
Future<List<IranProvinceCityModel>?> getCity({required String provinceName}) async {
var res = await _httpClient.get(
'/iran_city/?',
'/iran_city/',
queryParameters: {'name': provinceName},
fromJsonList: (json) =>
json.map((item) => IranProvinceCityModel.fromJson(item as Map<String, dynamic>)).toList(),
@@ -315,7 +317,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
required String stewardFreeBarKey,
}) async {
await _httpClient.delete(
'/steward_free_bar/0/?',
'/steward_free_bar/0/',
headers: {'Authorization': 'Bearer $token'},
queryParameters: {'key': stewardFreeBarKey},
);
@@ -327,7 +329,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/out-province-carcasses-buyer/?',
'/out-province-carcasses-buyer/',
queryParameters: queryParameters,
headers: {'Authorization': 'Bearer $token'},
fromJson: (json) => PaginationModel<OutProvinceCarcassesBuyer>.fromJson(
@@ -356,7 +358,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/steward_free_sale_bar/?',
'/steward_free_sale_bar/',
queryParameters: queryParameters,
headers: {'Authorization': 'Bearer $token'},
fromJson: (json) => PaginationModel<StewardFreeSaleBar>.fromJson(
@@ -392,4 +394,36 @@ class ChickenRepositoryImpl implements ChickenRepository {
headers: {'Authorization': 'Bearer $token'},
);
}
@override
Future<UserProfile?> getUserProfile({required String token}) async {
var res = await _httpClient.get(
'/system_user_profile/?self-profile',
headers: {'Authorization': 'Bearer $token'},
fromJson: (json) => UserProfile.fromJson(json),
);
return res.data;
}
@override
Future<void> updateUserProfile({required String token, required UserProfile userProfile}) async {
await _httpClient.put(
'/system_user_profile/?self-profile/0/',
headers: {'Authorization': 'Bearer $token'},
data: userProfile.toJson()..removeWhere((key, value) => value == null),
);
}
@override
Future<void> updatePassword({
required String token,
required ChangePasswordRequestModel model,
}) async {
await _httpClient.post(
'/api/change_password/',
headers: {'Authorization': 'Bearer $token'},
data: model.toJson()..removeWhere((key, value) => value == null),
);
}
}