사용하지 않는 파일 정리 전 백업 (Phase 10 완료 후 상태)
This commit is contained in:
@@ -1,72 +1,36 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:superport/data/models/zipcode_dto.dart';
|
||||
|
||||
part 'company_dto.freezed.dart';
|
||||
part 'company_dto.g.dart';
|
||||
|
||||
@freezed
|
||||
class CreateCompanyRequest with _$CreateCompanyRequest {
|
||||
const factory CreateCompanyRequest({
|
||||
class CompanyDto with _$CompanyDto {
|
||||
const CompanyDto._(); // Private constructor for getters
|
||||
|
||||
const factory CompanyDto({
|
||||
int? id,
|
||||
required String name,
|
||||
@JsonKey(name: 'contact_name') required String contactName,
|
||||
@JsonKey(name: 'contact_phone') required String contactPhone,
|
||||
@JsonKey(name: 'contact_email') required String contactEmail,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
@JsonKey(name: 'zipcodes_zipcode') String? zipcodesZipcode,
|
||||
required String address,
|
||||
@JsonKey(name: 'contact_name') required String contactName,
|
||||
@JsonKey(name: 'contact_position') required String contactPosition,
|
||||
@JsonKey(name: 'contact_phone') required String contactPhone,
|
||||
@JsonKey(name: 'contact_email') required String contactEmail,
|
||||
@JsonKey(name: 'company_types') @Default([]) List<String> companyTypes,
|
||||
@JsonKey(name: 'is_partner') @Default(false) bool isPartner,
|
||||
@JsonKey(name: 'is_customer') @Default(true) bool isCustomer,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
String? remark,
|
||||
}) = _CreateCompanyRequest;
|
||||
|
||||
factory CreateCompanyRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$CreateCompanyRequestFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class UpdateCompanyRequest with _$UpdateCompanyRequest {
|
||||
const factory UpdateCompanyRequest({
|
||||
String? name,
|
||||
String? address,
|
||||
@JsonKey(name: 'contact_name') String? contactName,
|
||||
@JsonKey(name: 'contact_position') String? contactPosition,
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') bool? isPartner,
|
||||
@JsonKey(name: 'is_customer') bool? isCustomer,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool? isActive,
|
||||
}) = _UpdateCompanyRequest;
|
||||
|
||||
factory UpdateCompanyRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$UpdateCompanyRequestFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class CompanyResponse with _$CompanyResponse {
|
||||
const factory CompanyResponse({
|
||||
required int id,
|
||||
required String name,
|
||||
String? address,
|
||||
@JsonKey(name: 'contact_name') required String contactName,
|
||||
@JsonKey(name: 'contact_position') String? contactPosition, // nullable로 변경
|
||||
@JsonKey(name: 'contact_phone') required String contactPhone,
|
||||
@JsonKey(name: 'contact_email') required String contactEmail,
|
||||
@JsonKey(name: 'company_types') @Default([]) List<String> companyTypes,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') required bool isActive,
|
||||
@JsonKey(name: 'is_partner') @Default(false) bool isPartner,
|
||||
@JsonKey(name: 'is_customer') @Default(false) bool isCustomer,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
@JsonKey(name: 'created_at') required DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt, // nullable로 변경
|
||||
@JsonKey(name: 'address_id') int? addressId,
|
||||
}) = _CompanyResponse;
|
||||
@JsonKey(name: 'is_active') @Default(false) bool isActive,
|
||||
@JsonKey(name: 'is_deleted') @Default(false) bool isDeleted,
|
||||
@JsonKey(name: 'registerd_at') DateTime? registeredAt,
|
||||
@JsonKey(name: 'Updated_at') DateTime? updatedAt,
|
||||
|
||||
// Nested data (optional, populated in GET requests)
|
||||
@JsonKey(name: 'parent_company') CompanyNameDto? parentCompany,
|
||||
@JsonKey(name: 'zipcode') ZipcodeDto? zipcode,
|
||||
}) = _CompanyDto;
|
||||
|
||||
factory CompanyResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$CompanyResponseFromJson(json);
|
||||
factory CompanyDto.fromJson(Map<String, dynamic> json) => _$CompanyDtoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
@@ -78,4 +42,58 @@ class CompanyNameDto with _$CompanyNameDto {
|
||||
|
||||
factory CompanyNameDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$CompanyNameDtoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class CompanyRequestDto with _$CompanyRequestDto {
|
||||
const factory CompanyRequestDto({
|
||||
required String name,
|
||||
@JsonKey(name: 'contact_name') required String contactName,
|
||||
@JsonKey(name: 'contact_phone') required String contactPhone,
|
||||
@JsonKey(name: 'contact_email') required String contactEmail,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
@JsonKey(name: 'zipcodes_zipcode') String? zipcodesZipcode,
|
||||
required String address,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_partner') @Default(false) bool isPartner,
|
||||
@JsonKey(name: 'is_customer') @Default(false) bool isCustomer,
|
||||
@JsonKey(name: 'is_active') @Default(false) bool isActive,
|
||||
}) = _CompanyRequestDto;
|
||||
|
||||
factory CompanyRequestDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$CompanyRequestDtoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class CompanyUpdateRequestDto with _$CompanyUpdateRequestDto {
|
||||
const factory CompanyUpdateRequestDto({
|
||||
String? name,
|
||||
@JsonKey(name: 'contact_name') String? contactName,
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
@JsonKey(name: 'zipcodes_zipcode') String? zipcodesZipcode,
|
||||
String? address,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_partner') bool? isPartner,
|
||||
@JsonKey(name: 'is_customer') bool? isCustomer,
|
||||
@JsonKey(name: 'is_active') bool? isActive,
|
||||
}) = _CompanyUpdateRequestDto;
|
||||
|
||||
factory CompanyUpdateRequestDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$CompanyUpdateRequestDtoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class CompanyListResponse with _$CompanyListResponse {
|
||||
const factory CompanyListResponse({
|
||||
@JsonKey(name: 'data') required List<CompanyDto> items,
|
||||
@JsonKey(name: 'total') required int totalCount,
|
||||
@JsonKey(name: 'page') required int currentPage,
|
||||
@JsonKey(name: 'total_pages') required int totalPages,
|
||||
@JsonKey(name: 'page_size') int? pageSize,
|
||||
}) = _CompanyListResponse;
|
||||
|
||||
factory CompanyListResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$CompanyListResponseFromJson(json);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,122 +6,55 @@ part of 'company_dto.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$CreateCompanyRequestImpl _$$CreateCompanyRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CreateCompanyRequestImpl(
|
||||
_$CompanyDtoImpl _$$CompanyDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$CompanyDtoImpl(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
name: json['name'] as String,
|
||||
contactName: json['contact_name'] as String,
|
||||
contactPhone: json['contact_phone'] as String,
|
||||
contactEmail: json['contact_email'] as String,
|
||||
parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
|
||||
zipcodesZipcode: json['zipcodes_zipcode'] as String?,
|
||||
address: json['address'] as String,
|
||||
contactName: json['contact_name'] as String,
|
||||
contactPosition: json['contact_position'] as String,
|
||||
contactPhone: json['contact_phone'] as String,
|
||||
contactEmail: json['contact_email'] as String,
|
||||
companyTypes: (json['company_types'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
isPartner: json['is_partner'] as bool? ?? false,
|
||||
isCustomer: json['is_customer'] as bool? ?? true,
|
||||
parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
|
||||
remark: json['remark'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CreateCompanyRequestImplToJson(
|
||||
_$CreateCompanyRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'address': instance.address,
|
||||
'contact_name': instance.contactName,
|
||||
'contact_position': instance.contactPosition,
|
||||
'contact_phone': instance.contactPhone,
|
||||
'contact_email': instance.contactEmail,
|
||||
'company_types': instance.companyTypes,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'parent_company_id': instance.parentCompanyId,
|
||||
'remark': instance.remark,
|
||||
};
|
||||
|
||||
_$UpdateCompanyRequestImpl _$$UpdateCompanyRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$UpdateCompanyRequestImpl(
|
||||
name: json['name'] as String?,
|
||||
address: json['address'] as String?,
|
||||
contactName: json['contact_name'] as String?,
|
||||
contactPosition: json['contact_position'] as String?,
|
||||
contactPhone: json['contact_phone'] as String?,
|
||||
contactEmail: json['contact_email'] as String?,
|
||||
companyTypes: (json['company_types'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
isPartner: json['is_partner'] as bool?,
|
||||
isCustomer: json['is_customer'] as bool?,
|
||||
parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
|
||||
remark: json['remark'] as String?,
|
||||
isActive: json['is_active'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$UpdateCompanyRequestImplToJson(
|
||||
_$UpdateCompanyRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'address': instance.address,
|
||||
'contact_name': instance.contactName,
|
||||
'contact_position': instance.contactPosition,
|
||||
'contact_phone': instance.contactPhone,
|
||||
'contact_email': instance.contactEmail,
|
||||
'company_types': instance.companyTypes,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'parent_company_id': instance.parentCompanyId,
|
||||
'remark': instance.remark,
|
||||
'is_active': instance.isActive,
|
||||
};
|
||||
|
||||
_$CompanyResponseImpl _$$CompanyResponseImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CompanyResponseImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
address: json['address'] as String?,
|
||||
contactName: json['contact_name'] as String,
|
||||
contactPosition: json['contact_position'] as String?,
|
||||
contactPhone: json['contact_phone'] as String,
|
||||
contactEmail: json['contact_email'] as String,
|
||||
companyTypes: (json['company_types'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
remark: json['remark'] as String?,
|
||||
isActive: json['is_active'] as bool,
|
||||
isPartner: json['is_partner'] as bool? ?? false,
|
||||
isCustomer: json['is_customer'] as bool? ?? false,
|
||||
parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: json['updated_at'] == null
|
||||
isActive: json['is_active'] as bool? ?? false,
|
||||
isDeleted: json['is_deleted'] as bool? ?? false,
|
||||
registeredAt: json['registerd_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String),
|
||||
addressId: (json['address_id'] as num?)?.toInt(),
|
||||
: DateTime.parse(json['registerd_at'] as String),
|
||||
updatedAt: json['Updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['Updated_at'] as String),
|
||||
parentCompany: json['parent_company'] == null
|
||||
? null
|
||||
: CompanyNameDto.fromJson(
|
||||
json['parent_company'] as Map<String, dynamic>),
|
||||
zipcode: json['zipcode'] == null
|
||||
? null
|
||||
: ZipcodeDto.fromJson(json['zipcode'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CompanyResponseImplToJson(
|
||||
_$CompanyResponseImpl instance) =>
|
||||
Map<String, dynamic> _$$CompanyDtoImplToJson(_$CompanyDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'address': instance.address,
|
||||
'contact_name': instance.contactName,
|
||||
'contact_position': instance.contactPosition,
|
||||
'contact_phone': instance.contactPhone,
|
||||
'contact_email': instance.contactEmail,
|
||||
'company_types': instance.companyTypes,
|
||||
'parent_company_id': instance.parentCompanyId,
|
||||
'zipcodes_zipcode': instance.zipcodesZipcode,
|
||||
'address': instance.address,
|
||||
'remark': instance.remark,
|
||||
'is_active': instance.isActive,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'parent_company_id': instance.parentCompanyId,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
'address_id': instance.addressId,
|
||||
'is_active': instance.isActive,
|
||||
'is_deleted': instance.isDeleted,
|
||||
'registerd_at': instance.registeredAt?.toIso8601String(),
|
||||
'Updated_at': instance.updatedAt?.toIso8601String(),
|
||||
'parent_company': instance.parentCompany,
|
||||
'zipcode': instance.zipcode,
|
||||
};
|
||||
|
||||
_$CompanyNameDtoImpl _$$CompanyNameDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
@@ -136,3 +69,89 @@ Map<String, dynamic> _$$CompanyNameDtoImplToJson(
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_$CompanyRequestDtoImpl _$$CompanyRequestDtoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CompanyRequestDtoImpl(
|
||||
name: json['name'] as String,
|
||||
contactName: json['contact_name'] as String,
|
||||
contactPhone: json['contact_phone'] as String,
|
||||
contactEmail: json['contact_email'] as String,
|
||||
parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
|
||||
zipcodesZipcode: json['zipcodes_zipcode'] as String?,
|
||||
address: json['address'] as String,
|
||||
remark: json['remark'] as String?,
|
||||
isPartner: json['is_partner'] as bool? ?? false,
|
||||
isCustomer: json['is_customer'] as bool? ?? false,
|
||||
isActive: json['is_active'] as bool? ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CompanyRequestDtoImplToJson(
|
||||
_$CompanyRequestDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'contact_name': instance.contactName,
|
||||
'contact_phone': instance.contactPhone,
|
||||
'contact_email': instance.contactEmail,
|
||||
'parent_company_id': instance.parentCompanyId,
|
||||
'zipcodes_zipcode': instance.zipcodesZipcode,
|
||||
'address': instance.address,
|
||||
'remark': instance.remark,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'is_active': instance.isActive,
|
||||
};
|
||||
|
||||
_$CompanyUpdateRequestDtoImpl _$$CompanyUpdateRequestDtoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CompanyUpdateRequestDtoImpl(
|
||||
name: json['name'] as String?,
|
||||
contactName: json['contact_name'] as String?,
|
||||
contactPhone: json['contact_phone'] as String?,
|
||||
contactEmail: json['contact_email'] as String?,
|
||||
parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
|
||||
zipcodesZipcode: json['zipcodes_zipcode'] as String?,
|
||||
address: json['address'] as String?,
|
||||
remark: json['remark'] as String?,
|
||||
isPartner: json['is_partner'] as bool?,
|
||||
isCustomer: json['is_customer'] as bool?,
|
||||
isActive: json['is_active'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CompanyUpdateRequestDtoImplToJson(
|
||||
_$CompanyUpdateRequestDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'contact_name': instance.contactName,
|
||||
'contact_phone': instance.contactPhone,
|
||||
'contact_email': instance.contactEmail,
|
||||
'parent_company_id': instance.parentCompanyId,
|
||||
'zipcodes_zipcode': instance.zipcodesZipcode,
|
||||
'address': instance.address,
|
||||
'remark': instance.remark,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'is_active': instance.isActive,
|
||||
};
|
||||
|
||||
_$CompanyListResponseImpl _$$CompanyListResponseImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CompanyListResponseImpl(
|
||||
items: (json['data'] as List<dynamic>)
|
||||
.map((e) => CompanyDto.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
totalCount: (json['total'] as num).toInt(),
|
||||
currentPage: (json['page'] as num).toInt(),
|
||||
totalPages: (json['total_pages'] as num).toInt(),
|
||||
pageSize: (json['page_size'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CompanyListResponseImplToJson(
|
||||
_$CompanyListResponseImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.items,
|
||||
'total': instance.totalCount,
|
||||
'page': instance.currentPage,
|
||||
'total_pages': instance.totalPages,
|
||||
'page_size': instance.pageSize,
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ class CompanyListDto with _$CompanyListDto {
|
||||
@JsonKey(name: 'is_partner') @Default(false) bool isPartner,
|
||||
@JsonKey(name: 'is_customer') @Default(false) bool isCustomer,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
@JsonKey(name: 'child_count') @Default(0) int childCount,
|
||||
}) = _CompanyListDto;
|
||||
|
||||
@@ -29,8 +29,8 @@ class CompanyListDto with _$CompanyListDto {
|
||||
@freezed
|
||||
class CompanyWithChildren with _$CompanyWithChildren {
|
||||
const factory CompanyWithChildren({
|
||||
required CompanyResponse company,
|
||||
@Default([]) List<CompanyResponse> children,
|
||||
required CompanyDto company,
|
||||
@Default([]) List<CompanyDto> children,
|
||||
}) = _CompanyWithChildren;
|
||||
|
||||
factory CompanyWithChildren.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -39,8 +39,8 @@ mixin _$CompanyListDto {
|
||||
bool get isCustomer => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'parent_company_id')
|
||||
int? get parentCompanyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime? get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'registered_at')
|
||||
DateTime? get registeredAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'child_count')
|
||||
int get childCount => throw _privateConstructorUsedError;
|
||||
|
||||
@@ -72,7 +72,7 @@ abstract class $CompanyListDtoCopyWith<$Res> {
|
||||
@JsonKey(name: 'is_partner') bool isPartner,
|
||||
@JsonKey(name: 'is_customer') bool isCustomer,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
@JsonKey(name: 'child_count') int childCount});
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ class _$CompanyListDtoCopyWithImpl<$Res, $Val extends CompanyListDto>
|
||||
Object? isPartner = null,
|
||||
Object? isCustomer = null,
|
||||
Object? parentCompanyId = freezed,
|
||||
Object? createdAt = freezed,
|
||||
Object? registeredAt = freezed,
|
||||
Object? childCount = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -150,9 +150,9 @@ class _$CompanyListDtoCopyWithImpl<$Res, $Val extends CompanyListDto>
|
||||
? _value.parentCompanyId
|
||||
: parentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
createdAt: freezed == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
registeredAt: freezed == registeredAt
|
||||
? _value.registeredAt
|
||||
: registeredAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
childCount: null == childCount
|
||||
? _value.childCount
|
||||
@@ -182,7 +182,7 @@ abstract class _$$CompanyListDtoImplCopyWith<$Res>
|
||||
@JsonKey(name: 'is_partner') bool isPartner,
|
||||
@JsonKey(name: 'is_customer') bool isCustomer,
|
||||
@JsonKey(name: 'parent_company_id') int? parentCompanyId,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
@JsonKey(name: 'child_count') int childCount});
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ class __$$CompanyListDtoImplCopyWithImpl<$Res>
|
||||
Object? isPartner = null,
|
||||
Object? isCustomer = null,
|
||||
Object? parentCompanyId = freezed,
|
||||
Object? createdAt = freezed,
|
||||
Object? registeredAt = freezed,
|
||||
Object? childCount = null,
|
||||
}) {
|
||||
return _then(_$CompanyListDtoImpl(
|
||||
@@ -258,9 +258,9 @@ class __$$CompanyListDtoImplCopyWithImpl<$Res>
|
||||
? _value.parentCompanyId
|
||||
: parentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
createdAt: freezed == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
registeredAt: freezed == registeredAt
|
||||
? _value.registeredAt
|
||||
: registeredAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
childCount: null == childCount
|
||||
? _value.childCount
|
||||
@@ -285,7 +285,7 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
@JsonKey(name: 'is_partner') this.isPartner = false,
|
||||
@JsonKey(name: 'is_customer') this.isCustomer = false,
|
||||
@JsonKey(name: 'parent_company_id') this.parentCompanyId,
|
||||
@JsonKey(name: 'created_at') this.createdAt,
|
||||
@JsonKey(name: 'registered_at') this.registeredAt,
|
||||
@JsonKey(name: 'child_count') this.childCount = 0})
|
||||
: _companyTypes = companyTypes;
|
||||
|
||||
@@ -331,15 +331,15 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
@JsonKey(name: 'parent_company_id')
|
||||
final int? parentCompanyId;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
final DateTime? createdAt;
|
||||
@JsonKey(name: 'registered_at')
|
||||
final DateTime? registeredAt;
|
||||
@override
|
||||
@JsonKey(name: 'child_count')
|
||||
final int childCount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CompanyListDto(id: $id, name: $name, address: $address, contactName: $contactName, contactPhone: $contactPhone, contactEmail: $contactEmail, companyTypes: $companyTypes, isActive: $isActive, isPartner: $isPartner, isCustomer: $isCustomer, parentCompanyId: $parentCompanyId, createdAt: $createdAt, childCount: $childCount)';
|
||||
return 'CompanyListDto(id: $id, name: $name, address: $address, contactName: $contactName, contactPhone: $contactPhone, contactEmail: $contactEmail, companyTypes: $companyTypes, isActive: $isActive, isPartner: $isPartner, isCustomer: $isCustomer, parentCompanyId: $parentCompanyId, registeredAt: $registeredAt, childCount: $childCount)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -366,8 +366,8 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
other.isCustomer == isCustomer) &&
|
||||
(identical(other.parentCompanyId, parentCompanyId) ||
|
||||
other.parentCompanyId == parentCompanyId) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.registeredAt, registeredAt) ||
|
||||
other.registeredAt == registeredAt) &&
|
||||
(identical(other.childCount, childCount) ||
|
||||
other.childCount == childCount));
|
||||
}
|
||||
@@ -387,7 +387,7 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
isPartner,
|
||||
isCustomer,
|
||||
parentCompanyId,
|
||||
createdAt,
|
||||
registeredAt,
|
||||
childCount);
|
||||
|
||||
/// Create a copy of CompanyListDto
|
||||
@@ -420,7 +420,7 @@ abstract class _CompanyListDto implements CompanyListDto {
|
||||
@JsonKey(name: 'is_partner') final bool isPartner,
|
||||
@JsonKey(name: 'is_customer') final bool isCustomer,
|
||||
@JsonKey(name: 'parent_company_id') final int? parentCompanyId,
|
||||
@JsonKey(name: 'created_at') final DateTime? createdAt,
|
||||
@JsonKey(name: 'registered_at') final DateTime? registeredAt,
|
||||
@JsonKey(name: 'child_count') final int childCount}) =
|
||||
_$CompanyListDtoImpl;
|
||||
|
||||
@@ -458,8 +458,8 @@ abstract class _CompanyListDto implements CompanyListDto {
|
||||
@JsonKey(name: 'parent_company_id')
|
||||
int? get parentCompanyId;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime? get createdAt;
|
||||
@JsonKey(name: 'registered_at')
|
||||
DateTime? get registeredAt;
|
||||
@override
|
||||
@JsonKey(name: 'child_count')
|
||||
int get childCount;
|
||||
@@ -478,8 +478,8 @@ CompanyWithChildren _$CompanyWithChildrenFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CompanyWithChildren {
|
||||
CompanyResponse get company => throw _privateConstructorUsedError;
|
||||
List<CompanyResponse> get children => throw _privateConstructorUsedError;
|
||||
CompanyDto get company => throw _privateConstructorUsedError;
|
||||
List<CompanyDto> get children => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CompanyWithChildren to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -497,9 +497,9 @@ abstract class $CompanyWithChildrenCopyWith<$Res> {
|
||||
CompanyWithChildren value, $Res Function(CompanyWithChildren) then) =
|
||||
_$CompanyWithChildrenCopyWithImpl<$Res, CompanyWithChildren>;
|
||||
@useResult
|
||||
$Res call({CompanyResponse company, List<CompanyResponse> children});
|
||||
$Res call({CompanyDto company, List<CompanyDto> children});
|
||||
|
||||
$CompanyResponseCopyWith<$Res> get company;
|
||||
$CompanyDtoCopyWith<$Res> get company;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -524,11 +524,11 @@ class _$CompanyWithChildrenCopyWithImpl<$Res, $Val extends CompanyWithChildren>
|
||||
company: null == company
|
||||
? _value.company
|
||||
: company // ignore: cast_nullable_to_non_nullable
|
||||
as CompanyResponse,
|
||||
as CompanyDto,
|
||||
children: null == children
|
||||
? _value.children
|
||||
: children // ignore: cast_nullable_to_non_nullable
|
||||
as List<CompanyResponse>,
|
||||
as List<CompanyDto>,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
@@ -536,8 +536,8 @@ class _$CompanyWithChildrenCopyWithImpl<$Res, $Val extends CompanyWithChildren>
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$CompanyResponseCopyWith<$Res> get company {
|
||||
return $CompanyResponseCopyWith<$Res>(_value.company, (value) {
|
||||
$CompanyDtoCopyWith<$Res> get company {
|
||||
return $CompanyDtoCopyWith<$Res>(_value.company, (value) {
|
||||
return _then(_value.copyWith(company: value) as $Val);
|
||||
});
|
||||
}
|
||||
@@ -551,10 +551,10 @@ abstract class _$$CompanyWithChildrenImplCopyWith<$Res>
|
||||
__$$CompanyWithChildrenImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({CompanyResponse company, List<CompanyResponse> children});
|
||||
$Res call({CompanyDto company, List<CompanyDto> children});
|
||||
|
||||
@override
|
||||
$CompanyResponseCopyWith<$Res> get company;
|
||||
$CompanyDtoCopyWith<$Res> get company;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -577,11 +577,11 @@ class __$$CompanyWithChildrenImplCopyWithImpl<$Res>
|
||||
company: null == company
|
||||
? _value.company
|
||||
: company // ignore: cast_nullable_to_non_nullable
|
||||
as CompanyResponse,
|
||||
as CompanyDto,
|
||||
children: null == children
|
||||
? _value._children
|
||||
: children // ignore: cast_nullable_to_non_nullable
|
||||
as List<CompanyResponse>,
|
||||
as List<CompanyDto>,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -590,18 +590,18 @@ class __$$CompanyWithChildrenImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$CompanyWithChildrenImpl implements _CompanyWithChildren {
|
||||
const _$CompanyWithChildrenImpl(
|
||||
{required this.company, final List<CompanyResponse> children = const []})
|
||||
{required this.company, final List<CompanyDto> children = const []})
|
||||
: _children = children;
|
||||
|
||||
factory _$CompanyWithChildrenImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CompanyWithChildrenImplFromJson(json);
|
||||
|
||||
@override
|
||||
final CompanyResponse company;
|
||||
final List<CompanyResponse> _children;
|
||||
final CompanyDto company;
|
||||
final List<CompanyDto> _children;
|
||||
@override
|
||||
@JsonKey()
|
||||
List<CompanyResponse> get children {
|
||||
List<CompanyDto> get children {
|
||||
if (_children is EqualUnmodifiableListView) return _children;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_children);
|
||||
@@ -645,16 +645,16 @@ class _$CompanyWithChildrenImpl implements _CompanyWithChildren {
|
||||
|
||||
abstract class _CompanyWithChildren implements CompanyWithChildren {
|
||||
const factory _CompanyWithChildren(
|
||||
{required final CompanyResponse company,
|
||||
final List<CompanyResponse> children}) = _$CompanyWithChildrenImpl;
|
||||
{required final CompanyDto company,
|
||||
final List<CompanyDto> children}) = _$CompanyWithChildrenImpl;
|
||||
|
||||
factory _CompanyWithChildren.fromJson(Map<String, dynamic> json) =
|
||||
_$CompanyWithChildrenImpl.fromJson;
|
||||
|
||||
@override
|
||||
CompanyResponse get company;
|
||||
CompanyDto get company;
|
||||
@override
|
||||
List<CompanyResponse> get children;
|
||||
List<CompanyDto> get children;
|
||||
|
||||
/// Create a copy of CompanyWithChildren
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
@@ -21,9 +21,9 @@ _$CompanyListDtoImpl _$$CompanyListDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
isPartner: json['is_partner'] as bool? ?? false,
|
||||
isCustomer: json['is_customer'] as bool? ?? false,
|
||||
parentCompanyId: (json['parent_company_id'] as num?)?.toInt(),
|
||||
createdAt: json['created_at'] == null
|
||||
registeredAt: json['registered_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String),
|
||||
: DateTime.parse(json['registered_at'] as String),
|
||||
childCount: (json['child_count'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
|
||||
@@ -41,17 +41,16 @@ Map<String, dynamic> _$$CompanyListDtoImplToJson(
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'parent_company_id': instance.parentCompanyId,
|
||||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
'registered_at': instance.registeredAt?.toIso8601String(),
|
||||
'child_count': instance.childCount,
|
||||
};
|
||||
|
||||
_$CompanyWithChildrenImpl _$$CompanyWithChildrenImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CompanyWithChildrenImpl(
|
||||
company:
|
||||
CompanyResponse.fromJson(json['company'] as Map<String, dynamic>),
|
||||
company: CompanyDto.fromJson(json['company'] as Map<String, dynamic>),
|
||||
children: (json['children'] as List<dynamic>?)
|
||||
?.map((e) => CompanyResponse.fromJson(e as Map<String, dynamic>))
|
||||
?.map((e) => CompanyDto.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user