Files
tm_app/lib/data/services/model/customer/customer.freezed.dart
T
amirrezaghabeli 13dbb5fae5 Enhance Customer model to include role attribute and update related components
- Added a new `role` attribute to the `Customer` model in `customer.dart` and updated the corresponding generated files.
- Modified the `AuthViewModel` to set the user role based on the logged-in user's role.
- Updated UI components in `TenderDetailActions` and `DesktopTendersPage` to conditionally render elements based on the user's role.
- Refactored tests to validate the new role attribute in the `Customer` model.
2025-10-14 09:12:24 +03:30

413 lines
33 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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 'customer.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$Customer {
String? get id; String? get type; String? get status;@JsonKey(name: 'first_name') String? get firstName;@JsonKey(name: 'last_name') String? get lastName;@JsonKey(name: 'full_name') String? get fullName; String? get email; String? get phone; String? get mobile;@JsonKey(name: 'registration_number') String? get registrationNumber;@JsonKey(name: 'tax_id') String? get taxId; String? get industry;@JsonKey(name: 'business_type') String? get businessType;@JsonKey(name: 'employee_count') int? get employeeCount;@JsonKey(name: 'annual_revenue') int? get annualRevenue;@JsonKey(name: 'founded_year') int? get foundedYear;@JsonKey(name: 'is_verified') bool? get isVerified;@JsonKey(name: 'is_compliant') bool? get isCompliant;@JsonKey(name: 'compliance_notes') String? get complianceNotes; String? get language; String? get username; String? get currency; String? get role; String? get timezone;@JsonKey(name: 'created_at') int? get createdAt;@JsonKey(name: 'updated_at') int? get updatedAt;@JsonKey(name: 'created_by') String? get createdBy;@JsonKey(name: 'updated_by') String? get updatedBy; Address? get address; ContactPerson? get contactPersons;
/// Create a copy of Customer
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$CustomerCopyWith<Customer> get copyWith => _$CustomerCopyWithImpl<Customer>(this as Customer, _$identity);
/// Serializes this Customer to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is Customer&&(identical(other.id, id) || other.id == id)&&(identical(other.type, type) || other.type == type)&&(identical(other.status, status) || other.status == status)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.fullName, fullName) || other.fullName == fullName)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.registrationNumber, registrationNumber) || other.registrationNumber == registrationNumber)&&(identical(other.taxId, taxId) || other.taxId == taxId)&&(identical(other.industry, industry) || other.industry == industry)&&(identical(other.businessType, businessType) || other.businessType == businessType)&&(identical(other.employeeCount, employeeCount) || other.employeeCount == employeeCount)&&(identical(other.annualRevenue, annualRevenue) || other.annualRevenue == annualRevenue)&&(identical(other.foundedYear, foundedYear) || other.foundedYear == foundedYear)&&(identical(other.isVerified, isVerified) || other.isVerified == isVerified)&&(identical(other.isCompliant, isCompliant) || other.isCompliant == isCompliant)&&(identical(other.complianceNotes, complianceNotes) || other.complianceNotes == complianceNotes)&&(identical(other.language, language) || other.language == language)&&(identical(other.username, username) || other.username == username)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.role, role) || other.role == role)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.updatedBy, updatedBy) || other.updatedBy == updatedBy)&&(identical(other.address, address) || other.address == address)&&(identical(other.contactPersons, contactPersons) || other.contactPersons == contactPersons));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,id,type,status,firstName,lastName,fullName,email,phone,mobile,registrationNumber,taxId,industry,businessType,employeeCount,annualRevenue,foundedYear,isVerified,isCompliant,complianceNotes,language,username,currency,role,timezone,createdAt,updatedAt,createdBy,updatedBy,address,contactPersons]);
@override
String toString() {
return 'Customer(id: $id, type: $type, status: $status, firstName: $firstName, lastName: $lastName, fullName: $fullName, email: $email, phone: $phone, mobile: $mobile, registrationNumber: $registrationNumber, taxId: $taxId, industry: $industry, businessType: $businessType, employeeCount: $employeeCount, annualRevenue: $annualRevenue, foundedYear: $foundedYear, isVerified: $isVerified, isCompliant: $isCompliant, complianceNotes: $complianceNotes, language: $language, username: $username, currency: $currency, role: $role, timezone: $timezone, createdAt: $createdAt, updatedAt: $updatedAt, createdBy: $createdBy, updatedBy: $updatedBy, address: $address, contactPersons: $contactPersons)';
}
}
/// @nodoc
abstract mixin class $CustomerCopyWith<$Res> {
factory $CustomerCopyWith(Customer value, $Res Function(Customer) _then) = _$CustomerCopyWithImpl;
@useResult
$Res call({
String? id, String? type, String? status,@JsonKey(name: 'first_name') String? firstName,@JsonKey(name: 'last_name') String? lastName,@JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile,@JsonKey(name: 'registration_number') String? registrationNumber,@JsonKey(name: 'tax_id') String? taxId, String? industry,@JsonKey(name: 'business_type') String? businessType,@JsonKey(name: 'employee_count') int? employeeCount,@JsonKey(name: 'annual_revenue') int? annualRevenue,@JsonKey(name: 'founded_year') int? foundedYear,@JsonKey(name: 'is_verified') bool? isVerified,@JsonKey(name: 'is_compliant') bool? isCompliant,@JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? role, String? timezone,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'updated_at') int? updatedAt,@JsonKey(name: 'created_by') String? createdBy,@JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons
});
$AddressCopyWith<$Res>? get address;$ContactPersonCopyWith<$Res>? get contactPersons;
}
/// @nodoc
class _$CustomerCopyWithImpl<$Res>
implements $CustomerCopyWith<$Res> {
_$CustomerCopyWithImpl(this._self, this._then);
final Customer _self;
final $Res Function(Customer) _then;
/// Create a copy of Customer
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? type = freezed,Object? status = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? fullName = freezed,Object? email = freezed,Object? phone = freezed,Object? mobile = freezed,Object? registrationNumber = freezed,Object? taxId = freezed,Object? industry = freezed,Object? businessType = freezed,Object? employeeCount = freezed,Object? annualRevenue = freezed,Object? foundedYear = freezed,Object? isVerified = freezed,Object? isCompliant = freezed,Object? complianceNotes = freezed,Object? language = freezed,Object? username = freezed,Object? currency = freezed,Object? role = freezed,Object? timezone = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,Object? createdBy = freezed,Object? updatedBy = freezed,Object? address = freezed,Object? contactPersons = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String?,status: freezed == status ? _self.status : status // 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?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
as String?,registrationNumber: freezed == registrationNumber ? _self.registrationNumber : registrationNumber // ignore: cast_nullable_to_non_nullable
as String?,taxId: freezed == taxId ? _self.taxId : taxId // ignore: cast_nullable_to_non_nullable
as String?,industry: freezed == industry ? _self.industry : industry // ignore: cast_nullable_to_non_nullable
as String?,businessType: freezed == businessType ? _self.businessType : businessType // ignore: cast_nullable_to_non_nullable
as String?,employeeCount: freezed == employeeCount ? _self.employeeCount : employeeCount // ignore: cast_nullable_to_non_nullable
as int?,annualRevenue: freezed == annualRevenue ? _self.annualRevenue : annualRevenue // ignore: cast_nullable_to_non_nullable
as int?,foundedYear: freezed == foundedYear ? _self.foundedYear : foundedYear // ignore: cast_nullable_to_non_nullable
as int?,isVerified: freezed == isVerified ? _self.isVerified : isVerified // ignore: cast_nullable_to_non_nullable
as bool?,isCompliant: freezed == isCompliant ? _self.isCompliant : isCompliant // ignore: cast_nullable_to_non_nullable
as bool?,complianceNotes: freezed == complianceNotes ? _self.complianceNotes : complianceNotes // ignore: cast_nullable_to_non_nullable
as String?,language: freezed == language ? _self.language : language // ignore: cast_nullable_to_non_nullable
as String?,username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable
as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as String?,timezone: freezed == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable
as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
as int?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable
as String?,updatedBy: freezed == updatedBy ? _self.updatedBy : updatedBy // ignore: cast_nullable_to_non_nullable
as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as Address?,contactPersons: freezed == contactPersons ? _self.contactPersons : contactPersons // ignore: cast_nullable_to_non_nullable
as ContactPerson?,
));
}
/// Create a copy of Customer
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AddressCopyWith<$Res>? get address {
if (_self.address == null) {
return null;
}
return $AddressCopyWith<$Res>(_self.address!, (value) {
return _then(_self.copyWith(address: value));
});
}/// Create a copy of Customer
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ContactPersonCopyWith<$Res>? get contactPersons {
if (_self.contactPersons == null) {
return null;
}
return $ContactPersonCopyWith<$Res>(_self.contactPersons!, (value) {
return _then(_self.copyWith(contactPersons: value));
});
}
}
/// Adds pattern-matching-related methods to [Customer].
extension CustomerPatterns on Customer {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _Customer value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _Customer() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _Customer value) $default,){
final _that = this;
switch (_that) {
case _Customer():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _Customer value)? $default,){
final _that = this;
switch (_that) {
case _Customer() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? id, String? type, String? status, @JsonKey(name: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile, @JsonKey(name: 'registration_number') String? registrationNumber, @JsonKey(name: 'tax_id') String? taxId, String? industry, @JsonKey(name: 'business_type') String? businessType, @JsonKey(name: 'employee_count') int? employeeCount, @JsonKey(name: 'annual_revenue') int? annualRevenue, @JsonKey(name: 'founded_year') int? foundedYear, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'is_compliant') bool? isCompliant, @JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? role, String? timezone, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt, @JsonKey(name: 'created_by') String? createdBy, @JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Customer() when $default != null:
return $default(_that.id,_that.type,_that.status,_that.firstName,_that.lastName,_that.fullName,_that.email,_that.phone,_that.mobile,_that.registrationNumber,_that.taxId,_that.industry,_that.businessType,_that.employeeCount,_that.annualRevenue,_that.foundedYear,_that.isVerified,_that.isCompliant,_that.complianceNotes,_that.language,_that.username,_that.currency,_that.role,_that.timezone,_that.createdAt,_that.updatedAt,_that.createdBy,_that.updatedBy,_that.address,_that.contactPersons);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? id, String? type, String? status, @JsonKey(name: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile, @JsonKey(name: 'registration_number') String? registrationNumber, @JsonKey(name: 'tax_id') String? taxId, String? industry, @JsonKey(name: 'business_type') String? businessType, @JsonKey(name: 'employee_count') int? employeeCount, @JsonKey(name: 'annual_revenue') int? annualRevenue, @JsonKey(name: 'founded_year') int? foundedYear, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'is_compliant') bool? isCompliant, @JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? role, String? timezone, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt, @JsonKey(name: 'created_by') String? createdBy, @JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons) $default,) {final _that = this;
switch (_that) {
case _Customer():
return $default(_that.id,_that.type,_that.status,_that.firstName,_that.lastName,_that.fullName,_that.email,_that.phone,_that.mobile,_that.registrationNumber,_that.taxId,_that.industry,_that.businessType,_that.employeeCount,_that.annualRevenue,_that.foundedYear,_that.isVerified,_that.isCompliant,_that.complianceNotes,_that.language,_that.username,_that.currency,_that.role,_that.timezone,_that.createdAt,_that.updatedAt,_that.createdBy,_that.updatedBy,_that.address,_that.contactPersons);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? id, String? type, String? status, @JsonKey(name: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile, @JsonKey(name: 'registration_number') String? registrationNumber, @JsonKey(name: 'tax_id') String? taxId, String? industry, @JsonKey(name: 'business_type') String? businessType, @JsonKey(name: 'employee_count') int? employeeCount, @JsonKey(name: 'annual_revenue') int? annualRevenue, @JsonKey(name: 'founded_year') int? foundedYear, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'is_compliant') bool? isCompliant, @JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? role, String? timezone, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt, @JsonKey(name: 'created_by') String? createdBy, @JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons)? $default,) {final _that = this;
switch (_that) {
case _Customer() when $default != null:
return $default(_that.id,_that.type,_that.status,_that.firstName,_that.lastName,_that.fullName,_that.email,_that.phone,_that.mobile,_that.registrationNumber,_that.taxId,_that.industry,_that.businessType,_that.employeeCount,_that.annualRevenue,_that.foundedYear,_that.isVerified,_that.isCompliant,_that.complianceNotes,_that.language,_that.username,_that.currency,_that.role,_that.timezone,_that.createdAt,_that.updatedAt,_that.createdBy,_that.updatedBy,_that.address,_that.contactPersons);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _Customer implements Customer {
const _Customer({required this.id, required this.type, required this.status, @JsonKey(name: 'first_name') required this.firstName, @JsonKey(name: 'last_name') required this.lastName, @JsonKey(name: 'full_name') required this.fullName, required this.email, required this.phone, required this.mobile, @JsonKey(name: 'registration_number') required this.registrationNumber, @JsonKey(name: 'tax_id') required this.taxId, required this.industry, @JsonKey(name: 'business_type') required this.businessType, @JsonKey(name: 'employee_count') required this.employeeCount, @JsonKey(name: 'annual_revenue') required this.annualRevenue, @JsonKey(name: 'founded_year') required this.foundedYear, @JsonKey(name: 'is_verified') required this.isVerified, @JsonKey(name: 'is_compliant') required this.isCompliant, @JsonKey(name: 'compliance_notes') required this.complianceNotes, required this.language, required this.username, required this.currency, required this.role, required this.timezone, @JsonKey(name: 'created_at') required this.createdAt, @JsonKey(name: 'updated_at') required this.updatedAt, @JsonKey(name: 'created_by') required this.createdBy, @JsonKey(name: 'updated_by') required this.updatedBy, required this.address, required this.contactPersons});
factory _Customer.fromJson(Map<String, dynamic> json) => _$CustomerFromJson(json);
@override final String? id;
@override final String? type;
@override final String? status;
@override@JsonKey(name: 'first_name') final String? firstName;
@override@JsonKey(name: 'last_name') final String? lastName;
@override@JsonKey(name: 'full_name') final String? fullName;
@override final String? email;
@override final String? phone;
@override final String? mobile;
@override@JsonKey(name: 'registration_number') final String? registrationNumber;
@override@JsonKey(name: 'tax_id') final String? taxId;
@override final String? industry;
@override@JsonKey(name: 'business_type') final String? businessType;
@override@JsonKey(name: 'employee_count') final int? employeeCount;
@override@JsonKey(name: 'annual_revenue') final int? annualRevenue;
@override@JsonKey(name: 'founded_year') final int? foundedYear;
@override@JsonKey(name: 'is_verified') final bool? isVerified;
@override@JsonKey(name: 'is_compliant') final bool? isCompliant;
@override@JsonKey(name: 'compliance_notes') final String? complianceNotes;
@override final String? language;
@override final String? username;
@override final String? currency;
@override final String? role;
@override final String? timezone;
@override@JsonKey(name: 'created_at') final int? createdAt;
@override@JsonKey(name: 'updated_at') final int? updatedAt;
@override@JsonKey(name: 'created_by') final String? createdBy;
@override@JsonKey(name: 'updated_by') final String? updatedBy;
@override final Address? address;
@override final ContactPerson? contactPersons;
/// Create a copy of Customer
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$CustomerCopyWith<_Customer> get copyWith => __$CustomerCopyWithImpl<_Customer>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$CustomerToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Customer&&(identical(other.id, id) || other.id == id)&&(identical(other.type, type) || other.type == type)&&(identical(other.status, status) || other.status == status)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.fullName, fullName) || other.fullName == fullName)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.registrationNumber, registrationNumber) || other.registrationNumber == registrationNumber)&&(identical(other.taxId, taxId) || other.taxId == taxId)&&(identical(other.industry, industry) || other.industry == industry)&&(identical(other.businessType, businessType) || other.businessType == businessType)&&(identical(other.employeeCount, employeeCount) || other.employeeCount == employeeCount)&&(identical(other.annualRevenue, annualRevenue) || other.annualRevenue == annualRevenue)&&(identical(other.foundedYear, foundedYear) || other.foundedYear == foundedYear)&&(identical(other.isVerified, isVerified) || other.isVerified == isVerified)&&(identical(other.isCompliant, isCompliant) || other.isCompliant == isCompliant)&&(identical(other.complianceNotes, complianceNotes) || other.complianceNotes == complianceNotes)&&(identical(other.language, language) || other.language == language)&&(identical(other.username, username) || other.username == username)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.role, role) || other.role == role)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.updatedBy, updatedBy) || other.updatedBy == updatedBy)&&(identical(other.address, address) || other.address == address)&&(identical(other.contactPersons, contactPersons) || other.contactPersons == contactPersons));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,id,type,status,firstName,lastName,fullName,email,phone,mobile,registrationNumber,taxId,industry,businessType,employeeCount,annualRevenue,foundedYear,isVerified,isCompliant,complianceNotes,language,username,currency,role,timezone,createdAt,updatedAt,createdBy,updatedBy,address,contactPersons]);
@override
String toString() {
return 'Customer(id: $id, type: $type, status: $status, firstName: $firstName, lastName: $lastName, fullName: $fullName, email: $email, phone: $phone, mobile: $mobile, registrationNumber: $registrationNumber, taxId: $taxId, industry: $industry, businessType: $businessType, employeeCount: $employeeCount, annualRevenue: $annualRevenue, foundedYear: $foundedYear, isVerified: $isVerified, isCompliant: $isCompliant, complianceNotes: $complianceNotes, language: $language, username: $username, currency: $currency, role: $role, timezone: $timezone, createdAt: $createdAt, updatedAt: $updatedAt, createdBy: $createdBy, updatedBy: $updatedBy, address: $address, contactPersons: $contactPersons)';
}
}
/// @nodoc
abstract mixin class _$CustomerCopyWith<$Res> implements $CustomerCopyWith<$Res> {
factory _$CustomerCopyWith(_Customer value, $Res Function(_Customer) _then) = __$CustomerCopyWithImpl;
@override @useResult
$Res call({
String? id, String? type, String? status,@JsonKey(name: 'first_name') String? firstName,@JsonKey(name: 'last_name') String? lastName,@JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile,@JsonKey(name: 'registration_number') String? registrationNumber,@JsonKey(name: 'tax_id') String? taxId, String? industry,@JsonKey(name: 'business_type') String? businessType,@JsonKey(name: 'employee_count') int? employeeCount,@JsonKey(name: 'annual_revenue') int? annualRevenue,@JsonKey(name: 'founded_year') int? foundedYear,@JsonKey(name: 'is_verified') bool? isVerified,@JsonKey(name: 'is_compliant') bool? isCompliant,@JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? role, String? timezone,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'updated_at') int? updatedAt,@JsonKey(name: 'created_by') String? createdBy,@JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons
});
@override $AddressCopyWith<$Res>? get address;@override $ContactPersonCopyWith<$Res>? get contactPersons;
}
/// @nodoc
class __$CustomerCopyWithImpl<$Res>
implements _$CustomerCopyWith<$Res> {
__$CustomerCopyWithImpl(this._self, this._then);
final _Customer _self;
final $Res Function(_Customer) _then;
/// Create a copy of Customer
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? type = freezed,Object? status = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? fullName = freezed,Object? email = freezed,Object? phone = freezed,Object? mobile = freezed,Object? registrationNumber = freezed,Object? taxId = freezed,Object? industry = freezed,Object? businessType = freezed,Object? employeeCount = freezed,Object? annualRevenue = freezed,Object? foundedYear = freezed,Object? isVerified = freezed,Object? isCompliant = freezed,Object? complianceNotes = freezed,Object? language = freezed,Object? username = freezed,Object? currency = freezed,Object? role = freezed,Object? timezone = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,Object? createdBy = freezed,Object? updatedBy = freezed,Object? address = freezed,Object? contactPersons = freezed,}) {
return _then(_Customer(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String?,status: freezed == status ? _self.status : status // 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?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
as String?,registrationNumber: freezed == registrationNumber ? _self.registrationNumber : registrationNumber // ignore: cast_nullable_to_non_nullable
as String?,taxId: freezed == taxId ? _self.taxId : taxId // ignore: cast_nullable_to_non_nullable
as String?,industry: freezed == industry ? _self.industry : industry // ignore: cast_nullable_to_non_nullable
as String?,businessType: freezed == businessType ? _self.businessType : businessType // ignore: cast_nullable_to_non_nullable
as String?,employeeCount: freezed == employeeCount ? _self.employeeCount : employeeCount // ignore: cast_nullable_to_non_nullable
as int?,annualRevenue: freezed == annualRevenue ? _self.annualRevenue : annualRevenue // ignore: cast_nullable_to_non_nullable
as int?,foundedYear: freezed == foundedYear ? _self.foundedYear : foundedYear // ignore: cast_nullable_to_non_nullable
as int?,isVerified: freezed == isVerified ? _self.isVerified : isVerified // ignore: cast_nullable_to_non_nullable
as bool?,isCompliant: freezed == isCompliant ? _self.isCompliant : isCompliant // ignore: cast_nullable_to_non_nullable
as bool?,complianceNotes: freezed == complianceNotes ? _self.complianceNotes : complianceNotes // ignore: cast_nullable_to_non_nullable
as String?,language: freezed == language ? _self.language : language // ignore: cast_nullable_to_non_nullable
as String?,username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable
as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as String?,timezone: freezed == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable
as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
as int?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable
as String?,updatedBy: freezed == updatedBy ? _self.updatedBy : updatedBy // ignore: cast_nullable_to_non_nullable
as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as Address?,contactPersons: freezed == contactPersons ? _self.contactPersons : contactPersons // ignore: cast_nullable_to_non_nullable
as ContactPerson?,
));
}
/// Create a copy of Customer
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AddressCopyWith<$Res>? get address {
if (_self.address == null) {
return null;
}
return $AddressCopyWith<$Res>(_self.address!, (value) {
return _then(_self.copyWith(address: value));
});
}/// Create a copy of Customer
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ContactPersonCopyWith<$Res>? get contactPersons {
if (_self.contactPersons == null) {
return null;
}
return $ContactPersonCopyWith<$Res>(_self.contactPersons!, (value) {
return _then(_self.copyWith(contactPersons: value));
});
}
}
// dart format on