test: 통합 테스트 오류 및 경고 수정
- 모든 서비스 메서드 시그니처를 실제 구현에 맞게 수정 - TestDataGenerator 제거하고 직접 객체 생성으로 변경 - 모델 필드명 및 타입 불일치 수정 - 불필요한 Either 패턴 사용 제거 - null safety 관련 이슈 해결 수정된 파일: - test/integration/screens/company_integration_test.dart - test/integration/screens/equipment_integration_test.dart - test/integration/screens/user_integration_test.dart - test/integration/screens/login_integration_test.dart
This commit is contained in:
34
lib/data/models/equipment/equipment_dto.dart
Normal file
34
lib/data/models/equipment/equipment_dto.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'equipment_dto.freezed.dart';
|
||||
part 'equipment_dto.g.dart';
|
||||
|
||||
@freezed
|
||||
class EquipmentDto with _$EquipmentDto {
|
||||
const factory EquipmentDto({
|
||||
required int id,
|
||||
@JsonKey(name: 'serial_number') required String serialNumber,
|
||||
required String name,
|
||||
String? category,
|
||||
String? manufacturer,
|
||||
String? model,
|
||||
required String status,
|
||||
@JsonKey(name: 'company_id') required int companyId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
||||
@JsonKey(name: 'purchase_date') String? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'current_value') double? currentValue,
|
||||
@JsonKey(name: 'warranty_expiry') String? warrantyExpiry,
|
||||
@JsonKey(name: 'last_maintenance_date') String? lastMaintenanceDate,
|
||||
@JsonKey(name: 'next_maintenance_date') String? nextMaintenanceDate,
|
||||
Map<String, dynamic>? specifications,
|
||||
String? notes,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
}) = _EquipmentDto;
|
||||
|
||||
factory EquipmentDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$EquipmentDtoFromJson(json);
|
||||
}
|
||||
657
lib/data/models/equipment/equipment_dto.freezed.dart
Normal file
657
lib/data/models/equipment/equipment_dto.freezed.dart
Normal file
@@ -0,0 +1,657 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'equipment_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
EquipmentDto _$EquipmentDtoFromJson(Map<String, dynamic> json) {
|
||||
return _EquipmentDto.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$EquipmentDto {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'serial_number')
|
||||
String get serialNumber => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String? get category => throw _privateConstructorUsedError;
|
||||
String? get manufacturer => throw _privateConstructorUsedError;
|
||||
String? get model => throw _privateConstructorUsedError;
|
||||
String get status => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_id')
|
||||
int get companyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String? get warehouseName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_date')
|
||||
String? get purchaseDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_price')
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current_value')
|
||||
double? get currentValue => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warranty_expiry')
|
||||
String? get warrantyExpiry => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'last_maintenance_date')
|
||||
String? get lastMaintenanceDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'next_maintenance_date')
|
||||
String? get nextMaintenanceDate => throw _privateConstructorUsedError;
|
||||
Map<String, dynamic>? get specifications =>
|
||||
throw _privateConstructorUsedError;
|
||||
String? get notes => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime? get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'updated_at')
|
||||
DateTime? get updatedAt => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of EquipmentDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$EquipmentDtoCopyWith<EquipmentDto> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $EquipmentDtoCopyWith<$Res> {
|
||||
factory $EquipmentDtoCopyWith(
|
||||
EquipmentDto value, $Res Function(EquipmentDto) then) =
|
||||
_$EquipmentDtoCopyWithImpl<$Res, EquipmentDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'serial_number') String serialNumber,
|
||||
String name,
|
||||
String? category,
|
||||
String? manufacturer,
|
||||
String? model,
|
||||
String status,
|
||||
@JsonKey(name: 'company_id') int companyId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
||||
@JsonKey(name: 'purchase_date') String? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'current_value') double? currentValue,
|
||||
@JsonKey(name: 'warranty_expiry') String? warrantyExpiry,
|
||||
@JsonKey(name: 'last_maintenance_date') String? lastMaintenanceDate,
|
||||
@JsonKey(name: 'next_maintenance_date') String? nextMaintenanceDate,
|
||||
Map<String, dynamic>? specifications,
|
||||
String? notes,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$EquipmentDtoCopyWithImpl<$Res, $Val extends EquipmentDto>
|
||||
implements $EquipmentDtoCopyWith<$Res> {
|
||||
_$EquipmentDtoCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of EquipmentDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? serialNumber = null,
|
||||
Object? name = null,
|
||||
Object? category = freezed,
|
||||
Object? manufacturer = freezed,
|
||||
Object? model = freezed,
|
||||
Object? status = null,
|
||||
Object? companyId = null,
|
||||
Object? companyName = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? currentValue = freezed,
|
||||
Object? warrantyExpiry = freezed,
|
||||
Object? lastMaintenanceDate = freezed,
|
||||
Object? nextMaintenanceDate = freezed,
|
||||
Object? specifications = freezed,
|
||||
Object? notes = freezed,
|
||||
Object? createdAt = freezed,
|
||||
Object? updatedAt = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
serialNumber: null == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
category: freezed == category
|
||||
? _value.category
|
||||
: category // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
manufacturer: freezed == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
model: freezed == model
|
||||
? _value.model
|
||||
: model // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
status: null == status
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
companyId: null == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
currentValue: freezed == currentValue
|
||||
? _value.currentValue
|
||||
: currentValue // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
warrantyExpiry: freezed == warrantyExpiry
|
||||
? _value.warrantyExpiry
|
||||
: warrantyExpiry // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
lastMaintenanceDate: freezed == lastMaintenanceDate
|
||||
? _value.lastMaintenanceDate
|
||||
: lastMaintenanceDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
nextMaintenanceDate: freezed == nextMaintenanceDate
|
||||
? _value.nextMaintenanceDate
|
||||
: nextMaintenanceDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
specifications: freezed == specifications
|
||||
? _value.specifications
|
||||
: specifications // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,
|
||||
notes: freezed == notes
|
||||
? _value.notes
|
||||
: notes // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
createdAt: freezed == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
updatedAt: freezed == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$EquipmentDtoImplCopyWith<$Res>
|
||||
implements $EquipmentDtoCopyWith<$Res> {
|
||||
factory _$$EquipmentDtoImplCopyWith(
|
||||
_$EquipmentDtoImpl value, $Res Function(_$EquipmentDtoImpl) then) =
|
||||
__$$EquipmentDtoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'serial_number') String serialNumber,
|
||||
String name,
|
||||
String? category,
|
||||
String? manufacturer,
|
||||
String? model,
|
||||
String status,
|
||||
@JsonKey(name: 'company_id') int companyId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
||||
@JsonKey(name: 'purchase_date') String? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'current_value') double? currentValue,
|
||||
@JsonKey(name: 'warranty_expiry') String? warrantyExpiry,
|
||||
@JsonKey(name: 'last_maintenance_date') String? lastMaintenanceDate,
|
||||
@JsonKey(name: 'next_maintenance_date') String? nextMaintenanceDate,
|
||||
Map<String, dynamic>? specifications,
|
||||
String? notes,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$EquipmentDtoImplCopyWithImpl<$Res>
|
||||
extends _$EquipmentDtoCopyWithImpl<$Res, _$EquipmentDtoImpl>
|
||||
implements _$$EquipmentDtoImplCopyWith<$Res> {
|
||||
__$$EquipmentDtoImplCopyWithImpl(
|
||||
_$EquipmentDtoImpl _value, $Res Function(_$EquipmentDtoImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of EquipmentDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? serialNumber = null,
|
||||
Object? name = null,
|
||||
Object? category = freezed,
|
||||
Object? manufacturer = freezed,
|
||||
Object? model = freezed,
|
||||
Object? status = null,
|
||||
Object? companyId = null,
|
||||
Object? companyName = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? currentValue = freezed,
|
||||
Object? warrantyExpiry = freezed,
|
||||
Object? lastMaintenanceDate = freezed,
|
||||
Object? nextMaintenanceDate = freezed,
|
||||
Object? specifications = freezed,
|
||||
Object? notes = freezed,
|
||||
Object? createdAt = freezed,
|
||||
Object? updatedAt = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentDtoImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
serialNumber: null == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
category: freezed == category
|
||||
? _value.category
|
||||
: category // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
manufacturer: freezed == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
model: freezed == model
|
||||
? _value.model
|
||||
: model // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
status: null == status
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
companyId: null == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
currentValue: freezed == currentValue
|
||||
? _value.currentValue
|
||||
: currentValue // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
warrantyExpiry: freezed == warrantyExpiry
|
||||
? _value.warrantyExpiry
|
||||
: warrantyExpiry // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
lastMaintenanceDate: freezed == lastMaintenanceDate
|
||||
? _value.lastMaintenanceDate
|
||||
: lastMaintenanceDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
nextMaintenanceDate: freezed == nextMaintenanceDate
|
||||
? _value.nextMaintenanceDate
|
||||
: nextMaintenanceDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
specifications: freezed == specifications
|
||||
? _value._specifications
|
||||
: specifications // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,
|
||||
notes: freezed == notes
|
||||
? _value.notes
|
||||
: notes // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
createdAt: freezed == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
updatedAt: freezed == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$EquipmentDtoImpl implements _EquipmentDto {
|
||||
const _$EquipmentDtoImpl(
|
||||
{required this.id,
|
||||
@JsonKey(name: 'serial_number') required this.serialNumber,
|
||||
required this.name,
|
||||
this.category,
|
||||
this.manufacturer,
|
||||
this.model,
|
||||
required this.status,
|
||||
@JsonKey(name: 'company_id') required this.companyId,
|
||||
@JsonKey(name: 'company_name') this.companyName,
|
||||
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
|
||||
@JsonKey(name: 'warehouse_name') this.warehouseName,
|
||||
@JsonKey(name: 'purchase_date') this.purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
||||
@JsonKey(name: 'current_value') this.currentValue,
|
||||
@JsonKey(name: 'warranty_expiry') this.warrantyExpiry,
|
||||
@JsonKey(name: 'last_maintenance_date') this.lastMaintenanceDate,
|
||||
@JsonKey(name: 'next_maintenance_date') this.nextMaintenanceDate,
|
||||
final Map<String, dynamic>? specifications,
|
||||
this.notes,
|
||||
@JsonKey(name: 'created_at') this.createdAt,
|
||||
@JsonKey(name: 'updated_at') this.updatedAt})
|
||||
: _specifications = specifications;
|
||||
|
||||
factory _$EquipmentDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$EquipmentDtoImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: 'serial_number')
|
||||
final String serialNumber;
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final String? category;
|
||||
@override
|
||||
final String? manufacturer;
|
||||
@override
|
||||
final String? model;
|
||||
@override
|
||||
final String status;
|
||||
@override
|
||||
@JsonKey(name: 'company_id')
|
||||
final int companyId;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
final String? companyName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
final int? warehouseLocationId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
final String? warehouseName;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
final String? purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
final double? purchasePrice;
|
||||
@override
|
||||
@JsonKey(name: 'current_value')
|
||||
final double? currentValue;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_expiry')
|
||||
final String? warrantyExpiry;
|
||||
@override
|
||||
@JsonKey(name: 'last_maintenance_date')
|
||||
final String? lastMaintenanceDate;
|
||||
@override
|
||||
@JsonKey(name: 'next_maintenance_date')
|
||||
final String? nextMaintenanceDate;
|
||||
final Map<String, dynamic>? _specifications;
|
||||
@override
|
||||
Map<String, dynamic>? get specifications {
|
||||
final value = _specifications;
|
||||
if (value == null) return null;
|
||||
if (_specifications is EqualUnmodifiableMapView) return _specifications;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableMapView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
final String? notes;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
final DateTime? createdAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
final DateTime? updatedAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentDto(id: $id, serialNumber: $serialNumber, name: $name, category: $category, manufacturer: $manufacturer, model: $model, status: $status, companyId: $companyId, companyName: $companyName, warehouseLocationId: $warehouseLocationId, warehouseName: $warehouseName, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, currentValue: $currentValue, warrantyExpiry: $warrantyExpiry, lastMaintenanceDate: $lastMaintenanceDate, nextMaintenanceDate: $nextMaintenanceDate, specifications: $specifications, notes: $notes, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$EquipmentDtoImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.serialNumber, serialNumber) ||
|
||||
other.serialNumber == serialNumber) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.category, category) ||
|
||||
other.category == category) &&
|
||||
(identical(other.manufacturer, manufacturer) ||
|
||||
other.manufacturer == manufacturer) &&
|
||||
(identical(other.model, model) || other.model == model) &&
|
||||
(identical(other.status, status) || other.status == status) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.warehouseName, warehouseName) ||
|
||||
other.warehouseName == warehouseName) &&
|
||||
(identical(other.purchaseDate, purchaseDate) ||
|
||||
other.purchaseDate == purchaseDate) &&
|
||||
(identical(other.purchasePrice, purchasePrice) ||
|
||||
other.purchasePrice == purchasePrice) &&
|
||||
(identical(other.currentValue, currentValue) ||
|
||||
other.currentValue == currentValue) &&
|
||||
(identical(other.warrantyExpiry, warrantyExpiry) ||
|
||||
other.warrantyExpiry == warrantyExpiry) &&
|
||||
(identical(other.lastMaintenanceDate, lastMaintenanceDate) ||
|
||||
other.lastMaintenanceDate == lastMaintenanceDate) &&
|
||||
(identical(other.nextMaintenanceDate, nextMaintenanceDate) ||
|
||||
other.nextMaintenanceDate == nextMaintenanceDate) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._specifications, _specifications) &&
|
||||
(identical(other.notes, notes) || other.notes == notes) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([
|
||||
runtimeType,
|
||||
id,
|
||||
serialNumber,
|
||||
name,
|
||||
category,
|
||||
manufacturer,
|
||||
model,
|
||||
status,
|
||||
companyId,
|
||||
companyName,
|
||||
warehouseLocationId,
|
||||
warehouseName,
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
currentValue,
|
||||
warrantyExpiry,
|
||||
lastMaintenanceDate,
|
||||
nextMaintenanceDate,
|
||||
const DeepCollectionEquality().hash(_specifications),
|
||||
notes,
|
||||
createdAt,
|
||||
updatedAt
|
||||
]);
|
||||
|
||||
/// Create a copy of EquipmentDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$EquipmentDtoImplCopyWith<_$EquipmentDtoImpl> get copyWith =>
|
||||
__$$EquipmentDtoImplCopyWithImpl<_$EquipmentDtoImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$EquipmentDtoImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _EquipmentDto implements EquipmentDto {
|
||||
const factory _EquipmentDto(
|
||||
{required final int id,
|
||||
@JsonKey(name: 'serial_number') required final String serialNumber,
|
||||
required final String name,
|
||||
final String? category,
|
||||
final String? manufacturer,
|
||||
final String? model,
|
||||
required final String status,
|
||||
@JsonKey(name: 'company_id') required final int companyId,
|
||||
@JsonKey(name: 'company_name') final String? companyName,
|
||||
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
|
||||
@JsonKey(name: 'warehouse_name') final String? warehouseName,
|
||||
@JsonKey(name: 'purchase_date') final String? purchaseDate,
|
||||
@JsonKey(name: 'purchase_price') final double? purchasePrice,
|
||||
@JsonKey(name: 'current_value') final double? currentValue,
|
||||
@JsonKey(name: 'warranty_expiry') final String? warrantyExpiry,
|
||||
@JsonKey(name: 'last_maintenance_date') final String? lastMaintenanceDate,
|
||||
@JsonKey(name: 'next_maintenance_date') final String? nextMaintenanceDate,
|
||||
final Map<String, dynamic>? specifications,
|
||||
final String? notes,
|
||||
@JsonKey(name: 'created_at') final DateTime? createdAt,
|
||||
@JsonKey(name: 'updated_at')
|
||||
final DateTime? updatedAt}) = _$EquipmentDtoImpl;
|
||||
|
||||
factory _EquipmentDto.fromJson(Map<String, dynamic> json) =
|
||||
_$EquipmentDtoImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: 'serial_number')
|
||||
String get serialNumber;
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
String? get category;
|
||||
@override
|
||||
String? get manufacturer;
|
||||
@override
|
||||
String? get model;
|
||||
@override
|
||||
String get status;
|
||||
@override
|
||||
@JsonKey(name: 'company_id')
|
||||
int get companyId;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String? get warehouseName;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
String? get purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
double? get purchasePrice;
|
||||
@override
|
||||
@JsonKey(name: 'current_value')
|
||||
double? get currentValue;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_expiry')
|
||||
String? get warrantyExpiry;
|
||||
@override
|
||||
@JsonKey(name: 'last_maintenance_date')
|
||||
String? get lastMaintenanceDate;
|
||||
@override
|
||||
@JsonKey(name: 'next_maintenance_date')
|
||||
String? get nextMaintenanceDate;
|
||||
@override
|
||||
Map<String, dynamic>? get specifications;
|
||||
@override
|
||||
String? get notes;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime? get createdAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
DateTime? get updatedAt;
|
||||
|
||||
/// Create a copy of EquipmentDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$EquipmentDtoImplCopyWith<_$EquipmentDtoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
61
lib/data/models/equipment/equipment_dto.g.dart
Normal file
61
lib/data/models/equipment/equipment_dto.g.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'equipment_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$EquipmentDtoImpl _$$EquipmentDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$EquipmentDtoImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
serialNumber: json['serial_number'] as String,
|
||||
name: json['name'] as String,
|
||||
category: json['category'] as String?,
|
||||
manufacturer: json['manufacturer'] as String?,
|
||||
model: json['model'] as String?,
|
||||
status: json['status'] as String,
|
||||
companyId: (json['company_id'] as num).toInt(),
|
||||
companyName: json['company_name'] as String?,
|
||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
||||
warehouseName: json['warehouse_name'] as String?,
|
||||
purchaseDate: json['purchase_date'] as String?,
|
||||
purchasePrice: (json['purchase_price'] as num?)?.toDouble(),
|
||||
currentValue: (json['current_value'] as num?)?.toDouble(),
|
||||
warrantyExpiry: json['warranty_expiry'] as String?,
|
||||
lastMaintenanceDate: json['last_maintenance_date'] as String?,
|
||||
nextMaintenanceDate: json['next_maintenance_date'] as String?,
|
||||
specifications: json['specifications'] as Map<String, dynamic>?,
|
||||
notes: json['notes'] as String?,
|
||||
createdAt: json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$EquipmentDtoImplToJson(_$EquipmentDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'serial_number': instance.serialNumber,
|
||||
'name': instance.name,
|
||||
'category': instance.category,
|
||||
'manufacturer': instance.manufacturer,
|
||||
'model': instance.model,
|
||||
'status': instance.status,
|
||||
'company_id': instance.companyId,
|
||||
'company_name': instance.companyName,
|
||||
'warehouse_location_id': instance.warehouseLocationId,
|
||||
'warehouse_name': instance.warehouseName,
|
||||
'purchase_date': instance.purchaseDate,
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'current_value': instance.currentValue,
|
||||
'warranty_expiry': instance.warrantyExpiry,
|
||||
'last_maintenance_date': instance.lastMaintenanceDate,
|
||||
'next_maintenance_date': instance.nextMaintenanceDate,
|
||||
'specifications': instance.specifications,
|
||||
'notes': instance.notes,
|
||||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
};
|
||||
Reference in New Issue
Block a user