사용하지 않는 파일 정리 전 백업 (Phase 10 완료 후 상태)

This commit is contained in:
JiWoong Sul
2025-08-29 15:11:59 +09:00
parent a740ff10c8
commit d916b281a7
333 changed files with 53617 additions and 22574 deletions

View File

@@ -5,28 +5,83 @@ part 'equipment_dto.g.dart';
@freezed
class EquipmentDto with _$EquipmentDto {
const EquipmentDto._(); // Private constructor for getters
const factory EquipmentDto({
required int id,
@JsonKey(name: 'equipment_number') required String equipmentNumber,
@JsonKey(name: 'serial_number') String? serialNumber,
String? category1,
String? category2,
String? category3,
required String manufacturer,
@JsonKey(name: 'companies_id') required int companiesId,
@JsonKey(name: 'company_name') String? companyName,
@JsonKey(name: 'models_id') required int modelsId,
@JsonKey(name: 'model_name') String? modelName,
@JsonKey(name: 'vendor_name') String? vendorName,
@JsonKey(name: 'serial_number') required String serialNumber,
String? barcode,
required String status,
@JsonKey(name: 'company_id') int? companyId,
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
@JsonKey(name: 'purchase_date') String? purchaseDate,
@JsonKey(name: 'purchase_price') double? purchasePrice,
@JsonKey(name: 'last_inspection_date') String? lastInspectionDate,
@JsonKey(name: 'next_inspection_date') String? nextInspectionDate,
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
@JsonKey(name: 'purchase_price') @Default(0) int purchasePrice,
@JsonKey(name: 'warranty_number') required String warrantyNumber,
@JsonKey(name: 'warranty_started_at') required DateTime warrantyStartedAt,
@JsonKey(name: 'warranty_ended_at') required DateTime warrantyEndedAt,
String? remark,
@JsonKey(name: 'created_at') DateTime? createdAt,
@JsonKey(name: 'is_deleted') @Default(false) bool isDeleted,
@JsonKey(name: 'registered_at') DateTime? registeredAt,
@JsonKey(name: 'updated_at') DateTime? updatedAt,
}) = _EquipmentDto;
// isActive 계산 속성 (is_deleted의 반대)
bool get isActive => !isDeleted;
factory EquipmentDto.fromJson(Map<String, dynamic> json) =>
_$EquipmentDtoFromJson(json);
}
@freezed
class EquipmentRequestDto with _$EquipmentRequestDto {
const factory EquipmentRequestDto({
@JsonKey(name: 'companies_id') required int companiesId,
@JsonKey(name: 'models_id') required int modelsId,
@JsonKey(name: 'serial_number') required String serialNumber,
String? barcode,
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
@JsonKey(name: 'purchase_price') @Default(0) int purchasePrice,
@JsonKey(name: 'warranty_number') required String warrantyNumber,
@JsonKey(name: 'warranty_started_at') required DateTime warrantyStartedAt,
@JsonKey(name: 'warranty_ended_at') required DateTime warrantyEndedAt,
String? remark,
}) = _EquipmentRequestDto;
factory EquipmentRequestDto.fromJson(Map<String, dynamic> json) =>
_$EquipmentRequestDtoFromJson(json);
}
@freezed
class EquipmentUpdateRequestDto with _$EquipmentUpdateRequestDto {
const factory EquipmentUpdateRequestDto({
@JsonKey(name: 'companies_id') int? companiesId,
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String? barcode,
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
@JsonKey(name: 'purchase_price') int? purchasePrice,
@JsonKey(name: 'warranty_number') String? warrantyNumber,
@JsonKey(name: 'warranty_started_at') DateTime? warrantyStartedAt,
@JsonKey(name: 'warranty_ended_at') DateTime? warrantyEndedAt,
String? remark,
}) = _EquipmentUpdateRequestDto;
factory EquipmentUpdateRequestDto.fromJson(Map<String, dynamic> json) =>
_$EquipmentUpdateRequestDtoFromJson(json);
}
@freezed
class EquipmentListResponse with _$EquipmentListResponse {
const factory EquipmentListResponse({
@JsonKey(name: 'data') required List<EquipmentDto> 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,
}) = _EquipmentListResponse;
factory EquipmentListResponse.fromJson(Map<String, dynamic> json) =>
_$EquipmentListResponseFromJson(json);
}

File diff suppressed because it is too large Load Diff

View File

@@ -9,25 +9,25 @@ part of 'equipment_dto.dart';
_$EquipmentDtoImpl _$$EquipmentDtoImplFromJson(Map<String, dynamic> json) =>
_$EquipmentDtoImpl(
id: (json['id'] as num).toInt(),
equipmentNumber: json['equipment_number'] as String,
serialNumber: json['serial_number'] as String?,
category1: json['category1'] as String?,
category2: json['category2'] as String?,
category3: json['category3'] as String?,
manufacturer: json['manufacturer'] as String,
companiesId: (json['companies_id'] as num).toInt(),
companyName: json['company_name'] as String?,
modelsId: (json['models_id'] as num).toInt(),
modelName: json['model_name'] as String?,
vendorName: json['vendor_name'] as String?,
serialNumber: json['serial_number'] as String,
barcode: json['barcode'] as String?,
status: json['status'] as String,
companyId: (json['company_id'] as num?)?.toInt(),
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
purchaseDate: json['purchase_date'] as String?,
purchasePrice: (json['purchase_price'] as num?)?.toDouble(),
lastInspectionDate: json['last_inspection_date'] as String?,
nextInspectionDate: json['next_inspection_date'] as String?,
remark: json['remark'] as String?,
createdAt: json['created_at'] == null
purchasedAt: json['purchased_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
: DateTime.parse(json['purchased_at'] as String),
purchasePrice: (json['purchase_price'] as num?)?.toInt() ?? 0,
warrantyNumber: json['warranty_number'] as String,
warrantyStartedAt: DateTime.parse(json['warranty_started_at'] as String),
warrantyEndedAt: DateTime.parse(json['warranty_ended_at'] as String),
remark: json['remark'] as String?,
isDeleted: json['is_deleted'] as bool? ?? false,
registeredAt: json['registered_at'] == null
? null
: DateTime.parse(json['registered_at'] as String),
updatedAt: json['updated_at'] == null
? null
: DateTime.parse(json['updated_at'] as String),
@@ -36,22 +36,110 @@ _$EquipmentDtoImpl _$$EquipmentDtoImplFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> _$$EquipmentDtoImplToJson(_$EquipmentDtoImpl instance) =>
<String, dynamic>{
'id': instance.id,
'equipment_number': instance.equipmentNumber,
'serial_number': instance.serialNumber,
'category1': instance.category1,
'category2': instance.category2,
'category3': instance.category3,
'manufacturer': instance.manufacturer,
'companies_id': instance.companiesId,
'company_name': instance.companyName,
'models_id': instance.modelsId,
'model_name': instance.modelName,
'vendor_name': instance.vendorName,
'serial_number': instance.serialNumber,
'barcode': instance.barcode,
'status': instance.status,
'company_id': instance.companyId,
'warehouse_location_id': instance.warehouseLocationId,
'purchase_date': instance.purchaseDate,
'purchased_at': instance.purchasedAt?.toIso8601String(),
'purchase_price': instance.purchasePrice,
'last_inspection_date': instance.lastInspectionDate,
'next_inspection_date': instance.nextInspectionDate,
'warranty_number': instance.warrantyNumber,
'warranty_started_at': instance.warrantyStartedAt.toIso8601String(),
'warranty_ended_at': instance.warrantyEndedAt.toIso8601String(),
'remark': instance.remark,
'created_at': instance.createdAt?.toIso8601String(),
'is_deleted': instance.isDeleted,
'registered_at': instance.registeredAt?.toIso8601String(),
'updated_at': instance.updatedAt?.toIso8601String(),
};
_$EquipmentRequestDtoImpl _$$EquipmentRequestDtoImplFromJson(
Map<String, dynamic> json) =>
_$EquipmentRequestDtoImpl(
companiesId: (json['companies_id'] as num).toInt(),
modelsId: (json['models_id'] as num).toInt(),
serialNumber: json['serial_number'] as String,
barcode: json['barcode'] as String?,
purchasedAt: json['purchased_at'] == null
? null
: DateTime.parse(json['purchased_at'] as String),
purchasePrice: (json['purchase_price'] as num?)?.toInt() ?? 0,
warrantyNumber: json['warranty_number'] as String,
warrantyStartedAt: DateTime.parse(json['warranty_started_at'] as String),
warrantyEndedAt: DateTime.parse(json['warranty_ended_at'] as String),
remark: json['remark'] as String?,
);
Map<String, dynamic> _$$EquipmentRequestDtoImplToJson(
_$EquipmentRequestDtoImpl instance) =>
<String, dynamic>{
'companies_id': instance.companiesId,
'models_id': instance.modelsId,
'serial_number': instance.serialNumber,
'barcode': instance.barcode,
'purchased_at': instance.purchasedAt?.toIso8601String(),
'purchase_price': instance.purchasePrice,
'warranty_number': instance.warrantyNumber,
'warranty_started_at': instance.warrantyStartedAt.toIso8601String(),
'warranty_ended_at': instance.warrantyEndedAt.toIso8601String(),
'remark': instance.remark,
};
_$EquipmentUpdateRequestDtoImpl _$$EquipmentUpdateRequestDtoImplFromJson(
Map<String, dynamic> json) =>
_$EquipmentUpdateRequestDtoImpl(
companiesId: (json['companies_id'] as num?)?.toInt(),
modelsId: (json['models_id'] as num?)?.toInt(),
serialNumber: json['serial_number'] as String?,
barcode: json['barcode'] as String?,
purchasedAt: json['purchased_at'] == null
? null
: DateTime.parse(json['purchased_at'] as String),
purchasePrice: (json['purchase_price'] as num?)?.toInt(),
warrantyNumber: json['warranty_number'] as String?,
warrantyStartedAt: json['warranty_started_at'] == null
? null
: DateTime.parse(json['warranty_started_at'] as String),
warrantyEndedAt: json['warranty_ended_at'] == null
? null
: DateTime.parse(json['warranty_ended_at'] as String),
remark: json['remark'] as String?,
);
Map<String, dynamic> _$$EquipmentUpdateRequestDtoImplToJson(
_$EquipmentUpdateRequestDtoImpl instance) =>
<String, dynamic>{
'companies_id': instance.companiesId,
'models_id': instance.modelsId,
'serial_number': instance.serialNumber,
'barcode': instance.barcode,
'purchased_at': instance.purchasedAt?.toIso8601String(),
'purchase_price': instance.purchasePrice,
'warranty_number': instance.warrantyNumber,
'warranty_started_at': instance.warrantyStartedAt?.toIso8601String(),
'warranty_ended_at': instance.warrantyEndedAt?.toIso8601String(),
'remark': instance.remark,
};
_$EquipmentListResponseImpl _$$EquipmentListResponseImplFromJson(
Map<String, dynamic> json) =>
_$EquipmentListResponseImpl(
items: (json['data'] as List<dynamic>)
.map((e) => EquipmentDto.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> _$$EquipmentListResponseImplToJson(
_$EquipmentListResponseImpl instance) =>
<String, dynamic>{
'data': instance.items,
'total': instance.totalCount,
'page': instance.currentPage,
'total_pages': instance.totalPages,
'page_size': instance.pageSize,
};

View File

@@ -1,4 +1,5 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:superport/data/models/model_dto.dart';
part 'equipment_list_dto.freezed.dart';
part 'equipment_list_dto.g.dart';
@@ -8,8 +9,8 @@ class EquipmentListDto with _$EquipmentListDto {
const factory EquipmentListDto({
required int id,
@JsonKey(name: 'equipment_number') required String equipmentNumber,
required String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
// Sprint 3: Replaced manufacturer, modelName with models_id and model
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
required String status,
@JsonKey(name: 'company_id') int? companyId,
@@ -18,6 +19,8 @@ class EquipmentListDto with _$EquipmentListDto {
// 추가 필드 (조인된 데이터)
@JsonKey(name: 'company_name') String? companyName,
@JsonKey(name: 'warehouse_name') String? warehouseName,
// Sprint 3: Added model relationship (includes vendor info)
ModelDto? model,
}) = _EquipmentListDto;
factory EquipmentListDto.fromJson(Map<String, dynamic> json) =>

View File

@@ -22,10 +22,10 @@ EquipmentListDto _$EquipmentListDtoFromJson(Map<String, dynamic> json) {
mixin _$EquipmentListDto {
int get id => throw _privateConstructorUsedError;
@JsonKey(name: 'equipment_number')
String get equipmentNumber => throw _privateConstructorUsedError;
String get manufacturer => throw _privateConstructorUsedError;
@JsonKey(name: 'model_name')
String? get modelName => throw _privateConstructorUsedError;
String get equipmentNumber =>
throw _privateConstructorUsedError; // Sprint 3: Replaced manufacturer, modelName with models_id and model
@JsonKey(name: 'models_id')
int? get modelsId => throw _privateConstructorUsedError;
@JsonKey(name: 'serial_number')
String? get serialNumber => throw _privateConstructorUsedError;
String get status => throw _privateConstructorUsedError;
@@ -39,7 +39,9 @@ mixin _$EquipmentListDto {
@JsonKey(name: 'company_name')
String? get companyName => throw _privateConstructorUsedError;
@JsonKey(name: 'warehouse_name')
String? get warehouseName => throw _privateConstructorUsedError;
String? get warehouseName =>
throw _privateConstructorUsedError; // Sprint 3: Added model relationship (includes vendor info)
ModelDto? get model => throw _privateConstructorUsedError;
/// Serializes this EquipmentListDto to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@@ -60,15 +62,17 @@ abstract class $EquipmentListDtoCopyWith<$Res> {
$Res call(
{int id,
@JsonKey(name: 'equipment_number') String equipmentNumber,
String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String status,
@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: 'warehouse_name') String? warehouseName});
@JsonKey(name: 'warehouse_name') String? warehouseName,
ModelDto? model});
$ModelDtoCopyWith<$Res>? get model;
}
/// @nodoc
@@ -88,8 +92,7 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
$Res call({
Object? id = null,
Object? equipmentNumber = null,
Object? manufacturer = null,
Object? modelName = freezed,
Object? modelsId = freezed,
Object? serialNumber = freezed,
Object? status = null,
Object? companyId = freezed,
@@ -97,6 +100,7 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
Object? createdAt = null,
Object? companyName = freezed,
Object? warehouseName = freezed,
Object? model = freezed,
}) {
return _then(_value.copyWith(
id: null == id
@@ -107,14 +111,10 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
? _value.equipmentNumber
: equipmentNumber // ignore: cast_nullable_to_non_nullable
as String,
manufacturer: null == manufacturer
? _value.manufacturer
: manufacturer // ignore: cast_nullable_to_non_nullable
as String,
modelName: freezed == modelName
? _value.modelName
: modelName // ignore: cast_nullable_to_non_nullable
as String?,
modelsId: freezed == modelsId
? _value.modelsId
: modelsId // ignore: cast_nullable_to_non_nullable
as int?,
serialNumber: freezed == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
@@ -143,8 +143,26 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
? _value.warehouseName
: warehouseName // ignore: cast_nullable_to_non_nullable
as String?,
model: freezed == model
? _value.model
: model // ignore: cast_nullable_to_non_nullable
as ModelDto?,
) as $Val);
}
/// Create a copy of EquipmentListDto
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ModelDtoCopyWith<$Res>? get model {
if (_value.model == null) {
return null;
}
return $ModelDtoCopyWith<$Res>(_value.model!, (value) {
return _then(_value.copyWith(model: value) as $Val);
});
}
}
/// @nodoc
@@ -158,15 +176,18 @@ abstract class _$$EquipmentListDtoImplCopyWith<$Res>
$Res call(
{int id,
@JsonKey(name: 'equipment_number') String equipmentNumber,
String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String status,
@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: 'warehouse_name') String? warehouseName});
@JsonKey(name: 'warehouse_name') String? warehouseName,
ModelDto? model});
@override
$ModelDtoCopyWith<$Res>? get model;
}
/// @nodoc
@@ -184,8 +205,7 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
$Res call({
Object? id = null,
Object? equipmentNumber = null,
Object? manufacturer = null,
Object? modelName = freezed,
Object? modelsId = freezed,
Object? serialNumber = freezed,
Object? status = null,
Object? companyId = freezed,
@@ -193,6 +213,7 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
Object? createdAt = null,
Object? companyName = freezed,
Object? warehouseName = freezed,
Object? model = freezed,
}) {
return _then(_$EquipmentListDtoImpl(
id: null == id
@@ -203,14 +224,10 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
? _value.equipmentNumber
: equipmentNumber // ignore: cast_nullable_to_non_nullable
as String,
manufacturer: null == manufacturer
? _value.manufacturer
: manufacturer // ignore: cast_nullable_to_non_nullable
as String,
modelName: freezed == modelName
? _value.modelName
: modelName // ignore: cast_nullable_to_non_nullable
as String?,
modelsId: freezed == modelsId
? _value.modelsId
: modelsId // ignore: cast_nullable_to_non_nullable
as int?,
serialNumber: freezed == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
@@ -239,6 +256,10 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
? _value.warehouseName
: warehouseName // ignore: cast_nullable_to_non_nullable
as String?,
model: freezed == model
? _value.model
: model // ignore: cast_nullable_to_non_nullable
as ModelDto?,
));
}
}
@@ -249,15 +270,15 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
const _$EquipmentListDtoImpl(
{required this.id,
@JsonKey(name: 'equipment_number') required this.equipmentNumber,
required this.manufacturer,
@JsonKey(name: 'model_name') this.modelName,
@JsonKey(name: 'models_id') this.modelsId,
@JsonKey(name: 'serial_number') this.serialNumber,
required this.status,
@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: 'warehouse_name') this.warehouseName});
@JsonKey(name: 'warehouse_name') this.warehouseName,
this.model});
factory _$EquipmentListDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$EquipmentListDtoImplFromJson(json);
@@ -267,11 +288,10 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
@override
@JsonKey(name: 'equipment_number')
final String equipmentNumber;
// Sprint 3: Replaced manufacturer, modelName with models_id and model
@override
final String manufacturer;
@override
@JsonKey(name: 'model_name')
final String? modelName;
@JsonKey(name: 'models_id')
final int? modelsId;
@override
@JsonKey(name: 'serial_number')
final String? serialNumber;
@@ -293,10 +313,13 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
@override
@JsonKey(name: 'warehouse_name')
final String? warehouseName;
// Sprint 3: Added model relationship (includes vendor info)
@override
final ModelDto? model;
@override
String toString() {
return 'EquipmentListDto(id: $id, equipmentNumber: $equipmentNumber, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, createdAt: $createdAt, companyName: $companyName, warehouseName: $warehouseName)';
return 'EquipmentListDto(id: $id, equipmentNumber: $equipmentNumber, modelsId: $modelsId, serialNumber: $serialNumber, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, createdAt: $createdAt, companyName: $companyName, warehouseName: $warehouseName, model: $model)';
}
@override
@@ -307,10 +330,8 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
(identical(other.id, id) || other.id == id) &&
(identical(other.equipmentNumber, equipmentNumber) ||
other.equipmentNumber == equipmentNumber) &&
(identical(other.manufacturer, manufacturer) ||
other.manufacturer == manufacturer) &&
(identical(other.modelName, modelName) ||
other.modelName == modelName) &&
(identical(other.modelsId, modelsId) ||
other.modelsId == modelsId) &&
(identical(other.serialNumber, serialNumber) ||
other.serialNumber == serialNumber) &&
(identical(other.status, status) || other.status == status) &&
@@ -323,7 +344,8 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
(identical(other.companyName, companyName) ||
other.companyName == companyName) &&
(identical(other.warehouseName, warehouseName) ||
other.warehouseName == warehouseName));
other.warehouseName == warehouseName) &&
(identical(other.model, model) || other.model == model));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -332,15 +354,15 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
runtimeType,
id,
equipmentNumber,
manufacturer,
modelName,
modelsId,
serialNumber,
status,
companyId,
warehouseLocationId,
createdAt,
companyName,
warehouseName);
warehouseName,
model);
/// Create a copy of EquipmentListDto
/// with the given fields replaced by the non-null parameter values.
@@ -363,16 +385,15 @@ abstract class _EquipmentListDto implements EquipmentListDto {
const factory _EquipmentListDto(
{required final int id,
@JsonKey(name: 'equipment_number') required final String equipmentNumber,
required final String manufacturer,
@JsonKey(name: 'model_name') final String? modelName,
@JsonKey(name: 'models_id') final int? modelsId,
@JsonKey(name: 'serial_number') final String? serialNumber,
required final String status,
@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: 'warehouse_name')
final String? warehouseName}) = _$EquipmentListDtoImpl;
@JsonKey(name: 'warehouse_name') final String? warehouseName,
final ModelDto? model}) = _$EquipmentListDtoImpl;
factory _EquipmentListDto.fromJson(Map<String, dynamic> json) =
_$EquipmentListDtoImpl.fromJson;
@@ -381,12 +402,11 @@ abstract class _EquipmentListDto implements EquipmentListDto {
int get id;
@override
@JsonKey(name: 'equipment_number')
String get equipmentNumber;
String
get equipmentNumber; // Sprint 3: Replaced manufacturer, modelName with models_id and model
@override
String get manufacturer;
@override
@JsonKey(name: 'model_name')
String? get modelName;
@JsonKey(name: 'models_id')
int? get modelsId;
@override
@JsonKey(name: 'serial_number')
String? get serialNumber;
@@ -406,7 +426,10 @@ abstract class _EquipmentListDto implements EquipmentListDto {
String? get companyName;
@override
@JsonKey(name: 'warehouse_name')
String? get warehouseName;
String?
get warehouseName; // Sprint 3: Added model relationship (includes vendor info)
@override
ModelDto? get model;
/// Create a copy of EquipmentListDto
/// with the given fields replaced by the non-null parameter values.

View File

@@ -11,8 +11,7 @@ _$EquipmentListDtoImpl _$$EquipmentListDtoImplFromJson(
_$EquipmentListDtoImpl(
id: (json['id'] as num).toInt(),
equipmentNumber: json['equipment_number'] as String,
manufacturer: json['manufacturer'] as String,
modelName: json['model_name'] as String?,
modelsId: (json['models_id'] as num?)?.toInt(),
serialNumber: json['serial_number'] as String?,
status: json['status'] as String,
companyId: (json['company_id'] as num?)?.toInt(),
@@ -20,6 +19,9 @@ _$EquipmentListDtoImpl _$$EquipmentListDtoImplFromJson(
createdAt: DateTime.parse(json['created_at'] as String),
companyName: json['company_name'] as String?,
warehouseName: json['warehouse_name'] as String?,
model: json['model'] == null
? null
: ModelDto.fromJson(json['model'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$EquipmentListDtoImplToJson(
@@ -27,8 +29,7 @@ Map<String, dynamic> _$$EquipmentListDtoImplToJson(
<String, dynamic>{
'id': instance.id,
'equipment_number': instance.equipmentNumber,
'manufacturer': instance.manufacturer,
'model_name': instance.modelName,
'models_id': instance.modelsId,
'serial_number': instance.serialNumber,
'status': instance.status,
'company_id': instance.companyId,
@@ -36,6 +37,7 @@ Map<String, dynamic> _$$EquipmentListDtoImplToJson(
'created_at': instance.createdAt.toIso8601String(),
'company_name': instance.companyName,
'warehouse_name': instance.warehouseName,
'model': instance.model,
};
_$EquipmentListResponseDtoImpl _$$EquipmentListResponseDtoImplFromJson(

View File

@@ -1,5 +1,4 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:superport/core/utils/equipment_status_converter.dart';
part 'equipment_request.freezed.dart';
part 'equipment_request.g.dart';
@@ -43,11 +42,8 @@ class DecimalConverter implements JsonConverter<double?, dynamic> {
class CreateEquipmentRequest with _$CreateEquipmentRequest {
const factory CreateEquipmentRequest({
@JsonKey(name: 'equipment_number') required String equipmentNumber,
String? category1,
String? category2,
String? category3,
required String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String? barcode,
@JsonKey(name: 'purchase_date') @NaiveDateConverter() DateTime? purchaseDate,
@@ -66,11 +62,8 @@ class CreateEquipmentRequest with _$CreateEquipmentRequest {
@freezed
class UpdateEquipmentRequest with _$UpdateEquipmentRequest {
const factory UpdateEquipmentRequest({
@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,
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
@JsonKey(name: 'models_id', includeIfNull: false) int? modelsId,
@JsonKey(name: 'serial_number', includeIfNull: false) String? serialNumber,
@JsonKey(includeIfNull: false) String? barcode,
@JsonKey(name: 'purchase_date', includeIfNull: false) @NaiveDateConverter() DateTime? purchaseDate,

View File

@@ -22,13 +22,10 @@ CreateEquipmentRequest _$CreateEquipmentRequestFromJson(
/// @nodoc
mixin _$CreateEquipmentRequest {
@JsonKey(name: 'equipment_number')
String get equipmentNumber => throw _privateConstructorUsedError;
String? get category1 => throw _privateConstructorUsedError;
String? get category2 => throw _privateConstructorUsedError;
String? get category3 => throw _privateConstructorUsedError;
String get manufacturer => throw _privateConstructorUsedError;
@JsonKey(name: 'model_name')
String? get modelName => throw _privateConstructorUsedError;
String get equipmentNumber =>
throw _privateConstructorUsedError; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
@JsonKey(name: 'models_id')
int? get modelsId => throw _privateConstructorUsedError;
@JsonKey(name: 'serial_number')
String? get serialNumber => throw _privateConstructorUsedError;
String? get barcode => throw _privateConstructorUsedError;
@@ -68,11 +65,7 @@ abstract class $CreateEquipmentRequestCopyWith<$Res> {
@useResult
$Res call(
{@JsonKey(name: 'equipment_number') String equipmentNumber,
String? category1,
String? category2,
String? category3,
String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String? barcode,
@JsonKey(name: 'purchase_date')
@@ -109,11 +102,7 @@ class _$CreateEquipmentRequestCopyWithImpl<$Res,
@override
$Res call({
Object? equipmentNumber = null,
Object? category1 = freezed,
Object? category2 = freezed,
Object? category3 = freezed,
Object? manufacturer = null,
Object? modelName = freezed,
Object? modelsId = freezed,
Object? serialNumber = freezed,
Object? barcode = freezed,
Object? purchaseDate = freezed,
@@ -129,26 +118,10 @@ class _$CreateEquipmentRequestCopyWithImpl<$Res,
? _value.equipmentNumber
: equipmentNumber // ignore: cast_nullable_to_non_nullable
as String,
category1: freezed == category1
? _value.category1
: category1 // ignore: cast_nullable_to_non_nullable
as String?,
category2: freezed == category2
? _value.category2
: category2 // ignore: cast_nullable_to_non_nullable
as String?,
category3: freezed == category3
? _value.category3
: category3 // ignore: cast_nullable_to_non_nullable
as String?,
manufacturer: null == manufacturer
? _value.manufacturer
: manufacturer // ignore: cast_nullable_to_non_nullable
as String,
modelName: freezed == modelName
? _value.modelName
: modelName // ignore: cast_nullable_to_non_nullable
as String?,
modelsId: freezed == modelsId
? _value.modelsId
: modelsId // ignore: cast_nullable_to_non_nullable
as int?,
serialNumber: freezed == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
@@ -200,11 +173,7 @@ abstract class _$$CreateEquipmentRequestImplCopyWith<$Res>
@useResult
$Res call(
{@JsonKey(name: 'equipment_number') String equipmentNumber,
String? category1,
String? category2,
String? category3,
String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String? barcode,
@JsonKey(name: 'purchase_date')
@@ -240,11 +209,7 @@ class __$$CreateEquipmentRequestImplCopyWithImpl<$Res>
@override
$Res call({
Object? equipmentNumber = null,
Object? category1 = freezed,
Object? category2 = freezed,
Object? category3 = freezed,
Object? manufacturer = null,
Object? modelName = freezed,
Object? modelsId = freezed,
Object? serialNumber = freezed,
Object? barcode = freezed,
Object? purchaseDate = freezed,
@@ -260,26 +225,10 @@ class __$$CreateEquipmentRequestImplCopyWithImpl<$Res>
? _value.equipmentNumber
: equipmentNumber // ignore: cast_nullable_to_non_nullable
as String,
category1: freezed == category1
? _value.category1
: category1 // ignore: cast_nullable_to_non_nullable
as String?,
category2: freezed == category2
? _value.category2
: category2 // ignore: cast_nullable_to_non_nullable
as String?,
category3: freezed == category3
? _value.category3
: category3 // ignore: cast_nullable_to_non_nullable
as String?,
manufacturer: null == manufacturer
? _value.manufacturer
: manufacturer // ignore: cast_nullable_to_non_nullable
as String,
modelName: freezed == modelName
? _value.modelName
: modelName // ignore: cast_nullable_to_non_nullable
as String?,
modelsId: freezed == modelsId
? _value.modelsId
: modelsId // ignore: cast_nullable_to_non_nullable
as int?,
serialNumber: freezed == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
@@ -325,11 +274,7 @@ class __$$CreateEquipmentRequestImplCopyWithImpl<$Res>
class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
const _$CreateEquipmentRequestImpl(
{@JsonKey(name: 'equipment_number') required this.equipmentNumber,
this.category1,
this.category2,
this.category3,
required this.manufacturer,
@JsonKey(name: 'model_name') this.modelName,
@JsonKey(name: 'models_id') this.modelsId,
@JsonKey(name: 'serial_number') this.serialNumber,
this.barcode,
@JsonKey(name: 'purchase_date') @NaiveDateConverter() this.purchaseDate,
@@ -350,17 +295,10 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
@override
@JsonKey(name: 'equipment_number')
final String equipmentNumber;
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
@override
final String? category1;
@override
final String? category2;
@override
final String? category3;
@override
final String manufacturer;
@override
@JsonKey(name: 'model_name')
final String? modelName;
@JsonKey(name: 'models_id')
final int? modelsId;
@override
@JsonKey(name: 'serial_number')
final String? serialNumber;
@@ -393,7 +331,7 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
@override
String toString() {
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)';
return 'CreateEquipmentRequest(equipmentNumber: $equipmentNumber, modelsId: $modelsId, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
}
@override
@@ -403,16 +341,8 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
other is _$CreateEquipmentRequestImpl &&
(identical(other.equipmentNumber, equipmentNumber) ||
other.equipmentNumber == equipmentNumber) &&
(identical(other.category1, category1) ||
other.category1 == category1) &&
(identical(other.category2, category2) ||
other.category2 == category2) &&
(identical(other.category3, category3) ||
other.category3 == category3) &&
(identical(other.manufacturer, manufacturer) ||
other.manufacturer == manufacturer) &&
(identical(other.modelName, modelName) ||
other.modelName == modelName) &&
(identical(other.modelsId, modelsId) ||
other.modelsId == modelsId) &&
(identical(other.serialNumber, serialNumber) ||
other.serialNumber == serialNumber) &&
(identical(other.barcode, barcode) || other.barcode == barcode) &&
@@ -436,11 +366,7 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
int get hashCode => Object.hash(
runtimeType,
equipmentNumber,
category1,
category2,
category3,
manufacturer,
modelName,
modelsId,
serialNumber,
barcode,
purchaseDate,
@@ -471,11 +397,7 @@ class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
abstract class _CreateEquipmentRequest implements CreateEquipmentRequest {
const factory _CreateEquipmentRequest(
{@JsonKey(name: 'equipment_number') required final String equipmentNumber,
final String? category1,
final String? category2,
final String? category3,
required final String manufacturer,
@JsonKey(name: 'model_name') final String? modelName,
@JsonKey(name: 'models_id') final int? modelsId,
@JsonKey(name: 'serial_number') final String? serialNumber,
final String? barcode,
@JsonKey(name: 'purchase_date')
@@ -499,18 +421,11 @@ abstract class _CreateEquipmentRequest implements CreateEquipmentRequest {
@override
@JsonKey(name: 'equipment_number')
String get equipmentNumber;
String
get equipmentNumber; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
@override
String? get category1;
@override
String? get category2;
@override
String? get category3;
@override
String get manufacturer;
@override
@JsonKey(name: 'model_name')
String? get modelName;
@JsonKey(name: 'models_id')
int? get modelsId;
@override
@JsonKey(name: 'serial_number')
String? get serialNumber;
@@ -556,16 +471,9 @@ 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', includeIfNull: false)
String? get modelName => throw _privateConstructorUsedError;
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
@JsonKey(name: 'models_id', includeIfNull: false)
int? get modelsId => throw _privateConstructorUsedError;
@JsonKey(name: 'serial_number', includeIfNull: false)
String? get serialNumber => throw _privateConstructorUsedError;
@JsonKey(includeIfNull: false)
@@ -608,11 +516,7 @@ abstract class $UpdateEquipmentRequestCopyWith<$Res> {
_$UpdateEquipmentRequestCopyWithImpl<$Res, UpdateEquipmentRequest>;
@useResult
$Res call(
{@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: 'models_id', includeIfNull: false) int? modelsId,
@JsonKey(name: 'serial_number', includeIfNull: false)
String? serialNumber,
@JsonKey(includeIfNull: false) String? barcode,
@@ -651,11 +555,7 @@ class _$UpdateEquipmentRequestCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? category1 = freezed,
Object? category2 = freezed,
Object? category3 = freezed,
Object? manufacturer = freezed,
Object? modelName = freezed,
Object? modelsId = freezed,
Object? serialNumber = freezed,
Object? barcode = freezed,
Object? purchaseDate = freezed,
@@ -668,26 +568,10 @@ class _$UpdateEquipmentRequestCopyWithImpl<$Res,
Object? remark = freezed,
}) {
return _then(_value.copyWith(
category1: freezed == category1
? _value.category1
: category1 // ignore: cast_nullable_to_non_nullable
as String?,
category2: freezed == category2
? _value.category2
: category2 // ignore: cast_nullable_to_non_nullable
as String?,
category3: freezed == category3
? _value.category3
: category3 // ignore: cast_nullable_to_non_nullable
as String?,
manufacturer: freezed == manufacturer
? _value.manufacturer
: manufacturer // ignore: cast_nullable_to_non_nullable
as String?,
modelName: freezed == modelName
? _value.modelName
: modelName // ignore: cast_nullable_to_non_nullable
as String?,
modelsId: freezed == modelsId
? _value.modelsId
: modelsId // ignore: cast_nullable_to_non_nullable
as int?,
serialNumber: freezed == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
@@ -742,11 +626,7 @@ abstract class _$$UpdateEquipmentRequestImplCopyWith<$Res>
@override
@useResult
$Res call(
{@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: 'models_id', includeIfNull: false) int? modelsId,
@JsonKey(name: 'serial_number', includeIfNull: false)
String? serialNumber,
@JsonKey(includeIfNull: false) String? barcode,
@@ -784,11 +664,7 @@ class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? category1 = freezed,
Object? category2 = freezed,
Object? category3 = freezed,
Object? manufacturer = freezed,
Object? modelName = freezed,
Object? modelsId = freezed,
Object? serialNumber = freezed,
Object? barcode = freezed,
Object? purchaseDate = freezed,
@@ -801,26 +677,10 @@ class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>
Object? remark = freezed,
}) {
return _then(_$UpdateEquipmentRequestImpl(
category1: freezed == category1
? _value.category1
: category1 // ignore: cast_nullable_to_non_nullable
as String?,
category2: freezed == category2
? _value.category2
: category2 // ignore: cast_nullable_to_non_nullable
as String?,
category3: freezed == category3
? _value.category3
: category3 // ignore: cast_nullable_to_non_nullable
as String?,
manufacturer: freezed == manufacturer
? _value.manufacturer
: manufacturer // ignore: cast_nullable_to_non_nullable
as String?,
modelName: freezed == modelName
? _value.modelName
: modelName // ignore: cast_nullable_to_non_nullable
as String?,
modelsId: freezed == modelsId
? _value.modelsId
: modelsId // ignore: cast_nullable_to_non_nullable
as int?,
serialNumber: freezed == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
@@ -869,11 +729,7 @@ class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>
@JsonSerializable()
class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
const _$UpdateEquipmentRequestImpl(
{@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: 'models_id', includeIfNull: false) this.modelsId,
@JsonKey(name: 'serial_number', includeIfNull: false) this.serialNumber,
@JsonKey(includeIfNull: false) this.barcode,
@JsonKey(name: 'purchase_date', includeIfNull: false)
@@ -897,21 +753,10 @@ class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
factory _$UpdateEquipmentRequestImpl.fromJson(Map<String, dynamic> json) =>
_$$UpdateEquipmentRequestImplFromJson(json);
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
@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', includeIfNull: false)
final String? modelName;
@JsonKey(name: 'models_id', includeIfNull: false)
final int? modelsId;
@override
@JsonKey(name: 'serial_number', includeIfNull: false)
final String? serialNumber;
@@ -949,7 +794,7 @@ class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
@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, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
return 'UpdateEquipmentRequest(modelsId: $modelsId, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
}
@override
@@ -957,16 +802,8 @@ class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$UpdateEquipmentRequestImpl &&
(identical(other.category1, category1) ||
other.category1 == category1) &&
(identical(other.category2, category2) ||
other.category2 == category2) &&
(identical(other.category3, category3) ||
other.category3 == category3) &&
(identical(other.manufacturer, manufacturer) ||
other.manufacturer == manufacturer) &&
(identical(other.modelName, modelName) ||
other.modelName == modelName) &&
(identical(other.modelsId, modelsId) ||
other.modelsId == modelsId) &&
(identical(other.serialNumber, serialNumber) ||
other.serialNumber == serialNumber) &&
(identical(other.barcode, barcode) || other.barcode == barcode) &&
@@ -990,11 +827,7 @@ class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
@override
int get hashCode => Object.hash(
runtimeType,
category1,
category2,
category3,
manufacturer,
modelName,
modelsId,
serialNumber,
barcode,
purchaseDate,
@@ -1025,12 +858,7 @@ class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
abstract class _UpdateEquipmentRequest implements UpdateEquipmentRequest {
const factory _UpdateEquipmentRequest(
{@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: 'models_id', includeIfNull: false) final int? modelsId,
@JsonKey(name: 'serial_number', includeIfNull: false)
final String? serialNumber,
@JsonKey(includeIfNull: false) final String? barcode,
@@ -1056,21 +884,10 @@ abstract class _UpdateEquipmentRequest implements UpdateEquipmentRequest {
factory _UpdateEquipmentRequest.fromJson(Map<String, dynamic> json) =
_$UpdateEquipmentRequestImpl.fromJson;
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
@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', includeIfNull: false)
String? get modelName;
@JsonKey(name: 'models_id', includeIfNull: false)
int? get modelsId;
@override
@JsonKey(name: 'serial_number', includeIfNull: false)
String? get serialNumber;

View File

@@ -10,11 +10,7 @@ _$CreateEquipmentRequestImpl _$$CreateEquipmentRequestImplFromJson(
Map<String, dynamic> json) =>
_$CreateEquipmentRequestImpl(
equipmentNumber: json['equipment_number'] as String,
category1: json['category1'] as String?,
category2: json['category2'] as String?,
category3: json['category3'] as String?,
manufacturer: json['manufacturer'] as String,
modelName: json['model_name'] as String?,
modelsId: (json['models_id'] as num?)?.toInt(),
serialNumber: json['serial_number'] as String?,
barcode: json['barcode'] as String?,
purchaseDate:
@@ -33,11 +29,7 @@ Map<String, dynamic> _$$CreateEquipmentRequestImplToJson(
_$CreateEquipmentRequestImpl instance) =>
<String, dynamic>{
'equipment_number': instance.equipmentNumber,
'category1': instance.category1,
'category2': instance.category2,
'category3': instance.category3,
'manufacturer': instance.manufacturer,
'model_name': instance.modelName,
'models_id': instance.modelsId,
'serial_number': instance.serialNumber,
'barcode': instance.barcode,
'purchase_date': const NaiveDateConverter().toJson(instance.purchaseDate),
@@ -54,11 +46,7 @@ Map<String, dynamic> _$$CreateEquipmentRequestImplToJson(
_$UpdateEquipmentRequestImpl _$$UpdateEquipmentRequestImplFromJson(
Map<String, dynamic> json) =>
_$UpdateEquipmentRequestImpl(
category1: json['category1'] as String?,
category2: json['category2'] as String?,
category3: json['category3'] as String?,
manufacturer: json['manufacturer'] as String?,
modelName: json['model_name'] as String?,
modelsId: (json['models_id'] as num?)?.toInt(),
serialNumber: json['serial_number'] as String?,
barcode: json['barcode'] as String?,
purchaseDate:
@@ -77,11 +65,7 @@ _$UpdateEquipmentRequestImpl _$$UpdateEquipmentRequestImplFromJson(
Map<String, dynamic> _$$UpdateEquipmentRequestImplToJson(
_$UpdateEquipmentRequestImpl instance) =>
<String, dynamic>{
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.modelsId case final value?) 'models_id': value,
if (instance.serialNumber case final value?) 'serial_number': value,
if (instance.barcode case final value?) 'barcode': value,
if (const NaiveDateConverter().toJson(instance.purchaseDate)

View File

@@ -1,5 +1,6 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:superport/core/utils/equipment_status_converter.dart';
import 'package:superport/data/models/model_dto.dart';
part 'equipment_response.freezed.dart';
part 'equipment_response.g.dart';
@@ -9,11 +10,8 @@ class EquipmentResponse with _$EquipmentResponse {
const factory EquipmentResponse({
required int id,
@JsonKey(name: 'equipment_number') required String equipmentNumber,
String? category1,
String? category2,
String? category3,
required String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String? barcode,
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
@@ -29,6 +27,8 @@ class EquipmentResponse with _$EquipmentResponse {
// 추가 필드 (조인된 데이터)
@JsonKey(name: 'company_name') String? companyName,
@JsonKey(name: 'warehouse_name') String? warehouseName,
// Sprint 3: Added model relationship (includes vendor info)
ModelDto? model,
}) = _EquipmentResponse;
factory EquipmentResponse.fromJson(Map<String, dynamic> json) =>

View File

@@ -22,13 +22,10 @@ EquipmentResponse _$EquipmentResponseFromJson(Map<String, dynamic> json) {
mixin _$EquipmentResponse {
int get id => throw _privateConstructorUsedError;
@JsonKey(name: 'equipment_number')
String get equipmentNumber => throw _privateConstructorUsedError;
String? get category1 => throw _privateConstructorUsedError;
String? get category2 => throw _privateConstructorUsedError;
String? get category3 => throw _privateConstructorUsedError;
String get manufacturer => throw _privateConstructorUsedError;
@JsonKey(name: 'model_name')
String? get modelName => throw _privateConstructorUsedError;
String get equipmentNumber =>
throw _privateConstructorUsedError; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model
@JsonKey(name: 'models_id')
int? get modelsId => throw _privateConstructorUsedError;
@JsonKey(name: 'serial_number')
String? get serialNumber => throw _privateConstructorUsedError;
String? get barcode => throw _privateConstructorUsedError;
@@ -55,7 +52,9 @@ mixin _$EquipmentResponse {
@JsonKey(name: 'company_name')
String? get companyName => throw _privateConstructorUsedError;
@JsonKey(name: 'warehouse_name')
String? get warehouseName => throw _privateConstructorUsedError;
String? get warehouseName =>
throw _privateConstructorUsedError; // Sprint 3: Added model relationship (includes vendor info)
ModelDto? get model => throw _privateConstructorUsedError;
/// Serializes this EquipmentResponse to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@@ -76,11 +75,7 @@ abstract class $EquipmentResponseCopyWith<$Res> {
$Res call(
{int id,
@JsonKey(name: 'equipment_number') String equipmentNumber,
String? category1,
String? category2,
String? category3,
String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String? barcode,
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
@@ -94,7 +89,10 @@ abstract class $EquipmentResponseCopyWith<$Res> {
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt,
@JsonKey(name: 'company_name') String? companyName,
@JsonKey(name: 'warehouse_name') String? warehouseName});
@JsonKey(name: 'warehouse_name') String? warehouseName,
ModelDto? model});
$ModelDtoCopyWith<$Res>? get model;
}
/// @nodoc
@@ -114,11 +112,7 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
$Res call({
Object? id = null,
Object? equipmentNumber = null,
Object? category1 = freezed,
Object? category2 = freezed,
Object? category3 = freezed,
Object? manufacturer = null,
Object? modelName = freezed,
Object? modelsId = freezed,
Object? serialNumber = freezed,
Object? barcode = freezed,
Object? purchaseDate = freezed,
@@ -133,6 +127,7 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
Object? updatedAt = null,
Object? companyName = freezed,
Object? warehouseName = freezed,
Object? model = freezed,
}) {
return _then(_value.copyWith(
id: null == id
@@ -143,26 +138,10 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
? _value.equipmentNumber
: equipmentNumber // ignore: cast_nullable_to_non_nullable
as String,
category1: freezed == category1
? _value.category1
: category1 // ignore: cast_nullable_to_non_nullable
as String?,
category2: freezed == category2
? _value.category2
: category2 // ignore: cast_nullable_to_non_nullable
as String?,
category3: freezed == category3
? _value.category3
: category3 // ignore: cast_nullable_to_non_nullable
as String?,
manufacturer: null == manufacturer
? _value.manufacturer
: manufacturer // ignore: cast_nullable_to_non_nullable
as String,
modelName: freezed == modelName
? _value.modelName
: modelName // ignore: cast_nullable_to_non_nullable
as String?,
modelsId: freezed == modelsId
? _value.modelsId
: modelsId // ignore: cast_nullable_to_non_nullable
as int?,
serialNumber: freezed == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
@@ -219,8 +198,26 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
? _value.warehouseName
: warehouseName // ignore: cast_nullable_to_non_nullable
as String?,
model: freezed == model
? _value.model
: model // ignore: cast_nullable_to_non_nullable
as ModelDto?,
) as $Val);
}
/// Create a copy of EquipmentResponse
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ModelDtoCopyWith<$Res>? get model {
if (_value.model == null) {
return null;
}
return $ModelDtoCopyWith<$Res>(_value.model!, (value) {
return _then(_value.copyWith(model: value) as $Val);
});
}
}
/// @nodoc
@@ -234,11 +231,7 @@ abstract class _$$EquipmentResponseImplCopyWith<$Res>
$Res call(
{int id,
@JsonKey(name: 'equipment_number') String equipmentNumber,
String? category1,
String? category2,
String? category3,
String manufacturer,
@JsonKey(name: 'model_name') String? modelName,
@JsonKey(name: 'models_id') int? modelsId,
@JsonKey(name: 'serial_number') String? serialNumber,
String? barcode,
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
@@ -252,7 +245,11 @@ abstract class _$$EquipmentResponseImplCopyWith<$Res>
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt,
@JsonKey(name: 'company_name') String? companyName,
@JsonKey(name: 'warehouse_name') String? warehouseName});
@JsonKey(name: 'warehouse_name') String? warehouseName,
ModelDto? model});
@override
$ModelDtoCopyWith<$Res>? get model;
}
/// @nodoc
@@ -270,11 +267,7 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
$Res call({
Object? id = null,
Object? equipmentNumber = null,
Object? category1 = freezed,
Object? category2 = freezed,
Object? category3 = freezed,
Object? manufacturer = null,
Object? modelName = freezed,
Object? modelsId = freezed,
Object? serialNumber = freezed,
Object? barcode = freezed,
Object? purchaseDate = freezed,
@@ -289,6 +282,7 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
Object? updatedAt = null,
Object? companyName = freezed,
Object? warehouseName = freezed,
Object? model = freezed,
}) {
return _then(_$EquipmentResponseImpl(
id: null == id
@@ -299,26 +293,10 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
? _value.equipmentNumber
: equipmentNumber // ignore: cast_nullable_to_non_nullable
as String,
category1: freezed == category1
? _value.category1
: category1 // ignore: cast_nullable_to_non_nullable
as String?,
category2: freezed == category2
? _value.category2
: category2 // ignore: cast_nullable_to_non_nullable
as String?,
category3: freezed == category3
? _value.category3
: category3 // ignore: cast_nullable_to_non_nullable
as String?,
manufacturer: null == manufacturer
? _value.manufacturer
: manufacturer // ignore: cast_nullable_to_non_nullable
as String,
modelName: freezed == modelName
? _value.modelName
: modelName // ignore: cast_nullable_to_non_nullable
as String?,
modelsId: freezed == modelsId
? _value.modelsId
: modelsId // ignore: cast_nullable_to_non_nullable
as int?,
serialNumber: freezed == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
@@ -375,6 +353,10 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
? _value.warehouseName
: warehouseName // ignore: cast_nullable_to_non_nullable
as String?,
model: freezed == model
? _value.model
: model // ignore: cast_nullable_to_non_nullable
as ModelDto?,
));
}
}
@@ -385,11 +367,7 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
const _$EquipmentResponseImpl(
{required this.id,
@JsonKey(name: 'equipment_number') required this.equipmentNumber,
this.category1,
this.category2,
this.category3,
required this.manufacturer,
@JsonKey(name: 'model_name') this.modelName,
@JsonKey(name: 'models_id') this.modelsId,
@JsonKey(name: 'serial_number') this.serialNumber,
this.barcode,
@JsonKey(name: 'purchase_date') this.purchaseDate,
@@ -403,7 +381,8 @@ 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: 'warehouse_name') this.warehouseName});
@JsonKey(name: 'warehouse_name') this.warehouseName,
this.model});
factory _$EquipmentResponseImpl.fromJson(Map<String, dynamic> json) =>
_$$EquipmentResponseImplFromJson(json);
@@ -413,17 +392,10 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
@override
@JsonKey(name: 'equipment_number')
final String equipmentNumber;
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model
@override
final String? category1;
@override
final String? category2;
@override
final String? category3;
@override
final String manufacturer;
@override
@JsonKey(name: 'model_name')
final String? modelName;
@JsonKey(name: 'models_id')
final int? modelsId;
@override
@JsonKey(name: 'serial_number')
final String? serialNumber;
@@ -465,10 +437,13 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
@override
@JsonKey(name: 'warehouse_name')
final String? warehouseName;
// Sprint 3: Added model relationship (includes vendor info)
@override
final ModelDto? model;
@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, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark, createdAt: $createdAt, updatedAt: $updatedAt, companyName: $companyName, warehouseName: $warehouseName)';
return 'EquipmentResponse(id: $id, equipmentNumber: $equipmentNumber, modelsId: $modelsId, 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, model: $model)';
}
@override
@@ -479,16 +454,8 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
(identical(other.id, id) || other.id == id) &&
(identical(other.equipmentNumber, equipmentNumber) ||
other.equipmentNumber == equipmentNumber) &&
(identical(other.category1, category1) ||
other.category1 == category1) &&
(identical(other.category2, category2) ||
other.category2 == category2) &&
(identical(other.category3, category3) ||
other.category3 == category3) &&
(identical(other.manufacturer, manufacturer) ||
other.manufacturer == manufacturer) &&
(identical(other.modelName, modelName) ||
other.modelName == modelName) &&
(identical(other.modelsId, modelsId) ||
other.modelsId == modelsId) &&
(identical(other.serialNumber, serialNumber) ||
other.serialNumber == serialNumber) &&
(identical(other.barcode, barcode) || other.barcode == barcode) &&
@@ -513,35 +480,32 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
(identical(other.companyName, companyName) ||
other.companyName == companyName) &&
(identical(other.warehouseName, warehouseName) ||
other.warehouseName == warehouseName));
other.warehouseName == warehouseName) &&
(identical(other.model, model) || other.model == model));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([
runtimeType,
id,
equipmentNumber,
category1,
category2,
category3,
manufacturer,
modelName,
serialNumber,
barcode,
purchaseDate,
purchasePrice,
status,
companyId,
warehouseLocationId,
lastInspectionDate,
nextInspectionDate,
remark,
createdAt,
updatedAt,
companyName,
warehouseName
]);
int get hashCode => Object.hash(
runtimeType,
id,
equipmentNumber,
modelsId,
serialNumber,
barcode,
purchaseDate,
purchasePrice,
status,
companyId,
warehouseLocationId,
lastInspectionDate,
nextInspectionDate,
remark,
createdAt,
updatedAt,
companyName,
warehouseName,
model);
/// Create a copy of EquipmentResponse
/// with the given fields replaced by the non-null parameter values.
@@ -564,11 +528,7 @@ abstract class _EquipmentResponse implements EquipmentResponse {
const factory _EquipmentResponse(
{required final int id,
@JsonKey(name: 'equipment_number') required final String equipmentNumber,
final String? category1,
final String? category2,
final String? category3,
required final String manufacturer,
@JsonKey(name: 'model_name') final String? modelName,
@JsonKey(name: 'models_id') final int? modelsId,
@JsonKey(name: 'serial_number') final String? serialNumber,
final String? barcode,
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
@@ -582,8 +542,8 @@ 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: 'warehouse_name')
final String? warehouseName}) = _$EquipmentResponseImpl;
@JsonKey(name: 'warehouse_name') final String? warehouseName,
final ModelDto? model}) = _$EquipmentResponseImpl;
factory _EquipmentResponse.fromJson(Map<String, dynamic> json) =
_$EquipmentResponseImpl.fromJson;
@@ -592,18 +552,11 @@ abstract class _EquipmentResponse implements EquipmentResponse {
int get id;
@override
@JsonKey(name: 'equipment_number')
String get equipmentNumber;
String
get equipmentNumber; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model
@override
String? get category1;
@override
String? get category2;
@override
String? get category3;
@override
String get manufacturer;
@override
@JsonKey(name: 'model_name')
String? get modelName;
@JsonKey(name: 'models_id')
int? get modelsId;
@override
@JsonKey(name: 'serial_number')
String? get serialNumber;
@@ -643,7 +596,10 @@ abstract class _EquipmentResponse implements EquipmentResponse {
String? get companyName;
@override
@JsonKey(name: 'warehouse_name')
String? get warehouseName;
String?
get warehouseName; // Sprint 3: Added model relationship (includes vendor info)
@override
ModelDto? get model;
/// Create a copy of EquipmentResponse
/// with the given fields replaced by the non-null parameter values.

View File

@@ -11,11 +11,7 @@ _$EquipmentResponseImpl _$$EquipmentResponseImplFromJson(
_$EquipmentResponseImpl(
id: (json['id'] as num).toInt(),
equipmentNumber: json['equipment_number'] as String,
category1: json['category1'] as String?,
category2: json['category2'] as String?,
category3: json['category3'] as String?,
manufacturer: json['manufacturer'] as String,
modelName: json['model_name'] as String?,
modelsId: (json['models_id'] as num?)?.toInt(),
serialNumber: json['serial_number'] as String?,
barcode: json['barcode'] as String?,
purchaseDate: json['purchase_date'] == null
@@ -37,6 +33,9 @@ _$EquipmentResponseImpl _$$EquipmentResponseImplFromJson(
updatedAt: DateTime.parse(json['updated_at'] as String),
companyName: json['company_name'] as String?,
warehouseName: json['warehouse_name'] as String?,
model: json['model'] == null
? null
: ModelDto.fromJson(json['model'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$EquipmentResponseImplToJson(
@@ -44,11 +43,7 @@ Map<String, dynamic> _$$EquipmentResponseImplToJson(
<String, dynamic>{
'id': instance.id,
'equipment_number': instance.equipmentNumber,
'category1': instance.category1,
'category2': instance.category2,
'category3': instance.category3,
'manufacturer': instance.manufacturer,
'model_name': instance.modelName,
'models_id': instance.modelsId,
'serial_number': instance.serialNumber,
'barcode': instance.barcode,
'purchase_date': instance.purchaseDate?.toIso8601String(),
@@ -63,4 +58,5 @@ Map<String, dynamic> _$$EquipmentResponseImplToJson(
'updated_at': instance.updatedAt.toIso8601String(),
'company_name': instance.companyName,
'warehouse_name': instance.warehouseName,
'model': instance.model,
};