diff --git a/lib/data/models/equipment/equipment_in_request.dart b/lib/data/models/equipment/equipment_in_request.dart deleted file mode 100644 index 869b13e..0000000 --- a/lib/data/models/equipment/equipment_in_request.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'equipment_in_request.freezed.dart'; -part 'equipment_in_request.g.dart'; - -@freezed -class EquipmentInRequest with _$EquipmentInRequest { - const factory EquipmentInRequest({ - required int equipmentId, - required int quantity, - int? warehouseLocationId, - String? notes, - }) = _EquipmentInRequest; - - factory EquipmentInRequest.fromJson(Map json) => - _$EquipmentInRequestFromJson(json); -} \ No newline at end of file diff --git a/lib/data/models/equipment/equipment_in_request.freezed.dart b/lib/data/models/equipment/equipment_in_request.freezed.dart deleted file mode 100644 index 23afbfe..0000000 --- a/lib/data/models/equipment/equipment_in_request.freezed.dart +++ /dev/null @@ -1,227 +0,0 @@ -// 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_in_request.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(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'); - -EquipmentInRequest _$EquipmentInRequestFromJson(Map json) { - return _EquipmentInRequest.fromJson(json); -} - -/// @nodoc -mixin _$EquipmentInRequest { - int get equipmentId => throw _privateConstructorUsedError; - int get quantity => throw _privateConstructorUsedError; - int? get warehouseLocationId => throw _privateConstructorUsedError; - String? get notes => throw _privateConstructorUsedError; - - /// Serializes this EquipmentInRequest to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EquipmentInRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EquipmentInRequestCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EquipmentInRequestCopyWith<$Res> { - factory $EquipmentInRequestCopyWith( - EquipmentInRequest value, $Res Function(EquipmentInRequest) then) = - _$EquipmentInRequestCopyWithImpl<$Res, EquipmentInRequest>; - @useResult - $Res call( - {int equipmentId, int quantity, int? warehouseLocationId, String? notes}); -} - -/// @nodoc -class _$EquipmentInRequestCopyWithImpl<$Res, $Val extends EquipmentInRequest> - implements $EquipmentInRequestCopyWith<$Res> { - _$EquipmentInRequestCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EquipmentInRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? equipmentId = null, - Object? quantity = null, - Object? warehouseLocationId = freezed, - Object? notes = freezed, - }) { - return _then(_value.copyWith( - equipmentId: null == equipmentId - ? _value.equipmentId - : equipmentId // ignore: cast_nullable_to_non_nullable - as int, - quantity: null == quantity - ? _value.quantity - : quantity // ignore: cast_nullable_to_non_nullable - as int, - warehouseLocationId: freezed == warehouseLocationId - ? _value.warehouseLocationId - : warehouseLocationId // ignore: cast_nullable_to_non_nullable - as int?, - notes: freezed == notes - ? _value.notes - : notes // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$EquipmentInRequestImplCopyWith<$Res> - implements $EquipmentInRequestCopyWith<$Res> { - factory _$$EquipmentInRequestImplCopyWith(_$EquipmentInRequestImpl value, - $Res Function(_$EquipmentInRequestImpl) then) = - __$$EquipmentInRequestImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {int equipmentId, int quantity, int? warehouseLocationId, String? notes}); -} - -/// @nodoc -class __$$EquipmentInRequestImplCopyWithImpl<$Res> - extends _$EquipmentInRequestCopyWithImpl<$Res, _$EquipmentInRequestImpl> - implements _$$EquipmentInRequestImplCopyWith<$Res> { - __$$EquipmentInRequestImplCopyWithImpl(_$EquipmentInRequestImpl _value, - $Res Function(_$EquipmentInRequestImpl) _then) - : super(_value, _then); - - /// Create a copy of EquipmentInRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? equipmentId = null, - Object? quantity = null, - Object? warehouseLocationId = freezed, - Object? notes = freezed, - }) { - return _then(_$EquipmentInRequestImpl( - equipmentId: null == equipmentId - ? _value.equipmentId - : equipmentId // ignore: cast_nullable_to_non_nullable - as int, - quantity: null == quantity - ? _value.quantity - : quantity // ignore: cast_nullable_to_non_nullable - as int, - warehouseLocationId: freezed == warehouseLocationId - ? _value.warehouseLocationId - : warehouseLocationId // ignore: cast_nullable_to_non_nullable - as int?, - notes: freezed == notes - ? _value.notes - : notes // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EquipmentInRequestImpl implements _EquipmentInRequest { - const _$EquipmentInRequestImpl( - {required this.equipmentId, - required this.quantity, - this.warehouseLocationId, - this.notes}); - - factory _$EquipmentInRequestImpl.fromJson(Map json) => - _$$EquipmentInRequestImplFromJson(json); - - @override - final int equipmentId; - @override - final int quantity; - @override - final int? warehouseLocationId; - @override - final String? notes; - - @override - String toString() { - return 'EquipmentInRequest(equipmentId: $equipmentId, quantity: $quantity, warehouseLocationId: $warehouseLocationId, notes: $notes)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EquipmentInRequestImpl && - (identical(other.equipmentId, equipmentId) || - other.equipmentId == equipmentId) && - (identical(other.quantity, quantity) || - other.quantity == quantity) && - (identical(other.warehouseLocationId, warehouseLocationId) || - other.warehouseLocationId == warehouseLocationId) && - (identical(other.notes, notes) || other.notes == notes)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, equipmentId, quantity, warehouseLocationId, notes); - - /// Create a copy of EquipmentInRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EquipmentInRequestImplCopyWith<_$EquipmentInRequestImpl> get copyWith => - __$$EquipmentInRequestImplCopyWithImpl<_$EquipmentInRequestImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$EquipmentInRequestImplToJson( - this, - ); - } -} - -abstract class _EquipmentInRequest implements EquipmentInRequest { - const factory _EquipmentInRequest( - {required final int equipmentId, - required final int quantity, - final int? warehouseLocationId, - final String? notes}) = _$EquipmentInRequestImpl; - - factory _EquipmentInRequest.fromJson(Map json) = - _$EquipmentInRequestImpl.fromJson; - - @override - int get equipmentId; - @override - int get quantity; - @override - int? get warehouseLocationId; - @override - String? get notes; - - /// Create a copy of EquipmentInRequest - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EquipmentInRequestImplCopyWith<_$EquipmentInRequestImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/lib/data/models/equipment/equipment_in_request.g.dart b/lib/data/models/equipment/equipment_in_request.g.dart deleted file mode 100644 index de1282b..0000000 --- a/lib/data/models/equipment/equipment_in_request.g.dart +++ /dev/null @@ -1,25 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'equipment_in_request.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$EquipmentInRequestImpl _$$EquipmentInRequestImplFromJson( - Map json) => - _$EquipmentInRequestImpl( - equipmentId: (json['equipmentId'] as num).toInt(), - quantity: (json['quantity'] as num).toInt(), - warehouseLocationId: (json['warehouseLocationId'] as num?)?.toInt(), - notes: json['notes'] as String?, - ); - -Map _$$EquipmentInRequestImplToJson( - _$EquipmentInRequestImpl instance) => - { - 'equipmentId': instance.equipmentId, - 'quantity': instance.quantity, - 'warehouseLocationId': instance.warehouseLocationId, - 'notes': instance.notes, - }; diff --git a/lib/data/models/equipment/equipment_io_response.dart b/lib/data/models/equipment/equipment_io_response.dart deleted file mode 100644 index a020223..0000000 --- a/lib/data/models/equipment/equipment_io_response.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'equipment_io_response.freezed.dart'; -part 'equipment_io_response.g.dart'; - -@freezed -class EquipmentIoResponse with _$EquipmentIoResponse { - const factory EquipmentIoResponse({ - required bool success, - required String message, - required int transactionId, - required int equipmentId, - required int quantity, - required String transactionType, - required DateTime transactionDate, - }) = _EquipmentIoResponse; - - factory EquipmentIoResponse.fromJson(Map json) => - _$EquipmentIoResponseFromJson(json); -} \ No newline at end of file diff --git a/lib/data/models/equipment/equipment_io_response.freezed.dart b/lib/data/models/equipment/equipment_io_response.freezed.dart deleted file mode 100644 index 7fe58f7..0000000 --- a/lib/data/models/equipment/equipment_io_response.freezed.dart +++ /dev/null @@ -1,295 +0,0 @@ -// 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_io_response.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(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'); - -EquipmentIoResponse _$EquipmentIoResponseFromJson(Map json) { - return _EquipmentIoResponse.fromJson(json); -} - -/// @nodoc -mixin _$EquipmentIoResponse { - bool get success => throw _privateConstructorUsedError; - String get message => throw _privateConstructorUsedError; - int get transactionId => throw _privateConstructorUsedError; - int get equipmentId => throw _privateConstructorUsedError; - int get quantity => throw _privateConstructorUsedError; - String get transactionType => throw _privateConstructorUsedError; - DateTime get transactionDate => throw _privateConstructorUsedError; - - /// Serializes this EquipmentIoResponse to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EquipmentIoResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EquipmentIoResponseCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EquipmentIoResponseCopyWith<$Res> { - factory $EquipmentIoResponseCopyWith( - EquipmentIoResponse value, $Res Function(EquipmentIoResponse) then) = - _$EquipmentIoResponseCopyWithImpl<$Res, EquipmentIoResponse>; - @useResult - $Res call( - {bool success, - String message, - int transactionId, - int equipmentId, - int quantity, - String transactionType, - DateTime transactionDate}); -} - -/// @nodoc -class _$EquipmentIoResponseCopyWithImpl<$Res, $Val extends EquipmentIoResponse> - implements $EquipmentIoResponseCopyWith<$Res> { - _$EquipmentIoResponseCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EquipmentIoResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? success = null, - Object? message = null, - Object? transactionId = null, - Object? equipmentId = null, - Object? quantity = null, - Object? transactionType = null, - Object? transactionDate = null, - }) { - return _then(_value.copyWith( - success: null == success - ? _value.success - : success // ignore: cast_nullable_to_non_nullable - as bool, - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - transactionId: null == transactionId - ? _value.transactionId - : transactionId // ignore: cast_nullable_to_non_nullable - as int, - equipmentId: null == equipmentId - ? _value.equipmentId - : equipmentId // ignore: cast_nullable_to_non_nullable - as int, - quantity: null == quantity - ? _value.quantity - : quantity // ignore: cast_nullable_to_non_nullable - as int, - transactionType: null == transactionType - ? _value.transactionType - : transactionType // ignore: cast_nullable_to_non_nullable - as String, - transactionDate: null == transactionDate - ? _value.transactionDate - : transactionDate // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$EquipmentIoResponseImplCopyWith<$Res> - implements $EquipmentIoResponseCopyWith<$Res> { - factory _$$EquipmentIoResponseImplCopyWith(_$EquipmentIoResponseImpl value, - $Res Function(_$EquipmentIoResponseImpl) then) = - __$$EquipmentIoResponseImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool success, - String message, - int transactionId, - int equipmentId, - int quantity, - String transactionType, - DateTime transactionDate}); -} - -/// @nodoc -class __$$EquipmentIoResponseImplCopyWithImpl<$Res> - extends _$EquipmentIoResponseCopyWithImpl<$Res, _$EquipmentIoResponseImpl> - implements _$$EquipmentIoResponseImplCopyWith<$Res> { - __$$EquipmentIoResponseImplCopyWithImpl(_$EquipmentIoResponseImpl _value, - $Res Function(_$EquipmentIoResponseImpl) _then) - : super(_value, _then); - - /// Create a copy of EquipmentIoResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? success = null, - Object? message = null, - Object? transactionId = null, - Object? equipmentId = null, - Object? quantity = null, - Object? transactionType = null, - Object? transactionDate = null, - }) { - return _then(_$EquipmentIoResponseImpl( - success: null == success - ? _value.success - : success // ignore: cast_nullable_to_non_nullable - as bool, - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - transactionId: null == transactionId - ? _value.transactionId - : transactionId // ignore: cast_nullable_to_non_nullable - as int, - equipmentId: null == equipmentId - ? _value.equipmentId - : equipmentId // ignore: cast_nullable_to_non_nullable - as int, - quantity: null == quantity - ? _value.quantity - : quantity // ignore: cast_nullable_to_non_nullable - as int, - transactionType: null == transactionType - ? _value.transactionType - : transactionType // ignore: cast_nullable_to_non_nullable - as String, - transactionDate: null == transactionDate - ? _value.transactionDate - : transactionDate // ignore: cast_nullable_to_non_nullable - as DateTime, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EquipmentIoResponseImpl implements _EquipmentIoResponse { - const _$EquipmentIoResponseImpl( - {required this.success, - required this.message, - required this.transactionId, - required this.equipmentId, - required this.quantity, - required this.transactionType, - required this.transactionDate}); - - factory _$EquipmentIoResponseImpl.fromJson(Map json) => - _$$EquipmentIoResponseImplFromJson(json); - - @override - final bool success; - @override - final String message; - @override - final int transactionId; - @override - final int equipmentId; - @override - final int quantity; - @override - final String transactionType; - @override - final DateTime transactionDate; - - @override - String toString() { - return 'EquipmentIoResponse(success: $success, message: $message, transactionId: $transactionId, equipmentId: $equipmentId, quantity: $quantity, transactionType: $transactionType, transactionDate: $transactionDate)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EquipmentIoResponseImpl && - (identical(other.success, success) || other.success == success) && - (identical(other.message, message) || other.message == message) && - (identical(other.transactionId, transactionId) || - other.transactionId == transactionId) && - (identical(other.equipmentId, equipmentId) || - other.equipmentId == equipmentId) && - (identical(other.quantity, quantity) || - other.quantity == quantity) && - (identical(other.transactionType, transactionType) || - other.transactionType == transactionType) && - (identical(other.transactionDate, transactionDate) || - other.transactionDate == transactionDate)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, success, message, transactionId, - equipmentId, quantity, transactionType, transactionDate); - - /// Create a copy of EquipmentIoResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EquipmentIoResponseImplCopyWith<_$EquipmentIoResponseImpl> get copyWith => - __$$EquipmentIoResponseImplCopyWithImpl<_$EquipmentIoResponseImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$EquipmentIoResponseImplToJson( - this, - ); - } -} - -abstract class _EquipmentIoResponse implements EquipmentIoResponse { - const factory _EquipmentIoResponse( - {required final bool success, - required final String message, - required final int transactionId, - required final int equipmentId, - required final int quantity, - required final String transactionType, - required final DateTime transactionDate}) = _$EquipmentIoResponseImpl; - - factory _EquipmentIoResponse.fromJson(Map json) = - _$EquipmentIoResponseImpl.fromJson; - - @override - bool get success; - @override - String get message; - @override - int get transactionId; - @override - int get equipmentId; - @override - int get quantity; - @override - String get transactionType; - @override - DateTime get transactionDate; - - /// Create a copy of EquipmentIoResponse - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EquipmentIoResponseImplCopyWith<_$EquipmentIoResponseImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/lib/data/models/equipment/equipment_io_response.g.dart b/lib/data/models/equipment/equipment_io_response.g.dart deleted file mode 100644 index c42599e..0000000 --- a/lib/data/models/equipment/equipment_io_response.g.dart +++ /dev/null @@ -1,31 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'equipment_io_response.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$EquipmentIoResponseImpl _$$EquipmentIoResponseImplFromJson( - Map json) => - _$EquipmentIoResponseImpl( - success: json['success'] as bool, - message: json['message'] as String, - transactionId: (json['transactionId'] as num).toInt(), - equipmentId: (json['equipmentId'] as num).toInt(), - quantity: (json['quantity'] as num).toInt(), - transactionType: json['transactionType'] as String, - transactionDate: DateTime.parse(json['transactionDate'] as String), - ); - -Map _$$EquipmentIoResponseImplToJson( - _$EquipmentIoResponseImpl instance) => - { - 'success': instance.success, - 'message': instance.message, - 'transactionId': instance.transactionId, - 'equipmentId': instance.equipmentId, - 'quantity': instance.quantity, - 'transactionType': instance.transactionType, - 'transactionDate': instance.transactionDate.toIso8601String(), - }; diff --git a/lib/data/models/equipment/equipment_out_request.dart b/lib/data/models/equipment/equipment_out_request.dart deleted file mode 100644 index bee6c31..0000000 --- a/lib/data/models/equipment/equipment_out_request.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'equipment_out_request.freezed.dart'; -part 'equipment_out_request.g.dart'; - -@freezed -class EquipmentOutRequest with _$EquipmentOutRequest { - const factory EquipmentOutRequest({ - required int equipmentId, - required int quantity, - required int companyId, - String? notes, - }) = _EquipmentOutRequest; - - factory EquipmentOutRequest.fromJson(Map json) => - _$EquipmentOutRequestFromJson(json); -} \ No newline at end of file diff --git a/lib/data/models/equipment/equipment_out_request.freezed.dart b/lib/data/models/equipment/equipment_out_request.freezed.dart deleted file mode 100644 index a066e97..0000000 --- a/lib/data/models/equipment/equipment_out_request.freezed.dart +++ /dev/null @@ -1,225 +0,0 @@ -// 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_out_request.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(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'); - -EquipmentOutRequest _$EquipmentOutRequestFromJson(Map json) { - return _EquipmentOutRequest.fromJson(json); -} - -/// @nodoc -mixin _$EquipmentOutRequest { - int get equipmentId => throw _privateConstructorUsedError; - int get quantity => throw _privateConstructorUsedError; - int get companyId => throw _privateConstructorUsedError; - String? get notes => throw _privateConstructorUsedError; - - /// Serializes this EquipmentOutRequest to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EquipmentOutRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EquipmentOutRequestCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EquipmentOutRequestCopyWith<$Res> { - factory $EquipmentOutRequestCopyWith( - EquipmentOutRequest value, $Res Function(EquipmentOutRequest) then) = - _$EquipmentOutRequestCopyWithImpl<$Res, EquipmentOutRequest>; - @useResult - $Res call({int equipmentId, int quantity, int companyId, String? notes}); -} - -/// @nodoc -class _$EquipmentOutRequestCopyWithImpl<$Res, $Val extends EquipmentOutRequest> - implements $EquipmentOutRequestCopyWith<$Res> { - _$EquipmentOutRequestCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EquipmentOutRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? equipmentId = null, - Object? quantity = null, - Object? companyId = null, - Object? notes = freezed, - }) { - return _then(_value.copyWith( - equipmentId: null == equipmentId - ? _value.equipmentId - : equipmentId // ignore: cast_nullable_to_non_nullable - as int, - quantity: null == quantity - ? _value.quantity - : quantity // ignore: cast_nullable_to_non_nullable - as int, - companyId: null == companyId - ? _value.companyId - : companyId // ignore: cast_nullable_to_non_nullable - as int, - notes: freezed == notes - ? _value.notes - : notes // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$EquipmentOutRequestImplCopyWith<$Res> - implements $EquipmentOutRequestCopyWith<$Res> { - factory _$$EquipmentOutRequestImplCopyWith(_$EquipmentOutRequestImpl value, - $Res Function(_$EquipmentOutRequestImpl) then) = - __$$EquipmentOutRequestImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int equipmentId, int quantity, int companyId, String? notes}); -} - -/// @nodoc -class __$$EquipmentOutRequestImplCopyWithImpl<$Res> - extends _$EquipmentOutRequestCopyWithImpl<$Res, _$EquipmentOutRequestImpl> - implements _$$EquipmentOutRequestImplCopyWith<$Res> { - __$$EquipmentOutRequestImplCopyWithImpl(_$EquipmentOutRequestImpl _value, - $Res Function(_$EquipmentOutRequestImpl) _then) - : super(_value, _then); - - /// Create a copy of EquipmentOutRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? equipmentId = null, - Object? quantity = null, - Object? companyId = null, - Object? notes = freezed, - }) { - return _then(_$EquipmentOutRequestImpl( - equipmentId: null == equipmentId - ? _value.equipmentId - : equipmentId // ignore: cast_nullable_to_non_nullable - as int, - quantity: null == quantity - ? _value.quantity - : quantity // ignore: cast_nullable_to_non_nullable - as int, - companyId: null == companyId - ? _value.companyId - : companyId // ignore: cast_nullable_to_non_nullable - as int, - notes: freezed == notes - ? _value.notes - : notes // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EquipmentOutRequestImpl implements _EquipmentOutRequest { - const _$EquipmentOutRequestImpl( - {required this.equipmentId, - required this.quantity, - required this.companyId, - this.notes}); - - factory _$EquipmentOutRequestImpl.fromJson(Map json) => - _$$EquipmentOutRequestImplFromJson(json); - - @override - final int equipmentId; - @override - final int quantity; - @override - final int companyId; - @override - final String? notes; - - @override - String toString() { - return 'EquipmentOutRequest(equipmentId: $equipmentId, quantity: $quantity, companyId: $companyId, notes: $notes)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EquipmentOutRequestImpl && - (identical(other.equipmentId, equipmentId) || - other.equipmentId == equipmentId) && - (identical(other.quantity, quantity) || - other.quantity == quantity) && - (identical(other.companyId, companyId) || - other.companyId == companyId) && - (identical(other.notes, notes) || other.notes == notes)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, equipmentId, quantity, companyId, notes); - - /// Create a copy of EquipmentOutRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EquipmentOutRequestImplCopyWith<_$EquipmentOutRequestImpl> get copyWith => - __$$EquipmentOutRequestImplCopyWithImpl<_$EquipmentOutRequestImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$EquipmentOutRequestImplToJson( - this, - ); - } -} - -abstract class _EquipmentOutRequest implements EquipmentOutRequest { - const factory _EquipmentOutRequest( - {required final int equipmentId, - required final int quantity, - required final int companyId, - final String? notes}) = _$EquipmentOutRequestImpl; - - factory _EquipmentOutRequest.fromJson(Map json) = - _$EquipmentOutRequestImpl.fromJson; - - @override - int get equipmentId; - @override - int get quantity; - @override - int get companyId; - @override - String? get notes; - - /// Create a copy of EquipmentOutRequest - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EquipmentOutRequestImplCopyWith<_$EquipmentOutRequestImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/lib/data/models/equipment/equipment_out_request.g.dart b/lib/data/models/equipment/equipment_out_request.g.dart deleted file mode 100644 index e089914..0000000 --- a/lib/data/models/equipment/equipment_out_request.g.dart +++ /dev/null @@ -1,25 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'equipment_out_request.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$EquipmentOutRequestImpl _$$EquipmentOutRequestImplFromJson( - Map json) => - _$EquipmentOutRequestImpl( - equipmentId: (json['equipmentId'] as num).toInt(), - quantity: (json['quantity'] as num).toInt(), - companyId: (json['companyId'] as num).toInt(), - notes: json['notes'] as String?, - ); - -Map _$$EquipmentOutRequestImplToJson( - _$EquipmentOutRequestImpl instance) => - { - 'equipmentId': instance.equipmentId, - 'quantity': instance.quantity, - 'companyId': instance.companyId, - 'notes': instance.notes, - }; diff --git a/lib/data/models/equipment/equipment_request.dart b/lib/data/models/equipment/equipment_request.dart deleted file mode 100644 index 6823e20..0000000 --- a/lib/data/models/equipment/equipment_request.dart +++ /dev/null @@ -1,81 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'equipment_request.freezed.dart'; -part 'equipment_request.g.dart'; - -/// NaiveDate 형식으로 변환하는 JsonConverter (날짜만, 시간 제외) -class NaiveDateConverter implements JsonConverter { - const NaiveDateConverter(); - - @override - DateTime? fromJson(String? json) { - return json != null ? DateTime.parse(json) : null; - } - - @override - String? toJson(DateTime? object) { - // NaiveDate 형식으로 변환: "YYYY-MM-DD" - return object?.toIso8601String().split('T')[0]; - } -} - -/// Decimal 호환성을 위한 JsonConverter -class DecimalConverter implements JsonConverter { - const DecimalConverter(); - - @override - double? fromJson(dynamic json) { - if (json == null) return null; - if (json is num) return json.toDouble(); - if (json is String) return double.tryParse(json); - return null; - } - - @override - dynamic toJson(double? object) { - // Rust Decimal과 호환을 위해 문자열로 전송 - return object?.toString(); - } -} - -@freezed -class CreateEquipmentRequest with _$CreateEquipmentRequest { - const factory CreateEquipmentRequest({ - @JsonKey(name: 'equipment_number') required String equipmentNumber, - // 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, - @JsonKey(name: 'purchase_price') @DecimalConverter() double? purchasePrice, - @JsonKey(name: 'company_id') int? companyId, - @JsonKey(name: 'warehouse_location_id') int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date') @NaiveDateConverter() DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date') @NaiveDateConverter() DateTime? nextInspectionDate, - String? remark, - }) = _CreateEquipmentRequest; - - factory CreateEquipmentRequest.fromJson(Map json) => - _$CreateEquipmentRequestFromJson(json); -} - -@freezed -class UpdateEquipmentRequest with _$UpdateEquipmentRequest { - const factory UpdateEquipmentRequest({ - // 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, - @JsonKey(name: 'purchase_price', includeIfNull: false) @DecimalConverter() double? purchasePrice, - @JsonKey(includeIfNull: false) String? status, - @JsonKey(name: 'company_id', includeIfNull: false) int? companyId, - @JsonKey(name: 'warehouse_location_id', includeIfNull: false) int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date', includeIfNull: false) @NaiveDateConverter() DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date', includeIfNull: false) @NaiveDateConverter() DateTime? nextInspectionDate, - @JsonKey(includeIfNull: false) String? remark, - }) = _UpdateEquipmentRequest; - - factory UpdateEquipmentRequest.fromJson(Map json) => - _$UpdateEquipmentRequestFromJson(json); -} \ No newline at end of file diff --git a/lib/data/models/equipment/equipment_request.freezed.dart b/lib/data/models/equipment/equipment_request.freezed.dart deleted file mode 100644 index 191c83f..0000000 --- a/lib/data/models/equipment/equipment_request.freezed.dart +++ /dev/null @@ -1,932 +0,0 @@ -// 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_request.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(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'); - -CreateEquipmentRequest _$CreateEquipmentRequestFromJson( - Map json) { - return _CreateEquipmentRequest.fromJson(json); -} - -/// @nodoc -mixin _$CreateEquipmentRequest { - @JsonKey(name: 'equipment_number') - 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; - @JsonKey(name: 'purchase_date') - @NaiveDateConverter() - DateTime? get purchaseDate => throw _privateConstructorUsedError; - @JsonKey(name: 'purchase_price') - @DecimalConverter() - double? get purchasePrice => throw _privateConstructorUsedError; - @JsonKey(name: 'company_id') - int? get companyId => throw _privateConstructorUsedError; - @JsonKey(name: 'warehouse_location_id') - int? get warehouseLocationId => throw _privateConstructorUsedError; - @JsonKey(name: 'last_inspection_date') - @NaiveDateConverter() - DateTime? get lastInspectionDate => throw _privateConstructorUsedError; - @JsonKey(name: 'next_inspection_date') - @NaiveDateConverter() - DateTime? get nextInspectionDate => throw _privateConstructorUsedError; - String? get remark => throw _privateConstructorUsedError; - - /// Serializes this CreateEquipmentRequest to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of CreateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CreateEquipmentRequestCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $CreateEquipmentRequestCopyWith<$Res> { - factory $CreateEquipmentRequestCopyWith(CreateEquipmentRequest value, - $Res Function(CreateEquipmentRequest) then) = - _$CreateEquipmentRequestCopyWithImpl<$Res, CreateEquipmentRequest>; - @useResult - $Res call( - {@JsonKey(name: 'equipment_number') String equipmentNumber, - @JsonKey(name: 'models_id') int? modelsId, - @JsonKey(name: 'serial_number') String? serialNumber, - String? barcode, - @JsonKey(name: 'purchase_date') - @NaiveDateConverter() - DateTime? purchaseDate, - @JsonKey(name: 'purchase_price') - @DecimalConverter() - double? purchasePrice, - @JsonKey(name: 'company_id') int? companyId, - @JsonKey(name: 'warehouse_location_id') int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date') - @NaiveDateConverter() - DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date') - @NaiveDateConverter() - DateTime? nextInspectionDate, - String? remark}); -} - -/// @nodoc -class _$CreateEquipmentRequestCopyWithImpl<$Res, - $Val extends CreateEquipmentRequest> - implements $CreateEquipmentRequestCopyWith<$Res> { - _$CreateEquipmentRequestCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CreateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? equipmentNumber = null, - Object? modelsId = freezed, - Object? serialNumber = freezed, - Object? barcode = freezed, - Object? purchaseDate = freezed, - Object? purchasePrice = freezed, - Object? companyId = freezed, - Object? warehouseLocationId = freezed, - Object? lastInspectionDate = freezed, - Object? nextInspectionDate = freezed, - Object? remark = freezed, - }) { - return _then(_value.copyWith( - equipmentNumber: null == equipmentNumber - ? _value.equipmentNumber - : equipmentNumber // 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 - as String?, - barcode: freezed == barcode - ? _value.barcode - : barcode // ignore: cast_nullable_to_non_nullable - as String?, - purchaseDate: freezed == purchaseDate - ? _value.purchaseDate - : purchaseDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - purchasePrice: freezed == purchasePrice - ? _value.purchasePrice - : purchasePrice // ignore: cast_nullable_to_non_nullable - as double?, - companyId: freezed == companyId - ? _value.companyId - : companyId // ignore: cast_nullable_to_non_nullable - as int?, - warehouseLocationId: freezed == warehouseLocationId - ? _value.warehouseLocationId - : warehouseLocationId // ignore: cast_nullable_to_non_nullable - as int?, - lastInspectionDate: freezed == lastInspectionDate - ? _value.lastInspectionDate - : lastInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - nextInspectionDate: freezed == nextInspectionDate - ? _value.nextInspectionDate - : nextInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - remark: freezed == remark - ? _value.remark - : remark // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$CreateEquipmentRequestImplCopyWith<$Res> - implements $CreateEquipmentRequestCopyWith<$Res> { - factory _$$CreateEquipmentRequestImplCopyWith( - _$CreateEquipmentRequestImpl value, - $Res Function(_$CreateEquipmentRequestImpl) then) = - __$$CreateEquipmentRequestImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: 'equipment_number') String equipmentNumber, - @JsonKey(name: 'models_id') int? modelsId, - @JsonKey(name: 'serial_number') String? serialNumber, - String? barcode, - @JsonKey(name: 'purchase_date') - @NaiveDateConverter() - DateTime? purchaseDate, - @JsonKey(name: 'purchase_price') - @DecimalConverter() - double? purchasePrice, - @JsonKey(name: 'company_id') int? companyId, - @JsonKey(name: 'warehouse_location_id') int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date') - @NaiveDateConverter() - DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date') - @NaiveDateConverter() - DateTime? nextInspectionDate, - String? remark}); -} - -/// @nodoc -class __$$CreateEquipmentRequestImplCopyWithImpl<$Res> - extends _$CreateEquipmentRequestCopyWithImpl<$Res, - _$CreateEquipmentRequestImpl> - implements _$$CreateEquipmentRequestImplCopyWith<$Res> { - __$$CreateEquipmentRequestImplCopyWithImpl( - _$CreateEquipmentRequestImpl _value, - $Res Function(_$CreateEquipmentRequestImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? equipmentNumber = null, - Object? modelsId = freezed, - Object? serialNumber = freezed, - Object? barcode = freezed, - Object? purchaseDate = freezed, - Object? purchasePrice = freezed, - Object? companyId = freezed, - Object? warehouseLocationId = freezed, - Object? lastInspectionDate = freezed, - Object? nextInspectionDate = freezed, - Object? remark = freezed, - }) { - return _then(_$CreateEquipmentRequestImpl( - equipmentNumber: null == equipmentNumber - ? _value.equipmentNumber - : equipmentNumber // 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 - as String?, - barcode: freezed == barcode - ? _value.barcode - : barcode // ignore: cast_nullable_to_non_nullable - as String?, - purchaseDate: freezed == purchaseDate - ? _value.purchaseDate - : purchaseDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - purchasePrice: freezed == purchasePrice - ? _value.purchasePrice - : purchasePrice // ignore: cast_nullable_to_non_nullable - as double?, - companyId: freezed == companyId - ? _value.companyId - : companyId // ignore: cast_nullable_to_non_nullable - as int?, - warehouseLocationId: freezed == warehouseLocationId - ? _value.warehouseLocationId - : warehouseLocationId // ignore: cast_nullable_to_non_nullable - as int?, - lastInspectionDate: freezed == lastInspectionDate - ? _value.lastInspectionDate - : lastInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - nextInspectionDate: freezed == nextInspectionDate - ? _value.nextInspectionDate - : nextInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - remark: freezed == remark - ? _value.remark - : remark // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest { - const _$CreateEquipmentRequestImpl( - {@JsonKey(name: 'equipment_number') required this.equipmentNumber, - @JsonKey(name: 'models_id') this.modelsId, - @JsonKey(name: 'serial_number') this.serialNumber, - this.barcode, - @JsonKey(name: 'purchase_date') @NaiveDateConverter() this.purchaseDate, - @JsonKey(name: 'purchase_price') @DecimalConverter() this.purchasePrice, - @JsonKey(name: 'company_id') this.companyId, - @JsonKey(name: 'warehouse_location_id') this.warehouseLocationId, - @JsonKey(name: 'last_inspection_date') - @NaiveDateConverter() - this.lastInspectionDate, - @JsonKey(name: 'next_inspection_date') - @NaiveDateConverter() - this.nextInspectionDate, - this.remark}); - - factory _$CreateEquipmentRequestImpl.fromJson(Map json) => - _$$CreateEquipmentRequestImplFromJson(json); - - @override - @JsonKey(name: 'equipment_number') - final String equipmentNumber; -// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id - @override - @JsonKey(name: 'models_id') - final int? modelsId; - @override - @JsonKey(name: 'serial_number') - final String? serialNumber; - @override - final String? barcode; - @override - @JsonKey(name: 'purchase_date') - @NaiveDateConverter() - final DateTime? purchaseDate; - @override - @JsonKey(name: 'purchase_price') - @DecimalConverter() - final double? purchasePrice; - @override - @JsonKey(name: 'company_id') - final int? companyId; - @override - @JsonKey(name: 'warehouse_location_id') - final int? warehouseLocationId; - @override - @JsonKey(name: 'last_inspection_date') - @NaiveDateConverter() - final DateTime? lastInspectionDate; - @override - @JsonKey(name: 'next_inspection_date') - @NaiveDateConverter() - final DateTime? nextInspectionDate; - @override - final String? remark; - - @override - String toString() { - return 'CreateEquipmentRequest(equipmentNumber: $equipmentNumber, modelsId: $modelsId, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateEquipmentRequestImpl && - (identical(other.equipmentNumber, equipmentNumber) || - other.equipmentNumber == equipmentNumber) && - (identical(other.modelsId, modelsId) || - other.modelsId == modelsId) && - (identical(other.serialNumber, serialNumber) || - other.serialNumber == serialNumber) && - (identical(other.barcode, barcode) || other.barcode == barcode) && - (identical(other.purchaseDate, purchaseDate) || - other.purchaseDate == purchaseDate) && - (identical(other.purchasePrice, purchasePrice) || - other.purchasePrice == purchasePrice) && - (identical(other.companyId, companyId) || - other.companyId == companyId) && - (identical(other.warehouseLocationId, warehouseLocationId) || - other.warehouseLocationId == warehouseLocationId) && - (identical(other.lastInspectionDate, lastInspectionDate) || - other.lastInspectionDate == lastInspectionDate) && - (identical(other.nextInspectionDate, nextInspectionDate) || - other.nextInspectionDate == nextInspectionDate) && - (identical(other.remark, remark) || other.remark == remark)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - equipmentNumber, - modelsId, - serialNumber, - barcode, - purchaseDate, - purchasePrice, - companyId, - warehouseLocationId, - lastInspectionDate, - nextInspectionDate, - remark); - - /// Create a copy of CreateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateEquipmentRequestImplCopyWith<_$CreateEquipmentRequestImpl> - get copyWith => __$$CreateEquipmentRequestImplCopyWithImpl< - _$CreateEquipmentRequestImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CreateEquipmentRequestImplToJson( - this, - ); - } -} - -abstract class _CreateEquipmentRequest implements CreateEquipmentRequest { - const factory _CreateEquipmentRequest( - {@JsonKey(name: 'equipment_number') required final String equipmentNumber, - @JsonKey(name: 'models_id') final int? modelsId, - @JsonKey(name: 'serial_number') final String? serialNumber, - final String? barcode, - @JsonKey(name: 'purchase_date') - @NaiveDateConverter() - final DateTime? purchaseDate, - @JsonKey(name: 'purchase_price') - @DecimalConverter() - final double? purchasePrice, - @JsonKey(name: 'company_id') final int? companyId, - @JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date') - @NaiveDateConverter() - final DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date') - @NaiveDateConverter() - final DateTime? nextInspectionDate, - final String? remark}) = _$CreateEquipmentRequestImpl; - - factory _CreateEquipmentRequest.fromJson(Map json) = - _$CreateEquipmentRequestImpl.fromJson; - - @override - @JsonKey(name: 'equipment_number') - String - get equipmentNumber; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id - @override - @JsonKey(name: 'models_id') - int? get modelsId; - @override - @JsonKey(name: 'serial_number') - String? get serialNumber; - @override - String? get barcode; - @override - @JsonKey(name: 'purchase_date') - @NaiveDateConverter() - DateTime? get purchaseDate; - @override - @JsonKey(name: 'purchase_price') - @DecimalConverter() - double? get purchasePrice; - @override - @JsonKey(name: 'company_id') - int? get companyId; - @override - @JsonKey(name: 'warehouse_location_id') - int? get warehouseLocationId; - @override - @JsonKey(name: 'last_inspection_date') - @NaiveDateConverter() - DateTime? get lastInspectionDate; - @override - @JsonKey(name: 'next_inspection_date') - @NaiveDateConverter() - DateTime? get nextInspectionDate; - @override - String? get remark; - - /// Create a copy of CreateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateEquipmentRequestImplCopyWith<_$CreateEquipmentRequestImpl> - get copyWith => throw _privateConstructorUsedError; -} - -UpdateEquipmentRequest _$UpdateEquipmentRequestFromJson( - Map json) { - return _UpdateEquipmentRequest.fromJson(json); -} - -/// @nodoc -mixin _$UpdateEquipmentRequest { -// 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) - String? get barcode => throw _privateConstructorUsedError; - @JsonKey(name: 'purchase_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? get purchaseDate => throw _privateConstructorUsedError; - @JsonKey(name: 'purchase_price', includeIfNull: false) - @DecimalConverter() - double? get purchasePrice => throw _privateConstructorUsedError; - @JsonKey(includeIfNull: false) - String? get status => throw _privateConstructorUsedError; - @JsonKey(name: 'company_id', includeIfNull: false) - int? get companyId => throw _privateConstructorUsedError; - @JsonKey(name: 'warehouse_location_id', includeIfNull: false) - int? get warehouseLocationId => throw _privateConstructorUsedError; - @JsonKey(name: 'last_inspection_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? get lastInspectionDate => throw _privateConstructorUsedError; - @JsonKey(name: 'next_inspection_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? get nextInspectionDate => throw _privateConstructorUsedError; - @JsonKey(includeIfNull: false) - String? get remark => throw _privateConstructorUsedError; - - /// Serializes this UpdateEquipmentRequest to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of UpdateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $UpdateEquipmentRequestCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $UpdateEquipmentRequestCopyWith<$Res> { - factory $UpdateEquipmentRequestCopyWith(UpdateEquipmentRequest value, - $Res Function(UpdateEquipmentRequest) then) = - _$UpdateEquipmentRequestCopyWithImpl<$Res, UpdateEquipmentRequest>; - @useResult - $Res call( - {@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, - @JsonKey(name: 'purchase_price', includeIfNull: false) - @DecimalConverter() - double? purchasePrice, - @JsonKey(includeIfNull: false) String? status, - @JsonKey(name: 'company_id', includeIfNull: false) int? companyId, - @JsonKey(name: 'warehouse_location_id', includeIfNull: false) - int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? nextInspectionDate, - @JsonKey(includeIfNull: false) String? remark}); -} - -/// @nodoc -class _$UpdateEquipmentRequestCopyWithImpl<$Res, - $Val extends UpdateEquipmentRequest> - implements $UpdateEquipmentRequestCopyWith<$Res> { - _$UpdateEquipmentRequestCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of UpdateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? modelsId = freezed, - Object? serialNumber = freezed, - Object? barcode = freezed, - Object? purchaseDate = freezed, - Object? purchasePrice = freezed, - Object? status = freezed, - Object? companyId = freezed, - Object? warehouseLocationId = freezed, - Object? lastInspectionDate = freezed, - Object? nextInspectionDate = freezed, - Object? remark = freezed, - }) { - return _then(_value.copyWith( - 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 - as String?, - barcode: freezed == barcode - ? _value.barcode - : barcode // ignore: cast_nullable_to_non_nullable - as String?, - purchaseDate: freezed == purchaseDate - ? _value.purchaseDate - : purchaseDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - purchasePrice: freezed == purchasePrice - ? _value.purchasePrice - : purchasePrice // ignore: cast_nullable_to_non_nullable - as double?, - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String?, - companyId: freezed == companyId - ? _value.companyId - : companyId // ignore: cast_nullable_to_non_nullable - as int?, - warehouseLocationId: freezed == warehouseLocationId - ? _value.warehouseLocationId - : warehouseLocationId // ignore: cast_nullable_to_non_nullable - as int?, - lastInspectionDate: freezed == lastInspectionDate - ? _value.lastInspectionDate - : lastInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - nextInspectionDate: freezed == nextInspectionDate - ? _value.nextInspectionDate - : nextInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - remark: freezed == remark - ? _value.remark - : remark // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$UpdateEquipmentRequestImplCopyWith<$Res> - implements $UpdateEquipmentRequestCopyWith<$Res> { - factory _$$UpdateEquipmentRequestImplCopyWith( - _$UpdateEquipmentRequestImpl value, - $Res Function(_$UpdateEquipmentRequestImpl) then) = - __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@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, - @JsonKey(name: 'purchase_price', includeIfNull: false) - @DecimalConverter() - double? purchasePrice, - @JsonKey(includeIfNull: false) String? status, - @JsonKey(name: 'company_id', includeIfNull: false) int? companyId, - @JsonKey(name: 'warehouse_location_id', includeIfNull: false) - int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? nextInspectionDate, - @JsonKey(includeIfNull: false) String? remark}); -} - -/// @nodoc -class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res> - extends _$UpdateEquipmentRequestCopyWithImpl<$Res, - _$UpdateEquipmentRequestImpl> - implements _$$UpdateEquipmentRequestImplCopyWith<$Res> { - __$$UpdateEquipmentRequestImplCopyWithImpl( - _$UpdateEquipmentRequestImpl _value, - $Res Function(_$UpdateEquipmentRequestImpl) _then) - : super(_value, _then); - - /// Create a copy of UpdateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? modelsId = freezed, - Object? serialNumber = freezed, - Object? barcode = freezed, - Object? purchaseDate = freezed, - Object? purchasePrice = freezed, - Object? status = freezed, - Object? companyId = freezed, - Object? warehouseLocationId = freezed, - Object? lastInspectionDate = freezed, - Object? nextInspectionDate = freezed, - Object? remark = freezed, - }) { - return _then(_$UpdateEquipmentRequestImpl( - 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 - as String?, - barcode: freezed == barcode - ? _value.barcode - : barcode // ignore: cast_nullable_to_non_nullable - as String?, - purchaseDate: freezed == purchaseDate - ? _value.purchaseDate - : purchaseDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - purchasePrice: freezed == purchasePrice - ? _value.purchasePrice - : purchasePrice // ignore: cast_nullable_to_non_nullable - as double?, - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String?, - companyId: freezed == companyId - ? _value.companyId - : companyId // ignore: cast_nullable_to_non_nullable - as int?, - warehouseLocationId: freezed == warehouseLocationId - ? _value.warehouseLocationId - : warehouseLocationId // ignore: cast_nullable_to_non_nullable - as int?, - lastInspectionDate: freezed == lastInspectionDate - ? _value.lastInspectionDate - : lastInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - nextInspectionDate: freezed == nextInspectionDate - ? _value.nextInspectionDate - : nextInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - remark: freezed == remark - ? _value.remark - : remark // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest { - const _$UpdateEquipmentRequestImpl( - {@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) - @NaiveDateConverter() - this.purchaseDate, - @JsonKey(name: 'purchase_price', includeIfNull: false) - @DecimalConverter() - this.purchasePrice, - @JsonKey(includeIfNull: false) this.status, - @JsonKey(name: 'company_id', includeIfNull: false) this.companyId, - @JsonKey(name: 'warehouse_location_id', includeIfNull: false) - this.warehouseLocationId, - @JsonKey(name: 'last_inspection_date', includeIfNull: false) - @NaiveDateConverter() - this.lastInspectionDate, - @JsonKey(name: 'next_inspection_date', includeIfNull: false) - @NaiveDateConverter() - this.nextInspectionDate, - @JsonKey(includeIfNull: false) this.remark}); - - factory _$UpdateEquipmentRequestImpl.fromJson(Map json) => - _$$UpdateEquipmentRequestImplFromJson(json); - -// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id - @override - @JsonKey(name: 'models_id', includeIfNull: false) - final int? modelsId; - @override - @JsonKey(name: 'serial_number', includeIfNull: false) - final String? serialNumber; - @override - @JsonKey(includeIfNull: false) - final String? barcode; - @override - @JsonKey(name: 'purchase_date', includeIfNull: false) - @NaiveDateConverter() - final DateTime? purchaseDate; - @override - @JsonKey(name: 'purchase_price', includeIfNull: false) - @DecimalConverter() - final double? purchasePrice; - @override - @JsonKey(includeIfNull: false) - final String? status; - @override - @JsonKey(name: 'company_id', includeIfNull: false) - final int? companyId; - @override - @JsonKey(name: 'warehouse_location_id', includeIfNull: false) - final int? warehouseLocationId; - @override - @JsonKey(name: 'last_inspection_date', includeIfNull: false) - @NaiveDateConverter() - final DateTime? lastInspectionDate; - @override - @JsonKey(name: 'next_inspection_date', includeIfNull: false) - @NaiveDateConverter() - final DateTime? nextInspectionDate; - @override - @JsonKey(includeIfNull: false) - final String? remark; - - @override - String toString() { - 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 - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$UpdateEquipmentRequestImpl && - (identical(other.modelsId, modelsId) || - other.modelsId == modelsId) && - (identical(other.serialNumber, serialNumber) || - other.serialNumber == serialNumber) && - (identical(other.barcode, barcode) || other.barcode == barcode) && - (identical(other.purchaseDate, purchaseDate) || - other.purchaseDate == purchaseDate) && - (identical(other.purchasePrice, purchasePrice) || - other.purchasePrice == purchasePrice) && - (identical(other.status, status) || other.status == status) && - (identical(other.companyId, companyId) || - other.companyId == companyId) && - (identical(other.warehouseLocationId, warehouseLocationId) || - other.warehouseLocationId == warehouseLocationId) && - (identical(other.lastInspectionDate, lastInspectionDate) || - other.lastInspectionDate == lastInspectionDate) && - (identical(other.nextInspectionDate, nextInspectionDate) || - other.nextInspectionDate == nextInspectionDate) && - (identical(other.remark, remark) || other.remark == remark)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - modelsId, - serialNumber, - barcode, - purchaseDate, - purchasePrice, - status, - companyId, - warehouseLocationId, - lastInspectionDate, - nextInspectionDate, - remark); - - /// Create a copy of UpdateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$UpdateEquipmentRequestImplCopyWith<_$UpdateEquipmentRequestImpl> - get copyWith => __$$UpdateEquipmentRequestImplCopyWithImpl< - _$UpdateEquipmentRequestImpl>(this, _$identity); - - @override - Map toJson() { - return _$$UpdateEquipmentRequestImplToJson( - this, - ); - } -} - -abstract class _UpdateEquipmentRequest implements UpdateEquipmentRequest { - const factory _UpdateEquipmentRequest( - {@JsonKey(name: 'models_id', includeIfNull: false) final int? modelsId, - @JsonKey(name: 'serial_number', includeIfNull: false) - final String? serialNumber, - @JsonKey(includeIfNull: false) final String? barcode, - @JsonKey(name: 'purchase_date', includeIfNull: false) - @NaiveDateConverter() - final DateTime? purchaseDate, - @JsonKey(name: 'purchase_price', includeIfNull: false) - @DecimalConverter() - final double? purchasePrice, - @JsonKey(includeIfNull: false) final String? status, - @JsonKey(name: 'company_id', includeIfNull: false) final int? companyId, - @JsonKey(name: 'warehouse_location_id', includeIfNull: false) - final int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date', includeIfNull: false) - @NaiveDateConverter() - final DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date', includeIfNull: false) - @NaiveDateConverter() - final DateTime? nextInspectionDate, - @JsonKey(includeIfNull: false) - final String? remark}) = _$UpdateEquipmentRequestImpl; - - factory _UpdateEquipmentRequest.fromJson(Map json) = - _$UpdateEquipmentRequestImpl.fromJson; - -// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id - @override - @JsonKey(name: 'models_id', includeIfNull: false) - int? get modelsId; - @override - @JsonKey(name: 'serial_number', includeIfNull: false) - String? get serialNumber; - @override - @JsonKey(includeIfNull: false) - String? get barcode; - @override - @JsonKey(name: 'purchase_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? get purchaseDate; - @override - @JsonKey(name: 'purchase_price', includeIfNull: false) - @DecimalConverter() - double? get purchasePrice; - @override - @JsonKey(includeIfNull: false) - String? get status; - @override - @JsonKey(name: 'company_id', includeIfNull: false) - int? get companyId; - @override - @JsonKey(name: 'warehouse_location_id', includeIfNull: false) - int? get warehouseLocationId; - @override - @JsonKey(name: 'last_inspection_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? get lastInspectionDate; - @override - @JsonKey(name: 'next_inspection_date', includeIfNull: false) - @NaiveDateConverter() - DateTime? get nextInspectionDate; - @override - @JsonKey(includeIfNull: false) - String? get remark; - - /// Create a copy of UpdateEquipmentRequest - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$UpdateEquipmentRequestImplCopyWith<_$UpdateEquipmentRequestImpl> - get copyWith => throw _privateConstructorUsedError; -} diff --git a/lib/data/models/equipment/equipment_request.g.dart b/lib/data/models/equipment/equipment_request.g.dart deleted file mode 100644 index 8adb776..0000000 --- a/lib/data/models/equipment/equipment_request.g.dart +++ /dev/null @@ -1,88 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'equipment_request.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$CreateEquipmentRequestImpl _$$CreateEquipmentRequestImplFromJson( - Map json) => - _$CreateEquipmentRequestImpl( - equipmentNumber: json['equipment_number'] as String, - modelsId: (json['models_id'] as num?)?.toInt(), - serialNumber: json['serial_number'] as String?, - barcode: json['barcode'] as String?, - purchaseDate: - const NaiveDateConverter().fromJson(json['purchase_date'] as String?), - purchasePrice: const DecimalConverter().fromJson(json['purchase_price']), - companyId: (json['company_id'] as num?)?.toInt(), - warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(), - lastInspectionDate: const NaiveDateConverter() - .fromJson(json['last_inspection_date'] as String?), - nextInspectionDate: const NaiveDateConverter() - .fromJson(json['next_inspection_date'] as String?), - remark: json['remark'] as String?, - ); - -Map _$$CreateEquipmentRequestImplToJson( - _$CreateEquipmentRequestImpl instance) => - { - 'equipment_number': instance.equipmentNumber, - 'models_id': instance.modelsId, - 'serial_number': instance.serialNumber, - 'barcode': instance.barcode, - 'purchase_date': const NaiveDateConverter().toJson(instance.purchaseDate), - 'purchase_price': const DecimalConverter().toJson(instance.purchasePrice), - 'company_id': instance.companyId, - 'warehouse_location_id': instance.warehouseLocationId, - 'last_inspection_date': - const NaiveDateConverter().toJson(instance.lastInspectionDate), - 'next_inspection_date': - const NaiveDateConverter().toJson(instance.nextInspectionDate), - 'remark': instance.remark, - }; - -_$UpdateEquipmentRequestImpl _$$UpdateEquipmentRequestImplFromJson( - Map json) => - _$UpdateEquipmentRequestImpl( - modelsId: (json['models_id'] as num?)?.toInt(), - serialNumber: json['serial_number'] as String?, - barcode: json['barcode'] as String?, - purchaseDate: - const NaiveDateConverter().fromJson(json['purchase_date'] as String?), - purchasePrice: const DecimalConverter().fromJson(json['purchase_price']), - status: json['status'] as String?, - companyId: (json['company_id'] as num?)?.toInt(), - warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(), - lastInspectionDate: const NaiveDateConverter() - .fromJson(json['last_inspection_date'] as String?), - nextInspectionDate: const NaiveDateConverter() - .fromJson(json['next_inspection_date'] as String?), - remark: json['remark'] as String?, - ); - -Map _$$UpdateEquipmentRequestImplToJson( - _$UpdateEquipmentRequestImpl instance) => - { - 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) - case final value?) - 'purchase_date': value, - if (const DecimalConverter().toJson(instance.purchasePrice) - case final value?) - 'purchase_price': value, - if (instance.status case final value?) 'status': value, - if (instance.companyId case final value?) 'company_id': value, - if (instance.warehouseLocationId case final value?) - 'warehouse_location_id': value, - if (const NaiveDateConverter().toJson(instance.lastInspectionDate) - case final value?) - 'last_inspection_date': value, - if (const NaiveDateConverter().toJson(instance.nextInspectionDate) - case final value?) - 'next_inspection_date': value, - if (instance.remark case final value?) 'remark': value, - }; diff --git a/lib/data/models/equipment/equipment_response.dart b/lib/data/models/equipment/equipment_response.dart deleted file mode 100644 index ad6f6a9..0000000 --- a/lib/data/models/equipment/equipment_response.dart +++ /dev/null @@ -1,36 +0,0 @@ -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'; - -@freezed -class EquipmentResponse with _$EquipmentResponse { - const factory EquipmentResponse({ - required int id, - @JsonKey(name: 'equipment_number') required String equipmentNumber, - // 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, - @JsonKey(name: 'purchase_price') String? purchasePrice, - @EquipmentStatusJsonConverter() required String status, - @JsonKey(name: 'company_id') int? companyId, - @JsonKey(name: 'warehouse_location_id') int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate, - String? remark, - @JsonKey(name: 'created_at') required DateTime createdAt, - @JsonKey(name: 'updated_at') required DateTime updatedAt, - // 추가 필드 (조인된 데이터) - @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 json) => - _$EquipmentResponseFromJson(json); -} \ No newline at end of file diff --git a/lib/data/models/equipment/equipment_response.freezed.dart b/lib/data/models/equipment/equipment_response.freezed.dart deleted file mode 100644 index 0e4efc2..0000000 --- a/lib/data/models/equipment/equipment_response.freezed.dart +++ /dev/null @@ -1,610 +0,0 @@ -// 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_response.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(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'); - -EquipmentResponse _$EquipmentResponseFromJson(Map json) { - return _EquipmentResponse.fromJson(json); -} - -/// @nodoc -mixin _$EquipmentResponse { - int get id => throw _privateConstructorUsedError; - @JsonKey(name: 'equipment_number') - 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; - @JsonKey(name: 'purchase_date') - DateTime? get purchaseDate => throw _privateConstructorUsedError; - @JsonKey(name: 'purchase_price') - String? get purchasePrice => throw _privateConstructorUsedError; - @EquipmentStatusJsonConverter() - String get status => throw _privateConstructorUsedError; - @JsonKey(name: 'company_id') - int? get companyId => throw _privateConstructorUsedError; - @JsonKey(name: 'warehouse_location_id') - int? get warehouseLocationId => throw _privateConstructorUsedError; - @JsonKey(name: 'last_inspection_date') - DateTime? get lastInspectionDate => throw _privateConstructorUsedError; - @JsonKey(name: 'next_inspection_date') - DateTime? get nextInspectionDate => throw _privateConstructorUsedError; - String? get remark => throw _privateConstructorUsedError; - @JsonKey(name: 'created_at') - DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') - DateTime get updatedAt => - throw _privateConstructorUsedError; // 추가 필드 (조인된 데이터) - @JsonKey(name: 'company_name') - String? get companyName => throw _privateConstructorUsedError; - @JsonKey(name: 'warehouse_name') - 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 toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EquipmentResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EquipmentResponseCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EquipmentResponseCopyWith<$Res> { - factory $EquipmentResponseCopyWith( - EquipmentResponse value, $Res Function(EquipmentResponse) then) = - _$EquipmentResponseCopyWithImpl<$Res, EquipmentResponse>; - @useResult - $Res call( - {int id, - @JsonKey(name: 'equipment_number') String equipmentNumber, - @JsonKey(name: 'models_id') int? modelsId, - @JsonKey(name: 'serial_number') String? serialNumber, - String? barcode, - @JsonKey(name: 'purchase_date') DateTime? purchaseDate, - @JsonKey(name: 'purchase_price') String? purchasePrice, - @EquipmentStatusJsonConverter() String status, - @JsonKey(name: 'company_id') int? companyId, - @JsonKey(name: 'warehouse_location_id') int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate, - String? remark, - @JsonKey(name: 'created_at') DateTime createdAt, - @JsonKey(name: 'updated_at') DateTime updatedAt, - @JsonKey(name: 'company_name') String? companyName, - @JsonKey(name: 'warehouse_name') String? warehouseName, - ModelDto? model}); - - $ModelDtoCopyWith<$Res>? get model; -} - -/// @nodoc -class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse> - implements $EquipmentResponseCopyWith<$Res> { - _$EquipmentResponseCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EquipmentResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? equipmentNumber = null, - Object? modelsId = freezed, - Object? serialNumber = freezed, - Object? barcode = freezed, - Object? purchaseDate = freezed, - Object? purchasePrice = freezed, - Object? status = null, - Object? companyId = freezed, - Object? warehouseLocationId = freezed, - Object? lastInspectionDate = freezed, - Object? nextInspectionDate = freezed, - Object? remark = freezed, - Object? createdAt = null, - Object? updatedAt = null, - Object? companyName = freezed, - Object? warehouseName = freezed, - Object? model = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - equipmentNumber: null == equipmentNumber - ? _value.equipmentNumber - : equipmentNumber // 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 - as String?, - barcode: freezed == barcode - ? _value.barcode - : barcode // ignore: cast_nullable_to_non_nullable - as String?, - purchaseDate: freezed == purchaseDate - ? _value.purchaseDate - : purchaseDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - purchasePrice: freezed == purchasePrice - ? _value.purchasePrice - : purchasePrice // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - companyId: freezed == companyId - ? _value.companyId - : companyId // ignore: cast_nullable_to_non_nullable - as int?, - warehouseLocationId: freezed == warehouseLocationId - ? _value.warehouseLocationId - : warehouseLocationId // ignore: cast_nullable_to_non_nullable - as int?, - lastInspectionDate: freezed == lastInspectionDate - ? _value.lastInspectionDate - : lastInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - nextInspectionDate: freezed == nextInspectionDate - ? _value.nextInspectionDate - : nextInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - remark: freezed == remark - ? _value.remark - : remark // ignore: cast_nullable_to_non_nullable - as String?, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - companyName: freezed == companyName - ? _value.companyName - : companyName // ignore: cast_nullable_to_non_nullable - as String?, - warehouseName: freezed == warehouseName - ? _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 -abstract class _$$EquipmentResponseImplCopyWith<$Res> - implements $EquipmentResponseCopyWith<$Res> { - factory _$$EquipmentResponseImplCopyWith(_$EquipmentResponseImpl value, - $Res Function(_$EquipmentResponseImpl) then) = - __$$EquipmentResponseImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {int id, - @JsonKey(name: 'equipment_number') String equipmentNumber, - @JsonKey(name: 'models_id') int? modelsId, - @JsonKey(name: 'serial_number') String? serialNumber, - String? barcode, - @JsonKey(name: 'purchase_date') DateTime? purchaseDate, - @JsonKey(name: 'purchase_price') String? purchasePrice, - @EquipmentStatusJsonConverter() String status, - @JsonKey(name: 'company_id') int? companyId, - @JsonKey(name: 'warehouse_location_id') int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate, - String? remark, - @JsonKey(name: 'created_at') DateTime createdAt, - @JsonKey(name: 'updated_at') DateTime updatedAt, - @JsonKey(name: 'company_name') String? companyName, - @JsonKey(name: 'warehouse_name') String? warehouseName, - ModelDto? model}); - - @override - $ModelDtoCopyWith<$Res>? get model; -} - -/// @nodoc -class __$$EquipmentResponseImplCopyWithImpl<$Res> - extends _$EquipmentResponseCopyWithImpl<$Res, _$EquipmentResponseImpl> - implements _$$EquipmentResponseImplCopyWith<$Res> { - __$$EquipmentResponseImplCopyWithImpl(_$EquipmentResponseImpl _value, - $Res Function(_$EquipmentResponseImpl) _then) - : super(_value, _then); - - /// Create a copy of EquipmentResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? equipmentNumber = null, - Object? modelsId = freezed, - Object? serialNumber = freezed, - Object? barcode = freezed, - Object? purchaseDate = freezed, - Object? purchasePrice = freezed, - Object? status = null, - Object? companyId = freezed, - Object? warehouseLocationId = freezed, - Object? lastInspectionDate = freezed, - Object? nextInspectionDate = freezed, - Object? remark = freezed, - Object? createdAt = null, - Object? updatedAt = null, - Object? companyName = freezed, - Object? warehouseName = freezed, - Object? model = freezed, - }) { - return _then(_$EquipmentResponseImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - equipmentNumber: null == equipmentNumber - ? _value.equipmentNumber - : equipmentNumber // 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 - as String?, - barcode: freezed == barcode - ? _value.barcode - : barcode // ignore: cast_nullable_to_non_nullable - as String?, - purchaseDate: freezed == purchaseDate - ? _value.purchaseDate - : purchaseDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - purchasePrice: freezed == purchasePrice - ? _value.purchasePrice - : purchasePrice // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - companyId: freezed == companyId - ? _value.companyId - : companyId // ignore: cast_nullable_to_non_nullable - as int?, - warehouseLocationId: freezed == warehouseLocationId - ? _value.warehouseLocationId - : warehouseLocationId // ignore: cast_nullable_to_non_nullable - as int?, - lastInspectionDate: freezed == lastInspectionDate - ? _value.lastInspectionDate - : lastInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - nextInspectionDate: freezed == nextInspectionDate - ? _value.nextInspectionDate - : nextInspectionDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - remark: freezed == remark - ? _value.remark - : remark // ignore: cast_nullable_to_non_nullable - as String?, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - companyName: freezed == companyName - ? _value.companyName - : companyName // ignore: cast_nullable_to_non_nullable - as String?, - warehouseName: freezed == warehouseName - ? _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?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EquipmentResponseImpl implements _EquipmentResponse { - const _$EquipmentResponseImpl( - {required this.id, - @JsonKey(name: 'equipment_number') required this.equipmentNumber, - @JsonKey(name: 'models_id') this.modelsId, - @JsonKey(name: 'serial_number') this.serialNumber, - this.barcode, - @JsonKey(name: 'purchase_date') this.purchaseDate, - @JsonKey(name: 'purchase_price') this.purchasePrice, - @EquipmentStatusJsonConverter() required this.status, - @JsonKey(name: 'company_id') this.companyId, - @JsonKey(name: 'warehouse_location_id') this.warehouseLocationId, - @JsonKey(name: 'last_inspection_date') this.lastInspectionDate, - @JsonKey(name: 'next_inspection_date') this.nextInspectionDate, - this.remark, - @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, - this.model}); - - factory _$EquipmentResponseImpl.fromJson(Map json) => - _$$EquipmentResponseImplFromJson(json); - - @override - final int id; - @override - @JsonKey(name: 'equipment_number') - final String equipmentNumber; -// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model - @override - @JsonKey(name: 'models_id') - final int? modelsId; - @override - @JsonKey(name: 'serial_number') - final String? serialNumber; - @override - final String? barcode; - @override - @JsonKey(name: 'purchase_date') - final DateTime? purchaseDate; - @override - @JsonKey(name: 'purchase_price') - final String? purchasePrice; - @override - @EquipmentStatusJsonConverter() - final String status; - @override - @JsonKey(name: 'company_id') - final int? companyId; - @override - @JsonKey(name: 'warehouse_location_id') - final int? warehouseLocationId; - @override - @JsonKey(name: 'last_inspection_date') - final DateTime? lastInspectionDate; - @override - @JsonKey(name: 'next_inspection_date') - final DateTime? nextInspectionDate; - @override - final String? remark; - @override - @JsonKey(name: 'created_at') - final DateTime createdAt; - @override - @JsonKey(name: 'updated_at') - final DateTime updatedAt; -// 추가 필드 (조인된 데이터) - @override - @JsonKey(name: 'company_name') - final String? companyName; - @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, 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 - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EquipmentResponseImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.equipmentNumber, equipmentNumber) || - other.equipmentNumber == equipmentNumber) && - (identical(other.modelsId, modelsId) || - other.modelsId == modelsId) && - (identical(other.serialNumber, serialNumber) || - other.serialNumber == serialNumber) && - (identical(other.barcode, barcode) || other.barcode == barcode) && - (identical(other.purchaseDate, purchaseDate) || - other.purchaseDate == purchaseDate) && - (identical(other.purchasePrice, purchasePrice) || - other.purchasePrice == purchasePrice) && - (identical(other.status, status) || other.status == status) && - (identical(other.companyId, companyId) || - other.companyId == companyId) && - (identical(other.warehouseLocationId, warehouseLocationId) || - other.warehouseLocationId == warehouseLocationId) && - (identical(other.lastInspectionDate, lastInspectionDate) || - other.lastInspectionDate == lastInspectionDate) && - (identical(other.nextInspectionDate, nextInspectionDate) || - other.nextInspectionDate == nextInspectionDate) && - (identical(other.remark, remark) || other.remark == remark) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt) && - (identical(other.companyName, companyName) || - other.companyName == companyName) && - (identical(other.warehouseName, warehouseName) || - other.warehouseName == warehouseName) && - (identical(other.model, model) || other.model == model)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - 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. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EquipmentResponseImplCopyWith<_$EquipmentResponseImpl> get copyWith => - __$$EquipmentResponseImplCopyWithImpl<_$EquipmentResponseImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$EquipmentResponseImplToJson( - this, - ); - } -} - -abstract class _EquipmentResponse implements EquipmentResponse { - const factory _EquipmentResponse( - {required final int id, - @JsonKey(name: 'equipment_number') required final String equipmentNumber, - @JsonKey(name: 'models_id') final int? modelsId, - @JsonKey(name: 'serial_number') final String? serialNumber, - final String? barcode, - @JsonKey(name: 'purchase_date') final DateTime? purchaseDate, - @JsonKey(name: 'purchase_price') final String? purchasePrice, - @EquipmentStatusJsonConverter() required final String status, - @JsonKey(name: 'company_id') final int? companyId, - @JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId, - @JsonKey(name: 'last_inspection_date') final DateTime? lastInspectionDate, - @JsonKey(name: 'next_inspection_date') final DateTime? nextInspectionDate, - final String? remark, - @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, - final ModelDto? model}) = _$EquipmentResponseImpl; - - factory _EquipmentResponse.fromJson(Map json) = - _$EquipmentResponseImpl.fromJson; - - @override - int get id; - @override - @JsonKey(name: 'equipment_number') - String - get equipmentNumber; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model - @override - @JsonKey(name: 'models_id') - int? get modelsId; - @override - @JsonKey(name: 'serial_number') - String? get serialNumber; - @override - String? get barcode; - @override - @JsonKey(name: 'purchase_date') - DateTime? get purchaseDate; - @override - @JsonKey(name: 'purchase_price') - String? get purchasePrice; - @override - @EquipmentStatusJsonConverter() - String get status; - @override - @JsonKey(name: 'company_id') - int? get companyId; - @override - @JsonKey(name: 'warehouse_location_id') - int? get warehouseLocationId; - @override - @JsonKey(name: 'last_inspection_date') - DateTime? get lastInspectionDate; - @override - @JsonKey(name: 'next_inspection_date') - DateTime? get nextInspectionDate; - @override - String? get remark; - @override - @JsonKey(name: 'created_at') - DateTime get createdAt; - @override - @JsonKey(name: 'updated_at') - DateTime get updatedAt; // 추가 필드 (조인된 데이터) - @override - @JsonKey(name: 'company_name') - String? get companyName; - @override - @JsonKey(name: 'warehouse_name') - 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. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EquipmentResponseImplCopyWith<_$EquipmentResponseImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/lib/data/models/equipment/equipment_response.g.dart b/lib/data/models/equipment/equipment_response.g.dart deleted file mode 100644 index 68ae8c7..0000000 --- a/lib/data/models/equipment/equipment_response.g.dart +++ /dev/null @@ -1,62 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'equipment_response.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$EquipmentResponseImpl _$$EquipmentResponseImplFromJson( - Map json) => - _$EquipmentResponseImpl( - id: (json['id'] as num).toInt(), - equipmentNumber: json['equipment_number'] 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 - ? null - : DateTime.parse(json['purchase_date'] as String), - purchasePrice: json['purchase_price'] as String?, - status: const EquipmentStatusJsonConverter() - .fromJson(json['status'] as String), - companyId: (json['company_id'] as num?)?.toInt(), - warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(), - lastInspectionDate: json['last_inspection_date'] == null - ? null - : DateTime.parse(json['last_inspection_date'] as String), - nextInspectionDate: json['next_inspection_date'] == null - ? null - : DateTime.parse(json['next_inspection_date'] as String), - remark: json['remark'] as String?, - createdAt: DateTime.parse(json['created_at'] as String), - 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), - ); - -Map _$$EquipmentResponseImplToJson( - _$EquipmentResponseImpl instance) => - { - 'id': instance.id, - 'equipment_number': instance.equipmentNumber, - 'models_id': instance.modelsId, - 'serial_number': instance.serialNumber, - 'barcode': instance.barcode, - 'purchase_date': instance.purchaseDate?.toIso8601String(), - 'purchase_price': instance.purchasePrice, - 'status': const EquipmentStatusJsonConverter().toJson(instance.status), - 'company_id': instance.companyId, - 'warehouse_location_id': instance.warehouseLocationId, - 'last_inspection_date': instance.lastInspectionDate?.toIso8601String(), - 'next_inspection_date': instance.nextInspectionDate?.toIso8601String(), - 'remark': instance.remark, - 'created_at': instance.createdAt.toIso8601String(), - 'updated_at': instance.updatedAt.toIso8601String(), - 'company_name': instance.companyName, - 'warehouse_name': instance.warehouseName, - 'model': instance.model, - }; diff --git a/lib/data/models/equipment_history_companies_link_dto.dart b/lib/data/models/equipment_history_companies_link_dto.dart deleted file mode 100644 index 26576d5..0000000 --- a/lib/data/models/equipment_history_companies_link_dto.dart +++ /dev/null @@ -1,69 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:superport/data/models/equipment_history_dto.dart'; -import 'package:superport/data/models/company/company_dto.dart'; - -part 'equipment_history_companies_link_dto.freezed.dart'; -part 'equipment_history_companies_link_dto.g.dart'; - -@freezed -class EquipmentHistoryCompaniesLinkDto with _$EquipmentHistoryCompaniesLinkDto { - const EquipmentHistoryCompaniesLinkDto._(); // Private constructor for getters - - const factory EquipmentHistoryCompaniesLinkDto({ - @JsonKey(name: 'Id') int? id, - @JsonKey(name: 'companies_id') required int companiesId, - @JsonKey(name: 'equipment_history_Id') required int equipmentHistoryId, - @JsonKey(name: 'Order') @Default(1) int order, - @JsonKey(name: 'is_deleted') @Default(false) bool isDeleted, - @JsonKey(name: 'registered_at') required DateTime registeredAt, - @JsonKey(name: 'updated_at') DateTime? updatedAt, - - // Related entities (optional, populated in GET requests) - CompanyDto? company, - EquipmentHistoryDto? equipmentHistory, - }) = _EquipmentHistoryCompaniesLinkDto; - - // isActive 계산 속성 (is_deleted의 반대) - bool get isActive => !isDeleted; - - factory EquipmentHistoryCompaniesLinkDto.fromJson(Map json) => - _$EquipmentHistoryCompaniesLinkDtoFromJson(json); -} - -@freezed -class EquipmentHistoryCompaniesLinkRequestDto with _$EquipmentHistoryCompaniesLinkRequestDto { - const factory EquipmentHistoryCompaniesLinkRequestDto({ - @JsonKey(name: 'companies_id') required int companiesId, - @JsonKey(name: 'equipment_history_Id') required int equipmentHistoryId, - @JsonKey(name: 'Order') @Default(1) int order, - }) = _EquipmentHistoryCompaniesLinkRequestDto; - - factory EquipmentHistoryCompaniesLinkRequestDto.fromJson(Map json) => - _$EquipmentHistoryCompaniesLinkRequestDtoFromJson(json); -} - -@freezed -class EquipmentHistoryCompaniesLinkUpdateRequestDto with _$EquipmentHistoryCompaniesLinkUpdateRequestDto { - const factory EquipmentHistoryCompaniesLinkUpdateRequestDto({ - @JsonKey(name: 'companies_id') int? companiesId, - @JsonKey(name: 'equipment_history_Id') int? equipmentHistoryId, - @JsonKey(name: 'Order') int? order, - }) = _EquipmentHistoryCompaniesLinkUpdateRequestDto; - - factory EquipmentHistoryCompaniesLinkUpdateRequestDto.fromJson(Map json) => - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoFromJson(json); -} - -@freezed -class EquipmentHistoryCompaniesLinkListResponse with _$EquipmentHistoryCompaniesLinkListResponse { - const factory EquipmentHistoryCompaniesLinkListResponse({ - @JsonKey(name: 'data') required List 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, - }) = _EquipmentHistoryCompaniesLinkListResponse; - - factory EquipmentHistoryCompaniesLinkListResponse.fromJson(Map json) => - _$EquipmentHistoryCompaniesLinkListResponseFromJson(json); -} \ No newline at end of file diff --git a/lib/data/models/equipment_history_companies_link_dto.freezed.dart b/lib/data/models/equipment_history_companies_link_dto.freezed.dart deleted file mode 100644 index 9225ed4..0000000 --- a/lib/data/models/equipment_history_companies_link_dto.freezed.dart +++ /dev/null @@ -1,1165 +0,0 @@ -// 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_history_companies_link_dto.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(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'); - -EquipmentHistoryCompaniesLinkDto _$EquipmentHistoryCompaniesLinkDtoFromJson( - Map json) { - return _EquipmentHistoryCompaniesLinkDto.fromJson(json); -} - -/// @nodoc -mixin _$EquipmentHistoryCompaniesLinkDto { - @JsonKey(name: 'Id') - int? get id => throw _privateConstructorUsedError; - @JsonKey(name: 'companies_id') - int get companiesId => throw _privateConstructorUsedError; - @JsonKey(name: 'equipment_history_Id') - int get equipmentHistoryId => throw _privateConstructorUsedError; - @JsonKey(name: 'Order') - int get order => throw _privateConstructorUsedError; - @JsonKey(name: 'is_deleted') - bool get isDeleted => throw _privateConstructorUsedError; - @JsonKey(name: 'registered_at') - DateTime get registeredAt => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') - DateTime? get updatedAt => - throw _privateConstructorUsedError; // Related entities (optional, populated in GET requests) - CompanyDto? get company => throw _privateConstructorUsedError; - EquipmentHistoryDto? get equipmentHistory => - throw _privateConstructorUsedError; - - /// Serializes this EquipmentHistoryCompaniesLinkDto to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EquipmentHistoryCompaniesLinkDto - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EquipmentHistoryCompaniesLinkDtoCopyWith - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EquipmentHistoryCompaniesLinkDtoCopyWith<$Res> { - factory $EquipmentHistoryCompaniesLinkDtoCopyWith( - EquipmentHistoryCompaniesLinkDto value, - $Res Function(EquipmentHistoryCompaniesLinkDto) then) = - _$EquipmentHistoryCompaniesLinkDtoCopyWithImpl<$Res, - EquipmentHistoryCompaniesLinkDto>; - @useResult - $Res call( - {@JsonKey(name: 'Id') int? id, - @JsonKey(name: 'companies_id') int companiesId, - @JsonKey(name: 'equipment_history_Id') int equipmentHistoryId, - @JsonKey(name: 'Order') int order, - @JsonKey(name: 'is_deleted') bool isDeleted, - @JsonKey(name: 'registered_at') DateTime registeredAt, - @JsonKey(name: 'updated_at') DateTime? updatedAt, - CompanyDto? company, - EquipmentHistoryDto? equipmentHistory}); - - $CompanyDtoCopyWith<$Res>? get company; - $EquipmentHistoryDtoCopyWith<$Res>? get equipmentHistory; -} - -/// @nodoc -class _$EquipmentHistoryCompaniesLinkDtoCopyWithImpl<$Res, - $Val extends EquipmentHistoryCompaniesLinkDto> - implements $EquipmentHistoryCompaniesLinkDtoCopyWith<$Res> { - _$EquipmentHistoryCompaniesLinkDtoCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EquipmentHistoryCompaniesLinkDto - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = freezed, - Object? companiesId = null, - Object? equipmentHistoryId = null, - Object? order = null, - Object? isDeleted = null, - Object? registeredAt = null, - Object? updatedAt = freezed, - Object? company = freezed, - Object? equipmentHistory = freezed, - }) { - return _then(_value.copyWith( - id: freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - companiesId: null == companiesId - ? _value.companiesId - : companiesId // ignore: cast_nullable_to_non_nullable - as int, - equipmentHistoryId: null == equipmentHistoryId - ? _value.equipmentHistoryId - : equipmentHistoryId // ignore: cast_nullable_to_non_nullable - as int, - order: null == order - ? _value.order - : order // ignore: cast_nullable_to_non_nullable - as int, - isDeleted: null == isDeleted - ? _value.isDeleted - : isDeleted // ignore: cast_nullable_to_non_nullable - as bool, - registeredAt: null == registeredAt - ? _value.registeredAt - : registeredAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: freezed == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - company: freezed == company - ? _value.company - : company // ignore: cast_nullable_to_non_nullable - as CompanyDto?, - equipmentHistory: freezed == equipmentHistory - ? _value.equipmentHistory - : equipmentHistory // ignore: cast_nullable_to_non_nullable - as EquipmentHistoryDto?, - ) as $Val); - } - - /// Create a copy of EquipmentHistoryCompaniesLinkDto - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CompanyDtoCopyWith<$Res>? get company { - if (_value.company == null) { - return null; - } - - return $CompanyDtoCopyWith<$Res>(_value.company!, (value) { - return _then(_value.copyWith(company: value) as $Val); - }); - } - - /// Create a copy of EquipmentHistoryCompaniesLinkDto - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $EquipmentHistoryDtoCopyWith<$Res>? get equipmentHistory { - if (_value.equipmentHistory == null) { - return null; - } - - return $EquipmentHistoryDtoCopyWith<$Res>(_value.equipmentHistory!, - (value) { - return _then(_value.copyWith(equipmentHistory: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$EquipmentHistoryCompaniesLinkDtoImplCopyWith<$Res> - implements $EquipmentHistoryCompaniesLinkDtoCopyWith<$Res> { - factory _$$EquipmentHistoryCompaniesLinkDtoImplCopyWith( - _$EquipmentHistoryCompaniesLinkDtoImpl value, - $Res Function(_$EquipmentHistoryCompaniesLinkDtoImpl) then) = - __$$EquipmentHistoryCompaniesLinkDtoImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: 'Id') int? id, - @JsonKey(name: 'companies_id') int companiesId, - @JsonKey(name: 'equipment_history_Id') int equipmentHistoryId, - @JsonKey(name: 'Order') int order, - @JsonKey(name: 'is_deleted') bool isDeleted, - @JsonKey(name: 'registered_at') DateTime registeredAt, - @JsonKey(name: 'updated_at') DateTime? updatedAt, - CompanyDto? company, - EquipmentHistoryDto? equipmentHistory}); - - @override - $CompanyDtoCopyWith<$Res>? get company; - @override - $EquipmentHistoryDtoCopyWith<$Res>? get equipmentHistory; -} - -/// @nodoc -class __$$EquipmentHistoryCompaniesLinkDtoImplCopyWithImpl<$Res> - extends _$EquipmentHistoryCompaniesLinkDtoCopyWithImpl<$Res, - _$EquipmentHistoryCompaniesLinkDtoImpl> - implements _$$EquipmentHistoryCompaniesLinkDtoImplCopyWith<$Res> { - __$$EquipmentHistoryCompaniesLinkDtoImplCopyWithImpl( - _$EquipmentHistoryCompaniesLinkDtoImpl _value, - $Res Function(_$EquipmentHistoryCompaniesLinkDtoImpl) _then) - : super(_value, _then); - - /// Create a copy of EquipmentHistoryCompaniesLinkDto - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = freezed, - Object? companiesId = null, - Object? equipmentHistoryId = null, - Object? order = null, - Object? isDeleted = null, - Object? registeredAt = null, - Object? updatedAt = freezed, - Object? company = freezed, - Object? equipmentHistory = freezed, - }) { - return _then(_$EquipmentHistoryCompaniesLinkDtoImpl( - id: freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - companiesId: null == companiesId - ? _value.companiesId - : companiesId // ignore: cast_nullable_to_non_nullable - as int, - equipmentHistoryId: null == equipmentHistoryId - ? _value.equipmentHistoryId - : equipmentHistoryId // ignore: cast_nullable_to_non_nullable - as int, - order: null == order - ? _value.order - : order // ignore: cast_nullable_to_non_nullable - as int, - isDeleted: null == isDeleted - ? _value.isDeleted - : isDeleted // ignore: cast_nullable_to_non_nullable - as bool, - registeredAt: null == registeredAt - ? _value.registeredAt - : registeredAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: freezed == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - company: freezed == company - ? _value.company - : company // ignore: cast_nullable_to_non_nullable - as CompanyDto?, - equipmentHistory: freezed == equipmentHistory - ? _value.equipmentHistory - : equipmentHistory // ignore: cast_nullable_to_non_nullable - as EquipmentHistoryDto?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EquipmentHistoryCompaniesLinkDtoImpl - extends _EquipmentHistoryCompaniesLinkDto { - const _$EquipmentHistoryCompaniesLinkDtoImpl( - {@JsonKey(name: 'Id') this.id, - @JsonKey(name: 'companies_id') required this.companiesId, - @JsonKey(name: 'equipment_history_Id') required this.equipmentHistoryId, - @JsonKey(name: 'Order') this.order = 1, - @JsonKey(name: 'is_deleted') this.isDeleted = false, - @JsonKey(name: 'registered_at') required this.registeredAt, - @JsonKey(name: 'updated_at') this.updatedAt, - this.company, - this.equipmentHistory}) - : super._(); - - factory _$EquipmentHistoryCompaniesLinkDtoImpl.fromJson( - Map json) => - _$$EquipmentHistoryCompaniesLinkDtoImplFromJson(json); - - @override - @JsonKey(name: 'Id') - final int? id; - @override - @JsonKey(name: 'companies_id') - final int companiesId; - @override - @JsonKey(name: 'equipment_history_Id') - final int equipmentHistoryId; - @override - @JsonKey(name: 'Order') - final int order; - @override - @JsonKey(name: 'is_deleted') - final bool isDeleted; - @override - @JsonKey(name: 'registered_at') - final DateTime registeredAt; - @override - @JsonKey(name: 'updated_at') - final DateTime? updatedAt; -// Related entities (optional, populated in GET requests) - @override - final CompanyDto? company; - @override - final EquipmentHistoryDto? equipmentHistory; - - @override - String toString() { - return 'EquipmentHistoryCompaniesLinkDto(id: $id, companiesId: $companiesId, equipmentHistoryId: $equipmentHistoryId, order: $order, isDeleted: $isDeleted, registeredAt: $registeredAt, updatedAt: $updatedAt, company: $company, equipmentHistory: $equipmentHistory)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EquipmentHistoryCompaniesLinkDtoImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.companiesId, companiesId) || - other.companiesId == companiesId) && - (identical(other.equipmentHistoryId, equipmentHistoryId) || - other.equipmentHistoryId == equipmentHistoryId) && - (identical(other.order, order) || other.order == order) && - (identical(other.isDeleted, isDeleted) || - other.isDeleted == isDeleted) && - (identical(other.registeredAt, registeredAt) || - other.registeredAt == registeredAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt) && - (identical(other.company, company) || other.company == company) && - (identical(other.equipmentHistory, equipmentHistory) || - other.equipmentHistory == equipmentHistory)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - id, - companiesId, - equipmentHistoryId, - order, - isDeleted, - registeredAt, - updatedAt, - company, - equipmentHistory); - - /// Create a copy of EquipmentHistoryCompaniesLinkDto - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EquipmentHistoryCompaniesLinkDtoImplCopyWith< - _$EquipmentHistoryCompaniesLinkDtoImpl> - get copyWith => __$$EquipmentHistoryCompaniesLinkDtoImplCopyWithImpl< - _$EquipmentHistoryCompaniesLinkDtoImpl>(this, _$identity); - - @override - Map toJson() { - return _$$EquipmentHistoryCompaniesLinkDtoImplToJson( - this, - ); - } -} - -abstract class _EquipmentHistoryCompaniesLinkDto - extends EquipmentHistoryCompaniesLinkDto { - const factory _EquipmentHistoryCompaniesLinkDto( - {@JsonKey(name: 'Id') final int? id, - @JsonKey(name: 'companies_id') required final int companiesId, - @JsonKey(name: 'equipment_history_Id') - required final int equipmentHistoryId, - @JsonKey(name: 'Order') final int order, - @JsonKey(name: 'is_deleted') final bool isDeleted, - @JsonKey(name: 'registered_at') required final DateTime registeredAt, - @JsonKey(name: 'updated_at') final DateTime? updatedAt, - final CompanyDto? company, - final EquipmentHistoryDto? equipmentHistory}) = - _$EquipmentHistoryCompaniesLinkDtoImpl; - const _EquipmentHistoryCompaniesLinkDto._() : super._(); - - factory _EquipmentHistoryCompaniesLinkDto.fromJson( - Map json) = - _$EquipmentHistoryCompaniesLinkDtoImpl.fromJson; - - @override - @JsonKey(name: 'Id') - int? get id; - @override - @JsonKey(name: 'companies_id') - int get companiesId; - @override - @JsonKey(name: 'equipment_history_Id') - int get equipmentHistoryId; - @override - @JsonKey(name: 'Order') - int get order; - @override - @JsonKey(name: 'is_deleted') - bool get isDeleted; - @override - @JsonKey(name: 'registered_at') - DateTime get registeredAt; - @override - @JsonKey(name: 'updated_at') - DateTime? - get updatedAt; // Related entities (optional, populated in GET requests) - @override - CompanyDto? get company; - @override - EquipmentHistoryDto? get equipmentHistory; - - /// Create a copy of EquipmentHistoryCompaniesLinkDto - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EquipmentHistoryCompaniesLinkDtoImplCopyWith< - _$EquipmentHistoryCompaniesLinkDtoImpl> - get copyWith => throw _privateConstructorUsedError; -} - -EquipmentHistoryCompaniesLinkRequestDto - _$EquipmentHistoryCompaniesLinkRequestDtoFromJson( - Map json) { - return _EquipmentHistoryCompaniesLinkRequestDto.fromJson(json); -} - -/// @nodoc -mixin _$EquipmentHistoryCompaniesLinkRequestDto { - @JsonKey(name: 'companies_id') - int get companiesId => throw _privateConstructorUsedError; - @JsonKey(name: 'equipment_history_Id') - int get equipmentHistoryId => throw _privateConstructorUsedError; - @JsonKey(name: 'Order') - int get order => throw _privateConstructorUsedError; - - /// Serializes this EquipmentHistoryCompaniesLinkRequestDto to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EquipmentHistoryCompaniesLinkRequestDto - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EquipmentHistoryCompaniesLinkRequestDtoCopyWith< - EquipmentHistoryCompaniesLinkRequestDto> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EquipmentHistoryCompaniesLinkRequestDtoCopyWith<$Res> { - factory $EquipmentHistoryCompaniesLinkRequestDtoCopyWith( - EquipmentHistoryCompaniesLinkRequestDto value, - $Res Function(EquipmentHistoryCompaniesLinkRequestDto) then) = - _$EquipmentHistoryCompaniesLinkRequestDtoCopyWithImpl<$Res, - EquipmentHistoryCompaniesLinkRequestDto>; - @useResult - $Res call( - {@JsonKey(name: 'companies_id') int companiesId, - @JsonKey(name: 'equipment_history_Id') int equipmentHistoryId, - @JsonKey(name: 'Order') int order}); -} - -/// @nodoc -class _$EquipmentHistoryCompaniesLinkRequestDtoCopyWithImpl<$Res, - $Val extends EquipmentHistoryCompaniesLinkRequestDto> - implements $EquipmentHistoryCompaniesLinkRequestDtoCopyWith<$Res> { - _$EquipmentHistoryCompaniesLinkRequestDtoCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EquipmentHistoryCompaniesLinkRequestDto - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? companiesId = null, - Object? equipmentHistoryId = null, - Object? order = null, - }) { - return _then(_value.copyWith( - companiesId: null == companiesId - ? _value.companiesId - : companiesId // ignore: cast_nullable_to_non_nullable - as int, - equipmentHistoryId: null == equipmentHistoryId - ? _value.equipmentHistoryId - : equipmentHistoryId // ignore: cast_nullable_to_non_nullable - as int, - order: null == order - ? _value.order - : order // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWith<$Res> - implements $EquipmentHistoryCompaniesLinkRequestDtoCopyWith<$Res> { - factory _$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWith( - _$EquipmentHistoryCompaniesLinkRequestDtoImpl value, - $Res Function(_$EquipmentHistoryCompaniesLinkRequestDtoImpl) then) = - __$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: 'companies_id') int companiesId, - @JsonKey(name: 'equipment_history_Id') int equipmentHistoryId, - @JsonKey(name: 'Order') int order}); -} - -/// @nodoc -class __$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWithImpl<$Res> - extends _$EquipmentHistoryCompaniesLinkRequestDtoCopyWithImpl<$Res, - _$EquipmentHistoryCompaniesLinkRequestDtoImpl> - implements _$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWith<$Res> { - __$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWithImpl( - _$EquipmentHistoryCompaniesLinkRequestDtoImpl _value, - $Res Function(_$EquipmentHistoryCompaniesLinkRequestDtoImpl) _then) - : super(_value, _then); - - /// Create a copy of EquipmentHistoryCompaniesLinkRequestDto - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? companiesId = null, - Object? equipmentHistoryId = null, - Object? order = null, - }) { - return _then(_$EquipmentHistoryCompaniesLinkRequestDtoImpl( - companiesId: null == companiesId - ? _value.companiesId - : companiesId // ignore: cast_nullable_to_non_nullable - as int, - equipmentHistoryId: null == equipmentHistoryId - ? _value.equipmentHistoryId - : equipmentHistoryId // ignore: cast_nullable_to_non_nullable - as int, - order: null == order - ? _value.order - : order // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EquipmentHistoryCompaniesLinkRequestDtoImpl - implements _EquipmentHistoryCompaniesLinkRequestDto { - const _$EquipmentHistoryCompaniesLinkRequestDtoImpl( - {@JsonKey(name: 'companies_id') required this.companiesId, - @JsonKey(name: 'equipment_history_Id') required this.equipmentHistoryId, - @JsonKey(name: 'Order') this.order = 1}); - - factory _$EquipmentHistoryCompaniesLinkRequestDtoImpl.fromJson( - Map json) => - _$$EquipmentHistoryCompaniesLinkRequestDtoImplFromJson(json); - - @override - @JsonKey(name: 'companies_id') - final int companiesId; - @override - @JsonKey(name: 'equipment_history_Id') - final int equipmentHistoryId; - @override - @JsonKey(name: 'Order') - final int order; - - @override - String toString() { - return 'EquipmentHistoryCompaniesLinkRequestDto(companiesId: $companiesId, equipmentHistoryId: $equipmentHistoryId, order: $order)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EquipmentHistoryCompaniesLinkRequestDtoImpl && - (identical(other.companiesId, companiesId) || - other.companiesId == companiesId) && - (identical(other.equipmentHistoryId, equipmentHistoryId) || - other.equipmentHistoryId == equipmentHistoryId) && - (identical(other.order, order) || other.order == order)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, companiesId, equipmentHistoryId, order); - - /// Create a copy of EquipmentHistoryCompaniesLinkRequestDto - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWith< - _$EquipmentHistoryCompaniesLinkRequestDtoImpl> - get copyWith => - __$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWithImpl< - _$EquipmentHistoryCompaniesLinkRequestDtoImpl>(this, _$identity); - - @override - Map toJson() { - return _$$EquipmentHistoryCompaniesLinkRequestDtoImplToJson( - this, - ); - } -} - -abstract class _EquipmentHistoryCompaniesLinkRequestDto - implements EquipmentHistoryCompaniesLinkRequestDto { - const factory _EquipmentHistoryCompaniesLinkRequestDto( - {@JsonKey(name: 'companies_id') required final int companiesId, - @JsonKey(name: 'equipment_history_Id') - required final int equipmentHistoryId, - @JsonKey(name: 'Order') final int order}) = - _$EquipmentHistoryCompaniesLinkRequestDtoImpl; - - factory _EquipmentHistoryCompaniesLinkRequestDto.fromJson( - Map json) = - _$EquipmentHistoryCompaniesLinkRequestDtoImpl.fromJson; - - @override - @JsonKey(name: 'companies_id') - int get companiesId; - @override - @JsonKey(name: 'equipment_history_Id') - int get equipmentHistoryId; - @override - @JsonKey(name: 'Order') - int get order; - - /// Create a copy of EquipmentHistoryCompaniesLinkRequestDto - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EquipmentHistoryCompaniesLinkRequestDtoImplCopyWith< - _$EquipmentHistoryCompaniesLinkRequestDtoImpl> - get copyWith => throw _privateConstructorUsedError; -} - -EquipmentHistoryCompaniesLinkUpdateRequestDto - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoFromJson( - Map json) { - return _EquipmentHistoryCompaniesLinkUpdateRequestDto.fromJson(json); -} - -/// @nodoc -mixin _$EquipmentHistoryCompaniesLinkUpdateRequestDto { - @JsonKey(name: 'companies_id') - int? get companiesId => throw _privateConstructorUsedError; - @JsonKey(name: 'equipment_history_Id') - int? get equipmentHistoryId => throw _privateConstructorUsedError; - @JsonKey(name: 'Order') - int? get order => throw _privateConstructorUsedError; - - /// Serializes this EquipmentHistoryCompaniesLinkUpdateRequestDto to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EquipmentHistoryCompaniesLinkUpdateRequestDto - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWith< - EquipmentHistoryCompaniesLinkUpdateRequestDto> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWith<$Res> { - factory $EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWith( - EquipmentHistoryCompaniesLinkUpdateRequestDto value, - $Res Function(EquipmentHistoryCompaniesLinkUpdateRequestDto) then) = - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWithImpl<$Res, - EquipmentHistoryCompaniesLinkUpdateRequestDto>; - @useResult - $Res call( - {@JsonKey(name: 'companies_id') int? companiesId, - @JsonKey(name: 'equipment_history_Id') int? equipmentHistoryId, - @JsonKey(name: 'Order') int? order}); -} - -/// @nodoc -class _$EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWithImpl<$Res, - $Val extends EquipmentHistoryCompaniesLinkUpdateRequestDto> - implements $EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWith<$Res> { - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EquipmentHistoryCompaniesLinkUpdateRequestDto - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? companiesId = freezed, - Object? equipmentHistoryId = freezed, - Object? order = freezed, - }) { - return _then(_value.copyWith( - companiesId: freezed == companiesId - ? _value.companiesId - : companiesId // ignore: cast_nullable_to_non_nullable - as int?, - equipmentHistoryId: freezed == equipmentHistoryId - ? _value.equipmentHistoryId - : equipmentHistoryId // ignore: cast_nullable_to_non_nullable - as int?, - order: freezed == order - ? _value.order - : order // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWith< - $Res> - implements $EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWith<$Res> { - factory _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWith( - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl value, - $Res Function(_$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl) - then) = - __$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: 'companies_id') int? companiesId, - @JsonKey(name: 'equipment_history_Id') int? equipmentHistoryId, - @JsonKey(name: 'Order') int? order}); -} - -/// @nodoc -class __$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWithImpl<$Res> - extends _$EquipmentHistoryCompaniesLinkUpdateRequestDtoCopyWithImpl<$Res, - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl> - implements - _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWith<$Res> { - __$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWithImpl( - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl _value, - $Res Function(_$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl) _then) - : super(_value, _then); - - /// Create a copy of EquipmentHistoryCompaniesLinkUpdateRequestDto - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? companiesId = freezed, - Object? equipmentHistoryId = freezed, - Object? order = freezed, - }) { - return _then(_$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl( - companiesId: freezed == companiesId - ? _value.companiesId - : companiesId // ignore: cast_nullable_to_non_nullable - as int?, - equipmentHistoryId: freezed == equipmentHistoryId - ? _value.equipmentHistoryId - : equipmentHistoryId // ignore: cast_nullable_to_non_nullable - as int?, - order: freezed == order - ? _value.order - : order // ignore: cast_nullable_to_non_nullable - as int?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl - implements _EquipmentHistoryCompaniesLinkUpdateRequestDto { - const _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl( - {@JsonKey(name: 'companies_id') this.companiesId, - @JsonKey(name: 'equipment_history_Id') this.equipmentHistoryId, - @JsonKey(name: 'Order') this.order}); - - factory _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl.fromJson( - Map json) => - _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplFromJson(json); - - @override - @JsonKey(name: 'companies_id') - final int? companiesId; - @override - @JsonKey(name: 'equipment_history_Id') - final int? equipmentHistoryId; - @override - @JsonKey(name: 'Order') - final int? order; - - @override - String toString() { - return 'EquipmentHistoryCompaniesLinkUpdateRequestDto(companiesId: $companiesId, equipmentHistoryId: $equipmentHistoryId, order: $order)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl && - (identical(other.companiesId, companiesId) || - other.companiesId == companiesId) && - (identical(other.equipmentHistoryId, equipmentHistoryId) || - other.equipmentHistoryId == equipmentHistoryId) && - (identical(other.order, order) || other.order == order)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, companiesId, equipmentHistoryId, order); - - /// Create a copy of EquipmentHistoryCompaniesLinkUpdateRequestDto - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWith< - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl> - get copyWith => - __$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWithImpl< - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplToJson( - this, - ); - } -} - -abstract class _EquipmentHistoryCompaniesLinkUpdateRequestDto - implements EquipmentHistoryCompaniesLinkUpdateRequestDto { - const factory _EquipmentHistoryCompaniesLinkUpdateRequestDto( - {@JsonKey(name: 'companies_id') final int? companiesId, - @JsonKey(name: 'equipment_history_Id') final int? equipmentHistoryId, - @JsonKey(name: 'Order') final int? order}) = - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl; - - factory _EquipmentHistoryCompaniesLinkUpdateRequestDto.fromJson( - Map json) = - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl.fromJson; - - @override - @JsonKey(name: 'companies_id') - int? get companiesId; - @override - @JsonKey(name: 'equipment_history_Id') - int? get equipmentHistoryId; - @override - @JsonKey(name: 'Order') - int? get order; - - /// Create a copy of EquipmentHistoryCompaniesLinkUpdateRequestDto - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplCopyWith< - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl> - get copyWith => throw _privateConstructorUsedError; -} - -EquipmentHistoryCompaniesLinkListResponse - _$EquipmentHistoryCompaniesLinkListResponseFromJson( - Map json) { - return _EquipmentHistoryCompaniesLinkListResponse.fromJson(json); -} - -/// @nodoc -mixin _$EquipmentHistoryCompaniesLinkListResponse { - @JsonKey(name: 'data') - List get items => - throw _privateConstructorUsedError; - @JsonKey(name: 'total') - int get totalCount => throw _privateConstructorUsedError; - @JsonKey(name: 'page') - int get currentPage => throw _privateConstructorUsedError; - @JsonKey(name: 'total_pages') - int get totalPages => throw _privateConstructorUsedError; - @JsonKey(name: 'page_size') - int? get pageSize => throw _privateConstructorUsedError; - - /// Serializes this EquipmentHistoryCompaniesLinkListResponse to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EquipmentHistoryCompaniesLinkListResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EquipmentHistoryCompaniesLinkListResponseCopyWith< - EquipmentHistoryCompaniesLinkListResponse> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EquipmentHistoryCompaniesLinkListResponseCopyWith<$Res> { - factory $EquipmentHistoryCompaniesLinkListResponseCopyWith( - EquipmentHistoryCompaniesLinkListResponse value, - $Res Function(EquipmentHistoryCompaniesLinkListResponse) then) = - _$EquipmentHistoryCompaniesLinkListResponseCopyWithImpl<$Res, - EquipmentHistoryCompaniesLinkListResponse>; - @useResult - $Res call( - {@JsonKey(name: 'data') List items, - @JsonKey(name: 'total') int totalCount, - @JsonKey(name: 'page') int currentPage, - @JsonKey(name: 'total_pages') int totalPages, - @JsonKey(name: 'page_size') int? pageSize}); -} - -/// @nodoc -class _$EquipmentHistoryCompaniesLinkListResponseCopyWithImpl<$Res, - $Val extends EquipmentHistoryCompaniesLinkListResponse> - implements $EquipmentHistoryCompaniesLinkListResponseCopyWith<$Res> { - _$EquipmentHistoryCompaniesLinkListResponseCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EquipmentHistoryCompaniesLinkListResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? items = null, - Object? totalCount = null, - Object? currentPage = null, - Object? totalPages = null, - Object? pageSize = freezed, - }) { - return _then(_value.copyWith( - items: null == items - ? _value.items - : items // ignore: cast_nullable_to_non_nullable - as List, - totalCount: null == totalCount - ? _value.totalCount - : totalCount // ignore: cast_nullable_to_non_nullable - as int, - currentPage: null == currentPage - ? _value.currentPage - : currentPage // ignore: cast_nullable_to_non_nullable - as int, - totalPages: null == totalPages - ? _value.totalPages - : totalPages // ignore: cast_nullable_to_non_nullable - as int, - pageSize: freezed == pageSize - ? _value.pageSize - : pageSize // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$EquipmentHistoryCompaniesLinkListResponseImplCopyWith<$Res> - implements $EquipmentHistoryCompaniesLinkListResponseCopyWith<$Res> { - factory _$$EquipmentHistoryCompaniesLinkListResponseImplCopyWith( - _$EquipmentHistoryCompaniesLinkListResponseImpl value, - $Res Function(_$EquipmentHistoryCompaniesLinkListResponseImpl) then) = - __$$EquipmentHistoryCompaniesLinkListResponseImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: 'data') List items, - @JsonKey(name: 'total') int totalCount, - @JsonKey(name: 'page') int currentPage, - @JsonKey(name: 'total_pages') int totalPages, - @JsonKey(name: 'page_size') int? pageSize}); -} - -/// @nodoc -class __$$EquipmentHistoryCompaniesLinkListResponseImplCopyWithImpl<$Res> - extends _$EquipmentHistoryCompaniesLinkListResponseCopyWithImpl<$Res, - _$EquipmentHistoryCompaniesLinkListResponseImpl> - implements _$$EquipmentHistoryCompaniesLinkListResponseImplCopyWith<$Res> { - __$$EquipmentHistoryCompaniesLinkListResponseImplCopyWithImpl( - _$EquipmentHistoryCompaniesLinkListResponseImpl _value, - $Res Function(_$EquipmentHistoryCompaniesLinkListResponseImpl) _then) - : super(_value, _then); - - /// Create a copy of EquipmentHistoryCompaniesLinkListResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? items = null, - Object? totalCount = null, - Object? currentPage = null, - Object? totalPages = null, - Object? pageSize = freezed, - }) { - return _then(_$EquipmentHistoryCompaniesLinkListResponseImpl( - items: null == items - ? _value._items - : items // ignore: cast_nullable_to_non_nullable - as List, - totalCount: null == totalCount - ? _value.totalCount - : totalCount // ignore: cast_nullable_to_non_nullable - as int, - currentPage: null == currentPage - ? _value.currentPage - : currentPage // ignore: cast_nullable_to_non_nullable - as int, - totalPages: null == totalPages - ? _value.totalPages - : totalPages // ignore: cast_nullable_to_non_nullable - as int, - pageSize: freezed == pageSize - ? _value.pageSize - : pageSize // ignore: cast_nullable_to_non_nullable - as int?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EquipmentHistoryCompaniesLinkListResponseImpl - implements _EquipmentHistoryCompaniesLinkListResponse { - const _$EquipmentHistoryCompaniesLinkListResponseImpl( - {@JsonKey(name: 'data') - required final List items, - @JsonKey(name: 'total') required this.totalCount, - @JsonKey(name: 'page') required this.currentPage, - @JsonKey(name: 'total_pages') required this.totalPages, - @JsonKey(name: 'page_size') this.pageSize}) - : _items = items; - - factory _$EquipmentHistoryCompaniesLinkListResponseImpl.fromJson( - Map json) => - _$$EquipmentHistoryCompaniesLinkListResponseImplFromJson(json); - - final List _items; - @override - @JsonKey(name: 'data') - List get items { - if (_items is EqualUnmodifiableListView) return _items; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_items); - } - - @override - @JsonKey(name: 'total') - final int totalCount; - @override - @JsonKey(name: 'page') - final int currentPage; - @override - @JsonKey(name: 'total_pages') - final int totalPages; - @override - @JsonKey(name: 'page_size') - final int? pageSize; - - @override - String toString() { - return 'EquipmentHistoryCompaniesLinkListResponse(items: $items, totalCount: $totalCount, currentPage: $currentPage, totalPages: $totalPages, pageSize: $pageSize)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EquipmentHistoryCompaniesLinkListResponseImpl && - const DeepCollectionEquality().equals(other._items, _items) && - (identical(other.totalCount, totalCount) || - other.totalCount == totalCount) && - (identical(other.currentPage, currentPage) || - other.currentPage == currentPage) && - (identical(other.totalPages, totalPages) || - other.totalPages == totalPages) && - (identical(other.pageSize, pageSize) || - other.pageSize == pageSize)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_items), - totalCount, - currentPage, - totalPages, - pageSize); - - /// Create a copy of EquipmentHistoryCompaniesLinkListResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EquipmentHistoryCompaniesLinkListResponseImplCopyWith< - _$EquipmentHistoryCompaniesLinkListResponseImpl> - get copyWith => - __$$EquipmentHistoryCompaniesLinkListResponseImplCopyWithImpl< - _$EquipmentHistoryCompaniesLinkListResponseImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$EquipmentHistoryCompaniesLinkListResponseImplToJson( - this, - ); - } -} - -abstract class _EquipmentHistoryCompaniesLinkListResponse - implements EquipmentHistoryCompaniesLinkListResponse { - const factory _EquipmentHistoryCompaniesLinkListResponse( - {@JsonKey(name: 'data') - required final List items, - @JsonKey(name: 'total') required final int totalCount, - @JsonKey(name: 'page') required final int currentPage, - @JsonKey(name: 'total_pages') required final int totalPages, - @JsonKey(name: 'page_size') final int? pageSize}) = - _$EquipmentHistoryCompaniesLinkListResponseImpl; - - factory _EquipmentHistoryCompaniesLinkListResponse.fromJson( - Map json) = - _$EquipmentHistoryCompaniesLinkListResponseImpl.fromJson; - - @override - @JsonKey(name: 'data') - List get items; - @override - @JsonKey(name: 'total') - int get totalCount; - @override - @JsonKey(name: 'page') - int get currentPage; - @override - @JsonKey(name: 'total_pages') - int get totalPages; - @override - @JsonKey(name: 'page_size') - int? get pageSize; - - /// Create a copy of EquipmentHistoryCompaniesLinkListResponse - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EquipmentHistoryCompaniesLinkListResponseImplCopyWith< - _$EquipmentHistoryCompaniesLinkListResponseImpl> - get copyWith => throw _privateConstructorUsedError; -} diff --git a/lib/data/models/equipment_history_companies_link_dto.g.dart b/lib/data/models/equipment_history_companies_link_dto.g.dart deleted file mode 100644 index 5fac392..0000000 --- a/lib/data/models/equipment_history_companies_link_dto.g.dart +++ /dev/null @@ -1,101 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'equipment_history_companies_link_dto.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$EquipmentHistoryCompaniesLinkDtoImpl - _$$EquipmentHistoryCompaniesLinkDtoImplFromJson( - Map json) => - _$EquipmentHistoryCompaniesLinkDtoImpl( - id: (json['Id'] as num?)?.toInt(), - companiesId: (json['companies_id'] as num).toInt(), - equipmentHistoryId: (json['equipment_history_Id'] as num).toInt(), - order: (json['Order'] as num?)?.toInt() ?? 1, - isDeleted: json['is_deleted'] as bool? ?? false, - registeredAt: DateTime.parse(json['registered_at'] as String), - updatedAt: json['updated_at'] == null - ? null - : DateTime.parse(json['updated_at'] as String), - company: json['company'] == null - ? null - : CompanyDto.fromJson(json['company'] as Map), - equipmentHistory: json['equipmentHistory'] == null - ? null - : EquipmentHistoryDto.fromJson( - json['equipmentHistory'] as Map), - ); - -Map _$$EquipmentHistoryCompaniesLinkDtoImplToJson( - _$EquipmentHistoryCompaniesLinkDtoImpl instance) => - { - 'Id': instance.id, - 'companies_id': instance.companiesId, - 'equipment_history_Id': instance.equipmentHistoryId, - 'Order': instance.order, - 'is_deleted': instance.isDeleted, - 'registered_at': instance.registeredAt.toIso8601String(), - 'updated_at': instance.updatedAt?.toIso8601String(), - 'company': instance.company, - 'equipmentHistory': instance.equipmentHistory, - }; - -_$EquipmentHistoryCompaniesLinkRequestDtoImpl - _$$EquipmentHistoryCompaniesLinkRequestDtoImplFromJson( - Map json) => - _$EquipmentHistoryCompaniesLinkRequestDtoImpl( - companiesId: (json['companies_id'] as num).toInt(), - equipmentHistoryId: (json['equipment_history_Id'] as num).toInt(), - order: (json['Order'] as num?)?.toInt() ?? 1, - ); - -Map _$$EquipmentHistoryCompaniesLinkRequestDtoImplToJson( - _$EquipmentHistoryCompaniesLinkRequestDtoImpl instance) => - { - 'companies_id': instance.companiesId, - 'equipment_history_Id': instance.equipmentHistoryId, - 'Order': instance.order, - }; - -_$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl - _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplFromJson( - Map json) => - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl( - companiesId: (json['companies_id'] as num?)?.toInt(), - equipmentHistoryId: (json['equipment_history_Id'] as num?)?.toInt(), - order: (json['Order'] as num?)?.toInt(), - ); - -Map _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplToJson( - _$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl instance) => - { - 'companies_id': instance.companiesId, - 'equipment_history_Id': instance.equipmentHistoryId, - 'Order': instance.order, - }; - -_$EquipmentHistoryCompaniesLinkListResponseImpl - _$$EquipmentHistoryCompaniesLinkListResponseImplFromJson( - Map json) => - _$EquipmentHistoryCompaniesLinkListResponseImpl( - items: (json['data'] as List) - .map((e) => EquipmentHistoryCompaniesLinkDto.fromJson( - e as Map)) - .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 _$$EquipmentHistoryCompaniesLinkListResponseImplToJson( - _$EquipmentHistoryCompaniesLinkListResponseImpl instance) => - { - 'data': instance.items, - 'total': instance.totalCount, - 'page': instance.currentPage, - 'total_pages': instance.totalPages, - 'page_size': instance.pageSize, - }; diff --git a/lib/domain/usecases/auth/auth_usecases.dart b/lib/domain/usecases/auth/auth_usecases.dart deleted file mode 100644 index f43522e..0000000 --- a/lib/domain/usecases/auth/auth_usecases.dart +++ /dev/null @@ -1,7 +0,0 @@ -/// Auth 도메인 UseCase 모음 -library; -export 'login_usecase.dart'; -export 'logout_usecase.dart'; -export 'refresh_token_usecase.dart'; -export 'get_current_user_usecase.dart'; -export 'check_auth_status_usecase.dart'; \ No newline at end of file diff --git a/lib/domain/usecases/company/company_usecases.dart b/lib/domain/usecases/company/company_usecases.dart deleted file mode 100644 index 8917792..0000000 --- a/lib/domain/usecases/company/company_usecases.dart +++ /dev/null @@ -1,13 +0,0 @@ -/// Company 도메인 UseCase 모음 -library; -export 'get_companies_usecase.dart'; -export 'create_company_usecase.dart'; -export 'update_company_usecase.dart'; -export 'delete_company_usecase.dart'; -export 'get_company_detail_usecase.dart'; -export 'toggle_company_status_usecase.dart'; - -// 계층 구조 관련 UseCase -export 'get_company_hierarchy_usecase.dart'; -export 'update_parent_company_usecase.dart'; -export 'validate_company_deletion_usecase.dart'; \ No newline at end of file diff --git a/lib/domain/usecases/equipment/equipment_usecases.dart b/lib/domain/usecases/equipment/equipment_usecases.dart deleted file mode 100644 index 27b9008..0000000 --- a/lib/domain/usecases/equipment/equipment_usecases.dart +++ /dev/null @@ -1,7 +0,0 @@ -/// Equipment 도메인 UseCase 모음 -library; -export 'get_equipments_usecase.dart'; -export 'get_equipment_detail_usecase.dart'; -export 'create_equipment_usecase.dart'; -export 'update_equipment_usecase.dart'; -export 'delete_equipment_usecase.dart'; \ No newline at end of file diff --git a/lib/domain/usecases/user/user_usecases.dart b/lib/domain/usecases/user/user_usecases.dart deleted file mode 100644 index 7cfa06f..0000000 --- a/lib/domain/usecases/user/user_usecases.dart +++ /dev/null @@ -1,9 +0,0 @@ -/// User 도메인 UseCase 모음 -library; -export 'get_users_usecase.dart'; -export 'create_user_usecase.dart'; -export 'update_user_usecase.dart'; -export 'delete_user_usecase.dart'; -export 'get_user_detail_usecase.dart'; -export 'reset_password_usecase.dart'; -export 'toggle_user_status_usecase.dart'; \ No newline at end of file diff --git a/lib/domain/usecases/warehouse_location/warehouse_location_usecases.dart b/lib/domain/usecases/warehouse_location/warehouse_location_usecases.dart deleted file mode 100644 index 8ed2cf0..0000000 --- a/lib/domain/usecases/warehouse_location/warehouse_location_usecases.dart +++ /dev/null @@ -1,6 +0,0 @@ -// WarehouseLocation UseCase barrel file -export 'get_warehouse_locations_usecase.dart'; -export 'get_warehouse_location_detail_usecase.dart'; -export 'create_warehouse_location_usecase.dart'; -export 'update_warehouse_location_usecase.dart'; -export 'delete_warehouse_location_usecase.dart'; \ No newline at end of file diff --git a/lib/screens/common/custom_widgets.dart b/lib/screens/common/custom_widgets.dart index 72df266..3738693 100644 --- a/lib/screens/common/custom_widgets.dart +++ b/lib/screens/common/custom_widgets.dart @@ -1,6 +1 @@ export 'custom_widgets/form_field_wrapper.dart'; -export 'custom_widgets/date_picker_field.dart'; -export 'custom_widgets/highlight_text.dart'; -export 'custom_widgets/autocomplete_dropdown.dart'; -export 'custom_widgets/category_selection_field.dart'; -export 'custom_widgets/category_data.dart'; diff --git a/lib/screens/common/custom_widgets/autocomplete_dropdown.dart b/lib/screens/common/custom_widgets/autocomplete_dropdown.dart deleted file mode 100644 index 8aea520..0000000 --- a/lib/screens/common/custom_widgets/autocomplete_dropdown.dart +++ /dev/null @@ -1,88 +0,0 @@ -import 'package:flutter/material.dart'; -import 'highlight_text.dart'; - -// 자동완성 드롭다운 공통 위젯 -class AutocompleteDropdown extends StatelessWidget { - // 드롭다운에 표시할 항목 리스트 - final List items; - // 현재 입력된 텍스트(하이라이트 기준) - final String inputText; - // 항목 선택 시 콜백 - final void Function(String) onSelect; - // 드롭다운 표시 여부 - final bool showDropdown; - // 최대 높이(항목 개수에 따라 자동 조절) - final double maxHeight; - // 드롭다운이 비었을 때 표시할 위젯 - final Widget emptyWidget; - - const AutocompleteDropdown({ - super.key, - required this.items, - required this.inputText, - required this.onSelect, - required this.showDropdown, - this.maxHeight = 200, - this.emptyWidget = const Padding( - padding: EdgeInsets.all(12.0), - child: Text('검색 결과가 없습니다'), - ), - }); - - @override - Widget build(BuildContext context) { - return AnimatedContainer( - duration: const Duration(milliseconds: 200), - height: - showDropdown - ? (items.length > 4 ? maxHeight : items.length * 50.0) - : 0, - margin: EdgeInsets.only(top: showDropdown ? 4 : 0), - child: SingleChildScrollView( - physics: const ClampingScrollPhysics(), - child: GestureDetector( - onTap: () {}, // 이벤트 버블링 방지 - child: Container( - width: double.infinity, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4), - border: Border.all(color: Colors.grey.shade300), - boxShadow: [ - BoxShadow( - color: Colors.grey.withAlpha(77), - spreadRadius: 1, - blurRadius: 3, - offset: const Offset(0, 1), - ), - ], - ), - child: - items.isEmpty - ? emptyWidget - : ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: items.length, - separatorBuilder: - (context, index) => - Divider(height: 1, color: Colors.grey.shade200), - itemBuilder: (context, index) { - final String item = items[index]; - return ListTile( - dense: true, - title: HighlightText( - text: item, - highlight: inputText, - highlightColor: Theme.of(context).primaryColor, - ), - onTap: () => onSelect(item), - ); - }, - ), - ), - ), - ), - ); - } -} diff --git a/lib/screens/common/custom_widgets/category_data.dart b/lib/screens/common/custom_widgets/category_data.dart deleted file mode 100644 index 82a0fd1..0000000 --- a/lib/screens/common/custom_widgets/category_data.dart +++ /dev/null @@ -1,18 +0,0 @@ -// 카테고리 데이터 (예시) -final Map>> categoryData = { - '컴퓨터': { - '데스크탑': ['사무용', '게이밍', '워크스테이션'], - '노트북': ['사무용', '게이밍', '울트라북'], - '태블릿': ['안드로이드', 'iOS', '윈도우'], - }, - '네트워크': { - '라우터': ['가정용', '기업용', '산업용'], - '스위치': ['관리형', '비관리형'], - '액세스 포인트': ['실내용', '실외용'], - }, - '주변기기': { - '모니터': ['LCD', 'LED', 'OLED'], - '키보드': ['유선', '무선', '기계식'], - '마우스': ['유선', '무선', '트랙볼'], - }, -}; diff --git a/lib/screens/common/custom_widgets/category_selection_field.dart b/lib/screens/common/custom_widgets/category_selection_field.dart deleted file mode 100644 index cf42768..0000000 --- a/lib/screens/common/custom_widgets/category_selection_field.dart +++ /dev/null @@ -1,562 +0,0 @@ -import 'package:flutter/material.dart'; -import 'autocomplete_dropdown.dart'; -import 'form_field_wrapper.dart'; -import 'category_data.dart'; - -// 카테고리 선택 필드 (대분류/중분류/소분류) -class CategorySelectionField extends StatefulWidget { - final String category; - final String subCategory; - final String subSubCategory; - final Function(String, String, String) onCategoryChanged; - final bool isRequired; - - const CategorySelectionField({ - super.key, - required this.category, - required this.subCategory, - required this.subSubCategory, - required this.onCategoryChanged, - this.isRequired = false, - }); - - @override - State createState() => _CategorySelectionFieldState(); -} - -class _CategorySelectionFieldState extends State { - // 검색 관련 컨트롤러 및 상태 변수 - final TextEditingController _categoryController = TextEditingController(); - final FocusNode _categoryFocusNode = FocusNode(); - bool _showCategoryDropdown = false; - List _filteredCategories = []; - - // 중분류 관련 변수 - final TextEditingController _subCategoryController = TextEditingController(); - final FocusNode _subCategoryFocusNode = FocusNode(); - bool _showSubCategoryDropdown = false; - List _filteredSubCategories = []; - - // 소분류 관련 변수 - final TextEditingController _subSubCategoryController = - TextEditingController(); - final FocusNode _subSubCategoryFocusNode = FocusNode(); - bool _showSubSubCategoryDropdown = false; - List _filteredSubSubCategories = []; - - List _allCategories = []; - String _selectedCategory = ''; - String _selectedSubCategory = ''; - String _selectedSubSubCategory = ''; - - @override - void initState() { - super.initState(); - _selectedCategory = widget.category; - _selectedSubCategory = widget.subCategory; - _selectedSubSubCategory = widget.subSubCategory; - _categoryController.text = _selectedCategory; - _subCategoryController.text = _selectedSubCategory; - _subSubCategoryController.text = _selectedSubSubCategory; - - // 모든 카테고리 목록 초기화 - _allCategories = categoryData.keys.toList(); - _filteredCategories = List.from(_allCategories); - - // 중분류 목록 초기화 - _updateSubCategories(); - - // 소분류 목록 초기화 - _updateSubSubCategories(); - - // 대분류 컨트롤러 리스너 설정 - _categoryController.addListener(_onCategoryTextChanged); - _categoryFocusNode.addListener(() { - setState(() { - if (_categoryFocusNode.hasFocus) { - _showCategoryDropdown = _filteredCategories.isNotEmpty; - } else { - _showCategoryDropdown = false; - } - }); - }); - - // 중분류 컨트롤러 리스너 설정 - _subCategoryController.addListener(_onSubCategoryTextChanged); - _subCategoryFocusNode.addListener(() { - setState(() { - if (_subCategoryFocusNode.hasFocus) { - _showSubCategoryDropdown = _filteredSubCategories.isNotEmpty; - } else { - _showSubCategoryDropdown = false; - } - }); - }); - - // 소분류 컨트롤러 리스너 설정 - _subSubCategoryController.addListener(_onSubSubCategoryTextChanged); - _subSubCategoryFocusNode.addListener(() { - setState(() { - if (_subSubCategoryFocusNode.hasFocus) { - _showSubSubCategoryDropdown = _filteredSubSubCategories.isNotEmpty; - } else { - _showSubSubCategoryDropdown = false; - } - }); - }); - } - - @override - void dispose() { - _categoryController.dispose(); - _categoryFocusNode.dispose(); - _subCategoryController.dispose(); - _subCategoryFocusNode.dispose(); - _subSubCategoryController.dispose(); - _subSubCategoryFocusNode.dispose(); - super.dispose(); - } - - // 중분류 목록 업데이트 - void _updateSubCategories() { - if (_selectedCategory.isNotEmpty) { - final subCategories = - categoryData[_selectedCategory]?.keys.toList() ?? []; - _filteredSubCategories = List.from(subCategories); - } else { - _filteredSubCategories = []; - } - } - - // 소분류 목록 업데이트 - void _updateSubSubCategories() { - if (_selectedCategory.isNotEmpty && _selectedSubCategory.isNotEmpty) { - final subSubCategories = - categoryData[_selectedCategory]?[_selectedSubCategory] ?? []; - _filteredSubSubCategories = List.from(subSubCategories); - } else { - _filteredSubSubCategories = []; - } - } - - void _onCategoryTextChanged() { - final text = _categoryController.text; - setState(() { - _selectedCategory = text; - - if (text.isEmpty) { - _filteredCategories = List.from(_allCategories); - } else { - _filteredCategories = - _allCategories - .where( - (item) => item.toLowerCase().contains(text.toLowerCase()), - ) - .toList(); - - // 시작 부분이 일치하는 항목 우선 정렬 - _filteredCategories.sort((a, b) { - bool aStartsWith = a.toLowerCase().startsWith(text.toLowerCase()); - bool bStartsWith = b.toLowerCase().startsWith(text.toLowerCase()); - - if (aStartsWith && !bStartsWith) return -1; - if (!aStartsWith && bStartsWith) return 1; - return a.compareTo(b); - }); - } - - _showCategoryDropdown = - _filteredCategories.isNotEmpty && _categoryFocusNode.hasFocus; - - // 카테고리가 변경되면 하위 카테고리 초기화 - if (_selectedCategory != widget.category) { - _selectedSubCategory = ''; - _subCategoryController.text = ''; - _selectedSubSubCategory = ''; - _subSubCategoryController.text = ''; - _updateSubCategories(); - _updateSubSubCategories(); - } - - // 콜백 호출 - widget.onCategoryChanged( - _selectedCategory, - _selectedSubCategory, - _selectedSubSubCategory, - ); - }); - } - - // 중분류 텍스트 변경 핸들러 - void _onSubCategoryTextChanged() { - final text = _subCategoryController.text; - setState(() { - _selectedSubCategory = text; - - if (_selectedCategory.isNotEmpty) { - final subCategories = - categoryData[_selectedCategory]?.keys.toList() ?? []; - - if (text.isEmpty) { - _filteredSubCategories = List.from(subCategories); - } else { - _filteredSubCategories = - subCategories - .where( - (item) => item.toLowerCase().contains(text.toLowerCase()), - ) - .toList(); - - // 시작 부분이 일치하는 항목 우선 정렬 - _filteredSubCategories.sort((a, b) { - bool aStartsWith = a.toLowerCase().startsWith(text.toLowerCase()); - bool bStartsWith = b.toLowerCase().startsWith(text.toLowerCase()); - - if (aStartsWith && !bStartsWith) return -1; - if (!aStartsWith && bStartsWith) return 1; - return a.compareTo(b); - }); - } - } else { - _filteredSubCategories = []; - } - - _showSubCategoryDropdown = - _filteredSubCategories.isNotEmpty && _subCategoryFocusNode.hasFocus; - - // 중분류가 변경되면 소분류 초기화 - if (_selectedSubCategory != widget.subCategory) { - _selectedSubSubCategory = ''; - _subSubCategoryController.text = ''; - _updateSubSubCategories(); - } - - // 콜백 호출 - widget.onCategoryChanged( - _selectedCategory, - _selectedSubCategory, - _selectedSubSubCategory, - ); - }); - } - - // 소분류 텍스트 변경 핸들러 - void _onSubSubCategoryTextChanged() { - final text = _subSubCategoryController.text; - setState(() { - _selectedSubSubCategory = text; - - if (_selectedCategory.isNotEmpty && _selectedSubCategory.isNotEmpty) { - final subSubCategories = - categoryData[_selectedCategory]?[_selectedSubCategory] ?? []; - - if (text.isEmpty) { - _filteredSubSubCategories = List.from(subSubCategories); - } else { - _filteredSubSubCategories = - subSubCategories - .where( - (item) => item.toLowerCase().contains(text.toLowerCase()), - ) - .toList(); - - // 시작 부분이 일치하는 항목 우선 정렬 - _filteredSubSubCategories.sort((a, b) { - bool aStartsWith = a.toLowerCase().startsWith(text.toLowerCase()); - bool bStartsWith = b.toLowerCase().startsWith(text.toLowerCase()); - - if (aStartsWith && !bStartsWith) return -1; - if (!aStartsWith && bStartsWith) return 1; - return a.compareTo(b); - }); - } - } else { - _filteredSubSubCategories = []; - } - - _showSubSubCategoryDropdown = - _filteredSubSubCategories.isNotEmpty && - _subSubCategoryFocusNode.hasFocus; - - // 콜백 호출 - widget.onCategoryChanged( - _selectedCategory, - _selectedSubCategory, - _selectedSubSubCategory, - ); - }); - } - - void _selectCategory(String category) { - setState(() { - _selectedCategory = category; - _categoryController.text = category; - _showCategoryDropdown = false; - _selectedSubCategory = ''; - _subCategoryController.text = ''; - _selectedSubSubCategory = ''; - _subSubCategoryController.text = ''; - _updateSubCategories(); - _updateSubSubCategories(); - widget.onCategoryChanged( - _selectedCategory, - _selectedSubCategory, - _selectedSubSubCategory, - ); - }); - } - - // 중분류 선택 핸들러 - void _selectSubCategory(String subCategory) { - setState(() { - _selectedSubCategory = subCategory; - _subCategoryController.text = subCategory; - _showSubCategoryDropdown = false; - _selectedSubSubCategory = ''; - _subSubCategoryController.text = ''; - _updateSubSubCategories(); - widget.onCategoryChanged( - _selectedCategory, - _selectedSubCategory, - _selectedSubSubCategory, - ); - }); - } - - // 소분류 선택 핸들러 - void _selectSubSubCategory(String subSubCategory) { - setState(() { - _selectedSubSubCategory = subSubCategory; - _subSubCategoryController.text = subSubCategory; - _showSubSubCategoryDropdown = false; - widget.onCategoryChanged( - _selectedCategory, - _selectedSubCategory, - _selectedSubSubCategory, - ); - }); - } - - @override - Widget build(BuildContext context) { - return FormFieldWrapper( - label: '카테고리', - isRequired: widget.isRequired, - child: Column( - children: [ - // 대분류 입력 필드 (자동완성) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextFormField( - controller: _categoryController, - focusNode: _categoryFocusNode, - decoration: InputDecoration( - hintText: '대분류', - contentPadding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 12, - ), - suffixIcon: - _categoryController.text.isNotEmpty - ? IconButton( - icon: const Icon(Icons.clear), - onPressed: () { - setState(() { - _categoryController.clear(); - _selectedCategory = ''; - _selectedSubCategory = ''; - _selectedSubSubCategory = ''; - _subCategoryController.clear(); - _subSubCategoryController.clear(); - _filteredCategories = List.from(_allCategories); - _filteredSubCategories = []; - _filteredSubSubCategories = []; - _showCategoryDropdown = - _categoryFocusNode.hasFocus; - widget.onCategoryChanged('', '', ''); - }); - }, - ) - : IconButton( - icon: const Icon(Icons.arrow_drop_down), - onPressed: () { - setState(() { - _showCategoryDropdown = !_showCategoryDropdown; - }); - }, - ), - ), - validator: (value) { - if (widget.isRequired && (value == null || value.isEmpty)) { - return '대분류를 선택해주세요'; - } - return null; - }, - onTap: () { - setState(() { - if (!_showCategoryDropdown) { - _showCategoryDropdown = true; - } - }); - }, - ), - - // 대분류 자동완성 드롭다운 - AutocompleteDropdown( - items: _filteredCategories, - inputText: _categoryController.text, - onSelect: _selectCategory, - showDropdown: _showCategoryDropdown, - ), - ], - ), - - const SizedBox(height: 12), - - // 중분류 및 소분류 선택 행 - Row( - children: [ - // 중분류 입력 필드 (자동완성) - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextFormField( - controller: _subCategoryController, - focusNode: _subCategoryFocusNode, - decoration: InputDecoration( - hintText: '중분류', - contentPadding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 12, - ), - suffixIcon: - _subCategoryController.text.isNotEmpty - ? IconButton( - icon: const Icon(Icons.clear), - onPressed: () { - setState(() { - _subCategoryController.clear(); - _selectedSubCategory = ''; - _selectedSubSubCategory = ''; - _subSubCategoryController.clear(); - _updateSubCategories(); - _updateSubSubCategories(); - _showSubCategoryDropdown = - _subCategoryFocusNode.hasFocus; - widget.onCategoryChanged( - _selectedCategory, - '', - '', - ); - }); - }, - ) - : IconButton( - icon: const Icon(Icons.arrow_drop_down), - onPressed: () { - setState(() { - _showSubCategoryDropdown = - !_showSubCategoryDropdown; - }); - }, - ), - ), - enabled: _selectedCategory.isNotEmpty, - onTap: () { - setState(() { - if (!_showSubCategoryDropdown && - _filteredSubCategories.isNotEmpty) { - _showSubCategoryDropdown = true; - } - }); - }, - ), - - // 중분류 자동완성 드롭다운 - AutocompleteDropdown( - items: _filteredSubCategories, - inputText: _subCategoryController.text, - onSelect: _selectSubCategory, - showDropdown: _showSubCategoryDropdown, - ), - ], - ), - ), - - const SizedBox(width: 12), - - // 소분류 입력 필드 (자동완성) - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextFormField( - controller: _subSubCategoryController, - focusNode: _subSubCategoryFocusNode, - decoration: InputDecoration( - hintText: '소분류', - contentPadding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 12, - ), - suffixIcon: - _subSubCategoryController.text.isNotEmpty - ? IconButton( - icon: const Icon(Icons.clear), - onPressed: () { - setState(() { - _subSubCategoryController.clear(); - _selectedSubSubCategory = ''; - _updateSubSubCategories(); - _showSubSubCategoryDropdown = - _subSubCategoryFocusNode.hasFocus; - widget.onCategoryChanged( - _selectedCategory, - _selectedSubCategory, - '', - ); - }); - }, - ) - : IconButton( - icon: const Icon(Icons.arrow_drop_down), - onPressed: () { - setState(() { - _showSubSubCategoryDropdown = - !_showSubSubCategoryDropdown; - }); - }, - ), - ), - enabled: - _selectedCategory.isNotEmpty && - _selectedSubCategory.isNotEmpty, - onTap: () { - setState(() { - if (!_showSubSubCategoryDropdown && - _filteredSubSubCategories.isNotEmpty) { - _showSubSubCategoryDropdown = true; - } - }); - }, - ), - - // 소분류 자동완성 드롭다운 - AutocompleteDropdown( - items: _filteredSubSubCategories, - inputText: _subSubCategoryController.text, - onSelect: _selectSubSubCategory, - showDropdown: _showSubSubCategoryDropdown, - ), - ], - ), - ), - ], - ), - ], - ), - ); - } -} diff --git a/lib/screens/common/custom_widgets/date_picker_field.dart b/lib/screens/common/custom_widgets/date_picker_field.dart deleted file mode 100644 index 0772e59..0000000 --- a/lib/screens/common/custom_widgets/date_picker_field.dart +++ /dev/null @@ -1,57 +0,0 @@ -import 'package:flutter/material.dart'; -import 'form_field_wrapper.dart'; -import 'package:superport/screens/common/theme_shadcn.dart'; - -// 날짜 선택 필드 -class DatePickerField extends StatelessWidget { - final DateTime selectedDate; - final Function(DateTime) onDateChanged; - final bool allowFutureDate; - final bool isRequired; - - const DatePickerField({ - super.key, - required this.selectedDate, - required this.onDateChanged, - this.allowFutureDate = false, - this.isRequired = false, - }); - - @override - Widget build(BuildContext context) { - return InkWell( - onTap: () async { - final DateTime? picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime(2000), - lastDate: allowFutureDate ? DateTime(2100) : DateTime.now(), - ); - if (picked != null && picked != selectedDate) { - onDateChanged(picked); - } - }, - child: FormFieldWrapper( - label: '날짜', - isRequired: isRequired, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 15), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade400), - borderRadius: BorderRadius.circular(4), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '${selectedDate.year}-${selectedDate.month.toString().padLeft(2, '0')}-${selectedDate.day.toString().padLeft(2, '0')}', - style: ShadcnTheme.bodyMedium, - ), - const Icon(Icons.calendar_today, size: 20), - ], - ), - ), - ), - ); - } -} diff --git a/lib/screens/common/custom_widgets/highlight_text.dart b/lib/screens/common/custom_widgets/highlight_text.dart deleted file mode 100644 index a6c9817..0000000 --- a/lib/screens/common/custom_widgets/highlight_text.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:flutter/material.dart'; - -// 자동완성 드롭다운에서 텍스트 하이라이트를 위한 위젯 -class HighlightText extends StatelessWidget { - // 전체 텍스트 - final String text; - // 하이라이트할 부분 - final String highlight; - // 하이라이트 색상 - final Color highlightColor; - // 텍스트 스타일 - final TextStyle? style; - - const HighlightText({ - super.key, - required this.text, - required this.highlight, - this.highlightColor = Colors.blue, - this.style, - }); - - @override - Widget build(BuildContext context) { - if (highlight.isEmpty) { - // 하이라이트가 없으면 전체 텍스트 반환 - return Text(text, style: style); - } - final String lowerText = text.toLowerCase(); - final String lowerHighlight = highlight.toLowerCase(); - final int start = lowerText.indexOf(lowerHighlight); - if (start < 0) { - // 일치하는 부분이 없으면 전체 텍스트 반환 - return Text(text, style: style); - } - final int end = start + highlight.length; - return RichText( - text: TextSpan( - style: style ?? DefaultTextStyle.of(context).style, - children: [ - if (start > 0) TextSpan(text: text.substring(0, start)), - TextSpan( - text: text.substring(start, end), - style: TextStyle( - fontWeight: FontWeight.bold, - color: highlightColor, - ), - ), - if (end < text.length) TextSpan(text: text.substring(end)), - ], - ), - ); - } -}