merge branches

This commit is contained in:
amirrezaghabeli
2025-08-18 08:28:18 +03:30
parent 0a54b613cd
commit 36f66bfca5
48 changed files with 2348 additions and 613 deletions
@@ -0,0 +1,47 @@
// ignore_for_file: invalid_annotation_target
import 'package:freezed_annotation/freezed_annotation.dart';
import '../address/address.dart';
import '../contact_person/contact_person.dart';
part 'customer.freezed.dart';
part 'customer.g.dart';
@freezed
abstract class Customer with _$Customer {
const factory Customer({
required String? id,
required String? type,
required String? status,
@JsonKey(name: 'first_name') required String? firstName,
@JsonKey(name: 'last_name') required String? lastName,
@JsonKey(name: 'full_name') required String? fullName,
required String? email,
required String? phone,
required String? mobile,
@JsonKey(name: 'registration_number') required String? registrationNumber,
@JsonKey(name: 'tax_id') required String? taxId,
required String? industry,
@JsonKey(name: 'business_type') required String? businessType,
@JsonKey(name: 'employee_count') required int? employeeCount,
@JsonKey(name: 'annual_revenue') required int? annualRevenue,
@JsonKey(name: 'founded_year') required int? foundedYear,
@JsonKey(name: 'is_verified') required bool? isVerified,
@JsonKey(name: 'is_compliant') required bool? isCompliant,
@JsonKey(name: 'compliance_notes') required String? complianceNotes,
required String? language,
required String? username,
required String? currency,
required String? timezone,
@JsonKey(name: 'created_at') required int? createdAt,
@JsonKey(name: 'updated_at') required int? updatedAt,
@JsonKey(name: 'created_by') required String? createdBy,
@JsonKey(name: 'updated_by') required String? updatedBy,
required Address? address,
required ContactPerson? contactPersons,
}) = _Customer;
factory Customer.fromJson(Map<String, Object?> json) =>
_$CustomerFromJson(json);
}
@@ -0,0 +1,409 @@
// 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 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.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,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, 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? 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? 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?,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? 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.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? 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.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? 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.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.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? 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.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,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, 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? 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? 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?,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
@@ -0,0 +1,79 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'customer.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_Customer _$CustomerFromJson(Map<String, dynamic> json) => _Customer(
id: json['id'] as String?,
type: json['type'] as String?,
status: json['status'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
fullName: json['full_name'] as String?,
email: json['email'] as String?,
phone: json['phone'] as String?,
mobile: json['mobile'] as String?,
registrationNumber: json['registration_number'] as String?,
taxId: json['tax_id'] as String?,
industry: json['industry'] as String?,
businessType: json['business_type'] as String?,
employeeCount: (json['employee_count'] as num?)?.toInt(),
annualRevenue: (json['annual_revenue'] as num?)?.toInt(),
foundedYear: (json['founded_year'] as num?)?.toInt(),
isVerified: json['is_verified'] as bool?,
isCompliant: json['is_compliant'] as bool?,
complianceNotes: json['compliance_notes'] as String?,
language: json['language'] as String?,
username: json['username'] as String?,
currency: json['currency'] as String?,
timezone: json['timezone'] as String?,
createdAt: (json['created_at'] as num?)?.toInt(),
updatedAt: (json['updated_at'] as num?)?.toInt(),
createdBy: json['created_by'] as String?,
updatedBy: json['updated_by'] as String?,
address:
json['address'] == null
? null
: Address.fromJson(json['address'] as Map<String, dynamic>),
contactPersons:
json['contactPersons'] == null
? null
: ContactPerson.fromJson(
json['contactPersons'] as Map<String, dynamic>,
),
);
Map<String, dynamic> _$CustomerToJson(_Customer instance) => <String, dynamic>{
'id': instance.id,
'type': instance.type,
'status': instance.status,
'first_name': instance.firstName,
'last_name': instance.lastName,
'full_name': instance.fullName,
'email': instance.email,
'phone': instance.phone,
'mobile': instance.mobile,
'registration_number': instance.registrationNumber,
'tax_id': instance.taxId,
'industry': instance.industry,
'business_type': instance.businessType,
'employee_count': instance.employeeCount,
'annual_revenue': instance.annualRevenue,
'founded_year': instance.foundedYear,
'is_verified': instance.isVerified,
'is_compliant': instance.isCompliant,
'compliance_notes': instance.complianceNotes,
'language': instance.language,
'username': instance.username,
'currency': instance.currency,
'timezone': instance.timezone,
'created_at': instance.createdAt,
'updated_at': instance.updatedAt,
'created_by': instance.createdBy,
'updated_by': instance.updatedBy,
'address': instance.address,
'contactPersons': instance.contactPersons,
};