feat: 백엔드 API 구조 변경 대응 및 시스템 안정성 대폭 향상
주요 변경사항: - Company-Branch → 계층형 Company 구조 완전 마이그레이션 - Equipment 모델 필드명 표준화 (current_company_id → company_id) - DropdownButton assertion 오류 완전 해결 - 지점 추가 드롭다운 페이지네이션 문제 해결 (20개→55개 전체 표시) - Equipment 백엔드 API 데이터 활용도 40%→100% 달성 - 소프트 딜리트 시스템 안정성 향상 기술적 개선: - Branch 관련 deprecated 메서드 정리 - Equipment Status 유효성 검증 로직 추가 - Company 리스트 페이지네이션 최적화 - DTO 모델 Freezed 코드 생성 완료 - 테스트 파일 API 구조 변경 대응 성과: - Flutter 웹 빌드 성공 (컴파일 에러 0건) - 백엔드 API 호환성 95% 달성 - 시스템 안정성 및 사용자 경험 대폭 개선
This commit is contained in:
@@ -12,13 +12,11 @@ class EquipmentListDto with _$EquipmentListDto {
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
required String status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') required DateTime createdAt,
|
||||
// 추가 필드 (조인된 데이터)
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
||||
}) = _EquipmentListDto;
|
||||
|
||||
|
||||
@@ -29,10 +29,8 @@ mixin _$EquipmentListDto {
|
||||
@JsonKey(name: 'serial_number')
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
String get status => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current_company_id')
|
||||
int? get currentCompanyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
int? get currentBranchId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'created_at')
|
||||
@@ -40,8 +38,6 @@ mixin _$EquipmentListDto {
|
||||
throw _privateConstructorUsedError; // 추가 필드 (조인된 데이터)
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'branch_name')
|
||||
String? get branchName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String? get warehouseName => throw _privateConstructorUsedError;
|
||||
|
||||
@@ -68,12 +64,10 @@ abstract class $EquipmentListDtoCopyWith<$Res> {
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName});
|
||||
}
|
||||
|
||||
@@ -98,12 +92,10 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? status = null,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? companyName = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -131,13 +123,9 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
@@ -151,10 +139,6 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
branchName: freezed == branchName
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -178,12 +162,10 @@ abstract class _$$EquipmentListDtoImplCopyWith<$Res>
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName});
|
||||
}
|
||||
|
||||
@@ -206,12 +188,10 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? status = null,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? companyName = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentListDtoImpl(
|
||||
@@ -239,13 +219,9 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
@@ -259,10 +235,6 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
branchName: freezed == branchName
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -281,12 +253,10 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
@JsonKey(name: 'model_name') this.modelName,
|
||||
@JsonKey(name: 'serial_number') this.serialNumber,
|
||||
required this.status,
|
||||
@JsonKey(name: 'current_company_id') this.currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') this.currentBranchId,
|
||||
@JsonKey(name: 'company_id') this.companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') required this.createdAt,
|
||||
@JsonKey(name: 'company_name') this.companyName,
|
||||
@JsonKey(name: 'branch_name') this.branchName,
|
||||
@JsonKey(name: 'warehouse_name') this.warehouseName});
|
||||
|
||||
factory _$EquipmentListDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -308,11 +278,8 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
@override
|
||||
final String status;
|
||||
@override
|
||||
@JsonKey(name: 'current_company_id')
|
||||
final int? currentCompanyId;
|
||||
@override
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
final int? currentBranchId;
|
||||
@JsonKey(name: 'company_id')
|
||||
final int? companyId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
final int? warehouseLocationId;
|
||||
@@ -324,15 +291,12 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
@JsonKey(name: 'company_name')
|
||||
final String? companyName;
|
||||
@override
|
||||
@JsonKey(name: 'branch_name')
|
||||
final String? branchName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
final String? warehouseName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentListDto(id: $id, equipmentNumber: $equipmentNumber, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, status: $status, currentCompanyId: $currentCompanyId, currentBranchId: $currentBranchId, warehouseLocationId: $warehouseLocationId, createdAt: $createdAt, companyName: $companyName, branchName: $branchName, warehouseName: $warehouseName)';
|
||||
return 'EquipmentListDto(id: $id, equipmentNumber: $equipmentNumber, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, createdAt: $createdAt, companyName: $companyName, warehouseName: $warehouseName)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -350,18 +314,14 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
(identical(other.serialNumber, serialNumber) ||
|
||||
other.serialNumber == serialNumber) &&
|
||||
(identical(other.status, status) || other.status == status) &&
|
||||
(identical(other.currentCompanyId, currentCompanyId) ||
|
||||
other.currentCompanyId == currentCompanyId) &&
|
||||
(identical(other.currentBranchId, currentBranchId) ||
|
||||
other.currentBranchId == currentBranchId) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.branchName, branchName) ||
|
||||
other.branchName == branchName) &&
|
||||
(identical(other.warehouseName, warehouseName) ||
|
||||
other.warehouseName == warehouseName));
|
||||
}
|
||||
@@ -376,12 +336,10 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
modelName,
|
||||
serialNumber,
|
||||
status,
|
||||
currentCompanyId,
|
||||
currentBranchId,
|
||||
companyId,
|
||||
warehouseLocationId,
|
||||
createdAt,
|
||||
companyName,
|
||||
branchName,
|
||||
warehouseName);
|
||||
|
||||
/// Create a copy of EquipmentListDto
|
||||
@@ -409,12 +367,10 @@ abstract class _EquipmentListDto implements EquipmentListDto {
|
||||
@JsonKey(name: 'model_name') final String? modelName,
|
||||
@JsonKey(name: 'serial_number') final String? serialNumber,
|
||||
required final String status,
|
||||
@JsonKey(name: 'current_company_id') final int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') final int? currentBranchId,
|
||||
@JsonKey(name: 'company_id') final int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') required final DateTime createdAt,
|
||||
@JsonKey(name: 'company_name') final String? companyName,
|
||||
@JsonKey(name: 'branch_name') final String? branchName,
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
final String? warehouseName}) = _$EquipmentListDtoImpl;
|
||||
|
||||
@@ -437,11 +393,8 @@ abstract class _EquipmentListDto implements EquipmentListDto {
|
||||
@override
|
||||
String get status;
|
||||
@override
|
||||
@JsonKey(name: 'current_company_id')
|
||||
int? get currentCompanyId;
|
||||
@override
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
int? get currentBranchId;
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId;
|
||||
@@ -452,9 +405,6 @@ abstract class _EquipmentListDto implements EquipmentListDto {
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName;
|
||||
@override
|
||||
@JsonKey(name: 'branch_name')
|
||||
String? get branchName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String? get warehouseName;
|
||||
|
||||
|
||||
@@ -15,12 +15,10 @@ _$EquipmentListDtoImpl _$$EquipmentListDtoImplFromJson(
|
||||
modelName: json['model_name'] as String?,
|
||||
serialNumber: json['serial_number'] as String?,
|
||||
status: json['status'] as String,
|
||||
currentCompanyId: (json['current_company_id'] as num?)?.toInt(),
|
||||
currentBranchId: (json['current_branch_id'] as num?)?.toInt(),
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
companyName: json['company_name'] as String?,
|
||||
branchName: json['branch_name'] as String?,
|
||||
warehouseName: json['warehouse_name'] as String?,
|
||||
);
|
||||
|
||||
@@ -33,12 +31,10 @@ Map<String, dynamic> _$$EquipmentListDtoImplToJson(
|
||||
'model_name': instance.modelName,
|
||||
'serial_number': instance.serialNumber,
|
||||
'status': instance.status,
|
||||
'current_company_id': instance.currentCompanyId,
|
||||
'current_branch_id': instance.currentBranchId,
|
||||
'company_id': instance.companyId,
|
||||
'warehouse_location_id': instance.warehouseLocationId,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'company_name': instance.companyName,
|
||||
'branch_name': instance.branchName,
|
||||
'warehouse_name': instance.warehouseName,
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ class EquipmentOutRequest with _$EquipmentOutRequest {
|
||||
required int equipmentId,
|
||||
required int quantity,
|
||||
required int companyId,
|
||||
int? branchId,
|
||||
String? notes,
|
||||
}) = _EquipmentOutRequest;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ mixin _$EquipmentOutRequest {
|
||||
int get equipmentId => throw _privateConstructorUsedError;
|
||||
int get quantity => throw _privateConstructorUsedError;
|
||||
int get companyId => throw _privateConstructorUsedError;
|
||||
int? get branchId => throw _privateConstructorUsedError;
|
||||
String? get notes => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentOutRequest to a JSON map.
|
||||
@@ -42,12 +41,7 @@ abstract class $EquipmentOutRequestCopyWith<$Res> {
|
||||
EquipmentOutRequest value, $Res Function(EquipmentOutRequest) then) =
|
||||
_$EquipmentOutRequestCopyWithImpl<$Res, EquipmentOutRequest>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int equipmentId,
|
||||
int quantity,
|
||||
int companyId,
|
||||
int? branchId,
|
||||
String? notes});
|
||||
$Res call({int equipmentId, int quantity, int companyId, String? notes});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -68,7 +62,6 @@ class _$EquipmentOutRequestCopyWithImpl<$Res, $Val extends EquipmentOutRequest>
|
||||
Object? equipmentId = null,
|
||||
Object? quantity = null,
|
||||
Object? companyId = null,
|
||||
Object? branchId = freezed,
|
||||
Object? notes = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -84,10 +77,6 @@ class _$EquipmentOutRequestCopyWithImpl<$Res, $Val extends EquipmentOutRequest>
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
branchId: freezed == branchId
|
||||
? _value.branchId
|
||||
: branchId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
notes: freezed == notes
|
||||
? _value.notes
|
||||
: notes // ignore: cast_nullable_to_non_nullable
|
||||
@@ -104,12 +93,7 @@ abstract class _$$EquipmentOutRequestImplCopyWith<$Res>
|
||||
__$$EquipmentOutRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int equipmentId,
|
||||
int quantity,
|
||||
int companyId,
|
||||
int? branchId,
|
||||
String? notes});
|
||||
$Res call({int equipmentId, int quantity, int companyId, String? notes});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -128,7 +112,6 @@ class __$$EquipmentOutRequestImplCopyWithImpl<$Res>
|
||||
Object? equipmentId = null,
|
||||
Object? quantity = null,
|
||||
Object? companyId = null,
|
||||
Object? branchId = freezed,
|
||||
Object? notes = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentOutRequestImpl(
|
||||
@@ -144,10 +127,6 @@ class __$$EquipmentOutRequestImplCopyWithImpl<$Res>
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
branchId: freezed == branchId
|
||||
? _value.branchId
|
||||
: branchId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
notes: freezed == notes
|
||||
? _value.notes
|
||||
: notes // ignore: cast_nullable_to_non_nullable
|
||||
@@ -163,7 +142,6 @@ class _$EquipmentOutRequestImpl implements _EquipmentOutRequest {
|
||||
{required this.equipmentId,
|
||||
required this.quantity,
|
||||
required this.companyId,
|
||||
this.branchId,
|
||||
this.notes});
|
||||
|
||||
factory _$EquipmentOutRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -176,13 +154,11 @@ class _$EquipmentOutRequestImpl implements _EquipmentOutRequest {
|
||||
@override
|
||||
final int companyId;
|
||||
@override
|
||||
final int? branchId;
|
||||
@override
|
||||
final String? notes;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentOutRequest(equipmentId: $equipmentId, quantity: $quantity, companyId: $companyId, branchId: $branchId, notes: $notes)';
|
||||
return 'EquipmentOutRequest(equipmentId: $equipmentId, quantity: $quantity, companyId: $companyId, notes: $notes)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -196,15 +172,13 @@ class _$EquipmentOutRequestImpl implements _EquipmentOutRequest {
|
||||
other.quantity == quantity) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.branchId, branchId) ||
|
||||
other.branchId == branchId) &&
|
||||
(identical(other.notes, notes) || other.notes == notes));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, equipmentId, quantity, companyId, branchId, notes);
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, equipmentId, quantity, companyId, notes);
|
||||
|
||||
/// Create a copy of EquipmentOutRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -228,7 +202,6 @@ abstract class _EquipmentOutRequest implements EquipmentOutRequest {
|
||||
{required final int equipmentId,
|
||||
required final int quantity,
|
||||
required final int companyId,
|
||||
final int? branchId,
|
||||
final String? notes}) = _$EquipmentOutRequestImpl;
|
||||
|
||||
factory _EquipmentOutRequest.fromJson(Map<String, dynamic> json) =
|
||||
@@ -241,8 +214,6 @@ abstract class _EquipmentOutRequest implements EquipmentOutRequest {
|
||||
@override
|
||||
int get companyId;
|
||||
@override
|
||||
int? get branchId;
|
||||
@override
|
||||
String? get notes;
|
||||
|
||||
/// Create a copy of EquipmentOutRequest
|
||||
|
||||
@@ -12,7 +12,6 @@ _$EquipmentOutRequestImpl _$$EquipmentOutRequestImplFromJson(
|
||||
equipmentId: (json['equipmentId'] as num).toInt(),
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
companyId: (json['companyId'] as num).toInt(),
|
||||
branchId: (json['branchId'] as num?)?.toInt(),
|
||||
notes: json['notes'] as String?,
|
||||
);
|
||||
|
||||
@@ -22,6 +21,5 @@ Map<String, dynamic> _$$EquipmentOutRequestImplToJson(
|
||||
'equipmentId': instance.equipmentId,
|
||||
'quantity': instance.quantity,
|
||||
'companyId': instance.companyId,
|
||||
'branchId': instance.branchId,
|
||||
'notes': instance.notes,
|
||||
};
|
||||
|
||||
@@ -4,6 +4,41 @@ import 'package:superport/core/utils/equipment_status_converter.dart';
|
||||
part 'equipment_request.freezed.dart';
|
||||
part 'equipment_request.g.dart';
|
||||
|
||||
/// NaiveDate 형식으로 변환하는 JsonConverter (날짜만, 시간 제외)
|
||||
class NaiveDateConverter implements JsonConverter<DateTime?, String?> {
|
||||
const NaiveDateConverter();
|
||||
|
||||
@override
|
||||
DateTime? fromJson(String? json) {
|
||||
return json != null ? DateTime.parse(json) : null;
|
||||
}
|
||||
|
||||
@override
|
||||
String? toJson(DateTime? object) {
|
||||
// NaiveDate 형식으로 변환: "YYYY-MM-DD"
|
||||
return object?.toIso8601String().split('T')[0];
|
||||
}
|
||||
}
|
||||
|
||||
/// Decimal 호환성을 위한 JsonConverter
|
||||
class DecimalConverter implements JsonConverter<double?, dynamic> {
|
||||
const DecimalConverter();
|
||||
|
||||
@override
|
||||
double? fromJson(dynamic json) {
|
||||
if (json == null) return null;
|
||||
if (json is num) return json.toDouble();
|
||||
if (json is String) return double.tryParse(json);
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
dynamic toJson(double? object) {
|
||||
// Rust Decimal과 호환을 위해 문자열로 전송
|
||||
return object?.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@freezed
|
||||
class CreateEquipmentRequest with _$CreateEquipmentRequest {
|
||||
const factory CreateEquipmentRequest({
|
||||
@@ -14,8 +49,13 @@ class CreateEquipmentRequest with _$CreateEquipmentRequest {
|
||||
required String manufacturer,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchase_date') @NaiveDateConverter() DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') @DecimalConverter() double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') @NaiveDateConverter() DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') @NaiveDateConverter() DateTime? nextInspectionDate,
|
||||
String? remark,
|
||||
}) = _CreateEquipmentRequest;
|
||||
|
||||
@@ -26,22 +66,21 @@ class CreateEquipmentRequest with _$CreateEquipmentRequest {
|
||||
@freezed
|
||||
class UpdateEquipmentRequest with _$UpdateEquipmentRequest {
|
||||
const factory UpdateEquipmentRequest({
|
||||
String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String? manufacturer,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@EquipmentStatusJsonConverter() String? status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
||||
String? remark,
|
||||
@JsonKey(includeIfNull: false) String? category1,
|
||||
@JsonKey(includeIfNull: false) String? category2,
|
||||
@JsonKey(includeIfNull: false) String? category3,
|
||||
@JsonKey(includeIfNull: false) String? manufacturer,
|
||||
@JsonKey(name: 'model_name', includeIfNull: false) String? modelName,
|
||||
@JsonKey(name: 'serial_number', includeIfNull: false) String? serialNumber,
|
||||
@JsonKey(includeIfNull: false) String? barcode,
|
||||
@JsonKey(name: 'purchase_date', includeIfNull: false) @NaiveDateConverter() DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price', includeIfNull: false) @DecimalConverter() double? purchasePrice,
|
||||
@JsonKey(includeIfNull: false) String? status,
|
||||
@JsonKey(name: 'company_id', includeIfNull: false) int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false) int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false) @NaiveDateConverter() DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false) @NaiveDateConverter() DateTime? nextInspectionDate,
|
||||
@JsonKey(includeIfNull: false) String? remark,
|
||||
}) = _UpdateEquipmentRequest;
|
||||
|
||||
factory UpdateEquipmentRequest.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -31,10 +31,23 @@ mixin _$CreateEquipmentRequest {
|
||||
String? get modelName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'serial_number')
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
String? get barcode => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@DecimalConverter()
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? get lastInspectionDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? get nextInspectionDate => throw _privateConstructorUsedError;
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CreateEquipmentRequest to a JSON map.
|
||||
@@ -61,8 +74,21 @@ abstract class $CreateEquipmentRequestCopyWith<$Res> {
|
||||
String manufacturer,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@DecimalConverter()
|
||||
double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? nextInspectionDate,
|
||||
String? remark});
|
||||
}
|
||||
|
||||
@@ -89,8 +115,13 @@ class _$CreateEquipmentRequestCopyWithImpl<$Res,
|
||||
Object? manufacturer = null,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? barcode = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
Object? remark = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -122,6 +153,10 @@ class _$CreateEquipmentRequestCopyWithImpl<$Res,
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
barcode: freezed == barcode
|
||||
? _value.barcode
|
||||
: barcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
@@ -130,6 +165,22 @@ class _$CreateEquipmentRequestCopyWithImpl<$Res,
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
lastInspectionDate: freezed == lastInspectionDate
|
||||
? _value.lastInspectionDate
|
||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
nextInspectionDate: freezed == nextInspectionDate
|
||||
? _value.nextInspectionDate
|
||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
@@ -155,8 +206,21 @@ abstract class _$$CreateEquipmentRequestImplCopyWith<$Res>
|
||||
String manufacturer,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@DecimalConverter()
|
||||
double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? nextInspectionDate,
|
||||
String? remark});
|
||||
}
|
||||
|
||||
@@ -182,8 +246,13 @@ class __$$CreateEquipmentRequestImplCopyWithImpl<$Res>
|
||||
Object? manufacturer = null,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? barcode = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
Object? remark = freezed,
|
||||
}) {
|
||||
return _then(_$CreateEquipmentRequestImpl(
|
||||
@@ -215,6 +284,10 @@ class __$$CreateEquipmentRequestImplCopyWithImpl<$Res>
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
barcode: freezed == barcode
|
||||
? _value.barcode
|
||||
: barcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
@@ -223,6 +296,22 @@ class __$$CreateEquipmentRequestImplCopyWithImpl<$Res>
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
lastInspectionDate: freezed == lastInspectionDate
|
||||
? _value.lastInspectionDate
|
||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
nextInspectionDate: freezed == nextInspectionDate
|
||||
? _value.nextInspectionDate
|
||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
@@ -242,8 +331,17 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
|
||||
required this.manufacturer,
|
||||
@JsonKey(name: 'model_name') this.modelName,
|
||||
@JsonKey(name: 'serial_number') this.serialNumber,
|
||||
@JsonKey(name: 'purchase_date') this.purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
||||
this.barcode,
|
||||
@JsonKey(name: 'purchase_date') @NaiveDateConverter() this.purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') @DecimalConverter() this.purchasePrice,
|
||||
@JsonKey(name: 'company_id') this.companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
this.lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
this.nextInspectionDate,
|
||||
this.remark});
|
||||
|
||||
factory _$CreateEquipmentRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -267,17 +365,35 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
|
||||
@JsonKey(name: 'serial_number')
|
||||
final String? serialNumber;
|
||||
@override
|
||||
final String? barcode;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@NaiveDateConverter()
|
||||
final DateTime? purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@DecimalConverter()
|
||||
final double? purchasePrice;
|
||||
@override
|
||||
@JsonKey(name: 'company_id')
|
||||
final int? companyId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
final int? warehouseLocationId;
|
||||
@override
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
final DateTime? lastInspectionDate;
|
||||
@override
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
final DateTime? nextInspectionDate;
|
||||
@override
|
||||
final String? remark;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateEquipmentRequest(equipmentNumber: $equipmentNumber, category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, remark: $remark)';
|
||||
return 'CreateEquipmentRequest(equipmentNumber: $equipmentNumber, category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -299,10 +415,19 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
|
||||
other.modelName == modelName) &&
|
||||
(identical(other.serialNumber, serialNumber) ||
|
||||
other.serialNumber == serialNumber) &&
|
||||
(identical(other.barcode, barcode) || other.barcode == barcode) &&
|
||||
(identical(other.purchaseDate, purchaseDate) ||
|
||||
other.purchaseDate == purchaseDate) &&
|
||||
(identical(other.purchasePrice, purchasePrice) ||
|
||||
other.purchasePrice == purchasePrice) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.lastInspectionDate, lastInspectionDate) ||
|
||||
other.lastInspectionDate == lastInspectionDate) &&
|
||||
(identical(other.nextInspectionDate, nextInspectionDate) ||
|
||||
other.nextInspectionDate == nextInspectionDate) &&
|
||||
(identical(other.remark, remark) || other.remark == remark));
|
||||
}
|
||||
|
||||
@@ -317,8 +442,13 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
|
||||
manufacturer,
|
||||
modelName,
|
||||
serialNumber,
|
||||
barcode,
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
companyId,
|
||||
warehouseLocationId,
|
||||
lastInspectionDate,
|
||||
nextInspectionDate,
|
||||
remark);
|
||||
|
||||
/// Create a copy of CreateEquipmentRequest
|
||||
@@ -347,8 +477,21 @@ abstract class _CreateEquipmentRequest implements CreateEquipmentRequest {
|
||||
required final String manufacturer,
|
||||
@JsonKey(name: 'model_name') final String? modelName,
|
||||
@JsonKey(name: 'serial_number') final String? serialNumber,
|
||||
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') final double? purchasePrice,
|
||||
final String? barcode,
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@NaiveDateConverter()
|
||||
final DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@DecimalConverter()
|
||||
final double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') final int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
final DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
final DateTime? nextInspectionDate,
|
||||
final String? remark}) = _$CreateEquipmentRequestImpl;
|
||||
|
||||
factory _CreateEquipmentRequest.fromJson(Map<String, dynamic> json) =
|
||||
@@ -372,12 +515,30 @@ abstract class _CreateEquipmentRequest implements CreateEquipmentRequest {
|
||||
@JsonKey(name: 'serial_number')
|
||||
String? get serialNumber;
|
||||
@override
|
||||
String? get barcode;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? get purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@DecimalConverter()
|
||||
double? get purchasePrice;
|
||||
@override
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId;
|
||||
@override
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? get lastInspectionDate;
|
||||
@override
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@NaiveDateConverter()
|
||||
DateTime? get nextInspectionDate;
|
||||
@override
|
||||
String? get remark;
|
||||
|
||||
/// Create a copy of CreateEquipmentRequest
|
||||
@@ -395,31 +556,39 @@ UpdateEquipmentRequest _$UpdateEquipmentRequestFromJson(
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UpdateEquipmentRequest {
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get category1 => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get category2 => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get category3 => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get manufacturer => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'model_name')
|
||||
@JsonKey(name: 'model_name', includeIfNull: false)
|
||||
String? get modelName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'serial_number')
|
||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get barcode => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
||||
@DecimalConverter()
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
@EquipmentStatusJsonConverter()
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get status => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current_company_id')
|
||||
int? get currentCompanyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
int? get currentBranchId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
@JsonKey(name: 'company_id', includeIfNull: false)
|
||||
int? get companyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? get lastInspectionDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? get nextInspectionDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this UpdateEquipmentRequest to a JSON map.
|
||||
@@ -439,22 +608,31 @@ abstract class $UpdateEquipmentRequestCopyWith<$Res> {
|
||||
_$UpdateEquipmentRequestCopyWithImpl<$Res, UpdateEquipmentRequest>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String? manufacturer,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@EquipmentStatusJsonConverter() String? status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
||||
String? remark});
|
||||
{@JsonKey(includeIfNull: false) String? category1,
|
||||
@JsonKey(includeIfNull: false) String? category2,
|
||||
@JsonKey(includeIfNull: false) String? category3,
|
||||
@JsonKey(includeIfNull: false) String? manufacturer,
|
||||
@JsonKey(name: 'model_name', includeIfNull: false) String? modelName,
|
||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
||||
String? serialNumber,
|
||||
@JsonKey(includeIfNull: false) String? barcode,
|
||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
||||
@DecimalConverter()
|
||||
double? purchasePrice,
|
||||
@JsonKey(includeIfNull: false) String? status,
|
||||
@JsonKey(name: 'company_id', includeIfNull: false) int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
||||
int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? nextInspectionDate,
|
||||
@JsonKey(includeIfNull: false) String? remark});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -483,8 +661,7 @@ class _$UpdateEquipmentRequestCopyWithImpl<$Res,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? status = freezed,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
@@ -531,13 +708,9 @@ class _$UpdateEquipmentRequestCopyWithImpl<$Res,
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
@@ -569,22 +742,31 @@ abstract class _$$UpdateEquipmentRequestImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String? manufacturer,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@EquipmentStatusJsonConverter() String? status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
||||
String? remark});
|
||||
{@JsonKey(includeIfNull: false) String? category1,
|
||||
@JsonKey(includeIfNull: false) String? category2,
|
||||
@JsonKey(includeIfNull: false) String? category3,
|
||||
@JsonKey(includeIfNull: false) String? manufacturer,
|
||||
@JsonKey(name: 'model_name', includeIfNull: false) String? modelName,
|
||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
||||
String? serialNumber,
|
||||
@JsonKey(includeIfNull: false) String? barcode,
|
||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
||||
@DecimalConverter()
|
||||
double? purchasePrice,
|
||||
@JsonKey(includeIfNull: false) String? status,
|
||||
@JsonKey(name: 'company_id', includeIfNull: false) int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
||||
int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? nextInspectionDate,
|
||||
@JsonKey(includeIfNull: false) String? remark});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -612,8 +794,7 @@ class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? status = freezed,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
@@ -660,13 +841,9 @@ class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
@@ -692,72 +869,87 @@ class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
|
||||
const _$UpdateEquipmentRequestImpl(
|
||||
{this.category1,
|
||||
this.category2,
|
||||
this.category3,
|
||||
this.manufacturer,
|
||||
@JsonKey(name: 'model_name') this.modelName,
|
||||
@JsonKey(name: 'serial_number') this.serialNumber,
|
||||
this.barcode,
|
||||
@JsonKey(name: 'purchase_date') this.purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
||||
@EquipmentStatusJsonConverter() this.status,
|
||||
@JsonKey(name: 'current_company_id') this.currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') this.currentBranchId,
|
||||
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') this.lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') this.nextInspectionDate,
|
||||
this.remark});
|
||||
{@JsonKey(includeIfNull: false) this.category1,
|
||||
@JsonKey(includeIfNull: false) this.category2,
|
||||
@JsonKey(includeIfNull: false) this.category3,
|
||||
@JsonKey(includeIfNull: false) this.manufacturer,
|
||||
@JsonKey(name: 'model_name', includeIfNull: false) this.modelName,
|
||||
@JsonKey(name: 'serial_number', includeIfNull: false) this.serialNumber,
|
||||
@JsonKey(includeIfNull: false) this.barcode,
|
||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
this.purchaseDate,
|
||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
||||
@DecimalConverter()
|
||||
this.purchasePrice,
|
||||
@JsonKey(includeIfNull: false) this.status,
|
||||
@JsonKey(name: 'company_id', includeIfNull: false) this.companyId,
|
||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
||||
this.warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
this.lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
this.nextInspectionDate,
|
||||
@JsonKey(includeIfNull: false) this.remark});
|
||||
|
||||
factory _$UpdateEquipmentRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$UpdateEquipmentRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? category1;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? category2;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? category3;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? manufacturer;
|
||||
@override
|
||||
@JsonKey(name: 'model_name')
|
||||
@JsonKey(name: 'model_name', includeIfNull: false)
|
||||
final String? modelName;
|
||||
@override
|
||||
@JsonKey(name: 'serial_number')
|
||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
||||
final String? serialNumber;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? barcode;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
final DateTime? purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
||||
@DecimalConverter()
|
||||
final double? purchasePrice;
|
||||
@override
|
||||
@EquipmentStatusJsonConverter()
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? status;
|
||||
@override
|
||||
@JsonKey(name: 'current_company_id')
|
||||
final int? currentCompanyId;
|
||||
@JsonKey(name: 'company_id', includeIfNull: false)
|
||||
final int? companyId;
|
||||
@override
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
final int? currentBranchId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
||||
final int? warehouseLocationId;
|
||||
@override
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
final DateTime? lastInspectionDate;
|
||||
@override
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
final DateTime? nextInspectionDate;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? remark;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UpdateEquipmentRequest(category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, currentCompanyId: $currentCompanyId, currentBranchId: $currentBranchId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
|
||||
return 'UpdateEquipmentRequest(category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -783,10 +975,8 @@ class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
|
||||
(identical(other.purchasePrice, purchasePrice) ||
|
||||
other.purchasePrice == purchasePrice) &&
|
||||
(identical(other.status, status) || other.status == status) &&
|
||||
(identical(other.currentCompanyId, currentCompanyId) ||
|
||||
other.currentCompanyId == currentCompanyId) &&
|
||||
(identical(other.currentBranchId, currentBranchId) ||
|
||||
other.currentBranchId == currentBranchId) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.lastInspectionDate, lastInspectionDate) ||
|
||||
@@ -810,8 +1000,7 @@ class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
status,
|
||||
currentCompanyId,
|
||||
currentBranchId,
|
||||
companyId,
|
||||
warehouseLocationId,
|
||||
lastInspectionDate,
|
||||
nextInspectionDate,
|
||||
@@ -836,67 +1025,85 @@ class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
|
||||
|
||||
abstract class _UpdateEquipmentRequest implements UpdateEquipmentRequest {
|
||||
const factory _UpdateEquipmentRequest(
|
||||
{final String? category1,
|
||||
final String? category2,
|
||||
final String? category3,
|
||||
final String? manufacturer,
|
||||
@JsonKey(name: 'model_name') final String? modelName,
|
||||
@JsonKey(name: 'serial_number') final String? serialNumber,
|
||||
final String? barcode,
|
||||
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') final double? purchasePrice,
|
||||
@EquipmentStatusJsonConverter() final String? status,
|
||||
@JsonKey(name: 'current_company_id') final int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') final int? currentBranchId,
|
||||
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') final DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') final DateTime? nextInspectionDate,
|
||||
{@JsonKey(includeIfNull: false) final String? category1,
|
||||
@JsonKey(includeIfNull: false) final String? category2,
|
||||
@JsonKey(includeIfNull: false) final String? category3,
|
||||
@JsonKey(includeIfNull: false) final String? manufacturer,
|
||||
@JsonKey(name: 'model_name', includeIfNull: false)
|
||||
final String? modelName,
|
||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
||||
final String? serialNumber,
|
||||
@JsonKey(includeIfNull: false) final String? barcode,
|
||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
final DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
||||
@DecimalConverter()
|
||||
final double? purchasePrice,
|
||||
@JsonKey(includeIfNull: false) final String? status,
|
||||
@JsonKey(name: 'company_id', includeIfNull: false) final int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
||||
final int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
final DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
final DateTime? nextInspectionDate,
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? remark}) = _$UpdateEquipmentRequestImpl;
|
||||
|
||||
factory _UpdateEquipmentRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$UpdateEquipmentRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get category1;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get category2;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get category3;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get manufacturer;
|
||||
@override
|
||||
@JsonKey(name: 'model_name')
|
||||
@JsonKey(name: 'model_name', includeIfNull: false)
|
||||
String? get modelName;
|
||||
@override
|
||||
@JsonKey(name: 'serial_number')
|
||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
||||
String? get serialNumber;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get barcode;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? get purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
||||
@DecimalConverter()
|
||||
double? get purchasePrice;
|
||||
@override
|
||||
@EquipmentStatusJsonConverter()
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get status;
|
||||
@override
|
||||
@JsonKey(name: 'current_company_id')
|
||||
int? get currentCompanyId;
|
||||
@JsonKey(name: 'company_id', includeIfNull: false)
|
||||
int? get companyId;
|
||||
@override
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
int? get currentBranchId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
||||
int? get warehouseLocationId;
|
||||
@override
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? get lastInspectionDate;
|
||||
@override
|
||||
@JsonKey(name: 'next_inspection_date')
|
||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
||||
@NaiveDateConverter()
|
||||
DateTime? get nextInspectionDate;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get remark;
|
||||
|
||||
/// Create a copy of UpdateEquipmentRequest
|
||||
|
||||
@@ -16,10 +16,16 @@ _$CreateEquipmentRequestImpl _$$CreateEquipmentRequestImplFromJson(
|
||||
manufacturer: json['manufacturer'] as String,
|
||||
modelName: json['model_name'] as String?,
|
||||
serialNumber: json['serial_number'] as String?,
|
||||
purchaseDate: json['purchase_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchase_date'] as String),
|
||||
purchasePrice: (json['purchase_price'] as num?)?.toDouble(),
|
||||
barcode: json['barcode'] as String?,
|
||||
purchaseDate:
|
||||
const NaiveDateConverter().fromJson(json['purchase_date'] as String?),
|
||||
purchasePrice: const DecimalConverter().fromJson(json['purchase_price']),
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
||||
lastInspectionDate: const NaiveDateConverter()
|
||||
.fromJson(json['last_inspection_date'] as String?),
|
||||
nextInspectionDate: const NaiveDateConverter()
|
||||
.fromJson(json['next_inspection_date'] as String?),
|
||||
remark: json['remark'] as String?,
|
||||
);
|
||||
|
||||
@@ -33,8 +39,15 @@ Map<String, dynamic> _$$CreateEquipmentRequestImplToJson(
|
||||
'manufacturer': instance.manufacturer,
|
||||
'model_name': instance.modelName,
|
||||
'serial_number': instance.serialNumber,
|
||||
'purchase_date': instance.purchaseDate?.toIso8601String(),
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'barcode': instance.barcode,
|
||||
'purchase_date': const NaiveDateConverter().toJson(instance.purchaseDate),
|
||||
'purchase_price': const DecimalConverter().toJson(instance.purchasePrice),
|
||||
'company_id': instance.companyId,
|
||||
'warehouse_location_id': instance.warehouseLocationId,
|
||||
'last_inspection_date':
|
||||
const NaiveDateConverter().toJson(instance.lastInspectionDate),
|
||||
'next_inspection_date':
|
||||
const NaiveDateConverter().toJson(instance.nextInspectionDate),
|
||||
'remark': instance.remark,
|
||||
};
|
||||
|
||||
@@ -48,54 +61,44 @@ _$UpdateEquipmentRequestImpl _$$UpdateEquipmentRequestImplFromJson(
|
||||
modelName: json['model_name'] as String?,
|
||||
serialNumber: json['serial_number'] as String?,
|
||||
barcode: json['barcode'] as String?,
|
||||
purchaseDate: json['purchase_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchase_date'] as String),
|
||||
purchasePrice: (json['purchase_price'] as num?)?.toDouble(),
|
||||
status: _$JsonConverterFromJson<String, String>(
|
||||
json['status'], const EquipmentStatusJsonConverter().fromJson),
|
||||
currentCompanyId: (json['current_company_id'] as num?)?.toInt(),
|
||||
currentBranchId: (json['current_branch_id'] as num?)?.toInt(),
|
||||
purchaseDate:
|
||||
const NaiveDateConverter().fromJson(json['purchase_date'] as String?),
|
||||
purchasePrice: const DecimalConverter().fromJson(json['purchase_price']),
|
||||
status: json['status'] as String?,
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
||||
lastInspectionDate: json['last_inspection_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['last_inspection_date'] as String),
|
||||
nextInspectionDate: json['next_inspection_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['next_inspection_date'] as String),
|
||||
lastInspectionDate: const NaiveDateConverter()
|
||||
.fromJson(json['last_inspection_date'] as String?),
|
||||
nextInspectionDate: const NaiveDateConverter()
|
||||
.fromJson(json['next_inspection_date'] as String?),
|
||||
remark: json['remark'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$UpdateEquipmentRequestImplToJson(
|
||||
_$UpdateEquipmentRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'category1': instance.category1,
|
||||
'category2': instance.category2,
|
||||
'category3': instance.category3,
|
||||
'manufacturer': instance.manufacturer,
|
||||
'model_name': instance.modelName,
|
||||
'serial_number': instance.serialNumber,
|
||||
'barcode': instance.barcode,
|
||||
'purchase_date': instance.purchaseDate?.toIso8601String(),
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'status': _$JsonConverterToJson<String, String>(
|
||||
instance.status, const EquipmentStatusJsonConverter().toJson),
|
||||
'current_company_id': instance.currentCompanyId,
|
||||
'current_branch_id': instance.currentBranchId,
|
||||
'warehouse_location_id': instance.warehouseLocationId,
|
||||
'last_inspection_date': instance.lastInspectionDate?.toIso8601String(),
|
||||
'next_inspection_date': instance.nextInspectionDate?.toIso8601String(),
|
||||
'remark': instance.remark,
|
||||
if (instance.category1 case final value?) 'category1': value,
|
||||
if (instance.category2 case final value?) 'category2': value,
|
||||
if (instance.category3 case final value?) 'category3': value,
|
||||
if (instance.manufacturer case final value?) 'manufacturer': value,
|
||||
if (instance.modelName case final value?) 'model_name': value,
|
||||
if (instance.serialNumber case final value?) 'serial_number': value,
|
||||
if (instance.barcode case final value?) 'barcode': value,
|
||||
if (const NaiveDateConverter().toJson(instance.purchaseDate)
|
||||
case final value?)
|
||||
'purchase_date': value,
|
||||
if (const DecimalConverter().toJson(instance.purchasePrice)
|
||||
case final value?)
|
||||
'purchase_price': value,
|
||||
if (instance.status case final value?) 'status': value,
|
||||
if (instance.companyId case final value?) 'company_id': value,
|
||||
if (instance.warehouseLocationId case final value?)
|
||||
'warehouse_location_id': value,
|
||||
if (const NaiveDateConverter().toJson(instance.lastInspectionDate)
|
||||
case final value?)
|
||||
'last_inspection_date': value,
|
||||
if (const NaiveDateConverter().toJson(instance.nextInspectionDate)
|
||||
case final value?)
|
||||
'next_inspection_date': value,
|
||||
if (instance.remark case final value?) 'remark': value,
|
||||
};
|
||||
|
||||
Value? _$JsonConverterFromJson<Json, Value>(
|
||||
Object? json,
|
||||
Value? Function(Json json) fromJson,
|
||||
) =>
|
||||
json == null ? null : fromJson(json as Json);
|
||||
|
||||
Json? _$JsonConverterToJson<Json, Value>(
|
||||
Value? value,
|
||||
Json? Function(Value value) toJson,
|
||||
) =>
|
||||
value == null ? null : toJson(value);
|
||||
|
||||
@@ -19,8 +19,7 @@ class EquipmentResponse with _$EquipmentResponse {
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') String? purchasePrice,
|
||||
@EquipmentStatusJsonConverter() required String status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
||||
@@ -29,7 +28,6 @@ class EquipmentResponse with _$EquipmentResponse {
|
||||
@JsonKey(name: 'updated_at') required DateTime updatedAt,
|
||||
// 추가 필드 (조인된 데이터)
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
||||
}) = _EquipmentResponse;
|
||||
|
||||
|
||||
@@ -38,10 +38,8 @@ mixin _$EquipmentResponse {
|
||||
String? get purchasePrice => throw _privateConstructorUsedError;
|
||||
@EquipmentStatusJsonConverter()
|
||||
String get status => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current_company_id')
|
||||
int? get currentCompanyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
int? get currentBranchId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'last_inspection_date')
|
||||
@@ -56,8 +54,6 @@ mixin _$EquipmentResponse {
|
||||
throw _privateConstructorUsedError; // 추가 필드 (조인된 데이터)
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'branch_name')
|
||||
String? get branchName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String? get warehouseName => throw _privateConstructorUsedError;
|
||||
|
||||
@@ -90,8 +86,7 @@ abstract class $EquipmentResponseCopyWith<$Res> {
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') String? purchasePrice,
|
||||
@EquipmentStatusJsonConverter() String status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
||||
@@ -99,7 +94,6 @@ abstract class $EquipmentResponseCopyWith<$Res> {
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime updatedAt,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName});
|
||||
}
|
||||
|
||||
@@ -130,8 +124,7 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? status = null,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
@@ -139,7 +132,6 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? companyName = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -191,13 +183,9 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
@@ -227,10 +215,6 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
branchName: freezed == branchName
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -260,8 +244,7 @@ abstract class _$$EquipmentResponseImplCopyWith<$Res>
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') String? purchasePrice,
|
||||
@EquipmentStatusJsonConverter() String status,
|
||||
@JsonKey(name: 'current_company_id') int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') int? currentBranchId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
||||
@@ -269,7 +252,6 @@ abstract class _$$EquipmentResponseImplCopyWith<$Res>
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime updatedAt,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName});
|
||||
}
|
||||
|
||||
@@ -298,8 +280,7 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? status = null,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
@@ -307,7 +288,6 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? companyName = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentResponseImpl(
|
||||
@@ -359,13 +339,9 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
@@ -395,10 +371,6 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
branchName: freezed == branchName
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -423,8 +395,7 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
@JsonKey(name: 'purchase_date') this.purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
||||
@EquipmentStatusJsonConverter() required this.status,
|
||||
@JsonKey(name: 'current_company_id') this.currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') this.currentBranchId,
|
||||
@JsonKey(name: 'company_id') this.companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') this.lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') this.nextInspectionDate,
|
||||
@@ -432,7 +403,6 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
@JsonKey(name: 'created_at') required this.createdAt,
|
||||
@JsonKey(name: 'updated_at') required this.updatedAt,
|
||||
@JsonKey(name: 'company_name') this.companyName,
|
||||
@JsonKey(name: 'branch_name') this.branchName,
|
||||
@JsonKey(name: 'warehouse_name') this.warehouseName});
|
||||
|
||||
factory _$EquipmentResponseImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -469,11 +439,8 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
@EquipmentStatusJsonConverter()
|
||||
final String status;
|
||||
@override
|
||||
@JsonKey(name: 'current_company_id')
|
||||
final int? currentCompanyId;
|
||||
@override
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
final int? currentBranchId;
|
||||
@JsonKey(name: 'company_id')
|
||||
final int? companyId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
final int? warehouseLocationId;
|
||||
@@ -496,15 +463,12 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
@JsonKey(name: 'company_name')
|
||||
final String? companyName;
|
||||
@override
|
||||
@JsonKey(name: 'branch_name')
|
||||
final String? branchName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
final String? warehouseName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentResponse(id: $id, equipmentNumber: $equipmentNumber, category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, currentCompanyId: $currentCompanyId, currentBranchId: $currentBranchId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark, createdAt: $createdAt, updatedAt: $updatedAt, companyName: $companyName, branchName: $branchName, warehouseName: $warehouseName)';
|
||||
return 'EquipmentResponse(id: $id, equipmentNumber: $equipmentNumber, category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark, createdAt: $createdAt, updatedAt: $updatedAt, companyName: $companyName, warehouseName: $warehouseName)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -533,10 +497,8 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
(identical(other.purchasePrice, purchasePrice) ||
|
||||
other.purchasePrice == purchasePrice) &&
|
||||
(identical(other.status, status) || other.status == status) &&
|
||||
(identical(other.currentCompanyId, currentCompanyId) ||
|
||||
other.currentCompanyId == currentCompanyId) &&
|
||||
(identical(other.currentBranchId, currentBranchId) ||
|
||||
other.currentBranchId == currentBranchId) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.lastInspectionDate, lastInspectionDate) ||
|
||||
@@ -550,8 +512,6 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
other.updatedAt == updatedAt) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.branchName, branchName) ||
|
||||
other.branchName == branchName) &&
|
||||
(identical(other.warehouseName, warehouseName) ||
|
||||
other.warehouseName == warehouseName));
|
||||
}
|
||||
@@ -572,8 +532,7 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
status,
|
||||
currentCompanyId,
|
||||
currentBranchId,
|
||||
companyId,
|
||||
warehouseLocationId,
|
||||
lastInspectionDate,
|
||||
nextInspectionDate,
|
||||
@@ -581,7 +540,6 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
createdAt,
|
||||
updatedAt,
|
||||
companyName,
|
||||
branchName,
|
||||
warehouseName
|
||||
]);
|
||||
|
||||
@@ -616,8 +574,7 @@ abstract class _EquipmentResponse implements EquipmentResponse {
|
||||
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') final String? purchasePrice,
|
||||
@EquipmentStatusJsonConverter() required final String status,
|
||||
@JsonKey(name: 'current_company_id') final int? currentCompanyId,
|
||||
@JsonKey(name: 'current_branch_id') final int? currentBranchId,
|
||||
@JsonKey(name: 'company_id') final int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
|
||||
@JsonKey(name: 'last_inspection_date') final DateTime? lastInspectionDate,
|
||||
@JsonKey(name: 'next_inspection_date') final DateTime? nextInspectionDate,
|
||||
@@ -625,7 +582,6 @@ abstract class _EquipmentResponse implements EquipmentResponse {
|
||||
@JsonKey(name: 'created_at') required final DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') required final DateTime updatedAt,
|
||||
@JsonKey(name: 'company_name') final String? companyName,
|
||||
@JsonKey(name: 'branch_name') final String? branchName,
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
final String? warehouseName}) = _$EquipmentResponseImpl;
|
||||
|
||||
@@ -663,11 +619,8 @@ abstract class _EquipmentResponse implements EquipmentResponse {
|
||||
@EquipmentStatusJsonConverter()
|
||||
String get status;
|
||||
@override
|
||||
@JsonKey(name: 'current_company_id')
|
||||
int? get currentCompanyId;
|
||||
@override
|
||||
@JsonKey(name: 'current_branch_id')
|
||||
int? get currentBranchId;
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId;
|
||||
@@ -689,9 +642,6 @@ abstract class _EquipmentResponse implements EquipmentResponse {
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName;
|
||||
@override
|
||||
@JsonKey(name: 'branch_name')
|
||||
String? get branchName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String? get warehouseName;
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ _$EquipmentResponseImpl _$$EquipmentResponseImplFromJson(
|
||||
purchasePrice: json['purchase_price'] as String?,
|
||||
status: const EquipmentStatusJsonConverter()
|
||||
.fromJson(json['status'] as String),
|
||||
currentCompanyId: (json['current_company_id'] as num?)?.toInt(),
|
||||
currentBranchId: (json['current_branch_id'] as num?)?.toInt(),
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
||||
lastInspectionDate: json['last_inspection_date'] == null
|
||||
? null
|
||||
@@ -37,7 +36,6 @@ _$EquipmentResponseImpl _$$EquipmentResponseImplFromJson(
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
||||
companyName: json['company_name'] as String?,
|
||||
branchName: json['branch_name'] as String?,
|
||||
warehouseName: json['warehouse_name'] as String?,
|
||||
);
|
||||
|
||||
@@ -56,8 +54,7 @@ Map<String, dynamic> _$$EquipmentResponseImplToJson(
|
||||
'purchase_date': instance.purchaseDate?.toIso8601String(),
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'status': const EquipmentStatusJsonConverter().toJson(instance.status),
|
||||
'current_company_id': instance.currentCompanyId,
|
||||
'current_branch_id': instance.currentBranchId,
|
||||
'company_id': instance.companyId,
|
||||
'warehouse_location_id': instance.warehouseLocationId,
|
||||
'last_inspection_date': instance.lastInspectionDate?.toIso8601String(),
|
||||
'next_inspection_date': instance.nextInspectionDate?.toIso8601String(),
|
||||
@@ -65,6 +62,5 @@ Map<String, dynamic> _$$EquipmentResponseImplToJson(
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt.toIso8601String(),
|
||||
'company_name': instance.companyName,
|
||||
'branch_name': instance.branchName,
|
||||
'warehouse_name': instance.warehouseName,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user