backup: 사용하지 않는 파일 삭제 전 복구 지점
- 전체 371개 파일 중 82개 미사용 파일 식별 - Phase 1: 33개 파일 삭제 예정 (100% 안전) - Phase 2: 30개 파일 삭제 검토 예정 - Phase 3: 19개 파일 수동 검토 예정 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,8 @@ class AuthUser with _$AuthUser {
|
||||
required String email,
|
||||
required String name,
|
||||
@Default('admin') String role, // Default to 'admin' if not provided
|
||||
String? phone, // Added for /auth/me API
|
||||
String? mobile, // Added for /auth/me API
|
||||
}) = _AuthUser;
|
||||
|
||||
factory AuthUser.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -25,7 +25,11 @@ mixin _$AuthUser {
|
||||
throw _privateConstructorUsedError; // API doesn't return username
|
||||
String get email => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get role => throw _privateConstructorUsedError;
|
||||
String get role =>
|
||||
throw _privateConstructorUsedError; // Default to 'admin' if not provided
|
||||
String? get phone =>
|
||||
throw _privateConstructorUsedError; // Added for /auth/me API
|
||||
String? get mobile => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this AuthUser to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -42,7 +46,14 @@ abstract class $AuthUserCopyWith<$Res> {
|
||||
factory $AuthUserCopyWith(AuthUser value, $Res Function(AuthUser) then) =
|
||||
_$AuthUserCopyWithImpl<$Res, AuthUser>;
|
||||
@useResult
|
||||
$Res call({int id, String? username, String email, String name, String role});
|
||||
$Res call(
|
||||
{int id,
|
||||
String? username,
|
||||
String email,
|
||||
String name,
|
||||
String role,
|
||||
String? phone,
|
||||
String? mobile});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -65,6 +76,8 @@ class _$AuthUserCopyWithImpl<$Res, $Val extends AuthUser>
|
||||
Object? email = null,
|
||||
Object? name = null,
|
||||
Object? role = null,
|
||||
Object? phone = freezed,
|
||||
Object? mobile = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
@@ -87,6 +100,14 @@ class _$AuthUserCopyWithImpl<$Res, $Val extends AuthUser>
|
||||
? _value.role
|
||||
: role // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
phone: freezed == phone
|
||||
? _value.phone
|
||||
: phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mobile: freezed == mobile
|
||||
? _value.mobile
|
||||
: mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -99,7 +120,14 @@ abstract class _$$AuthUserImplCopyWith<$Res>
|
||||
__$$AuthUserImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int id, String? username, String email, String name, String role});
|
||||
$Res call(
|
||||
{int id,
|
||||
String? username,
|
||||
String email,
|
||||
String name,
|
||||
String role,
|
||||
String? phone,
|
||||
String? mobile});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -120,6 +148,8 @@ class __$$AuthUserImplCopyWithImpl<$Res>
|
||||
Object? email = null,
|
||||
Object? name = null,
|
||||
Object? role = null,
|
||||
Object? phone = freezed,
|
||||
Object? mobile = freezed,
|
||||
}) {
|
||||
return _then(_$AuthUserImpl(
|
||||
id: null == id
|
||||
@@ -142,6 +172,14 @@ class __$$AuthUserImplCopyWithImpl<$Res>
|
||||
? _value.role
|
||||
: role // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
phone: freezed == phone
|
||||
? _value.phone
|
||||
: phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mobile: freezed == mobile
|
||||
? _value.mobile
|
||||
: mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -154,7 +192,9 @@ class _$AuthUserImpl implements _AuthUser {
|
||||
this.username,
|
||||
required this.email,
|
||||
required this.name,
|
||||
this.role = 'admin'});
|
||||
this.role = 'admin',
|
||||
this.phone,
|
||||
this.mobile});
|
||||
|
||||
factory _$AuthUserImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$AuthUserImplFromJson(json);
|
||||
@@ -171,10 +211,16 @@ class _$AuthUserImpl implements _AuthUser {
|
||||
@override
|
||||
@JsonKey()
|
||||
final String role;
|
||||
// Default to 'admin' if not provided
|
||||
@override
|
||||
final String? phone;
|
||||
// Added for /auth/me API
|
||||
@override
|
||||
final String? mobile;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AuthUser(id: $id, username: $username, email: $email, name: $name, role: $role)';
|
||||
return 'AuthUser(id: $id, username: $username, email: $email, name: $name, role: $role, phone: $phone, mobile: $mobile)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -187,12 +233,15 @@ class _$AuthUserImpl implements _AuthUser {
|
||||
other.username == username) &&
|
||||
(identical(other.email, email) || other.email == email) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.role, role) || other.role == role));
|
||||
(identical(other.role, role) || other.role == role) &&
|
||||
(identical(other.phone, phone) || other.phone == phone) &&
|
||||
(identical(other.mobile, mobile) || other.mobile == mobile));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, username, email, name, role);
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, id, username, email, name, role, phone, mobile);
|
||||
|
||||
/// Create a copy of AuthUser
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -216,7 +265,9 @@ abstract class _AuthUser implements AuthUser {
|
||||
final String? username,
|
||||
required final String email,
|
||||
required final String name,
|
||||
final String role}) = _$AuthUserImpl;
|
||||
final String role,
|
||||
final String? phone,
|
||||
final String? mobile}) = _$AuthUserImpl;
|
||||
|
||||
factory _AuthUser.fromJson(Map<String, dynamic> json) =
|
||||
_$AuthUserImpl.fromJson;
|
||||
@@ -230,7 +281,11 @@ abstract class _AuthUser implements AuthUser {
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
String get role;
|
||||
String get role; // Default to 'admin' if not provided
|
||||
@override
|
||||
String? get phone; // Added for /auth/me API
|
||||
@override
|
||||
String? get mobile;
|
||||
|
||||
/// Create a copy of AuthUser
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
@@ -13,6 +13,8 @@ _$AuthUserImpl _$$AuthUserImplFromJson(Map<String, dynamic> json) =>
|
||||
email: json['email'] as String,
|
||||
name: json['name'] as String,
|
||||
role: json['role'] as String? ?? 'admin',
|
||||
phone: json['phone'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$AuthUserImplToJson(_$AuthUserImpl instance) =>
|
||||
@@ -22,4 +24,6 @@ Map<String, dynamic> _$$AuthUserImplToJson(_$AuthUserImpl instance) =>
|
||||
'email': instance.email,
|
||||
'name': instance.name,
|
||||
'role': instance.role,
|
||||
'phone': instance.phone,
|
||||
'mobile': instance.mobile,
|
||||
};
|
||||
|
||||
15
lib/data/models/auth/change_password_request.dart
Normal file
15
lib/data/models/auth/change_password_request.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'change_password_request.freezed.dart';
|
||||
part 'change_password_request.g.dart';
|
||||
|
||||
@freezed
|
||||
class ChangePasswordRequest with _$ChangePasswordRequest {
|
||||
const factory ChangePasswordRequest({
|
||||
@JsonKey(name: 'old_password') required String oldPassword,
|
||||
@JsonKey(name: 'new_password') required String newPassword,
|
||||
}) = _ChangePasswordRequest;
|
||||
|
||||
factory ChangePasswordRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$ChangePasswordRequestFromJson(json);
|
||||
}
|
||||
202
lib/data/models/auth/change_password_request.freezed.dart
Normal file
202
lib/data/models/auth/change_password_request.freezed.dart
Normal file
@@ -0,0 +1,202 @@
|
||||
// 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 'change_password_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ChangePasswordRequest _$ChangePasswordRequestFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _ChangePasswordRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChangePasswordRequest {
|
||||
@JsonKey(name: 'old_password')
|
||||
String get oldPassword => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'new_password')
|
||||
String get newPassword => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChangePasswordRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChangePasswordRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChangePasswordRequestCopyWith<ChangePasswordRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChangePasswordRequestCopyWith<$Res> {
|
||||
factory $ChangePasswordRequestCopyWith(ChangePasswordRequest value,
|
||||
$Res Function(ChangePasswordRequest) then) =
|
||||
_$ChangePasswordRequestCopyWithImpl<$Res, ChangePasswordRequest>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'old_password') String oldPassword,
|
||||
@JsonKey(name: 'new_password') String newPassword});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChangePasswordRequestCopyWithImpl<$Res,
|
||||
$Val extends ChangePasswordRequest>
|
||||
implements $ChangePasswordRequestCopyWith<$Res> {
|
||||
_$ChangePasswordRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChangePasswordRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? oldPassword = null,
|
||||
Object? newPassword = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
oldPassword: null == oldPassword
|
||||
? _value.oldPassword
|
||||
: oldPassword // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
newPassword: null == newPassword
|
||||
? _value.newPassword
|
||||
: newPassword // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChangePasswordRequestImplCopyWith<$Res>
|
||||
implements $ChangePasswordRequestCopyWith<$Res> {
|
||||
factory _$$ChangePasswordRequestImplCopyWith(
|
||||
_$ChangePasswordRequestImpl value,
|
||||
$Res Function(_$ChangePasswordRequestImpl) then) =
|
||||
__$$ChangePasswordRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'old_password') String oldPassword,
|
||||
@JsonKey(name: 'new_password') String newPassword});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChangePasswordRequestImplCopyWithImpl<$Res>
|
||||
extends _$ChangePasswordRequestCopyWithImpl<$Res,
|
||||
_$ChangePasswordRequestImpl>
|
||||
implements _$$ChangePasswordRequestImplCopyWith<$Res> {
|
||||
__$$ChangePasswordRequestImplCopyWithImpl(_$ChangePasswordRequestImpl _value,
|
||||
$Res Function(_$ChangePasswordRequestImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChangePasswordRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? oldPassword = null,
|
||||
Object? newPassword = null,
|
||||
}) {
|
||||
return _then(_$ChangePasswordRequestImpl(
|
||||
oldPassword: null == oldPassword
|
||||
? _value.oldPassword
|
||||
: oldPassword // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
newPassword: null == newPassword
|
||||
? _value.newPassword
|
||||
: newPassword // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChangePasswordRequestImpl implements _ChangePasswordRequest {
|
||||
const _$ChangePasswordRequestImpl(
|
||||
{@JsonKey(name: 'old_password') required this.oldPassword,
|
||||
@JsonKey(name: 'new_password') required this.newPassword});
|
||||
|
||||
factory _$ChangePasswordRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChangePasswordRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'old_password')
|
||||
final String oldPassword;
|
||||
@override
|
||||
@JsonKey(name: 'new_password')
|
||||
final String newPassword;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChangePasswordRequest(oldPassword: $oldPassword, newPassword: $newPassword)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChangePasswordRequestImpl &&
|
||||
(identical(other.oldPassword, oldPassword) ||
|
||||
other.oldPassword == oldPassword) &&
|
||||
(identical(other.newPassword, newPassword) ||
|
||||
other.newPassword == newPassword));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, oldPassword, newPassword);
|
||||
|
||||
/// Create a copy of ChangePasswordRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChangePasswordRequestImplCopyWith<_$ChangePasswordRequestImpl>
|
||||
get copyWith => __$$ChangePasswordRequestImplCopyWithImpl<
|
||||
_$ChangePasswordRequestImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChangePasswordRequestImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChangePasswordRequest implements ChangePasswordRequest {
|
||||
const factory _ChangePasswordRequest(
|
||||
{@JsonKey(name: 'old_password') required final String oldPassword,
|
||||
@JsonKey(name: 'new_password') required final String newPassword}) =
|
||||
_$ChangePasswordRequestImpl;
|
||||
|
||||
factory _ChangePasswordRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$ChangePasswordRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'old_password')
|
||||
String get oldPassword;
|
||||
@override
|
||||
@JsonKey(name: 'new_password')
|
||||
String get newPassword;
|
||||
|
||||
/// Create a copy of ChangePasswordRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChangePasswordRequestImplCopyWith<_$ChangePasswordRequestImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
21
lib/data/models/auth/change_password_request.g.dart
Normal file
21
lib/data/models/auth/change_password_request.g.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'change_password_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChangePasswordRequestImpl _$$ChangePasswordRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ChangePasswordRequestImpl(
|
||||
oldPassword: json['old_password'] as String,
|
||||
newPassword: json['new_password'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChangePasswordRequestImplToJson(
|
||||
_$ChangePasswordRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'old_password': instance.oldPassword,
|
||||
'new_password': instance.newPassword,
|
||||
};
|
||||
14
lib/data/models/auth/message_response.dart
Normal file
14
lib/data/models/auth/message_response.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'message_response.freezed.dart';
|
||||
part 'message_response.g.dart';
|
||||
|
||||
@freezed
|
||||
class MessageResponse with _$MessageResponse {
|
||||
const factory MessageResponse({
|
||||
required String message,
|
||||
}) = _MessageResponse;
|
||||
|
||||
factory MessageResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$MessageResponseFromJson(json);
|
||||
}
|
||||
166
lib/data/models/auth/message_response.freezed.dart
Normal file
166
lib/data/models/auth/message_response.freezed.dart
Normal file
@@ -0,0 +1,166 @@
|
||||
// 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 'message_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
MessageResponse _$MessageResponseFromJson(Map<String, dynamic> json) {
|
||||
return _MessageResponse.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$MessageResponse {
|
||||
String get message => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this MessageResponse to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of MessageResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$MessageResponseCopyWith<MessageResponse> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $MessageResponseCopyWith<$Res> {
|
||||
factory $MessageResponseCopyWith(
|
||||
MessageResponse value, $Res Function(MessageResponse) then) =
|
||||
_$MessageResponseCopyWithImpl<$Res, MessageResponse>;
|
||||
@useResult
|
||||
$Res call({String message});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$MessageResponseCopyWithImpl<$Res, $Val extends MessageResponse>
|
||||
implements $MessageResponseCopyWith<$Res> {
|
||||
_$MessageResponseCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of MessageResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$MessageResponseImplCopyWith<$Res>
|
||||
implements $MessageResponseCopyWith<$Res> {
|
||||
factory _$$MessageResponseImplCopyWith(_$MessageResponseImpl value,
|
||||
$Res Function(_$MessageResponseImpl) then) =
|
||||
__$$MessageResponseImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String message});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$MessageResponseImplCopyWithImpl<$Res>
|
||||
extends _$MessageResponseCopyWithImpl<$Res, _$MessageResponseImpl>
|
||||
implements _$$MessageResponseImplCopyWith<$Res> {
|
||||
__$$MessageResponseImplCopyWithImpl(
|
||||
_$MessageResponseImpl _value, $Res Function(_$MessageResponseImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of MessageResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
}) {
|
||||
return _then(_$MessageResponseImpl(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$MessageResponseImpl implements _MessageResponse {
|
||||
const _$MessageResponseImpl({required this.message});
|
||||
|
||||
factory _$MessageResponseImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$MessageResponseImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String message;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MessageResponse(message: $message)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$MessageResponseImpl &&
|
||||
(identical(other.message, message) || other.message == message));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, message);
|
||||
|
||||
/// Create a copy of MessageResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$MessageResponseImplCopyWith<_$MessageResponseImpl> get copyWith =>
|
||||
__$$MessageResponseImplCopyWithImpl<_$MessageResponseImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$MessageResponseImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _MessageResponse implements MessageResponse {
|
||||
const factory _MessageResponse({required final String message}) =
|
||||
_$MessageResponseImpl;
|
||||
|
||||
factory _MessageResponse.fromJson(Map<String, dynamic> json) =
|
||||
_$MessageResponseImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get message;
|
||||
|
||||
/// Create a copy of MessageResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$MessageResponseImplCopyWith<_$MessageResponseImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
19
lib/data/models/auth/message_response.g.dart
Normal file
19
lib/data/models/auth/message_response.g.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'message_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$MessageResponseImpl _$$MessageResponseImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MessageResponseImpl(
|
||||
message: json['message'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MessageResponseImplToJson(
|
||||
_$MessageResponseImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'message': instance.message,
|
||||
};
|
||||
@@ -37,15 +37,15 @@ class EquipmentDto with _$EquipmentDto {
|
||||
@freezed
|
||||
class EquipmentRequestDto with _$EquipmentRequestDto {
|
||||
const factory EquipmentRequestDto({
|
||||
@JsonKey(name: 'companies_id') required int companiesId,
|
||||
@JsonKey(name: 'models_id') required int modelsId,
|
||||
@JsonKey(name: 'companies_id') int? companiesId, // 백엔드: Option<i32>
|
||||
@JsonKey(name: 'models_id') int? modelsId, // 백엔드: Option<i32>
|
||||
@JsonKey(name: 'serial_number') required String serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
|
||||
@JsonKey(name: 'purchased_at') required DateTime purchasedAt, // UTC로 미리 변환해서 전달
|
||||
@JsonKey(name: 'purchase_price') @Default(0) int purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') required String warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') required DateTime warrantyStartedAt,
|
||||
@JsonKey(name: 'warranty_ended_at') required DateTime warrantyEndedAt,
|
||||
@JsonKey(name: 'warranty_started_at') required DateTime warrantyStartedAt, // UTC로 미리 변환해서 전달
|
||||
@JsonKey(name: 'warranty_ended_at') required DateTime warrantyEndedAt, // UTC로 미리 변환해서 전달
|
||||
String? remark,
|
||||
}) = _EquipmentRequestDto;
|
||||
|
||||
|
||||
@@ -582,22 +582,26 @@ EquipmentRequestDto _$EquipmentRequestDtoFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$EquipmentRequestDto {
|
||||
@JsonKey(name: 'companies_id')
|
||||
int get companiesId => throw _privateConstructorUsedError;
|
||||
int? get companiesId =>
|
||||
throw _privateConstructorUsedError; // 백엔드: Option<i32>
|
||||
@JsonKey(name: 'models_id')
|
||||
int get modelsId => throw _privateConstructorUsedError;
|
||||
int? get modelsId => throw _privateConstructorUsedError; // 백엔드: Option<i32>
|
||||
@JsonKey(name: 'serial_number')
|
||||
String get serialNumber => throw _privateConstructorUsedError;
|
||||
String? get barcode => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchased_at')
|
||||
DateTime? get purchasedAt => throw _privateConstructorUsedError;
|
||||
DateTime get purchasedAt =>
|
||||
throw _privateConstructorUsedError; // UTC로 미리 변환해서 전달
|
||||
@JsonKey(name: 'purchase_price')
|
||||
int get purchasePrice => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warranty_number')
|
||||
String get warrantyNumber => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warranty_started_at')
|
||||
DateTime get warrantyStartedAt => throw _privateConstructorUsedError;
|
||||
DateTime get warrantyStartedAt =>
|
||||
throw _privateConstructorUsedError; // UTC로 미리 변환해서 전달
|
||||
@JsonKey(name: 'warranty_ended_at')
|
||||
DateTime get warrantyEndedAt => throw _privateConstructorUsedError;
|
||||
DateTime get warrantyEndedAt =>
|
||||
throw _privateConstructorUsedError; // UTC로 미리 변환해서 전달
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentRequestDto to a JSON map.
|
||||
@@ -617,11 +621,11 @@ abstract class $EquipmentRequestDtoCopyWith<$Res> {
|
||||
_$EquipmentRequestDtoCopyWithImpl<$Res, EquipmentRequestDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'companies_id') int companiesId,
|
||||
@JsonKey(name: 'models_id') int modelsId,
|
||||
{@JsonKey(name: 'companies_id') int? companiesId,
|
||||
@JsonKey(name: 'models_id') int? modelsId,
|
||||
@JsonKey(name: 'serial_number') String serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
|
||||
@JsonKey(name: 'purchased_at') DateTime purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') int purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') String warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') DateTime warrantyStartedAt,
|
||||
@@ -644,11 +648,11 @@ class _$EquipmentRequestDtoCopyWithImpl<$Res, $Val extends EquipmentRequestDto>
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? companiesId = null,
|
||||
Object? modelsId = null,
|
||||
Object? companiesId = freezed,
|
||||
Object? modelsId = freezed,
|
||||
Object? serialNumber = null,
|
||||
Object? barcode = freezed,
|
||||
Object? purchasedAt = freezed,
|
||||
Object? purchasedAt = null,
|
||||
Object? purchasePrice = null,
|
||||
Object? warrantyNumber = null,
|
||||
Object? warrantyStartedAt = null,
|
||||
@@ -656,14 +660,14 @@ class _$EquipmentRequestDtoCopyWithImpl<$Res, $Val extends EquipmentRequestDto>
|
||||
Object? remark = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
companiesId: null == companiesId
|
||||
companiesId: freezed == companiesId
|
||||
? _value.companiesId
|
||||
: companiesId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
modelsId: null == modelsId
|
||||
as int?,
|
||||
modelsId: freezed == modelsId
|
||||
? _value.modelsId
|
||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
as int?,
|
||||
serialNumber: null == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
@@ -672,10 +676,10 @@ class _$EquipmentRequestDtoCopyWithImpl<$Res, $Val extends EquipmentRequestDto>
|
||||
? _value.barcode
|
||||
: barcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchasedAt: freezed == purchasedAt
|
||||
purchasedAt: null == purchasedAt
|
||||
? _value.purchasedAt
|
||||
: purchasedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
as DateTime,
|
||||
purchasePrice: null == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
@@ -709,11 +713,11 @@ abstract class _$$EquipmentRequestDtoImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'companies_id') int companiesId,
|
||||
@JsonKey(name: 'models_id') int modelsId,
|
||||
{@JsonKey(name: 'companies_id') int? companiesId,
|
||||
@JsonKey(name: 'models_id') int? modelsId,
|
||||
@JsonKey(name: 'serial_number') String serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
|
||||
@JsonKey(name: 'purchased_at') DateTime purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') int purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') String warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') DateTime warrantyStartedAt,
|
||||
@@ -734,11 +738,11 @@ class __$$EquipmentRequestDtoImplCopyWithImpl<$Res>
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? companiesId = null,
|
||||
Object? modelsId = null,
|
||||
Object? companiesId = freezed,
|
||||
Object? modelsId = freezed,
|
||||
Object? serialNumber = null,
|
||||
Object? barcode = freezed,
|
||||
Object? purchasedAt = freezed,
|
||||
Object? purchasedAt = null,
|
||||
Object? purchasePrice = null,
|
||||
Object? warrantyNumber = null,
|
||||
Object? warrantyStartedAt = null,
|
||||
@@ -746,14 +750,14 @@ class __$$EquipmentRequestDtoImplCopyWithImpl<$Res>
|
||||
Object? remark = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentRequestDtoImpl(
|
||||
companiesId: null == companiesId
|
||||
companiesId: freezed == companiesId
|
||||
? _value.companiesId
|
||||
: companiesId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
modelsId: null == modelsId
|
||||
as int?,
|
||||
modelsId: freezed == modelsId
|
||||
? _value.modelsId
|
||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
as int?,
|
||||
serialNumber: null == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
@@ -762,10 +766,10 @@ class __$$EquipmentRequestDtoImplCopyWithImpl<$Res>
|
||||
? _value.barcode
|
||||
: barcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchasedAt: freezed == purchasedAt
|
||||
purchasedAt: null == purchasedAt
|
||||
? _value.purchasedAt
|
||||
: purchasedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
as DateTime,
|
||||
purchasePrice: null == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
@@ -794,11 +798,11 @@ class __$$EquipmentRequestDtoImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$EquipmentRequestDtoImpl implements _EquipmentRequestDto {
|
||||
const _$EquipmentRequestDtoImpl(
|
||||
{@JsonKey(name: 'companies_id') required this.companiesId,
|
||||
@JsonKey(name: 'models_id') required this.modelsId,
|
||||
{@JsonKey(name: 'companies_id') this.companiesId,
|
||||
@JsonKey(name: 'models_id') this.modelsId,
|
||||
@JsonKey(name: 'serial_number') required this.serialNumber,
|
||||
this.barcode,
|
||||
@JsonKey(name: 'purchased_at') this.purchasedAt,
|
||||
@JsonKey(name: 'purchased_at') required this.purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice = 0,
|
||||
@JsonKey(name: 'warranty_number') required this.warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') required this.warrantyStartedAt,
|
||||
@@ -810,10 +814,12 @@ class _$EquipmentRequestDtoImpl implements _EquipmentRequestDto {
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'companies_id')
|
||||
final int companiesId;
|
||||
final int? companiesId;
|
||||
// 백엔드: Option<i32>
|
||||
@override
|
||||
@JsonKey(name: 'models_id')
|
||||
final int modelsId;
|
||||
final int? modelsId;
|
||||
// 백엔드: Option<i32>
|
||||
@override
|
||||
@JsonKey(name: 'serial_number')
|
||||
final String serialNumber;
|
||||
@@ -821,7 +827,8 @@ class _$EquipmentRequestDtoImpl implements _EquipmentRequestDto {
|
||||
final String? barcode;
|
||||
@override
|
||||
@JsonKey(name: 'purchased_at')
|
||||
final DateTime? purchasedAt;
|
||||
final DateTime purchasedAt;
|
||||
// UTC로 미리 변환해서 전달
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
final int purchasePrice;
|
||||
@@ -831,9 +838,11 @@ class _$EquipmentRequestDtoImpl implements _EquipmentRequestDto {
|
||||
@override
|
||||
@JsonKey(name: 'warranty_started_at')
|
||||
final DateTime warrantyStartedAt;
|
||||
// UTC로 미리 변환해서 전달
|
||||
@override
|
||||
@JsonKey(name: 'warranty_ended_at')
|
||||
final DateTime warrantyEndedAt;
|
||||
// UTC로 미리 변환해서 전달
|
||||
@override
|
||||
final String? remark;
|
||||
|
||||
@@ -901,11 +910,11 @@ class _$EquipmentRequestDtoImpl implements _EquipmentRequestDto {
|
||||
|
||||
abstract class _EquipmentRequestDto implements EquipmentRequestDto {
|
||||
const factory _EquipmentRequestDto(
|
||||
{@JsonKey(name: 'companies_id') required final int companiesId,
|
||||
@JsonKey(name: 'models_id') required final int modelsId,
|
||||
{@JsonKey(name: 'companies_id') final int? companiesId,
|
||||
@JsonKey(name: 'models_id') final int? modelsId,
|
||||
@JsonKey(name: 'serial_number') required final String serialNumber,
|
||||
final String? barcode,
|
||||
@JsonKey(name: 'purchased_at') final DateTime? purchasedAt,
|
||||
@JsonKey(name: 'purchased_at') required final DateTime purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') final int purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') required final String warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at')
|
||||
@@ -919,10 +928,10 @@ abstract class _EquipmentRequestDto implements EquipmentRequestDto {
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'companies_id')
|
||||
int get companiesId;
|
||||
int? get companiesId; // 백엔드: Option<i32>
|
||||
@override
|
||||
@JsonKey(name: 'models_id')
|
||||
int get modelsId;
|
||||
int? get modelsId; // 백엔드: Option<i32>
|
||||
@override
|
||||
@JsonKey(name: 'serial_number')
|
||||
String get serialNumber;
|
||||
@@ -930,7 +939,7 @@ abstract class _EquipmentRequestDto implements EquipmentRequestDto {
|
||||
String? get barcode;
|
||||
@override
|
||||
@JsonKey(name: 'purchased_at')
|
||||
DateTime? get purchasedAt;
|
||||
DateTime get purchasedAt; // UTC로 미리 변환해서 전달
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
int get purchasePrice;
|
||||
@@ -939,10 +948,10 @@ abstract class _EquipmentRequestDto implements EquipmentRequestDto {
|
||||
String get warrantyNumber;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_started_at')
|
||||
DateTime get warrantyStartedAt;
|
||||
DateTime get warrantyStartedAt; // UTC로 미리 변환해서 전달
|
||||
@override
|
||||
@JsonKey(name: 'warranty_ended_at')
|
||||
DateTime get warrantyEndedAt;
|
||||
DateTime get warrantyEndedAt; // UTC로 미리 변환해서 전달
|
||||
@override
|
||||
String? get remark;
|
||||
|
||||
|
||||
@@ -54,13 +54,11 @@ Map<String, dynamic> _$$EquipmentDtoImplToJson(_$EquipmentDtoImpl instance) =>
|
||||
_$EquipmentRequestDtoImpl _$$EquipmentRequestDtoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$EquipmentRequestDtoImpl(
|
||||
companiesId: (json['companies_id'] as num).toInt(),
|
||||
modelsId: (json['models_id'] as num).toInt(),
|
||||
companiesId: (json['companies_id'] as num?)?.toInt(),
|
||||
modelsId: (json['models_id'] as num?)?.toInt(),
|
||||
serialNumber: json['serial_number'] as String,
|
||||
barcode: json['barcode'] as String?,
|
||||
purchasedAt: json['purchased_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchased_at'] as String),
|
||||
purchasedAt: DateTime.parse(json['purchased_at'] as String),
|
||||
purchasePrice: (json['purchase_price'] as num?)?.toInt() ?? 0,
|
||||
warrantyNumber: json['warranty_number'] as String,
|
||||
warrantyStartedAt: DateTime.parse(json['warranty_started_at'] as String),
|
||||
@@ -75,7 +73,7 @@ Map<String, dynamic> _$$EquipmentRequestDtoImplToJson(
|
||||
'models_id': instance.modelsId,
|
||||
'serial_number': instance.serialNumber,
|
||||
'barcode': instance.barcode,
|
||||
'purchased_at': instance.purchasedAt?.toIso8601String(),
|
||||
'purchased_at': instance.purchasedAt.toIso8601String(),
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'warranty_number': instance.warrantyNumber,
|
||||
'warranty_started_at': instance.warrantyStartedAt.toIso8601String(),
|
||||
|
||||
@@ -8,18 +8,22 @@ part 'equipment_list_dto.g.dart';
|
||||
class EquipmentListDto with _$EquipmentListDto {
|
||||
const factory EquipmentListDto({
|
||||
required int id,
|
||||
@JsonKey(name: 'equipment_number') required String equipmentNumber,
|
||||
// Sprint 3: Replaced manufacturer, modelName with models_id and model
|
||||
@JsonKey(name: 'models_id') int? modelsId,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
required String status,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') required DateTime createdAt,
|
||||
// 추가 필드 (조인된 데이터)
|
||||
@JsonKey(name: 'companies_id') int? companiesId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
||||
// Sprint 3: Added model relationship (includes vendor info)
|
||||
@JsonKey(name: 'models_id') int? modelsId,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'vendor_name') String? vendorName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') int? purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') String? warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') DateTime? warrantyStartedAt,
|
||||
@JsonKey(name: 'warranty_ended_at') DateTime? warrantyEndedAt,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_deleted') bool? isDeleted,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
ModelDto? model,
|
||||
}) = _EquipmentListDto;
|
||||
|
||||
|
||||
@@ -21,26 +21,36 @@ EquipmentListDto _$EquipmentListDtoFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$EquipmentListDto {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'equipment_number')
|
||||
String get equipmentNumber =>
|
||||
throw _privateConstructorUsedError; // Sprint 3: Replaced manufacturer, modelName with models_id and model
|
||||
@JsonKey(name: 'models_id')
|
||||
int? get modelsId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'serial_number')
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
String get status => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime get createdAt =>
|
||||
throw _privateConstructorUsedError; // 추가 필드 (조인된 데이터)
|
||||
@JsonKey(name: 'companies_id')
|
||||
int? get companiesId => 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)
|
||||
@JsonKey(name: 'models_id')
|
||||
int? get modelsId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'model_name')
|
||||
String? get modelName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'vendor_name')
|
||||
String? get vendorName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'serial_number')
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
String? get barcode => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchased_at')
|
||||
DateTime? get purchasedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_price')
|
||||
int? get purchasePrice => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warranty_number')
|
||||
String? get warrantyNumber => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warranty_started_at')
|
||||
DateTime? get warrantyStartedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warranty_ended_at')
|
||||
DateTime? get warrantyEndedAt => throw _privateConstructorUsedError;
|
||||
String? get remark => 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;
|
||||
ModelDto? get model => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentListDto to a JSON map.
|
||||
@@ -61,15 +71,22 @@ abstract class $EquipmentListDtoCopyWith<$Res> {
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'equipment_number') String equipmentNumber,
|
||||
@JsonKey(name: 'models_id') int? modelsId,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String status,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'companies_id') int? companiesId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
||||
@JsonKey(name: 'models_id') int? modelsId,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'vendor_name') String? vendorName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') int? purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') String? warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') DateTime? warrantyStartedAt,
|
||||
@JsonKey(name: 'warranty_ended_at') DateTime? warrantyEndedAt,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_deleted') bool? isDeleted,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
ModelDto? model});
|
||||
|
||||
$ModelDtoCopyWith<$Res>? get model;
|
||||
@@ -91,15 +108,22 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? equipmentNumber = null,
|
||||
Object? modelsId = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? status = null,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? companiesId = freezed,
|
||||
Object? companyName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
Object? modelsId = freezed,
|
||||
Object? modelName = freezed,
|
||||
Object? vendorName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? barcode = freezed,
|
||||
Object? purchasedAt = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? warrantyNumber = freezed,
|
||||
Object? warrantyStartedAt = freezed,
|
||||
Object? warrantyEndedAt = freezed,
|
||||
Object? remark = freezed,
|
||||
Object? isDeleted = freezed,
|
||||
Object? registeredAt = freezed,
|
||||
Object? updatedAt = freezed,
|
||||
Object? model = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -107,42 +131,70 @@ class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
|
||||
? _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
|
||||
companiesId: freezed == companiesId
|
||||
? _value.companiesId
|
||||
: companiesId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
serialNumber: freezed == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // 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?,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // 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
|
||||
modelsId: freezed == modelsId
|
||||
? _value.modelsId
|
||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
vendorName: freezed == vendorName
|
||||
? _value.vendorName
|
||||
: vendorName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
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?,
|
||||
purchasedAt: freezed == purchasedAt
|
||||
? _value.purchasedAt
|
||||
: purchasedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warrantyNumber: freezed == warrantyNumber
|
||||
? _value.warrantyNumber
|
||||
: warrantyNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warrantyStartedAt: freezed == warrantyStartedAt
|
||||
? _value.warrantyStartedAt
|
||||
: warrantyStartedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
warrantyEndedAt: freezed == warrantyEndedAt
|
||||
? _value.warrantyEndedAt
|
||||
: warrantyEndedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
isDeleted: freezed == isDeleted
|
||||
? _value.isDeleted
|
||||
: isDeleted // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
registeredAt: freezed == 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?,
|
||||
model: freezed == model
|
||||
? _value.model
|
||||
: model // ignore: cast_nullable_to_non_nullable
|
||||
@@ -175,15 +227,22 @@ abstract class _$$EquipmentListDtoImplCopyWith<$Res>
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'equipment_number') String equipmentNumber,
|
||||
@JsonKey(name: 'models_id') int? modelsId,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String status,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'companies_id') int? companiesId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
||||
@JsonKey(name: 'models_id') int? modelsId,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'vendor_name') String? vendorName,
|
||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
||||
String? barcode,
|
||||
@JsonKey(name: 'purchased_at') DateTime? purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') int? purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') String? warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') DateTime? warrantyStartedAt,
|
||||
@JsonKey(name: 'warranty_ended_at') DateTime? warrantyEndedAt,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_deleted') bool? isDeleted,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
ModelDto? model});
|
||||
|
||||
@override
|
||||
@@ -204,15 +263,22 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? equipmentNumber = null,
|
||||
Object? modelsId = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? status = null,
|
||||
Object? companyId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? companiesId = freezed,
|
||||
Object? companyName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
Object? modelsId = freezed,
|
||||
Object? modelName = freezed,
|
||||
Object? vendorName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? barcode = freezed,
|
||||
Object? purchasedAt = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? warrantyNumber = freezed,
|
||||
Object? warrantyStartedAt = freezed,
|
||||
Object? warrantyEndedAt = freezed,
|
||||
Object? remark = freezed,
|
||||
Object? isDeleted = freezed,
|
||||
Object? registeredAt = freezed,
|
||||
Object? updatedAt = freezed,
|
||||
Object? model = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentListDtoImpl(
|
||||
@@ -220,42 +286,70 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
|
||||
? _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
|
||||
companiesId: freezed == companiesId
|
||||
? _value.companiesId
|
||||
: companiesId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
serialNumber: freezed == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // 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?,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // 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
|
||||
modelsId: freezed == modelsId
|
||||
? _value.modelsId
|
||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
vendorName: freezed == vendorName
|
||||
? _value.vendorName
|
||||
: vendorName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
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?,
|
||||
purchasedAt: freezed == purchasedAt
|
||||
? _value.purchasedAt
|
||||
: purchasedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warrantyNumber: freezed == warrantyNumber
|
||||
? _value.warrantyNumber
|
||||
: warrantyNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warrantyStartedAt: freezed == warrantyStartedAt
|
||||
? _value.warrantyStartedAt
|
||||
: warrantyStartedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
warrantyEndedAt: freezed == warrantyEndedAt
|
||||
? _value.warrantyEndedAt
|
||||
: warrantyEndedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
isDeleted: freezed == isDeleted
|
||||
? _value.isDeleted
|
||||
: isDeleted // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
registeredAt: freezed == 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?,
|
||||
model: freezed == model
|
||||
? _value.model
|
||||
: model // ignore: cast_nullable_to_non_nullable
|
||||
@@ -269,15 +363,22 @@ class __$$EquipmentListDtoImplCopyWithImpl<$Res>
|
||||
class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
const _$EquipmentListDtoImpl(
|
||||
{required this.id,
|
||||
@JsonKey(name: 'equipment_number') required this.equipmentNumber,
|
||||
@JsonKey(name: 'models_id') this.modelsId,
|
||||
@JsonKey(name: 'serial_number') this.serialNumber,
|
||||
required this.status,
|
||||
@JsonKey(name: 'company_id') this.companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') required this.createdAt,
|
||||
@JsonKey(name: 'companies_id') this.companiesId,
|
||||
@JsonKey(name: 'company_name') this.companyName,
|
||||
@JsonKey(name: 'warehouse_name') this.warehouseName,
|
||||
@JsonKey(name: 'models_id') this.modelsId,
|
||||
@JsonKey(name: 'model_name') this.modelName,
|
||||
@JsonKey(name: 'vendor_name') this.vendorName,
|
||||
@JsonKey(name: 'serial_number') this.serialNumber,
|
||||
this.barcode,
|
||||
@JsonKey(name: 'purchased_at') this.purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') this.warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') this.warrantyStartedAt,
|
||||
@JsonKey(name: 'warranty_ended_at') this.warrantyEndedAt,
|
||||
this.remark,
|
||||
@JsonKey(name: 'is_deleted') this.isDeleted,
|
||||
@JsonKey(name: 'registered_at') this.registeredAt,
|
||||
@JsonKey(name: 'updated_at') this.updatedAt,
|
||||
this.model});
|
||||
|
||||
factory _$EquipmentListDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -286,40 +387,57 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_number')
|
||||
final String equipmentNumber;
|
||||
// Sprint 3: Replaced 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 status;
|
||||
@override
|
||||
@JsonKey(name: 'company_id')
|
||||
final int? companyId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
final int? warehouseLocationId;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
final DateTime createdAt;
|
||||
// 추가 필드 (조인된 데이터)
|
||||
@JsonKey(name: 'companies_id')
|
||||
final int? companiesId;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
final String? companyName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
final String? warehouseName;
|
||||
// Sprint 3: Added model relationship (includes vendor info)
|
||||
@JsonKey(name: 'models_id')
|
||||
final int? modelsId;
|
||||
@override
|
||||
@JsonKey(name: 'model_name')
|
||||
final String? modelName;
|
||||
@override
|
||||
@JsonKey(name: 'vendor_name')
|
||||
final String? vendorName;
|
||||
@override
|
||||
@JsonKey(name: 'serial_number')
|
||||
final String? serialNumber;
|
||||
@override
|
||||
final String? barcode;
|
||||
@override
|
||||
@JsonKey(name: 'purchased_at')
|
||||
final DateTime? purchasedAt;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
final int? purchasePrice;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_number')
|
||||
final String? warrantyNumber;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_started_at')
|
||||
final DateTime? warrantyStartedAt;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_ended_at')
|
||||
final DateTime? warrantyEndedAt;
|
||||
@override
|
||||
final String? remark;
|
||||
@override
|
||||
@JsonKey(name: 'is_deleted')
|
||||
final bool? isDeleted;
|
||||
@override
|
||||
@JsonKey(name: 'registered_at')
|
||||
final DateTime? registeredAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
final DateTime? updatedAt;
|
||||
@override
|
||||
final ModelDto? model;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentListDto(id: $id, equipmentNumber: $equipmentNumber, modelsId: $modelsId, serialNumber: $serialNumber, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, createdAt: $createdAt, companyName: $companyName, warehouseName: $warehouseName, model: $model)';
|
||||
return 'EquipmentListDto(id: $id, companiesId: $companiesId, companyName: $companyName, modelsId: $modelsId, modelName: $modelName, vendorName: $vendorName, serialNumber: $serialNumber, barcode: $barcode, purchasedAt: $purchasedAt, purchasePrice: $purchasePrice, warrantyNumber: $warrantyNumber, warrantyStartedAt: $warrantyStartedAt, warrantyEndedAt: $warrantyEndedAt, remark: $remark, isDeleted: $isDeleted, registeredAt: $registeredAt, updatedAt: $updatedAt, model: $model)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -328,23 +446,36 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$EquipmentListDtoImpl &&
|
||||
(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.status, status) || other.status == status) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.companiesId, companiesId) ||
|
||||
other.companiesId == companiesId) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.warehouseName, warehouseName) ||
|
||||
other.warehouseName == warehouseName) &&
|
||||
(identical(other.modelsId, modelsId) ||
|
||||
other.modelsId == modelsId) &&
|
||||
(identical(other.modelName, modelName) ||
|
||||
other.modelName == modelName) &&
|
||||
(identical(other.vendorName, vendorName) ||
|
||||
other.vendorName == vendorName) &&
|
||||
(identical(other.serialNumber, serialNumber) ||
|
||||
other.serialNumber == serialNumber) &&
|
||||
(identical(other.barcode, barcode) || other.barcode == barcode) &&
|
||||
(identical(other.purchasedAt, purchasedAt) ||
|
||||
other.purchasedAt == purchasedAt) &&
|
||||
(identical(other.purchasePrice, purchasePrice) ||
|
||||
other.purchasePrice == purchasePrice) &&
|
||||
(identical(other.warrantyNumber, warrantyNumber) ||
|
||||
other.warrantyNumber == warrantyNumber) &&
|
||||
(identical(other.warrantyStartedAt, warrantyStartedAt) ||
|
||||
other.warrantyStartedAt == warrantyStartedAt) &&
|
||||
(identical(other.warrantyEndedAt, warrantyEndedAt) ||
|
||||
other.warrantyEndedAt == warrantyEndedAt) &&
|
||||
(identical(other.remark, remark) || other.remark == remark) &&
|
||||
(identical(other.isDeleted, isDeleted) ||
|
||||
other.isDeleted == isDeleted) &&
|
||||
(identical(other.registeredAt, registeredAt) ||
|
||||
other.registeredAt == registeredAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt) &&
|
||||
(identical(other.model, model) || other.model == model));
|
||||
}
|
||||
|
||||
@@ -353,15 +484,22 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
equipmentNumber,
|
||||
modelsId,
|
||||
serialNumber,
|
||||
status,
|
||||
companyId,
|
||||
warehouseLocationId,
|
||||
createdAt,
|
||||
companiesId,
|
||||
companyName,
|
||||
warehouseName,
|
||||
modelsId,
|
||||
modelName,
|
||||
vendorName,
|
||||
serialNumber,
|
||||
barcode,
|
||||
purchasedAt,
|
||||
purchasePrice,
|
||||
warrantyNumber,
|
||||
warrantyStartedAt,
|
||||
warrantyEndedAt,
|
||||
remark,
|
||||
isDeleted,
|
||||
registeredAt,
|
||||
updatedAt,
|
||||
model);
|
||||
|
||||
/// Create a copy of EquipmentListDto
|
||||
@@ -384,15 +522,22 @@ class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
abstract class _EquipmentListDto implements EquipmentListDto {
|
||||
const factory _EquipmentListDto(
|
||||
{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,
|
||||
required final String status,
|
||||
@JsonKey(name: 'company_id') final int? companyId,
|
||||
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
|
||||
@JsonKey(name: 'created_at') required final DateTime createdAt,
|
||||
@JsonKey(name: 'companies_id') final int? companiesId,
|
||||
@JsonKey(name: 'company_name') final String? companyName,
|
||||
@JsonKey(name: 'warehouse_name') final String? warehouseName,
|
||||
@JsonKey(name: 'models_id') final int? modelsId,
|
||||
@JsonKey(name: 'model_name') final String? modelName,
|
||||
@JsonKey(name: 'vendor_name') final String? vendorName,
|
||||
@JsonKey(name: 'serial_number') final String? serialNumber,
|
||||
final String? barcode,
|
||||
@JsonKey(name: 'purchased_at') final DateTime? purchasedAt,
|
||||
@JsonKey(name: 'purchase_price') final int? purchasePrice,
|
||||
@JsonKey(name: 'warranty_number') final String? warrantyNumber,
|
||||
@JsonKey(name: 'warranty_started_at') final DateTime? warrantyStartedAt,
|
||||
@JsonKey(name: 'warranty_ended_at') final DateTime? warrantyEndedAt,
|
||||
final String? remark,
|
||||
@JsonKey(name: 'is_deleted') final bool? isDeleted,
|
||||
@JsonKey(name: 'registered_at') final DateTime? registeredAt,
|
||||
@JsonKey(name: 'updated_at') final DateTime? updatedAt,
|
||||
final ModelDto? model}) = _$EquipmentListDtoImpl;
|
||||
|
||||
factory _EquipmentListDto.fromJson(Map<String, dynamic> json) =
|
||||
@@ -401,33 +546,51 @@ abstract class _EquipmentListDto implements EquipmentListDto {
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_number')
|
||||
String
|
||||
get equipmentNumber; // Sprint 3: Replaced 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 status;
|
||||
@override
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_location_id')
|
||||
int? get warehouseLocationId;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime get createdAt; // 추가 필드 (조인된 데이터)
|
||||
@JsonKey(name: 'companies_id')
|
||||
int? get companiesId;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String?
|
||||
get warehouseName; // Sprint 3: Added model relationship (includes vendor info)
|
||||
@JsonKey(name: 'models_id')
|
||||
int? get modelsId;
|
||||
@override
|
||||
@JsonKey(name: 'model_name')
|
||||
String? get modelName;
|
||||
@override
|
||||
@JsonKey(name: 'vendor_name')
|
||||
String? get vendorName;
|
||||
@override
|
||||
@JsonKey(name: 'serial_number')
|
||||
String? get serialNumber;
|
||||
@override
|
||||
String? get barcode;
|
||||
@override
|
||||
@JsonKey(name: 'purchased_at')
|
||||
DateTime? get purchasedAt;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
int? get purchasePrice;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_number')
|
||||
String? get warrantyNumber;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_started_at')
|
||||
DateTime? get warrantyStartedAt;
|
||||
@override
|
||||
@JsonKey(name: 'warranty_ended_at')
|
||||
DateTime? get warrantyEndedAt;
|
||||
@override
|
||||
String? get remark;
|
||||
@override
|
||||
@JsonKey(name: 'is_deleted')
|
||||
bool? get isDeleted;
|
||||
@override
|
||||
@JsonKey(name: 'registered_at')
|
||||
DateTime? get registeredAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
DateTime? get updatedAt;
|
||||
@override
|
||||
ModelDto? get model;
|
||||
|
||||
|
||||
@@ -10,15 +10,32 @@ _$EquipmentListDtoImpl _$$EquipmentListDtoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$EquipmentListDtoImpl(
|
||||
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?,
|
||||
status: json['status'] as String,
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
companiesId: (json['companies_id'] as num?)?.toInt(),
|
||||
companyName: json['company_name'] as String?,
|
||||
warehouseName: json['warehouse_name'] as String?,
|
||||
modelsId: (json['models_id'] as num?)?.toInt(),
|
||||
modelName: json['model_name'] as String?,
|
||||
vendorName: json['vendor_name'] as String?,
|
||||
serialNumber: json['serial_number'] as String?,
|
||||
barcode: json['barcode'] as String?,
|
||||
purchasedAt: json['purchased_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchased_at'] as String),
|
||||
purchasePrice: (json['purchase_price'] as num?)?.toInt(),
|
||||
warrantyNumber: json['warranty_number'] as String?,
|
||||
warrantyStartedAt: json['warranty_started_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['warranty_started_at'] as String),
|
||||
warrantyEndedAt: json['warranty_ended_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['warranty_ended_at'] as String),
|
||||
remark: json['remark'] as String?,
|
||||
isDeleted: json['is_deleted'] as bool?,
|
||||
registeredAt: json['registered_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['registered_at'] as String),
|
||||
updatedAt: json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String),
|
||||
model: json['model'] == null
|
||||
? null
|
||||
: ModelDto.fromJson(json['model'] as Map<String, dynamic>),
|
||||
@@ -28,15 +45,22 @@ Map<String, dynamic> _$$EquipmentListDtoImplToJson(
|
||||
_$EquipmentListDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'equipment_number': instance.equipmentNumber,
|
||||
'models_id': instance.modelsId,
|
||||
'serial_number': instance.serialNumber,
|
||||
'status': instance.status,
|
||||
'company_id': instance.companyId,
|
||||
'warehouse_location_id': instance.warehouseLocationId,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'companies_id': instance.companiesId,
|
||||
'company_name': instance.companyName,
|
||||
'warehouse_name': instance.warehouseName,
|
||||
'models_id': instance.modelsId,
|
||||
'model_name': instance.modelName,
|
||||
'vendor_name': instance.vendorName,
|
||||
'serial_number': instance.serialNumber,
|
||||
'barcode': instance.barcode,
|
||||
'purchased_at': instance.purchasedAt?.toIso8601String(),
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'warranty_number': instance.warrantyNumber,
|
||||
'warranty_started_at': instance.warrantyStartedAt?.toIso8601String(),
|
||||
'warranty_ended_at': instance.warrantyEndedAt?.toIso8601String(),
|
||||
'remark': instance.remark,
|
||||
'is_deleted': instance.isDeleted,
|
||||
'registered_at': instance.registeredAt?.toIso8601String(),
|
||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
'model': instance.model,
|
||||
};
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@ class MaintenanceDto with _$MaintenanceDto {
|
||||
|
||||
const factory MaintenanceDto({
|
||||
@JsonKey(name: 'id') int? id,
|
||||
@JsonKey(name: 'equipment_history_id') required int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId, // Optional in backend
|
||||
@JsonKey(name: 'started_at') required DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') @Default(1) int periodMonth,
|
||||
@JsonKey(name: 'maintenance_type') @Default('O') String maintenanceType,
|
||||
@JsonKey(name: 'maintenance_type') @Default('WARRANTY') String maintenanceType, // WARRANTY|CONTRACT|INSPECTION
|
||||
@JsonKey(name: 'is_deleted') @Default(false) bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') required DateTime registeredAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
@@ -39,11 +39,11 @@ class MaintenanceDto with _$MaintenanceDto {
|
||||
@freezed
|
||||
class MaintenanceRequestDto with _$MaintenanceRequestDto {
|
||||
const factory MaintenanceRequestDto({
|
||||
@JsonKey(name: 'equipment_history_id') required int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId, // Optional in backend
|
||||
@JsonKey(name: 'started_at') required DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') @Default(1) int periodMonth,
|
||||
@JsonKey(name: 'maintenance_type') @Default('O') String maintenanceType,
|
||||
@JsonKey(name: 'maintenance_type') @Default('WARRANTY') String maintenanceType, // WARRANTY|CONTRACT|INSPECTION
|
||||
}) = _MaintenanceRequestDto;
|
||||
|
||||
factory MaintenanceRequestDto.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -77,24 +77,46 @@ class MaintenanceListResponse with _$MaintenanceListResponse {
|
||||
_$MaintenanceListResponseFromJson(json);
|
||||
}
|
||||
|
||||
// Maintenance Type 헬퍼
|
||||
@freezed
|
||||
class MaintenanceQueryDto with _$MaintenanceQueryDto {
|
||||
const factory MaintenanceQueryDto({
|
||||
@JsonKey(name: 'equipment_id') int? equipmentId,
|
||||
@JsonKey(name: 'maintenance_type') String? maintenanceType,
|
||||
@JsonKey(name: 'is_expired') bool? isExpired,
|
||||
@JsonKey(name: 'expiring_days') int? expiringDays,
|
||||
@JsonKey(name: 'page') @Default(1) int page,
|
||||
@JsonKey(name: 'per_page') @Default(10) int perPage,
|
||||
@JsonKey(name: 'include_deleted') @Default(false) bool includeDeleted,
|
||||
}) = _MaintenanceQueryDto;
|
||||
|
||||
factory MaintenanceQueryDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$MaintenanceQueryDtoFromJson(json);
|
||||
}
|
||||
|
||||
// Maintenance Type 헬퍼 (백엔드와 일치)
|
||||
class MaintenanceType {
|
||||
static const String onsite = 'O';
|
||||
static const String remote = 'R';
|
||||
static const String preventive = 'P';
|
||||
static const String warranty = 'WARRANTY';
|
||||
static const String contract = 'CONTRACT';
|
||||
static const String inspection = 'INSPECTION';
|
||||
|
||||
static String getDisplayName(String type) {
|
||||
switch (type) {
|
||||
case onsite:
|
||||
return '방문';
|
||||
case remote:
|
||||
return '원격';
|
||||
case preventive:
|
||||
return '예방';
|
||||
case warranty:
|
||||
return '무상 보증';
|
||||
case contract:
|
||||
return '유상 계약';
|
||||
case inspection:
|
||||
return '점검';
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
static List<String> get allTypes => [onsite, remote, preventive];
|
||||
static List<String> get allTypes => [warranty, contract, inspection];
|
||||
|
||||
static List<Map<String, String>> get typeOptions => [
|
||||
{'value': warranty, 'label': '무상 보증'},
|
||||
{'value': contract, 'label': '유상 계약'},
|
||||
{'value': inspection, 'label': '점검'},
|
||||
];
|
||||
}
|
||||
@@ -23,7 +23,8 @@ mixin _$MaintenanceDto {
|
||||
@JsonKey(name: 'id')
|
||||
int? get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int get equipmentHistoryId => throw _privateConstructorUsedError;
|
||||
int? get equipmentHistoryId =>
|
||||
throw _privateConstructorUsedError; // Optional in backend
|
||||
@JsonKey(name: 'started_at')
|
||||
DateTime get startedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'ended_at')
|
||||
@@ -31,7 +32,8 @@ mixin _$MaintenanceDto {
|
||||
@JsonKey(name: 'period_month')
|
||||
int get periodMonth => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'maintenance_type')
|
||||
String get maintenanceType => throw _privateConstructorUsedError;
|
||||
String get maintenanceType =>
|
||||
throw _privateConstructorUsedError; // WARRANTY|CONTRACT|INSPECTION
|
||||
@JsonKey(name: 'is_deleted')
|
||||
bool get isDeleted => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'registered_at')
|
||||
@@ -69,7 +71,7 @@ abstract class $MaintenanceDtoCopyWith<$Res> {
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'id') int? id,
|
||||
@JsonKey(name: 'equipment_history_id') int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId,
|
||||
@JsonKey(name: 'started_at') DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') int periodMonth,
|
||||
@@ -102,7 +104,7 @@ class _$MaintenanceDtoCopyWithImpl<$Res, $Val extends MaintenanceDto>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = freezed,
|
||||
Object? equipmentHistoryId = null,
|
||||
Object? equipmentHistoryId = freezed,
|
||||
Object? startedAt = null,
|
||||
Object? endedAt = null,
|
||||
Object? periodMonth = null,
|
||||
@@ -121,10 +123,10 @@ class _$MaintenanceDtoCopyWithImpl<$Res, $Val extends MaintenanceDto>
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
equipmentHistoryId: null == equipmentHistoryId
|
||||
equipmentHistoryId: freezed == equipmentHistoryId
|
||||
? _value.equipmentHistoryId
|
||||
: equipmentHistoryId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
as int?,
|
||||
startedAt: null == startedAt
|
||||
? _value.startedAt
|
||||
: startedAt // ignore: cast_nullable_to_non_nullable
|
||||
@@ -202,7 +204,7 @@ abstract class _$$MaintenanceDtoImplCopyWith<$Res>
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'id') int? id,
|
||||
@JsonKey(name: 'equipment_history_id') int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId,
|
||||
@JsonKey(name: 'started_at') DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') int periodMonth,
|
||||
@@ -234,7 +236,7 @@ class __$$MaintenanceDtoImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = freezed,
|
||||
Object? equipmentHistoryId = null,
|
||||
Object? equipmentHistoryId = freezed,
|
||||
Object? startedAt = null,
|
||||
Object? endedAt = null,
|
||||
Object? periodMonth = null,
|
||||
@@ -253,10 +255,10 @@ class __$$MaintenanceDtoImplCopyWithImpl<$Res>
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
equipmentHistoryId: null == equipmentHistoryId
|
||||
equipmentHistoryId: freezed == equipmentHistoryId
|
||||
? _value.equipmentHistoryId
|
||||
: equipmentHistoryId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
as int?,
|
||||
startedAt: null == startedAt
|
||||
? _value.startedAt
|
||||
: startedAt // ignore: cast_nullable_to_non_nullable
|
||||
@@ -314,11 +316,11 @@ class __$$MaintenanceDtoImplCopyWithImpl<$Res>
|
||||
class _$MaintenanceDtoImpl extends _MaintenanceDto {
|
||||
const _$MaintenanceDtoImpl(
|
||||
{@JsonKey(name: 'id') this.id,
|
||||
@JsonKey(name: 'equipment_history_id') required this.equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') this.equipmentHistoryId,
|
||||
@JsonKey(name: 'started_at') required this.startedAt,
|
||||
@JsonKey(name: 'ended_at') required this.endedAt,
|
||||
@JsonKey(name: 'period_month') this.periodMonth = 1,
|
||||
@JsonKey(name: 'maintenance_type') this.maintenanceType = 'O',
|
||||
@JsonKey(name: 'maintenance_type') this.maintenanceType = 'WARRANTY',
|
||||
@JsonKey(name: 'is_deleted') this.isDeleted = false,
|
||||
@JsonKey(name: 'registered_at') required this.registeredAt,
|
||||
@JsonKey(name: 'updated_at') this.updatedAt,
|
||||
@@ -337,7 +339,8 @@ class _$MaintenanceDtoImpl extends _MaintenanceDto {
|
||||
final int? id;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
final int equipmentHistoryId;
|
||||
final int? equipmentHistoryId;
|
||||
// Optional in backend
|
||||
@override
|
||||
@JsonKey(name: 'started_at')
|
||||
final DateTime startedAt;
|
||||
@@ -350,6 +353,7 @@ class _$MaintenanceDtoImpl extends _MaintenanceDto {
|
||||
@override
|
||||
@JsonKey(name: 'maintenance_type')
|
||||
final String maintenanceType;
|
||||
// WARRANTY|CONTRACT|INSPECTION
|
||||
@override
|
||||
@JsonKey(name: 'is_deleted')
|
||||
final bool isDeleted;
|
||||
@@ -453,8 +457,7 @@ class _$MaintenanceDtoImpl extends _MaintenanceDto {
|
||||
abstract class _MaintenanceDto extends MaintenanceDto {
|
||||
const factory _MaintenanceDto(
|
||||
{@JsonKey(name: 'id') final int? id,
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
required final int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') final int? equipmentHistoryId,
|
||||
@JsonKey(name: 'started_at') required final DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required final DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') final int periodMonth,
|
||||
@@ -477,7 +480,7 @@ abstract class _MaintenanceDto extends MaintenanceDto {
|
||||
int? get id;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int get equipmentHistoryId;
|
||||
int? get equipmentHistoryId; // Optional in backend
|
||||
@override
|
||||
@JsonKey(name: 'started_at')
|
||||
DateTime get startedAt;
|
||||
@@ -489,7 +492,7 @@ abstract class _MaintenanceDto extends MaintenanceDto {
|
||||
int get periodMonth;
|
||||
@override
|
||||
@JsonKey(name: 'maintenance_type')
|
||||
String get maintenanceType;
|
||||
String get maintenanceType; // WARRANTY|CONTRACT|INSPECTION
|
||||
@override
|
||||
@JsonKey(name: 'is_deleted')
|
||||
bool get isDeleted;
|
||||
@@ -530,7 +533,8 @@ MaintenanceRequestDto _$MaintenanceRequestDtoFromJson(
|
||||
/// @nodoc
|
||||
mixin _$MaintenanceRequestDto {
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int get equipmentHistoryId => throw _privateConstructorUsedError;
|
||||
int? get equipmentHistoryId =>
|
||||
throw _privateConstructorUsedError; // Optional in backend
|
||||
@JsonKey(name: 'started_at')
|
||||
DateTime get startedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'ended_at')
|
||||
@@ -557,7 +561,7 @@ abstract class $MaintenanceRequestDtoCopyWith<$Res> {
|
||||
_$MaintenanceRequestDtoCopyWithImpl<$Res, MaintenanceRequestDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'equipment_history_id') int equipmentHistoryId,
|
||||
{@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId,
|
||||
@JsonKey(name: 'started_at') DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') int periodMonth,
|
||||
@@ -580,17 +584,17 @@ class _$MaintenanceRequestDtoCopyWithImpl<$Res,
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentHistoryId = null,
|
||||
Object? equipmentHistoryId = freezed,
|
||||
Object? startedAt = null,
|
||||
Object? endedAt = null,
|
||||
Object? periodMonth = null,
|
||||
Object? maintenanceType = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
equipmentHistoryId: null == equipmentHistoryId
|
||||
equipmentHistoryId: freezed == equipmentHistoryId
|
||||
? _value.equipmentHistoryId
|
||||
: equipmentHistoryId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
as int?,
|
||||
startedAt: null == startedAt
|
||||
? _value.startedAt
|
||||
: startedAt // ignore: cast_nullable_to_non_nullable
|
||||
@@ -621,7 +625,7 @@ abstract class _$$MaintenanceRequestDtoImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'equipment_history_id') int equipmentHistoryId,
|
||||
{@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId,
|
||||
@JsonKey(name: 'started_at') DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') int periodMonth,
|
||||
@@ -642,17 +646,17 @@ class __$$MaintenanceRequestDtoImplCopyWithImpl<$Res>
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentHistoryId = null,
|
||||
Object? equipmentHistoryId = freezed,
|
||||
Object? startedAt = null,
|
||||
Object? endedAt = null,
|
||||
Object? periodMonth = null,
|
||||
Object? maintenanceType = null,
|
||||
}) {
|
||||
return _then(_$MaintenanceRequestDtoImpl(
|
||||
equipmentHistoryId: null == equipmentHistoryId
|
||||
equipmentHistoryId: freezed == equipmentHistoryId
|
||||
? _value.equipmentHistoryId
|
||||
: equipmentHistoryId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
as int?,
|
||||
startedAt: null == startedAt
|
||||
? _value.startedAt
|
||||
: startedAt // ignore: cast_nullable_to_non_nullable
|
||||
@@ -677,18 +681,19 @@ class __$$MaintenanceRequestDtoImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$MaintenanceRequestDtoImpl implements _MaintenanceRequestDto {
|
||||
const _$MaintenanceRequestDtoImpl(
|
||||
{@JsonKey(name: 'equipment_history_id') required this.equipmentHistoryId,
|
||||
{@JsonKey(name: 'equipment_history_id') this.equipmentHistoryId,
|
||||
@JsonKey(name: 'started_at') required this.startedAt,
|
||||
@JsonKey(name: 'ended_at') required this.endedAt,
|
||||
@JsonKey(name: 'period_month') this.periodMonth = 1,
|
||||
@JsonKey(name: 'maintenance_type') this.maintenanceType = 'O'});
|
||||
@JsonKey(name: 'maintenance_type') this.maintenanceType = 'WARRANTY'});
|
||||
|
||||
factory _$MaintenanceRequestDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$MaintenanceRequestDtoImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
final int equipmentHistoryId;
|
||||
final int? equipmentHistoryId;
|
||||
// Optional in backend
|
||||
@override
|
||||
@JsonKey(name: 'started_at')
|
||||
final DateTime startedAt;
|
||||
@@ -747,8 +752,7 @@ class _$MaintenanceRequestDtoImpl implements _MaintenanceRequestDto {
|
||||
|
||||
abstract class _MaintenanceRequestDto implements MaintenanceRequestDto {
|
||||
const factory _MaintenanceRequestDto(
|
||||
{@JsonKey(name: 'equipment_history_id')
|
||||
required final int equipmentHistoryId,
|
||||
{@JsonKey(name: 'equipment_history_id') final int? equipmentHistoryId,
|
||||
@JsonKey(name: 'started_at') required final DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required final DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') final int periodMonth,
|
||||
@@ -760,7 +764,7 @@ abstract class _MaintenanceRequestDto implements MaintenanceRequestDto {
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int get equipmentHistoryId;
|
||||
int? get equipmentHistoryId; // Optional in backend
|
||||
@override
|
||||
@JsonKey(name: 'started_at')
|
||||
DateTime get startedAt;
|
||||
@@ -1294,3 +1298,305 @@ abstract class _MaintenanceListResponse implements MaintenanceListResponse {
|
||||
_$$MaintenanceListResponseImplCopyWith<_$MaintenanceListResponseImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
MaintenanceQueryDto _$MaintenanceQueryDtoFromJson(Map<String, dynamic> json) {
|
||||
return _MaintenanceQueryDto.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$MaintenanceQueryDto {
|
||||
@JsonKey(name: 'equipment_id')
|
||||
int? get equipmentId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'maintenance_type')
|
||||
String? get maintenanceType => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_expired')
|
||||
bool? get isExpired => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'expiring_days')
|
||||
int? get expiringDays => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'page')
|
||||
int get page => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'per_page')
|
||||
int get perPage => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'include_deleted')
|
||||
bool get includeDeleted => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this MaintenanceQueryDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of MaintenanceQueryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$MaintenanceQueryDtoCopyWith<MaintenanceQueryDto> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $MaintenanceQueryDtoCopyWith<$Res> {
|
||||
factory $MaintenanceQueryDtoCopyWith(
|
||||
MaintenanceQueryDto value, $Res Function(MaintenanceQueryDto) then) =
|
||||
_$MaintenanceQueryDtoCopyWithImpl<$Res, MaintenanceQueryDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'equipment_id') int? equipmentId,
|
||||
@JsonKey(name: 'maintenance_type') String? maintenanceType,
|
||||
@JsonKey(name: 'is_expired') bool? isExpired,
|
||||
@JsonKey(name: 'expiring_days') int? expiringDays,
|
||||
@JsonKey(name: 'page') int page,
|
||||
@JsonKey(name: 'per_page') int perPage,
|
||||
@JsonKey(name: 'include_deleted') bool includeDeleted});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$MaintenanceQueryDtoCopyWithImpl<$Res, $Val extends MaintenanceQueryDto>
|
||||
implements $MaintenanceQueryDtoCopyWith<$Res> {
|
||||
_$MaintenanceQueryDtoCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of MaintenanceQueryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentId = freezed,
|
||||
Object? maintenanceType = freezed,
|
||||
Object? isExpired = freezed,
|
||||
Object? expiringDays = freezed,
|
||||
Object? page = null,
|
||||
Object? perPage = null,
|
||||
Object? includeDeleted = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
equipmentId: freezed == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
maintenanceType: freezed == maintenanceType
|
||||
? _value.maintenanceType
|
||||
: maintenanceType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
isExpired: freezed == isExpired
|
||||
? _value.isExpired
|
||||
: isExpired // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
expiringDays: freezed == expiringDays
|
||||
? _value.expiringDays
|
||||
: expiringDays // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
page: null == page
|
||||
? _value.page
|
||||
: page // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
perPage: null == perPage
|
||||
? _value.perPage
|
||||
: perPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
includeDeleted: null == includeDeleted
|
||||
? _value.includeDeleted
|
||||
: includeDeleted // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$MaintenanceQueryDtoImplCopyWith<$Res>
|
||||
implements $MaintenanceQueryDtoCopyWith<$Res> {
|
||||
factory _$$MaintenanceQueryDtoImplCopyWith(_$MaintenanceQueryDtoImpl value,
|
||||
$Res Function(_$MaintenanceQueryDtoImpl) then) =
|
||||
__$$MaintenanceQueryDtoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'equipment_id') int? equipmentId,
|
||||
@JsonKey(name: 'maintenance_type') String? maintenanceType,
|
||||
@JsonKey(name: 'is_expired') bool? isExpired,
|
||||
@JsonKey(name: 'expiring_days') int? expiringDays,
|
||||
@JsonKey(name: 'page') int page,
|
||||
@JsonKey(name: 'per_page') int perPage,
|
||||
@JsonKey(name: 'include_deleted') bool includeDeleted});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$MaintenanceQueryDtoImplCopyWithImpl<$Res>
|
||||
extends _$MaintenanceQueryDtoCopyWithImpl<$Res, _$MaintenanceQueryDtoImpl>
|
||||
implements _$$MaintenanceQueryDtoImplCopyWith<$Res> {
|
||||
__$$MaintenanceQueryDtoImplCopyWithImpl(_$MaintenanceQueryDtoImpl _value,
|
||||
$Res Function(_$MaintenanceQueryDtoImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of MaintenanceQueryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentId = freezed,
|
||||
Object? maintenanceType = freezed,
|
||||
Object? isExpired = freezed,
|
||||
Object? expiringDays = freezed,
|
||||
Object? page = null,
|
||||
Object? perPage = null,
|
||||
Object? includeDeleted = null,
|
||||
}) {
|
||||
return _then(_$MaintenanceQueryDtoImpl(
|
||||
equipmentId: freezed == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
maintenanceType: freezed == maintenanceType
|
||||
? _value.maintenanceType
|
||||
: maintenanceType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
isExpired: freezed == isExpired
|
||||
? _value.isExpired
|
||||
: isExpired // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
expiringDays: freezed == expiringDays
|
||||
? _value.expiringDays
|
||||
: expiringDays // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
page: null == page
|
||||
? _value.page
|
||||
: page // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
perPage: null == perPage
|
||||
? _value.perPage
|
||||
: perPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
includeDeleted: null == includeDeleted
|
||||
? _value.includeDeleted
|
||||
: includeDeleted // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$MaintenanceQueryDtoImpl implements _MaintenanceQueryDto {
|
||||
const _$MaintenanceQueryDtoImpl(
|
||||
{@JsonKey(name: 'equipment_id') this.equipmentId,
|
||||
@JsonKey(name: 'maintenance_type') this.maintenanceType,
|
||||
@JsonKey(name: 'is_expired') this.isExpired,
|
||||
@JsonKey(name: 'expiring_days') this.expiringDays,
|
||||
@JsonKey(name: 'page') this.page = 1,
|
||||
@JsonKey(name: 'per_page') this.perPage = 10,
|
||||
@JsonKey(name: 'include_deleted') this.includeDeleted = false});
|
||||
|
||||
factory _$MaintenanceQueryDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$MaintenanceQueryDtoImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'equipment_id')
|
||||
final int? equipmentId;
|
||||
@override
|
||||
@JsonKey(name: 'maintenance_type')
|
||||
final String? maintenanceType;
|
||||
@override
|
||||
@JsonKey(name: 'is_expired')
|
||||
final bool? isExpired;
|
||||
@override
|
||||
@JsonKey(name: 'expiring_days')
|
||||
final int? expiringDays;
|
||||
@override
|
||||
@JsonKey(name: 'page')
|
||||
final int page;
|
||||
@override
|
||||
@JsonKey(name: 'per_page')
|
||||
final int perPage;
|
||||
@override
|
||||
@JsonKey(name: 'include_deleted')
|
||||
final bool includeDeleted;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MaintenanceQueryDto(equipmentId: $equipmentId, maintenanceType: $maintenanceType, isExpired: $isExpired, expiringDays: $expiringDays, page: $page, perPage: $perPage, includeDeleted: $includeDeleted)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$MaintenanceQueryDtoImpl &&
|
||||
(identical(other.equipmentId, equipmentId) ||
|
||||
other.equipmentId == equipmentId) &&
|
||||
(identical(other.maintenanceType, maintenanceType) ||
|
||||
other.maintenanceType == maintenanceType) &&
|
||||
(identical(other.isExpired, isExpired) ||
|
||||
other.isExpired == isExpired) &&
|
||||
(identical(other.expiringDays, expiringDays) ||
|
||||
other.expiringDays == expiringDays) &&
|
||||
(identical(other.page, page) || other.page == page) &&
|
||||
(identical(other.perPage, perPage) || other.perPage == perPage) &&
|
||||
(identical(other.includeDeleted, includeDeleted) ||
|
||||
other.includeDeleted == includeDeleted));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, equipmentId, maintenanceType,
|
||||
isExpired, expiringDays, page, perPage, includeDeleted);
|
||||
|
||||
/// Create a copy of MaintenanceQueryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$MaintenanceQueryDtoImplCopyWith<_$MaintenanceQueryDtoImpl> get copyWith =>
|
||||
__$$MaintenanceQueryDtoImplCopyWithImpl<_$MaintenanceQueryDtoImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$MaintenanceQueryDtoImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _MaintenanceQueryDto implements MaintenanceQueryDto {
|
||||
const factory _MaintenanceQueryDto(
|
||||
{@JsonKey(name: 'equipment_id') final int? equipmentId,
|
||||
@JsonKey(name: 'maintenance_type') final String? maintenanceType,
|
||||
@JsonKey(name: 'is_expired') final bool? isExpired,
|
||||
@JsonKey(name: 'expiring_days') final int? expiringDays,
|
||||
@JsonKey(name: 'page') final int page,
|
||||
@JsonKey(name: 'per_page') final int perPage,
|
||||
@JsonKey(name: 'include_deleted') final bool includeDeleted}) =
|
||||
_$MaintenanceQueryDtoImpl;
|
||||
|
||||
factory _MaintenanceQueryDto.fromJson(Map<String, dynamic> json) =
|
||||
_$MaintenanceQueryDtoImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'equipment_id')
|
||||
int? get equipmentId;
|
||||
@override
|
||||
@JsonKey(name: 'maintenance_type')
|
||||
String? get maintenanceType;
|
||||
@override
|
||||
@JsonKey(name: 'is_expired')
|
||||
bool? get isExpired;
|
||||
@override
|
||||
@JsonKey(name: 'expiring_days')
|
||||
int? get expiringDays;
|
||||
@override
|
||||
@JsonKey(name: 'page')
|
||||
int get page;
|
||||
@override
|
||||
@JsonKey(name: 'per_page')
|
||||
int get perPage;
|
||||
@override
|
||||
@JsonKey(name: 'include_deleted')
|
||||
bool get includeDeleted;
|
||||
|
||||
/// Create a copy of MaintenanceQueryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$MaintenanceQueryDtoImplCopyWith<_$MaintenanceQueryDtoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ part of 'maintenance_dto.dart';
|
||||
_$MaintenanceDtoImpl _$$MaintenanceDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$MaintenanceDtoImpl(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
equipmentHistoryId: (json['equipment_history_id'] as num).toInt(),
|
||||
equipmentHistoryId: (json['equipment_history_id'] as num?)?.toInt(),
|
||||
startedAt: DateTime.parse(json['started_at'] as String),
|
||||
endedAt: DateTime.parse(json['ended_at'] as String),
|
||||
periodMonth: (json['period_month'] as num?)?.toInt() ?? 1,
|
||||
maintenanceType: json['maintenance_type'] as String? ?? 'O',
|
||||
maintenanceType: json['maintenance_type'] as String? ?? 'WARRANTY',
|
||||
isDeleted: json['is_deleted'] as bool? ?? false,
|
||||
registeredAt: DateTime.parse(json['registered_at'] as String),
|
||||
updatedAt: json['updated_at'] == null
|
||||
@@ -51,11 +51,11 @@ Map<String, dynamic> _$$MaintenanceDtoImplToJson(
|
||||
_$MaintenanceRequestDtoImpl _$$MaintenanceRequestDtoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MaintenanceRequestDtoImpl(
|
||||
equipmentHistoryId: (json['equipment_history_id'] as num).toInt(),
|
||||
equipmentHistoryId: (json['equipment_history_id'] as num?)?.toInt(),
|
||||
startedAt: DateTime.parse(json['started_at'] as String),
|
||||
endedAt: DateTime.parse(json['ended_at'] as String),
|
||||
periodMonth: (json['period_month'] as num?)?.toInt() ?? 1,
|
||||
maintenanceType: json['maintenance_type'] as String? ?? 'O',
|
||||
maintenanceType: json['maintenance_type'] as String? ?? 'WARRANTY',
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MaintenanceRequestDtoImplToJson(
|
||||
@@ -111,3 +111,27 @@ Map<String, dynamic> _$$MaintenanceListResponseImplToJson(
|
||||
'total_pages': instance.totalPages,
|
||||
'page_size': instance.pageSize,
|
||||
};
|
||||
|
||||
_$MaintenanceQueryDtoImpl _$$MaintenanceQueryDtoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MaintenanceQueryDtoImpl(
|
||||
equipmentId: (json['equipment_id'] as num?)?.toInt(),
|
||||
maintenanceType: json['maintenance_type'] as String?,
|
||||
isExpired: json['is_expired'] as bool?,
|
||||
expiringDays: (json['expiring_days'] as num?)?.toInt(),
|
||||
page: (json['page'] as num?)?.toInt() ?? 1,
|
||||
perPage: (json['per_page'] as num?)?.toInt() ?? 10,
|
||||
includeDeleted: json['include_deleted'] as bool? ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MaintenanceQueryDtoImplToJson(
|
||||
_$MaintenanceQueryDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'equipment_id': instance.equipmentId,
|
||||
'maintenance_type': instance.maintenanceType,
|
||||
'is_expired': instance.isExpired,
|
||||
'expiring_days': instance.expiringDays,
|
||||
'page': instance.page,
|
||||
'per_page': instance.perPage,
|
||||
'include_deleted': instance.includeDeleted,
|
||||
};
|
||||
|
||||
52
lib/data/models/model/model_dto.dart
Normal file
52
lib/data/models/model/model_dto.dart
Normal file
@@ -0,0 +1,52 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'model_dto.freezed.dart';
|
||||
part 'model_dto.g.dart';
|
||||
|
||||
@freezed
|
||||
class ModelDto with _$ModelDto {
|
||||
const factory ModelDto({
|
||||
required int id,
|
||||
@JsonKey(name: 'vendors_id') required int vendorsId,
|
||||
@JsonKey(name: 'vendor_name') String? vendorName, // JOIN 필드
|
||||
required String name,
|
||||
@JsonKey(name: 'is_deleted') required bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') required DateTime registeredAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
}) = _ModelDto;
|
||||
|
||||
factory ModelDto.fromJson(Map<String, dynamic> json) => _$ModelDtoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class ModelListDto with _$ModelListDto {
|
||||
const factory ModelListDto({
|
||||
@JsonKey(name: 'data') required List<ModelDto> items,
|
||||
required int total,
|
||||
required int page,
|
||||
@JsonKey(name: 'page_size') required int perPage,
|
||||
@JsonKey(name: 'total_pages') required int totalPages,
|
||||
}) = _ModelListDto;
|
||||
|
||||
factory ModelListDto.fromJson(Map<String, dynamic> json) => _$ModelListDtoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class CreateModelRequest with _$CreateModelRequest {
|
||||
const factory CreateModelRequest({
|
||||
@JsonKey(name: 'vendors_id') required int vendorsId,
|
||||
required String name,
|
||||
}) = _CreateModelRequest;
|
||||
|
||||
factory CreateModelRequest.fromJson(Map<String, dynamic> json) => _$CreateModelRequestFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class UpdateModelRequest with _$UpdateModelRequest {
|
||||
const factory UpdateModelRequest({
|
||||
@JsonKey(name: 'vendors_id') int? vendorsId,
|
||||
String? name,
|
||||
}) = _UpdateModelRequest;
|
||||
|
||||
factory UpdateModelRequest.fromJson(Map<String, dynamic> json) => _$UpdateModelRequestFromJson(json);
|
||||
}
|
||||
913
lib/data/models/model/model_dto.freezed.dart
Normal file
913
lib/data/models/model/model_dto.freezed.dart
Normal file
@@ -0,0 +1,913 @@
|
||||
// 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 'model_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ModelDto _$ModelDtoFromJson(Map<String, dynamic> json) {
|
||||
return _ModelDto.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ModelDto {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'vendors_id')
|
||||
int get vendorsId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'vendor_name')
|
||||
String? get vendorName => throw _privateConstructorUsedError; // JOIN 필드
|
||||
String get name => 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;
|
||||
|
||||
/// Serializes this ModelDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ModelDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ModelDtoCopyWith<ModelDto> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ModelDtoCopyWith<$Res> {
|
||||
factory $ModelDtoCopyWith(ModelDto value, $Res Function(ModelDto) then) =
|
||||
_$ModelDtoCopyWithImpl<$Res, ModelDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'vendors_id') int vendorsId,
|
||||
@JsonKey(name: 'vendor_name') String? vendorName,
|
||||
String name,
|
||||
@JsonKey(name: 'is_deleted') bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') DateTime registeredAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ModelDtoCopyWithImpl<$Res, $Val extends ModelDto>
|
||||
implements $ModelDtoCopyWith<$Res> {
|
||||
_$ModelDtoCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ModelDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? vendorsId = null,
|
||||
Object? vendorName = freezed,
|
||||
Object? name = null,
|
||||
Object? isDeleted = null,
|
||||
Object? registeredAt = null,
|
||||
Object? updatedAt = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
vendorsId: null == vendorsId
|
||||
? _value.vendorsId
|
||||
: vendorsId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
vendorName: freezed == vendorName
|
||||
? _value.vendorName
|
||||
: vendorName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
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?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ModelDtoImplCopyWith<$Res>
|
||||
implements $ModelDtoCopyWith<$Res> {
|
||||
factory _$$ModelDtoImplCopyWith(
|
||||
_$ModelDtoImpl value, $Res Function(_$ModelDtoImpl) then) =
|
||||
__$$ModelDtoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'vendors_id') int vendorsId,
|
||||
@JsonKey(name: 'vendor_name') String? vendorName,
|
||||
String name,
|
||||
@JsonKey(name: 'is_deleted') bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') DateTime registeredAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ModelDtoImplCopyWithImpl<$Res>
|
||||
extends _$ModelDtoCopyWithImpl<$Res, _$ModelDtoImpl>
|
||||
implements _$$ModelDtoImplCopyWith<$Res> {
|
||||
__$$ModelDtoImplCopyWithImpl(
|
||||
_$ModelDtoImpl _value, $Res Function(_$ModelDtoImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ModelDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? vendorsId = null,
|
||||
Object? vendorName = freezed,
|
||||
Object? name = null,
|
||||
Object? isDeleted = null,
|
||||
Object? registeredAt = null,
|
||||
Object? updatedAt = freezed,
|
||||
}) {
|
||||
return _then(_$ModelDtoImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
vendorsId: null == vendorsId
|
||||
? _value.vendorsId
|
||||
: vendorsId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
vendorName: freezed == vendorName
|
||||
? _value.vendorName
|
||||
: vendorName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
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?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ModelDtoImpl implements _ModelDto {
|
||||
const _$ModelDtoImpl(
|
||||
{required this.id,
|
||||
@JsonKey(name: 'vendors_id') required this.vendorsId,
|
||||
@JsonKey(name: 'vendor_name') this.vendorName,
|
||||
required this.name,
|
||||
@JsonKey(name: 'is_deleted') required this.isDeleted,
|
||||
@JsonKey(name: 'registered_at') required this.registeredAt,
|
||||
@JsonKey(name: 'updated_at') this.updatedAt});
|
||||
|
||||
factory _$ModelDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ModelDtoImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: 'vendors_id')
|
||||
final int vendorsId;
|
||||
@override
|
||||
@JsonKey(name: 'vendor_name')
|
||||
final String? vendorName;
|
||||
// JOIN 필드
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
@JsonKey(name: 'is_deleted')
|
||||
final bool isDeleted;
|
||||
@override
|
||||
@JsonKey(name: 'registered_at')
|
||||
final DateTime registeredAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
final DateTime? updatedAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ModelDto(id: $id, vendorsId: $vendorsId, vendorName: $vendorName, name: $name, isDeleted: $isDeleted, registeredAt: $registeredAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ModelDtoImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.vendorsId, vendorsId) ||
|
||||
other.vendorsId == vendorsId) &&
|
||||
(identical(other.vendorName, vendorName) ||
|
||||
other.vendorName == vendorName) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.isDeleted, isDeleted) ||
|
||||
other.isDeleted == isDeleted) &&
|
||||
(identical(other.registeredAt, registeredAt) ||
|
||||
other.registeredAt == registeredAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, vendorsId, vendorName, name,
|
||||
isDeleted, registeredAt, updatedAt);
|
||||
|
||||
/// Create a copy of ModelDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ModelDtoImplCopyWith<_$ModelDtoImpl> get copyWith =>
|
||||
__$$ModelDtoImplCopyWithImpl<_$ModelDtoImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ModelDtoImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ModelDto implements ModelDto {
|
||||
const factory _ModelDto(
|
||||
{required final int id,
|
||||
@JsonKey(name: 'vendors_id') required final int vendorsId,
|
||||
@JsonKey(name: 'vendor_name') final String? vendorName,
|
||||
required final String name,
|
||||
@JsonKey(name: 'is_deleted') required final bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') required final DateTime registeredAt,
|
||||
@JsonKey(name: 'updated_at') final DateTime? updatedAt}) = _$ModelDtoImpl;
|
||||
|
||||
factory _ModelDto.fromJson(Map<String, dynamic> json) =
|
||||
_$ModelDtoImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: 'vendors_id')
|
||||
int get vendorsId;
|
||||
@override
|
||||
@JsonKey(name: 'vendor_name')
|
||||
String? get vendorName; // JOIN 필드
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
@JsonKey(name: 'is_deleted')
|
||||
bool get isDeleted;
|
||||
@override
|
||||
@JsonKey(name: 'registered_at')
|
||||
DateTime get registeredAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
DateTime? get updatedAt;
|
||||
|
||||
/// Create a copy of ModelDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ModelDtoImplCopyWith<_$ModelDtoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
ModelListDto _$ModelListDtoFromJson(Map<String, dynamic> json) {
|
||||
return _ModelListDto.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ModelListDto {
|
||||
@JsonKey(name: 'data')
|
||||
List<ModelDto> get items => throw _privateConstructorUsedError;
|
||||
int get total => throw _privateConstructorUsedError;
|
||||
int get page => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'page_size')
|
||||
int get perPage => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_pages')
|
||||
int get totalPages => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ModelListDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ModelListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ModelListDtoCopyWith<ModelListDto> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ModelListDtoCopyWith<$Res> {
|
||||
factory $ModelListDtoCopyWith(
|
||||
ModelListDto value, $Res Function(ModelListDto) then) =
|
||||
_$ModelListDtoCopyWithImpl<$Res, ModelListDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<ModelDto> items,
|
||||
int total,
|
||||
int page,
|
||||
@JsonKey(name: 'page_size') int perPage,
|
||||
@JsonKey(name: 'total_pages') int totalPages});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ModelListDtoCopyWithImpl<$Res, $Val extends ModelListDto>
|
||||
implements $ModelListDtoCopyWith<$Res> {
|
||||
_$ModelListDtoCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ModelListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? items = null,
|
||||
Object? total = null,
|
||||
Object? page = null,
|
||||
Object? perPage = null,
|
||||
Object? totalPages = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
items: null == items
|
||||
? _value.items
|
||||
: items // ignore: cast_nullable_to_non_nullable
|
||||
as List<ModelDto>,
|
||||
total: null == total
|
||||
? _value.total
|
||||
: total // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
page: null == page
|
||||
? _value.page
|
||||
: page // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
perPage: null == perPage
|
||||
? _value.perPage
|
||||
: perPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalPages: null == totalPages
|
||||
? _value.totalPages
|
||||
: totalPages // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ModelListDtoImplCopyWith<$Res>
|
||||
implements $ModelListDtoCopyWith<$Res> {
|
||||
factory _$$ModelListDtoImplCopyWith(
|
||||
_$ModelListDtoImpl value, $Res Function(_$ModelListDtoImpl) then) =
|
||||
__$$ModelListDtoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<ModelDto> items,
|
||||
int total,
|
||||
int page,
|
||||
@JsonKey(name: 'page_size') int perPage,
|
||||
@JsonKey(name: 'total_pages') int totalPages});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ModelListDtoImplCopyWithImpl<$Res>
|
||||
extends _$ModelListDtoCopyWithImpl<$Res, _$ModelListDtoImpl>
|
||||
implements _$$ModelListDtoImplCopyWith<$Res> {
|
||||
__$$ModelListDtoImplCopyWithImpl(
|
||||
_$ModelListDtoImpl _value, $Res Function(_$ModelListDtoImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ModelListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? items = null,
|
||||
Object? total = null,
|
||||
Object? page = null,
|
||||
Object? perPage = null,
|
||||
Object? totalPages = null,
|
||||
}) {
|
||||
return _then(_$ModelListDtoImpl(
|
||||
items: null == items
|
||||
? _value._items
|
||||
: items // ignore: cast_nullable_to_non_nullable
|
||||
as List<ModelDto>,
|
||||
total: null == total
|
||||
? _value.total
|
||||
: total // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
page: null == page
|
||||
? _value.page
|
||||
: page // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
perPage: null == perPage
|
||||
? _value.perPage
|
||||
: perPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalPages: null == totalPages
|
||||
? _value.totalPages
|
||||
: totalPages // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ModelListDtoImpl implements _ModelListDto {
|
||||
const _$ModelListDtoImpl(
|
||||
{@JsonKey(name: 'data') required final List<ModelDto> items,
|
||||
required this.total,
|
||||
required this.page,
|
||||
@JsonKey(name: 'page_size') required this.perPage,
|
||||
@JsonKey(name: 'total_pages') required this.totalPages})
|
||||
: _items = items;
|
||||
|
||||
factory _$ModelListDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ModelListDtoImplFromJson(json);
|
||||
|
||||
final List<ModelDto> _items;
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<ModelDto> get items {
|
||||
if (_items is EqualUnmodifiableListView) return _items;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_items);
|
||||
}
|
||||
|
||||
@override
|
||||
final int total;
|
||||
@override
|
||||
final int page;
|
||||
@override
|
||||
@JsonKey(name: 'page_size')
|
||||
final int perPage;
|
||||
@override
|
||||
@JsonKey(name: 'total_pages')
|
||||
final int totalPages;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ModelListDto(items: $items, total: $total, page: $page, perPage: $perPage, totalPages: $totalPages)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ModelListDtoImpl &&
|
||||
const DeepCollectionEquality().equals(other._items, _items) &&
|
||||
(identical(other.total, total) || other.total == total) &&
|
||||
(identical(other.page, page) || other.page == page) &&
|
||||
(identical(other.perPage, perPage) || other.perPage == perPage) &&
|
||||
(identical(other.totalPages, totalPages) ||
|
||||
other.totalPages == totalPages));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
const DeepCollectionEquality().hash(_items),
|
||||
total,
|
||||
page,
|
||||
perPage,
|
||||
totalPages);
|
||||
|
||||
/// Create a copy of ModelListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ModelListDtoImplCopyWith<_$ModelListDtoImpl> get copyWith =>
|
||||
__$$ModelListDtoImplCopyWithImpl<_$ModelListDtoImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ModelListDtoImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ModelListDto implements ModelListDto {
|
||||
const factory _ModelListDto(
|
||||
{@JsonKey(name: 'data') required final List<ModelDto> items,
|
||||
required final int total,
|
||||
required final int page,
|
||||
@JsonKey(name: 'page_size') required final int perPage,
|
||||
@JsonKey(name: 'total_pages') required final int totalPages}) =
|
||||
_$ModelListDtoImpl;
|
||||
|
||||
factory _ModelListDto.fromJson(Map<String, dynamic> json) =
|
||||
_$ModelListDtoImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<ModelDto> get items;
|
||||
@override
|
||||
int get total;
|
||||
@override
|
||||
int get page;
|
||||
@override
|
||||
@JsonKey(name: 'page_size')
|
||||
int get perPage;
|
||||
@override
|
||||
@JsonKey(name: 'total_pages')
|
||||
int get totalPages;
|
||||
|
||||
/// Create a copy of ModelListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ModelListDtoImplCopyWith<_$ModelListDtoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
CreateModelRequest _$CreateModelRequestFromJson(Map<String, dynamic> json) {
|
||||
return _CreateModelRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreateModelRequest {
|
||||
@JsonKey(name: 'vendors_id')
|
||||
int get vendorsId => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CreateModelRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CreateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CreateModelRequestCopyWith<CreateModelRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CreateModelRequestCopyWith<$Res> {
|
||||
factory $CreateModelRequestCopyWith(
|
||||
CreateModelRequest value, $Res Function(CreateModelRequest) then) =
|
||||
_$CreateModelRequestCopyWithImpl<$Res, CreateModelRequest>;
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'vendors_id') int vendorsId, String name});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CreateModelRequestCopyWithImpl<$Res, $Val extends CreateModelRequest>
|
||||
implements $CreateModelRequestCopyWith<$Res> {
|
||||
_$CreateModelRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CreateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? vendorsId = null,
|
||||
Object? name = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
vendorsId: null == vendorsId
|
||||
? _value.vendorsId
|
||||
: vendorsId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CreateModelRequestImplCopyWith<$Res>
|
||||
implements $CreateModelRequestCopyWith<$Res> {
|
||||
factory _$$CreateModelRequestImplCopyWith(_$CreateModelRequestImpl value,
|
||||
$Res Function(_$CreateModelRequestImpl) then) =
|
||||
__$$CreateModelRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'vendors_id') int vendorsId, String name});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CreateModelRequestImplCopyWithImpl<$Res>
|
||||
extends _$CreateModelRequestCopyWithImpl<$Res, _$CreateModelRequestImpl>
|
||||
implements _$$CreateModelRequestImplCopyWith<$Res> {
|
||||
__$$CreateModelRequestImplCopyWithImpl(_$CreateModelRequestImpl _value,
|
||||
$Res Function(_$CreateModelRequestImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? vendorsId = null,
|
||||
Object? name = null,
|
||||
}) {
|
||||
return _then(_$CreateModelRequestImpl(
|
||||
vendorsId: null == vendorsId
|
||||
? _value.vendorsId
|
||||
: vendorsId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CreateModelRequestImpl implements _CreateModelRequest {
|
||||
const _$CreateModelRequestImpl(
|
||||
{@JsonKey(name: 'vendors_id') required this.vendorsId,
|
||||
required this.name});
|
||||
|
||||
factory _$CreateModelRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CreateModelRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'vendors_id')
|
||||
final int vendorsId;
|
||||
@override
|
||||
final String name;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateModelRequest(vendorsId: $vendorsId, name: $name)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CreateModelRequestImpl &&
|
||||
(identical(other.vendorsId, vendorsId) ||
|
||||
other.vendorsId == vendorsId) &&
|
||||
(identical(other.name, name) || other.name == name));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, vendorsId, name);
|
||||
|
||||
/// Create a copy of CreateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreateModelRequestImplCopyWith<_$CreateModelRequestImpl> get copyWith =>
|
||||
__$$CreateModelRequestImplCopyWithImpl<_$CreateModelRequestImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CreateModelRequestImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CreateModelRequest implements CreateModelRequest {
|
||||
const factory _CreateModelRequest(
|
||||
{@JsonKey(name: 'vendors_id') required final int vendorsId,
|
||||
required final String name}) = _$CreateModelRequestImpl;
|
||||
|
||||
factory _CreateModelRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$CreateModelRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'vendors_id')
|
||||
int get vendorsId;
|
||||
@override
|
||||
String get name;
|
||||
|
||||
/// Create a copy of CreateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CreateModelRequestImplCopyWith<_$CreateModelRequestImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
UpdateModelRequest _$UpdateModelRequestFromJson(Map<String, dynamic> json) {
|
||||
return _UpdateModelRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UpdateModelRequest {
|
||||
@JsonKey(name: 'vendors_id')
|
||||
int? get vendorsId => throw _privateConstructorUsedError;
|
||||
String? get name => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this UpdateModelRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of UpdateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$UpdateModelRequestCopyWith<UpdateModelRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $UpdateModelRequestCopyWith<$Res> {
|
||||
factory $UpdateModelRequestCopyWith(
|
||||
UpdateModelRequest value, $Res Function(UpdateModelRequest) then) =
|
||||
_$UpdateModelRequestCopyWithImpl<$Res, UpdateModelRequest>;
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'vendors_id') int? vendorsId, String? name});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$UpdateModelRequestCopyWithImpl<$Res, $Val extends UpdateModelRequest>
|
||||
implements $UpdateModelRequestCopyWith<$Res> {
|
||||
_$UpdateModelRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of UpdateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? vendorsId = freezed,
|
||||
Object? name = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
vendorsId: freezed == vendorsId
|
||||
? _value.vendorsId
|
||||
: vendorsId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
name: freezed == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$UpdateModelRequestImplCopyWith<$Res>
|
||||
implements $UpdateModelRequestCopyWith<$Res> {
|
||||
factory _$$UpdateModelRequestImplCopyWith(_$UpdateModelRequestImpl value,
|
||||
$Res Function(_$UpdateModelRequestImpl) then) =
|
||||
__$$UpdateModelRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'vendors_id') int? vendorsId, String? name});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$UpdateModelRequestImplCopyWithImpl<$Res>
|
||||
extends _$UpdateModelRequestCopyWithImpl<$Res, _$UpdateModelRequestImpl>
|
||||
implements _$$UpdateModelRequestImplCopyWith<$Res> {
|
||||
__$$UpdateModelRequestImplCopyWithImpl(_$UpdateModelRequestImpl _value,
|
||||
$Res Function(_$UpdateModelRequestImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of UpdateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? vendorsId = freezed,
|
||||
Object? name = freezed,
|
||||
}) {
|
||||
return _then(_$UpdateModelRequestImpl(
|
||||
vendorsId: freezed == vendorsId
|
||||
? _value.vendorsId
|
||||
: vendorsId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
name: freezed == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$UpdateModelRequestImpl implements _UpdateModelRequest {
|
||||
const _$UpdateModelRequestImpl(
|
||||
{@JsonKey(name: 'vendors_id') this.vendorsId, this.name});
|
||||
|
||||
factory _$UpdateModelRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$UpdateModelRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'vendors_id')
|
||||
final int? vendorsId;
|
||||
@override
|
||||
final String? name;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UpdateModelRequest(vendorsId: $vendorsId, name: $name)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$UpdateModelRequestImpl &&
|
||||
(identical(other.vendorsId, vendorsId) ||
|
||||
other.vendorsId == vendorsId) &&
|
||||
(identical(other.name, name) || other.name == name));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, vendorsId, name);
|
||||
|
||||
/// Create a copy of UpdateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$UpdateModelRequestImplCopyWith<_$UpdateModelRequestImpl> get copyWith =>
|
||||
__$$UpdateModelRequestImplCopyWithImpl<_$UpdateModelRequestImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$UpdateModelRequestImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _UpdateModelRequest implements UpdateModelRequest {
|
||||
const factory _UpdateModelRequest(
|
||||
{@JsonKey(name: 'vendors_id') final int? vendorsId,
|
||||
final String? name}) = _$UpdateModelRequestImpl;
|
||||
|
||||
factory _UpdateModelRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$UpdateModelRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'vendors_id')
|
||||
int? get vendorsId;
|
||||
@override
|
||||
String? get name;
|
||||
|
||||
/// Create a copy of UpdateModelRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$UpdateModelRequestImplCopyWith<_$UpdateModelRequestImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
79
lib/data/models/model/model_dto.g.dart
Normal file
79
lib/data/models/model/model_dto.g.dart
Normal file
@@ -0,0 +1,79 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'model_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ModelDtoImpl _$$ModelDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ModelDtoImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
vendorsId: (json['vendors_id'] as num).toInt(),
|
||||
vendorName: json['vendor_name'] as String?,
|
||||
name: json['name'] as String,
|
||||
isDeleted: json['is_deleted'] as bool,
|
||||
registeredAt: DateTime.parse(json['registered_at'] as String),
|
||||
updatedAt: json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ModelDtoImplToJson(_$ModelDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'vendors_id': instance.vendorsId,
|
||||
'vendor_name': instance.vendorName,
|
||||
'name': instance.name,
|
||||
'is_deleted': instance.isDeleted,
|
||||
'registered_at': instance.registeredAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
};
|
||||
|
||||
_$ModelListDtoImpl _$$ModelListDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ModelListDtoImpl(
|
||||
items: (json['data'] as List<dynamic>)
|
||||
.map((e) => ModelDto.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
total: (json['total'] as num).toInt(),
|
||||
page: (json['page'] as num).toInt(),
|
||||
perPage: (json['page_size'] as num).toInt(),
|
||||
totalPages: (json['total_pages'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ModelListDtoImplToJson(_$ModelListDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.items,
|
||||
'total': instance.total,
|
||||
'page': instance.page,
|
||||
'page_size': instance.perPage,
|
||||
'total_pages': instance.totalPages,
|
||||
};
|
||||
|
||||
_$CreateModelRequestImpl _$$CreateModelRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CreateModelRequestImpl(
|
||||
vendorsId: (json['vendors_id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CreateModelRequestImplToJson(
|
||||
_$CreateModelRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'vendors_id': instance.vendorsId,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_$UpdateModelRequestImpl _$$UpdateModelRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$UpdateModelRequestImpl(
|
||||
vendorsId: (json['vendors_id'] as num?)?.toInt(),
|
||||
name: json['name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$UpdateModelRequestImplToJson(
|
||||
_$UpdateModelRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'vendors_id': instance.vendorsId,
|
||||
'name': instance.name,
|
||||
};
|
||||
@@ -57,11 +57,11 @@ class ModelUpdateRequestDto with _$ModelUpdateRequestDto {
|
||||
@freezed
|
||||
class ModelListResponse with _$ModelListResponse {
|
||||
const factory ModelListResponse({
|
||||
@JsonKey(name: 'data') required List<ModelDto> items,
|
||||
required List<ModelDto> items, // 백엔드 '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,
|
||||
@JsonKey(name: 'per_page') int? pageSize, // 백엔드 'per_page' 키와 일치
|
||||
}) = _ModelListResponse;
|
||||
|
||||
factory ModelListResponse.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -713,15 +713,15 @@ ModelListResponse _$ModelListResponseFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ModelListResponse {
|
||||
@JsonKey(name: 'data')
|
||||
List<ModelDto> get items => throw _privateConstructorUsedError;
|
||||
List<ModelDto> get items =>
|
||||
throw _privateConstructorUsedError; // 백엔드 'items' 키와 일치
|
||||
@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')
|
||||
@JsonKey(name: 'per_page')
|
||||
int? get pageSize => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ModelListResponse to a JSON map.
|
||||
@@ -741,11 +741,11 @@ abstract class $ModelListResponseCopyWith<$Res> {
|
||||
_$ModelListResponseCopyWithImpl<$Res, ModelListResponse>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<ModelDto> items,
|
||||
{List<ModelDto> items,
|
||||
@JsonKey(name: 'total') int totalCount,
|
||||
@JsonKey(name: 'page') int currentPage,
|
||||
@JsonKey(name: 'total_pages') int totalPages,
|
||||
@JsonKey(name: 'page_size') int? pageSize});
|
||||
@JsonKey(name: 'per_page') int? pageSize});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -803,11 +803,11 @@ abstract class _$$ModelListResponseImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<ModelDto> items,
|
||||
{List<ModelDto> items,
|
||||
@JsonKey(name: 'total') int totalCount,
|
||||
@JsonKey(name: 'page') int currentPage,
|
||||
@JsonKey(name: 'total_pages') int totalPages,
|
||||
@JsonKey(name: 'page_size') int? pageSize});
|
||||
@JsonKey(name: 'per_page') int? pageSize});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -858,11 +858,11 @@ class __$$ModelListResponseImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$ModelListResponseImpl implements _ModelListResponse {
|
||||
const _$ModelListResponseImpl(
|
||||
{@JsonKey(name: 'data') required final List<ModelDto> items,
|
||||
{required final List<ModelDto> 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})
|
||||
@JsonKey(name: 'per_page') this.pageSize})
|
||||
: _items = items;
|
||||
|
||||
factory _$ModelListResponseImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -870,13 +870,13 @@ class _$ModelListResponseImpl implements _ModelListResponse {
|
||||
|
||||
final List<ModelDto> _items;
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<ModelDto> get items {
|
||||
if (_items is EqualUnmodifiableListView) return _items;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_items);
|
||||
}
|
||||
|
||||
// 백엔드 'items' 키와 일치
|
||||
@override
|
||||
@JsonKey(name: 'total')
|
||||
final int totalCount;
|
||||
@@ -887,7 +887,7 @@ class _$ModelListResponseImpl implements _ModelListResponse {
|
||||
@JsonKey(name: 'total_pages')
|
||||
final int totalPages;
|
||||
@override
|
||||
@JsonKey(name: 'page_size')
|
||||
@JsonKey(name: 'per_page')
|
||||
final int? pageSize;
|
||||
|
||||
@override
|
||||
@@ -940,19 +940,18 @@ class _$ModelListResponseImpl implements _ModelListResponse {
|
||||
|
||||
abstract class _ModelListResponse implements ModelListResponse {
|
||||
const factory _ModelListResponse(
|
||||
{@JsonKey(name: 'data') required final List<ModelDto> items,
|
||||
{required final List<ModelDto> 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}) =
|
||||
@JsonKey(name: 'per_page') final int? pageSize}) =
|
||||
_$ModelListResponseImpl;
|
||||
|
||||
factory _ModelListResponse.fromJson(Map<String, dynamic> json) =
|
||||
_$ModelListResponseImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<ModelDto> get items;
|
||||
List<ModelDto> get items; // 백엔드 'items' 키와 일치
|
||||
@override
|
||||
@JsonKey(name: 'total')
|
||||
int get totalCount;
|
||||
@@ -963,7 +962,7 @@ abstract class _ModelListResponse implements ModelListResponse {
|
||||
@JsonKey(name: 'total_pages')
|
||||
int get totalPages;
|
||||
@override
|
||||
@JsonKey(name: 'page_size')
|
||||
@JsonKey(name: 'per_page')
|
||||
int? get pageSize;
|
||||
|
||||
/// Create a copy of ModelListResponse
|
||||
|
||||
@@ -67,21 +67,21 @@ Map<String, dynamic> _$$ModelUpdateRequestDtoImplToJson(
|
||||
_$ModelListResponseImpl _$$ModelListResponseImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ModelListResponseImpl(
|
||||
items: (json['data'] as List<dynamic>)
|
||||
items: (json['items'] as List<dynamic>)
|
||||
.map((e) => ModelDto.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
totalCount: (json['total'] as num).toInt(),
|
||||
currentPage: (json['page'] as num).toInt(),
|
||||
totalPages: (json['total_pages'] as num).toInt(),
|
||||
pageSize: (json['page_size'] as num?)?.toInt(),
|
||||
pageSize: (json['per_page'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ModelListResponseImplToJson(
|
||||
_$ModelListResponseImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.items,
|
||||
'items': instance.items,
|
||||
'total': instance.totalCount,
|
||||
'page': instance.currentPage,
|
||||
'total_pages': instance.totalPages,
|
||||
'page_size': instance.pageSize,
|
||||
'per_page': instance.pageSize,
|
||||
};
|
||||
|
||||
@@ -12,7 +12,15 @@ class RentDto with _$RentDto {
|
||||
int? id,
|
||||
@JsonKey(name: 'started_at') required DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required DateTime endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') required int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId,
|
||||
|
||||
// JOIN fields from backend (계산된 필드들)
|
||||
@JsonKey(name: 'equipment_serial') String? equipmentSerial,
|
||||
@JsonKey(name: 'equipment_model') String? equipmentModel,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'days_remaining') int? daysRemaining,
|
||||
@JsonKey(name: 'is_active') bool? isActive,
|
||||
@JsonKey(name: 'total_days') int? totalDays,
|
||||
|
||||
// Related entities (optional, populated in GET requests)
|
||||
EquipmentHistoryDto? equipmentHistory,
|
||||
@@ -27,7 +35,7 @@ class RentRequestDto with _$RentRequestDto {
|
||||
const factory RentRequestDto({
|
||||
@JsonKey(name: 'started_at') required DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required DateTime endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') required int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') required int equipmentHistoryId,
|
||||
}) = _RentRequestDto;
|
||||
|
||||
factory RentRequestDto.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -39,7 +47,7 @@ class RentUpdateRequestDto with _$RentUpdateRequestDto {
|
||||
const factory RentUpdateRequestDto({
|
||||
@JsonKey(name: 'started_at') DateTime? startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime? endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') int? equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId,
|
||||
}) = _RentUpdateRequestDto;
|
||||
|
||||
factory RentUpdateRequestDto.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -25,8 +25,21 @@ mixin _$RentDto {
|
||||
DateTime get startedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'ended_at')
|
||||
DateTime get endedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
int get equipmentHistoryId =>
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int? get equipmentHistoryId =>
|
||||
throw _privateConstructorUsedError; // JOIN fields from backend (계산된 필드들)
|
||||
@JsonKey(name: 'equipment_serial')
|
||||
String? get equipmentSerial => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'equipment_model')
|
||||
String? get equipmentModel => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'days_remaining')
|
||||
int? get daysRemaining => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_active')
|
||||
bool? get isActive => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_days')
|
||||
int? get totalDays =>
|
||||
throw _privateConstructorUsedError; // Related entities (optional, populated in GET requests)
|
||||
EquipmentHistoryDto? get equipmentHistory =>
|
||||
throw _privateConstructorUsedError;
|
||||
@@ -49,7 +62,13 @@ abstract class $RentDtoCopyWith<$Res> {
|
||||
{int? id,
|
||||
@JsonKey(name: 'started_at') DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_serial') String? equipmentSerial,
|
||||
@JsonKey(name: 'equipment_model') String? equipmentModel,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'days_remaining') int? daysRemaining,
|
||||
@JsonKey(name: 'is_active') bool? isActive,
|
||||
@JsonKey(name: 'total_days') int? totalDays,
|
||||
EquipmentHistoryDto? equipmentHistory});
|
||||
|
||||
$EquipmentHistoryDtoCopyWith<$Res>? get equipmentHistory;
|
||||
@@ -73,7 +92,13 @@ class _$RentDtoCopyWithImpl<$Res, $Val extends RentDto>
|
||||
Object? id = freezed,
|
||||
Object? startedAt = null,
|
||||
Object? endedAt = null,
|
||||
Object? equipmentHistoryId = null,
|
||||
Object? equipmentHistoryId = freezed,
|
||||
Object? equipmentSerial = freezed,
|
||||
Object? equipmentModel = freezed,
|
||||
Object? companyName = freezed,
|
||||
Object? daysRemaining = freezed,
|
||||
Object? isActive = freezed,
|
||||
Object? totalDays = freezed,
|
||||
Object? equipmentHistory = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -89,10 +114,34 @@ class _$RentDtoCopyWithImpl<$Res, $Val extends RentDto>
|
||||
? _value.endedAt
|
||||
: endedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
equipmentHistoryId: null == equipmentHistoryId
|
||||
equipmentHistoryId: freezed == equipmentHistoryId
|
||||
? _value.equipmentHistoryId
|
||||
: equipmentHistoryId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
as int?,
|
||||
equipmentSerial: freezed == equipmentSerial
|
||||
? _value.equipmentSerial
|
||||
: equipmentSerial // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
equipmentModel: freezed == equipmentModel
|
||||
? _value.equipmentModel
|
||||
: equipmentModel // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
daysRemaining: freezed == daysRemaining
|
||||
? _value.daysRemaining
|
||||
: daysRemaining // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
isActive: freezed == isActive
|
||||
? _value.isActive
|
||||
: isActive // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
totalDays: freezed == totalDays
|
||||
? _value.totalDays
|
||||
: totalDays // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
equipmentHistory: freezed == equipmentHistory
|
||||
? _value.equipmentHistory
|
||||
: equipmentHistory // ignore: cast_nullable_to_non_nullable
|
||||
@@ -127,7 +176,13 @@ abstract class _$$RentDtoImplCopyWith<$Res> implements $RentDtoCopyWith<$Res> {
|
||||
{int? id,
|
||||
@JsonKey(name: 'started_at') DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_serial') String? equipmentSerial,
|
||||
@JsonKey(name: 'equipment_model') String? equipmentModel,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'days_remaining') int? daysRemaining,
|
||||
@JsonKey(name: 'is_active') bool? isActive,
|
||||
@JsonKey(name: 'total_days') int? totalDays,
|
||||
EquipmentHistoryDto? equipmentHistory});
|
||||
|
||||
@override
|
||||
@@ -150,7 +205,13 @@ class __$$RentDtoImplCopyWithImpl<$Res>
|
||||
Object? id = freezed,
|
||||
Object? startedAt = null,
|
||||
Object? endedAt = null,
|
||||
Object? equipmentHistoryId = null,
|
||||
Object? equipmentHistoryId = freezed,
|
||||
Object? equipmentSerial = freezed,
|
||||
Object? equipmentModel = freezed,
|
||||
Object? companyName = freezed,
|
||||
Object? daysRemaining = freezed,
|
||||
Object? isActive = freezed,
|
||||
Object? totalDays = freezed,
|
||||
Object? equipmentHistory = freezed,
|
||||
}) {
|
||||
return _then(_$RentDtoImpl(
|
||||
@@ -166,10 +227,34 @@ class __$$RentDtoImplCopyWithImpl<$Res>
|
||||
? _value.endedAt
|
||||
: endedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
equipmentHistoryId: null == equipmentHistoryId
|
||||
equipmentHistoryId: freezed == equipmentHistoryId
|
||||
? _value.equipmentHistoryId
|
||||
: equipmentHistoryId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
as int?,
|
||||
equipmentSerial: freezed == equipmentSerial
|
||||
? _value.equipmentSerial
|
||||
: equipmentSerial // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
equipmentModel: freezed == equipmentModel
|
||||
? _value.equipmentModel
|
||||
: equipmentModel // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
daysRemaining: freezed == daysRemaining
|
||||
? _value.daysRemaining
|
||||
: daysRemaining // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
isActive: freezed == isActive
|
||||
? _value.isActive
|
||||
: isActive // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
totalDays: freezed == totalDays
|
||||
? _value.totalDays
|
||||
: totalDays // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
equipmentHistory: freezed == equipmentHistory
|
||||
? _value.equipmentHistory
|
||||
: equipmentHistory // ignore: cast_nullable_to_non_nullable
|
||||
@@ -185,7 +270,13 @@ class _$RentDtoImpl extends _RentDto {
|
||||
{this.id,
|
||||
@JsonKey(name: 'started_at') required this.startedAt,
|
||||
@JsonKey(name: 'ended_at') required this.endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') required this.equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') this.equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_serial') this.equipmentSerial,
|
||||
@JsonKey(name: 'equipment_model') this.equipmentModel,
|
||||
@JsonKey(name: 'company_name') this.companyName,
|
||||
@JsonKey(name: 'days_remaining') this.daysRemaining,
|
||||
@JsonKey(name: 'is_active') this.isActive,
|
||||
@JsonKey(name: 'total_days') this.totalDays,
|
||||
this.equipmentHistory})
|
||||
: super._();
|
||||
|
||||
@@ -201,15 +292,34 @@ class _$RentDtoImpl extends _RentDto {
|
||||
@JsonKey(name: 'ended_at')
|
||||
final DateTime endedAt;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
final int equipmentHistoryId;
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
final int? equipmentHistoryId;
|
||||
// JOIN fields from backend (계산된 필드들)
|
||||
@override
|
||||
@JsonKey(name: 'equipment_serial')
|
||||
final String? equipmentSerial;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_model')
|
||||
final String? equipmentModel;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
final String? companyName;
|
||||
@override
|
||||
@JsonKey(name: 'days_remaining')
|
||||
final int? daysRemaining;
|
||||
@override
|
||||
@JsonKey(name: 'is_active')
|
||||
final bool? isActive;
|
||||
@override
|
||||
@JsonKey(name: 'total_days')
|
||||
final int? totalDays;
|
||||
// Related entities (optional, populated in GET requests)
|
||||
@override
|
||||
final EquipmentHistoryDto? equipmentHistory;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RentDto(id: $id, startedAt: $startedAt, endedAt: $endedAt, equipmentHistoryId: $equipmentHistoryId, equipmentHistory: $equipmentHistory)';
|
||||
return 'RentDto(id: $id, startedAt: $startedAt, endedAt: $endedAt, equipmentHistoryId: $equipmentHistoryId, equipmentSerial: $equipmentSerial, equipmentModel: $equipmentModel, companyName: $companyName, daysRemaining: $daysRemaining, isActive: $isActive, totalDays: $totalDays, equipmentHistory: $equipmentHistory)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -223,14 +333,37 @@ class _$RentDtoImpl extends _RentDto {
|
||||
(identical(other.endedAt, endedAt) || other.endedAt == endedAt) &&
|
||||
(identical(other.equipmentHistoryId, equipmentHistoryId) ||
|
||||
other.equipmentHistoryId == equipmentHistoryId) &&
|
||||
(identical(other.equipmentSerial, equipmentSerial) ||
|
||||
other.equipmentSerial == equipmentSerial) &&
|
||||
(identical(other.equipmentModel, equipmentModel) ||
|
||||
other.equipmentModel == equipmentModel) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.daysRemaining, daysRemaining) ||
|
||||
other.daysRemaining == daysRemaining) &&
|
||||
(identical(other.isActive, isActive) ||
|
||||
other.isActive == isActive) &&
|
||||
(identical(other.totalDays, totalDays) ||
|
||||
other.totalDays == totalDays) &&
|
||||
(identical(other.equipmentHistory, equipmentHistory) ||
|
||||
other.equipmentHistory == equipmentHistory));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, startedAt, endedAt,
|
||||
equipmentHistoryId, equipmentHistory);
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
startedAt,
|
||||
endedAt,
|
||||
equipmentHistoryId,
|
||||
equipmentSerial,
|
||||
equipmentModel,
|
||||
companyName,
|
||||
daysRemaining,
|
||||
isActive,
|
||||
totalDays,
|
||||
equipmentHistory);
|
||||
|
||||
/// Create a copy of RentDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -253,8 +386,13 @@ abstract class _RentDto extends RentDto {
|
||||
{final int? id,
|
||||
@JsonKey(name: 'started_at') required final DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required final DateTime endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
required final int equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_history_id') final int? equipmentHistoryId,
|
||||
@JsonKey(name: 'equipment_serial') final String? equipmentSerial,
|
||||
@JsonKey(name: 'equipment_model') final String? equipmentModel,
|
||||
@JsonKey(name: 'company_name') final String? companyName,
|
||||
@JsonKey(name: 'days_remaining') final int? daysRemaining,
|
||||
@JsonKey(name: 'is_active') final bool? isActive,
|
||||
@JsonKey(name: 'total_days') final int? totalDays,
|
||||
final EquipmentHistoryDto? equipmentHistory}) = _$RentDtoImpl;
|
||||
const _RentDto._() : super._();
|
||||
|
||||
@@ -269,8 +407,26 @@ abstract class _RentDto extends RentDto {
|
||||
@JsonKey(name: 'ended_at')
|
||||
DateTime get endedAt;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
int get equipmentHistoryId; // Related entities (optional, populated in GET requests)
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int? get equipmentHistoryId; // JOIN fields from backend (계산된 필드들)
|
||||
@override
|
||||
@JsonKey(name: 'equipment_serial')
|
||||
String? get equipmentSerial;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_model')
|
||||
String? get equipmentModel;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName;
|
||||
@override
|
||||
@JsonKey(name: 'days_remaining')
|
||||
int? get daysRemaining;
|
||||
@override
|
||||
@JsonKey(name: 'is_active')
|
||||
bool? get isActive;
|
||||
@override
|
||||
@JsonKey(name: 'total_days')
|
||||
int? get totalDays; // Related entities (optional, populated in GET requests)
|
||||
@override
|
||||
EquipmentHistoryDto? get equipmentHistory;
|
||||
|
||||
@@ -292,7 +448,7 @@ mixin _$RentRequestDto {
|
||||
DateTime get startedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'ended_at')
|
||||
DateTime get endedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int get equipmentHistoryId => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this RentRequestDto to a JSON map.
|
||||
@@ -314,7 +470,7 @@ abstract class $RentRequestDtoCopyWith<$Res> {
|
||||
$Res call(
|
||||
{@JsonKey(name: 'started_at') DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') int equipmentHistoryId});
|
||||
@JsonKey(name: 'equipment_history_id') int equipmentHistoryId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -364,7 +520,7 @@ abstract class _$$RentRequestDtoImplCopyWith<$Res>
|
||||
$Res call(
|
||||
{@JsonKey(name: 'started_at') DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') int equipmentHistoryId});
|
||||
@JsonKey(name: 'equipment_history_id') int equipmentHistoryId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -407,7 +563,7 @@ class _$RentRequestDtoImpl implements _RentRequestDto {
|
||||
const _$RentRequestDtoImpl(
|
||||
{@JsonKey(name: 'started_at') required this.startedAt,
|
||||
@JsonKey(name: 'ended_at') required this.endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') required this.equipmentHistoryId});
|
||||
@JsonKey(name: 'equipment_history_id') required this.equipmentHistoryId});
|
||||
|
||||
factory _$RentRequestDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RentRequestDtoImplFromJson(json);
|
||||
@@ -419,7 +575,7 @@ class _$RentRequestDtoImpl implements _RentRequestDto {
|
||||
@JsonKey(name: 'ended_at')
|
||||
final DateTime endedAt;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
final int equipmentHistoryId;
|
||||
|
||||
@override
|
||||
@@ -465,7 +621,7 @@ abstract class _RentRequestDto implements RentRequestDto {
|
||||
const factory _RentRequestDto(
|
||||
{@JsonKey(name: 'started_at') required final DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required final DateTime endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
required final int equipmentHistoryId}) = _$RentRequestDtoImpl;
|
||||
|
||||
factory _RentRequestDto.fromJson(Map<String, dynamic> json) =
|
||||
@@ -478,7 +634,7 @@ abstract class _RentRequestDto implements RentRequestDto {
|
||||
@JsonKey(name: 'ended_at')
|
||||
DateTime get endedAt;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int get equipmentHistoryId;
|
||||
|
||||
/// Create a copy of RentRequestDto
|
||||
@@ -499,7 +655,7 @@ mixin _$RentUpdateRequestDto {
|
||||
DateTime? get startedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'ended_at')
|
||||
DateTime? get endedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int? get equipmentHistoryId => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this RentUpdateRequestDto to a JSON map.
|
||||
@@ -521,7 +677,7 @@ abstract class $RentUpdateRequestDtoCopyWith<$Res> {
|
||||
$Res call(
|
||||
{@JsonKey(name: 'started_at') DateTime? startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime? endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') int? equipmentHistoryId});
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -572,7 +728,7 @@ abstract class _$$RentUpdateRequestDtoImplCopyWith<$Res>
|
||||
$Res call(
|
||||
{@JsonKey(name: 'started_at') DateTime? startedAt,
|
||||
@JsonKey(name: 'ended_at') DateTime? endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') int? equipmentHistoryId});
|
||||
@JsonKey(name: 'equipment_history_id') int? equipmentHistoryId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -615,7 +771,7 @@ class _$RentUpdateRequestDtoImpl implements _RentUpdateRequestDto {
|
||||
const _$RentUpdateRequestDtoImpl(
|
||||
{@JsonKey(name: 'started_at') this.startedAt,
|
||||
@JsonKey(name: 'ended_at') this.endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id') this.equipmentHistoryId});
|
||||
@JsonKey(name: 'equipment_history_id') this.equipmentHistoryId});
|
||||
|
||||
factory _$RentUpdateRequestDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RentUpdateRequestDtoImplFromJson(json);
|
||||
@@ -627,7 +783,7 @@ class _$RentUpdateRequestDtoImpl implements _RentUpdateRequestDto {
|
||||
@JsonKey(name: 'ended_at')
|
||||
final DateTime? endedAt;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
final int? equipmentHistoryId;
|
||||
|
||||
@override
|
||||
@@ -674,7 +830,7 @@ abstract class _RentUpdateRequestDto implements RentUpdateRequestDto {
|
||||
const factory _RentUpdateRequestDto(
|
||||
{@JsonKey(name: 'started_at') final DateTime? startedAt,
|
||||
@JsonKey(name: 'ended_at') final DateTime? endedAt,
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
final int? equipmentHistoryId}) = _$RentUpdateRequestDtoImpl;
|
||||
|
||||
factory _RentUpdateRequestDto.fromJson(Map<String, dynamic> json) =
|
||||
@@ -687,7 +843,7 @@ abstract class _RentUpdateRequestDto implements RentUpdateRequestDto {
|
||||
@JsonKey(name: 'ended_at')
|
||||
DateTime? get endedAt;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_history_Id')
|
||||
@JsonKey(name: 'equipment_history_id')
|
||||
int? get equipmentHistoryId;
|
||||
|
||||
/// Create a copy of RentUpdateRequestDto
|
||||
|
||||
@@ -11,7 +11,13 @@ _$RentDtoImpl _$$RentDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
startedAt: DateTime.parse(json['started_at'] as String),
|
||||
endedAt: DateTime.parse(json['ended_at'] as String),
|
||||
equipmentHistoryId: (json['equipment_history_Id'] as num).toInt(),
|
||||
equipmentHistoryId: (json['equipment_history_id'] as num?)?.toInt(),
|
||||
equipmentSerial: json['equipment_serial'] as String?,
|
||||
equipmentModel: json['equipment_model'] as String?,
|
||||
companyName: json['company_name'] as String?,
|
||||
daysRemaining: (json['days_remaining'] as num?)?.toInt(),
|
||||
isActive: json['is_active'] as bool?,
|
||||
totalDays: (json['total_days'] as num?)?.toInt(),
|
||||
equipmentHistory: json['equipmentHistory'] == null
|
||||
? null
|
||||
: EquipmentHistoryDto.fromJson(
|
||||
@@ -23,7 +29,13 @@ Map<String, dynamic> _$$RentDtoImplToJson(_$RentDtoImpl instance) =>
|
||||
'id': instance.id,
|
||||
'started_at': instance.startedAt.toIso8601String(),
|
||||
'ended_at': instance.endedAt.toIso8601String(),
|
||||
'equipment_history_Id': instance.equipmentHistoryId,
|
||||
'equipment_history_id': instance.equipmentHistoryId,
|
||||
'equipment_serial': instance.equipmentSerial,
|
||||
'equipment_model': instance.equipmentModel,
|
||||
'company_name': instance.companyName,
|
||||
'days_remaining': instance.daysRemaining,
|
||||
'is_active': instance.isActive,
|
||||
'total_days': instance.totalDays,
|
||||
'equipmentHistory': instance.equipmentHistory,
|
||||
};
|
||||
|
||||
@@ -31,7 +43,7 @@ _$RentRequestDtoImpl _$$RentRequestDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$RentRequestDtoImpl(
|
||||
startedAt: DateTime.parse(json['started_at'] as String),
|
||||
endedAt: DateTime.parse(json['ended_at'] as String),
|
||||
equipmentHistoryId: (json['equipment_history_Id'] as num).toInt(),
|
||||
equipmentHistoryId: (json['equipment_history_id'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RentRequestDtoImplToJson(
|
||||
@@ -39,7 +51,7 @@ Map<String, dynamic> _$$RentRequestDtoImplToJson(
|
||||
<String, dynamic>{
|
||||
'started_at': instance.startedAt.toIso8601String(),
|
||||
'ended_at': instance.endedAt.toIso8601String(),
|
||||
'equipment_history_Id': instance.equipmentHistoryId,
|
||||
'equipment_history_id': instance.equipmentHistoryId,
|
||||
};
|
||||
|
||||
_$RentUpdateRequestDtoImpl _$$RentUpdateRequestDtoImplFromJson(
|
||||
@@ -51,7 +63,7 @@ _$RentUpdateRequestDtoImpl _$$RentUpdateRequestDtoImplFromJson(
|
||||
endedAt: json['ended_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['ended_at'] as String),
|
||||
equipmentHistoryId: (json['equipment_history_Id'] as num?)?.toInt(),
|
||||
equipmentHistoryId: (json['equipment_history_id'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RentUpdateRequestDtoImplToJson(
|
||||
@@ -59,7 +71,7 @@ Map<String, dynamic> _$$RentUpdateRequestDtoImplToJson(
|
||||
<String, dynamic>{
|
||||
'started_at': instance.startedAt?.toIso8601String(),
|
||||
'ended_at': instance.endedAt?.toIso8601String(),
|
||||
'equipment_history_Id': instance.equipmentHistoryId,
|
||||
'equipment_history_id': instance.equipmentHistoryId,
|
||||
};
|
||||
|
||||
_$RentListResponseImpl _$$RentListResponseImplFromJson(
|
||||
|
||||
34
lib/data/models/stock_status_dto.dart
Normal file
34
lib/data/models/stock_status_dto.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'stock_status_dto.freezed.dart';
|
||||
part 'stock_status_dto.g.dart';
|
||||
|
||||
/// 재고 현황 DTO (백엔드 stock-status API 응답)
|
||||
@freezed
|
||||
class StockStatusDto with _$StockStatusDto {
|
||||
const factory StockStatusDto({
|
||||
@JsonKey(name: 'equipments_id') required int equipmentsId,
|
||||
@JsonKey(name: 'warehouses_id') required int warehousesId,
|
||||
@JsonKey(name: 'equipment_serial') required String equipmentSerial,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'warehouse_name') required String warehouseName,
|
||||
@JsonKey(name: 'current_quantity') required int currentQuantity,
|
||||
@JsonKey(name: 'last_transaction_date') DateTime? lastTransactionDate,
|
||||
}) = _StockStatusDto;
|
||||
|
||||
factory StockStatusDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$StockStatusDtoFromJson(json);
|
||||
}
|
||||
|
||||
/// 재고 현황 목록 응답 DTO
|
||||
@freezed
|
||||
class StockStatusListResponse with _$StockStatusListResponse {
|
||||
const factory StockStatusListResponse({
|
||||
required List<StockStatusDto> items,
|
||||
}) = _StockStatusListResponse;
|
||||
|
||||
factory StockStatusListResponse.fromJson(List<dynamic> json) =>
|
||||
StockStatusListResponse(
|
||||
items: json.map((item) => StockStatusDto.fromJson(item)).toList(),
|
||||
);
|
||||
}
|
||||
491
lib/data/models/stock_status_dto.freezed.dart
Normal file
491
lib/data/models/stock_status_dto.freezed.dart
Normal file
@@ -0,0 +1,491 @@
|
||||
// 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 'stock_status_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
StockStatusDto _$StockStatusDtoFromJson(Map<String, dynamic> json) {
|
||||
return _StockStatusDto.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$StockStatusDto {
|
||||
@JsonKey(name: 'equipments_id')
|
||||
int get equipmentsId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouses_id')
|
||||
int get warehousesId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'equipment_serial')
|
||||
String get equipmentSerial => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'model_name')
|
||||
String? get modelName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String get warehouseName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current_quantity')
|
||||
int get currentQuantity => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'last_transaction_date')
|
||||
DateTime? get lastTransactionDate => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this StockStatusDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of StockStatusDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$StockStatusDtoCopyWith<StockStatusDto> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $StockStatusDtoCopyWith<$Res> {
|
||||
factory $StockStatusDtoCopyWith(
|
||||
StockStatusDto value, $Res Function(StockStatusDto) then) =
|
||||
_$StockStatusDtoCopyWithImpl<$Res, StockStatusDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'equipments_id') int equipmentsId,
|
||||
@JsonKey(name: 'warehouses_id') int warehousesId,
|
||||
@JsonKey(name: 'equipment_serial') String equipmentSerial,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'warehouse_name') String warehouseName,
|
||||
@JsonKey(name: 'current_quantity') int currentQuantity,
|
||||
@JsonKey(name: 'last_transaction_date') DateTime? lastTransactionDate});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$StockStatusDtoCopyWithImpl<$Res, $Val extends StockStatusDto>
|
||||
implements $StockStatusDtoCopyWith<$Res> {
|
||||
_$StockStatusDtoCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of StockStatusDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentsId = null,
|
||||
Object? warehousesId = null,
|
||||
Object? equipmentSerial = null,
|
||||
Object? modelName = freezed,
|
||||
Object? warehouseName = null,
|
||||
Object? currentQuantity = null,
|
||||
Object? lastTransactionDate = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
equipmentsId: null == equipmentsId
|
||||
? _value.equipmentsId
|
||||
: equipmentsId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
warehousesId: null == warehousesId
|
||||
? _value.warehousesId
|
||||
: warehousesId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentSerial: null == equipmentSerial
|
||||
? _value.equipmentSerial
|
||||
: equipmentSerial // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: null == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
currentQuantity: null == currentQuantity
|
||||
? _value.currentQuantity
|
||||
: currentQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
lastTransactionDate: freezed == lastTransactionDate
|
||||
? _value.lastTransactionDate
|
||||
: lastTransactionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$StockStatusDtoImplCopyWith<$Res>
|
||||
implements $StockStatusDtoCopyWith<$Res> {
|
||||
factory _$$StockStatusDtoImplCopyWith(_$StockStatusDtoImpl value,
|
||||
$Res Function(_$StockStatusDtoImpl) then) =
|
||||
__$$StockStatusDtoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'equipments_id') int equipmentsId,
|
||||
@JsonKey(name: 'warehouses_id') int warehousesId,
|
||||
@JsonKey(name: 'equipment_serial') String equipmentSerial,
|
||||
@JsonKey(name: 'model_name') String? modelName,
|
||||
@JsonKey(name: 'warehouse_name') String warehouseName,
|
||||
@JsonKey(name: 'current_quantity') int currentQuantity,
|
||||
@JsonKey(name: 'last_transaction_date') DateTime? lastTransactionDate});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$StockStatusDtoImplCopyWithImpl<$Res>
|
||||
extends _$StockStatusDtoCopyWithImpl<$Res, _$StockStatusDtoImpl>
|
||||
implements _$$StockStatusDtoImplCopyWith<$Res> {
|
||||
__$$StockStatusDtoImplCopyWithImpl(
|
||||
_$StockStatusDtoImpl _value, $Res Function(_$StockStatusDtoImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of StockStatusDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentsId = null,
|
||||
Object? warehousesId = null,
|
||||
Object? equipmentSerial = null,
|
||||
Object? modelName = freezed,
|
||||
Object? warehouseName = null,
|
||||
Object? currentQuantity = null,
|
||||
Object? lastTransactionDate = freezed,
|
||||
}) {
|
||||
return _then(_$StockStatusDtoImpl(
|
||||
equipmentsId: null == equipmentsId
|
||||
? _value.equipmentsId
|
||||
: equipmentsId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
warehousesId: null == warehousesId
|
||||
? _value.warehousesId
|
||||
: warehousesId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentSerial: null == equipmentSerial
|
||||
? _value.equipmentSerial
|
||||
: equipmentSerial // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: null == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
currentQuantity: null == currentQuantity
|
||||
? _value.currentQuantity
|
||||
: currentQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
lastTransactionDate: freezed == lastTransactionDate
|
||||
? _value.lastTransactionDate
|
||||
: lastTransactionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$StockStatusDtoImpl implements _StockStatusDto {
|
||||
const _$StockStatusDtoImpl(
|
||||
{@JsonKey(name: 'equipments_id') required this.equipmentsId,
|
||||
@JsonKey(name: 'warehouses_id') required this.warehousesId,
|
||||
@JsonKey(name: 'equipment_serial') required this.equipmentSerial,
|
||||
@JsonKey(name: 'model_name') this.modelName,
|
||||
@JsonKey(name: 'warehouse_name') required this.warehouseName,
|
||||
@JsonKey(name: 'current_quantity') required this.currentQuantity,
|
||||
@JsonKey(name: 'last_transaction_date') this.lastTransactionDate});
|
||||
|
||||
factory _$StockStatusDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$StockStatusDtoImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'equipments_id')
|
||||
final int equipmentsId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouses_id')
|
||||
final int warehousesId;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_serial')
|
||||
final String equipmentSerial;
|
||||
@override
|
||||
@JsonKey(name: 'model_name')
|
||||
final String? modelName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
final String warehouseName;
|
||||
@override
|
||||
@JsonKey(name: 'current_quantity')
|
||||
final int currentQuantity;
|
||||
@override
|
||||
@JsonKey(name: 'last_transaction_date')
|
||||
final DateTime? lastTransactionDate;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StockStatusDto(equipmentsId: $equipmentsId, warehousesId: $warehousesId, equipmentSerial: $equipmentSerial, modelName: $modelName, warehouseName: $warehouseName, currentQuantity: $currentQuantity, lastTransactionDate: $lastTransactionDate)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$StockStatusDtoImpl &&
|
||||
(identical(other.equipmentsId, equipmentsId) ||
|
||||
other.equipmentsId == equipmentsId) &&
|
||||
(identical(other.warehousesId, warehousesId) ||
|
||||
other.warehousesId == warehousesId) &&
|
||||
(identical(other.equipmentSerial, equipmentSerial) ||
|
||||
other.equipmentSerial == equipmentSerial) &&
|
||||
(identical(other.modelName, modelName) ||
|
||||
other.modelName == modelName) &&
|
||||
(identical(other.warehouseName, warehouseName) ||
|
||||
other.warehouseName == warehouseName) &&
|
||||
(identical(other.currentQuantity, currentQuantity) ||
|
||||
other.currentQuantity == currentQuantity) &&
|
||||
(identical(other.lastTransactionDate, lastTransactionDate) ||
|
||||
other.lastTransactionDate == lastTransactionDate));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
equipmentsId,
|
||||
warehousesId,
|
||||
equipmentSerial,
|
||||
modelName,
|
||||
warehouseName,
|
||||
currentQuantity,
|
||||
lastTransactionDate);
|
||||
|
||||
/// Create a copy of StockStatusDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$StockStatusDtoImplCopyWith<_$StockStatusDtoImpl> get copyWith =>
|
||||
__$$StockStatusDtoImplCopyWithImpl<_$StockStatusDtoImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$StockStatusDtoImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _StockStatusDto implements StockStatusDto {
|
||||
const factory _StockStatusDto(
|
||||
{@JsonKey(name: 'equipments_id') required final int equipmentsId,
|
||||
@JsonKey(name: 'warehouses_id') required final int warehousesId,
|
||||
@JsonKey(name: 'equipment_serial') required final String equipmentSerial,
|
||||
@JsonKey(name: 'model_name') final String? modelName,
|
||||
@JsonKey(name: 'warehouse_name') required final String warehouseName,
|
||||
@JsonKey(name: 'current_quantity') required final int currentQuantity,
|
||||
@JsonKey(name: 'last_transaction_date')
|
||||
final DateTime? lastTransactionDate}) = _$StockStatusDtoImpl;
|
||||
|
||||
factory _StockStatusDto.fromJson(Map<String, dynamic> json) =
|
||||
_$StockStatusDtoImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'equipments_id')
|
||||
int get equipmentsId;
|
||||
@override
|
||||
@JsonKey(name: 'warehouses_id')
|
||||
int get warehousesId;
|
||||
@override
|
||||
@JsonKey(name: 'equipment_serial')
|
||||
String get equipmentSerial;
|
||||
@override
|
||||
@JsonKey(name: 'model_name')
|
||||
String? get modelName;
|
||||
@override
|
||||
@JsonKey(name: 'warehouse_name')
|
||||
String get warehouseName;
|
||||
@override
|
||||
@JsonKey(name: 'current_quantity')
|
||||
int get currentQuantity;
|
||||
@override
|
||||
@JsonKey(name: 'last_transaction_date')
|
||||
DateTime? get lastTransactionDate;
|
||||
|
||||
/// Create a copy of StockStatusDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$StockStatusDtoImplCopyWith<_$StockStatusDtoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
StockStatusListResponse _$StockStatusListResponseFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _StockStatusListResponse.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$StockStatusListResponse {
|
||||
List<StockStatusDto> get items => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this StockStatusListResponse to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of StockStatusListResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$StockStatusListResponseCopyWith<StockStatusListResponse> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $StockStatusListResponseCopyWith<$Res> {
|
||||
factory $StockStatusListResponseCopyWith(StockStatusListResponse value,
|
||||
$Res Function(StockStatusListResponse) then) =
|
||||
_$StockStatusListResponseCopyWithImpl<$Res, StockStatusListResponse>;
|
||||
@useResult
|
||||
$Res call({List<StockStatusDto> items});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$StockStatusListResponseCopyWithImpl<$Res,
|
||||
$Val extends StockStatusListResponse>
|
||||
implements $StockStatusListResponseCopyWith<$Res> {
|
||||
_$StockStatusListResponseCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of StockStatusListResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? items = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
items: null == items
|
||||
? _value.items
|
||||
: items // ignore: cast_nullable_to_non_nullable
|
||||
as List<StockStatusDto>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$StockStatusListResponseImplCopyWith<$Res>
|
||||
implements $StockStatusListResponseCopyWith<$Res> {
|
||||
factory _$$StockStatusListResponseImplCopyWith(
|
||||
_$StockStatusListResponseImpl value,
|
||||
$Res Function(_$StockStatusListResponseImpl) then) =
|
||||
__$$StockStatusListResponseImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<StockStatusDto> items});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$StockStatusListResponseImplCopyWithImpl<$Res>
|
||||
extends _$StockStatusListResponseCopyWithImpl<$Res,
|
||||
_$StockStatusListResponseImpl>
|
||||
implements _$$StockStatusListResponseImplCopyWith<$Res> {
|
||||
__$$StockStatusListResponseImplCopyWithImpl(
|
||||
_$StockStatusListResponseImpl _value,
|
||||
$Res Function(_$StockStatusListResponseImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of StockStatusListResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? items = null,
|
||||
}) {
|
||||
return _then(_$StockStatusListResponseImpl(
|
||||
items: null == items
|
||||
? _value._items
|
||||
: items // ignore: cast_nullable_to_non_nullable
|
||||
as List<StockStatusDto>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$StockStatusListResponseImpl implements _StockStatusListResponse {
|
||||
const _$StockStatusListResponseImpl(
|
||||
{required final List<StockStatusDto> items})
|
||||
: _items = items;
|
||||
|
||||
factory _$StockStatusListResponseImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$StockStatusListResponseImplFromJson(json);
|
||||
|
||||
final List<StockStatusDto> _items;
|
||||
@override
|
||||
List<StockStatusDto> get items {
|
||||
if (_items is EqualUnmodifiableListView) return _items;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_items);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StockStatusListResponse(items: $items)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$StockStatusListResponseImpl &&
|
||||
const DeepCollectionEquality().equals(other._items, _items));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, const DeepCollectionEquality().hash(_items));
|
||||
|
||||
/// Create a copy of StockStatusListResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$StockStatusListResponseImplCopyWith<_$StockStatusListResponseImpl>
|
||||
get copyWith => __$$StockStatusListResponseImplCopyWithImpl<
|
||||
_$StockStatusListResponseImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$StockStatusListResponseImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _StockStatusListResponse implements StockStatusListResponse {
|
||||
const factory _StockStatusListResponse(
|
||||
{required final List<StockStatusDto> items}) =
|
||||
_$StockStatusListResponseImpl;
|
||||
|
||||
factory _StockStatusListResponse.fromJson(Map<String, dynamic> json) =
|
||||
_$StockStatusListResponseImpl.fromJson;
|
||||
|
||||
@override
|
||||
List<StockStatusDto> get items;
|
||||
|
||||
/// Create a copy of StockStatusListResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$StockStatusListResponseImplCopyWith<_$StockStatusListResponseImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
46
lib/data/models/stock_status_dto.g.dart
Normal file
46
lib/data/models/stock_status_dto.g.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'stock_status_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$StockStatusDtoImpl _$$StockStatusDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$StockStatusDtoImpl(
|
||||
equipmentsId: (json['equipments_id'] as num).toInt(),
|
||||
warehousesId: (json['warehouses_id'] as num).toInt(),
|
||||
equipmentSerial: json['equipment_serial'] as String,
|
||||
modelName: json['model_name'] as String?,
|
||||
warehouseName: json['warehouse_name'] as String,
|
||||
currentQuantity: (json['current_quantity'] as num).toInt(),
|
||||
lastTransactionDate: json['last_transaction_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['last_transaction_date'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$StockStatusDtoImplToJson(
|
||||
_$StockStatusDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'equipments_id': instance.equipmentsId,
|
||||
'warehouses_id': instance.warehousesId,
|
||||
'equipment_serial': instance.equipmentSerial,
|
||||
'model_name': instance.modelName,
|
||||
'warehouse_name': instance.warehouseName,
|
||||
'current_quantity': instance.currentQuantity,
|
||||
'last_transaction_date': instance.lastTransactionDate?.toIso8601String(),
|
||||
};
|
||||
|
||||
_$StockStatusListResponseImpl _$$StockStatusListResponseImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$StockStatusListResponseImpl(
|
||||
items: (json['items'] as List<dynamic>)
|
||||
.map((e) => StockStatusDto.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$StockStatusListResponseImplToJson(
|
||||
_$StockStatusListResponseImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'items': instance.items,
|
||||
};
|
||||
@@ -13,6 +13,7 @@ class WarehouseLocationDto with _$WarehouseLocationDto {
|
||||
@JsonKey(name: 'Id') int? id,
|
||||
@JsonKey(name: 'Name') required String name,
|
||||
@JsonKey(name: 'zipcodes_zipcode') String? zipcodesZipcode,
|
||||
@JsonKey(name: 'zipcode_address') String? zipcodeAddress,
|
||||
@JsonKey(name: 'Remark') String? remark,
|
||||
@JsonKey(name: 'is_deleted') @Default(false) bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
|
||||
@@ -26,6 +26,8 @@ mixin _$WarehouseLocationDto {
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'zipcodes_zipcode')
|
||||
String? get zipcodesZipcode => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'zipcode_address')
|
||||
String? get zipcodeAddress => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'Remark')
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_deleted')
|
||||
@@ -58,6 +60,7 @@ abstract class $WarehouseLocationDtoCopyWith<$Res> {
|
||||
{@JsonKey(name: 'Id') int? id,
|
||||
@JsonKey(name: 'Name') String name,
|
||||
@JsonKey(name: 'zipcodes_zipcode') String? zipcodesZipcode,
|
||||
@JsonKey(name: 'zipcode_address') String? zipcodeAddress,
|
||||
@JsonKey(name: 'Remark') String? remark,
|
||||
@JsonKey(name: 'is_deleted') bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
@@ -86,6 +89,7 @@ class _$WarehouseLocationDtoCopyWithImpl<$Res,
|
||||
Object? id = freezed,
|
||||
Object? name = null,
|
||||
Object? zipcodesZipcode = freezed,
|
||||
Object? zipcodeAddress = freezed,
|
||||
Object? remark = freezed,
|
||||
Object? isDeleted = null,
|
||||
Object? registeredAt = freezed,
|
||||
@@ -105,6 +109,10 @@ class _$WarehouseLocationDtoCopyWithImpl<$Res,
|
||||
? _value.zipcodesZipcode
|
||||
: zipcodesZipcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
zipcodeAddress: freezed == zipcodeAddress
|
||||
? _value.zipcodeAddress
|
||||
: zipcodeAddress // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
@@ -155,6 +163,7 @@ abstract class _$$WarehouseLocationDtoImplCopyWith<$Res>
|
||||
{@JsonKey(name: 'Id') int? id,
|
||||
@JsonKey(name: 'Name') String name,
|
||||
@JsonKey(name: 'zipcodes_zipcode') String? zipcodesZipcode,
|
||||
@JsonKey(name: 'zipcode_address') String? zipcodeAddress,
|
||||
@JsonKey(name: 'Remark') String? remark,
|
||||
@JsonKey(name: 'is_deleted') bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') DateTime? registeredAt,
|
||||
@@ -181,6 +190,7 @@ class __$$WarehouseLocationDtoImplCopyWithImpl<$Res>
|
||||
Object? id = freezed,
|
||||
Object? name = null,
|
||||
Object? zipcodesZipcode = freezed,
|
||||
Object? zipcodeAddress = freezed,
|
||||
Object? remark = freezed,
|
||||
Object? isDeleted = null,
|
||||
Object? registeredAt = freezed,
|
||||
@@ -200,6 +210,10 @@ class __$$WarehouseLocationDtoImplCopyWithImpl<$Res>
|
||||
? _value.zipcodesZipcode
|
||||
: zipcodesZipcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
zipcodeAddress: freezed == zipcodeAddress
|
||||
? _value.zipcodeAddress
|
||||
: zipcodeAddress // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
@@ -231,6 +245,7 @@ class _$WarehouseLocationDtoImpl extends _WarehouseLocationDto {
|
||||
{@JsonKey(name: 'Id') this.id,
|
||||
@JsonKey(name: 'Name') required this.name,
|
||||
@JsonKey(name: 'zipcodes_zipcode') this.zipcodesZipcode,
|
||||
@JsonKey(name: 'zipcode_address') this.zipcodeAddress,
|
||||
@JsonKey(name: 'Remark') this.remark,
|
||||
@JsonKey(name: 'is_deleted') this.isDeleted = false,
|
||||
@JsonKey(name: 'registered_at') this.registeredAt,
|
||||
@@ -251,6 +266,9 @@ class _$WarehouseLocationDtoImpl extends _WarehouseLocationDto {
|
||||
@JsonKey(name: 'zipcodes_zipcode')
|
||||
final String? zipcodesZipcode;
|
||||
@override
|
||||
@JsonKey(name: 'zipcode_address')
|
||||
final String? zipcodeAddress;
|
||||
@override
|
||||
@JsonKey(name: 'Remark')
|
||||
final String? remark;
|
||||
@override
|
||||
@@ -269,7 +287,7 @@ class _$WarehouseLocationDtoImpl extends _WarehouseLocationDto {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'WarehouseLocationDto(id: $id, name: $name, zipcodesZipcode: $zipcodesZipcode, remark: $remark, isDeleted: $isDeleted, registeredAt: $registeredAt, updatedAt: $updatedAt, zipcode: $zipcode)';
|
||||
return 'WarehouseLocationDto(id: $id, name: $name, zipcodesZipcode: $zipcodesZipcode, zipcodeAddress: $zipcodeAddress, remark: $remark, isDeleted: $isDeleted, registeredAt: $registeredAt, updatedAt: $updatedAt, zipcode: $zipcode)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -281,6 +299,8 @@ class _$WarehouseLocationDtoImpl extends _WarehouseLocationDto {
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.zipcodesZipcode, zipcodesZipcode) ||
|
||||
other.zipcodesZipcode == zipcodesZipcode) &&
|
||||
(identical(other.zipcodeAddress, zipcodeAddress) ||
|
||||
other.zipcodeAddress == zipcodeAddress) &&
|
||||
(identical(other.remark, remark) || other.remark == remark) &&
|
||||
(identical(other.isDeleted, isDeleted) ||
|
||||
other.isDeleted == isDeleted) &&
|
||||
@@ -294,7 +314,7 @@ class _$WarehouseLocationDtoImpl extends _WarehouseLocationDto {
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, name, zipcodesZipcode,
|
||||
remark, isDeleted, registeredAt, updatedAt, zipcode);
|
||||
zipcodeAddress, remark, isDeleted, registeredAt, updatedAt, zipcode);
|
||||
|
||||
/// Create a copy of WarehouseLocationDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -319,6 +339,7 @@ abstract class _WarehouseLocationDto extends WarehouseLocationDto {
|
||||
{@JsonKey(name: 'Id') final int? id,
|
||||
@JsonKey(name: 'Name') required final String name,
|
||||
@JsonKey(name: 'zipcodes_zipcode') final String? zipcodesZipcode,
|
||||
@JsonKey(name: 'zipcode_address') final String? zipcodeAddress,
|
||||
@JsonKey(name: 'Remark') final String? remark,
|
||||
@JsonKey(name: 'is_deleted') final bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') final DateTime? registeredAt,
|
||||
@@ -340,6 +361,9 @@ abstract class _WarehouseLocationDto extends WarehouseLocationDto {
|
||||
@JsonKey(name: 'zipcodes_zipcode')
|
||||
String? get zipcodesZipcode;
|
||||
@override
|
||||
@JsonKey(name: 'zipcode_address')
|
||||
String? get zipcodeAddress;
|
||||
@override
|
||||
@JsonKey(name: 'Remark')
|
||||
String? get remark;
|
||||
@override
|
||||
|
||||
@@ -12,6 +12,7 @@ _$WarehouseLocationDtoImpl _$$WarehouseLocationDtoImplFromJson(
|
||||
id: (json['Id'] as num?)?.toInt(),
|
||||
name: json['Name'] as String,
|
||||
zipcodesZipcode: json['zipcodes_zipcode'] as String?,
|
||||
zipcodeAddress: json['zipcode_address'] as String?,
|
||||
remark: json['Remark'] as String?,
|
||||
isDeleted: json['is_deleted'] as bool? ?? false,
|
||||
registeredAt: json['registered_at'] == null
|
||||
@@ -31,6 +32,7 @@ Map<String, dynamic> _$$WarehouseLocationDtoImplToJson(
|
||||
'Id': instance.id,
|
||||
'Name': instance.name,
|
||||
'zipcodes_zipcode': instance.zipcodesZipcode,
|
||||
'zipcode_address': instance.zipcodeAddress,
|
||||
'Remark': instance.remark,
|
||||
'is_deleted': instance.isDeleted,
|
||||
'registered_at': instance.registeredAt?.toIso8601String(),
|
||||
|
||||
@@ -53,4 +53,29 @@ class ZipcodeListResponse with _$ZipcodeListResponse {
|
||||
|
||||
factory ZipcodeListResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$ZipcodeListResponseFromJson(json);
|
||||
}
|
||||
}
|
||||
|
||||
// Hierarchy API 응답 래퍼
|
||||
@freezed
|
||||
class HierarchyMeta with _$HierarchyMeta {
|
||||
const factory HierarchyMeta({
|
||||
required int total,
|
||||
String? sido,
|
||||
String? gu,
|
||||
}) = _HierarchyMeta;
|
||||
|
||||
factory HierarchyMeta.fromJson(Map<String, dynamic> json) =>
|
||||
_$HierarchyMetaFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class HierarchyResponse with _$HierarchyResponse {
|
||||
const factory HierarchyResponse({
|
||||
@JsonKey(name: 'data') required List<String> data,
|
||||
@JsonKey(name: 'meta') required HierarchyMeta meta,
|
||||
}) = _HierarchyResponse;
|
||||
|
||||
factory HierarchyResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$HierarchyResponseFromJson(json);
|
||||
}
|
||||
|
||||
|
||||
@@ -572,3 +572,391 @@ abstract class _ZipcodeListResponse implements ZipcodeListResponse {
|
||||
_$$ZipcodeListResponseImplCopyWith<_$ZipcodeListResponseImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
HierarchyMeta _$HierarchyMetaFromJson(Map<String, dynamic> json) {
|
||||
return _HierarchyMeta.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$HierarchyMeta {
|
||||
int get total => throw _privateConstructorUsedError;
|
||||
String? get sido => throw _privateConstructorUsedError;
|
||||
String? get gu => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this HierarchyMeta to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of HierarchyMeta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$HierarchyMetaCopyWith<HierarchyMeta> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $HierarchyMetaCopyWith<$Res> {
|
||||
factory $HierarchyMetaCopyWith(
|
||||
HierarchyMeta value, $Res Function(HierarchyMeta) then) =
|
||||
_$HierarchyMetaCopyWithImpl<$Res, HierarchyMeta>;
|
||||
@useResult
|
||||
$Res call({int total, String? sido, String? gu});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$HierarchyMetaCopyWithImpl<$Res, $Val extends HierarchyMeta>
|
||||
implements $HierarchyMetaCopyWith<$Res> {
|
||||
_$HierarchyMetaCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of HierarchyMeta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? total = null,
|
||||
Object? sido = freezed,
|
||||
Object? gu = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
total: null == total
|
||||
? _value.total
|
||||
: total // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
sido: freezed == sido
|
||||
? _value.sido
|
||||
: sido // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
gu: freezed == gu
|
||||
? _value.gu
|
||||
: gu // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$HierarchyMetaImplCopyWith<$Res>
|
||||
implements $HierarchyMetaCopyWith<$Res> {
|
||||
factory _$$HierarchyMetaImplCopyWith(
|
||||
_$HierarchyMetaImpl value, $Res Function(_$HierarchyMetaImpl) then) =
|
||||
__$$HierarchyMetaImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int total, String? sido, String? gu});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$HierarchyMetaImplCopyWithImpl<$Res>
|
||||
extends _$HierarchyMetaCopyWithImpl<$Res, _$HierarchyMetaImpl>
|
||||
implements _$$HierarchyMetaImplCopyWith<$Res> {
|
||||
__$$HierarchyMetaImplCopyWithImpl(
|
||||
_$HierarchyMetaImpl _value, $Res Function(_$HierarchyMetaImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of HierarchyMeta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? total = null,
|
||||
Object? sido = freezed,
|
||||
Object? gu = freezed,
|
||||
}) {
|
||||
return _then(_$HierarchyMetaImpl(
|
||||
total: null == total
|
||||
? _value.total
|
||||
: total // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
sido: freezed == sido
|
||||
? _value.sido
|
||||
: sido // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
gu: freezed == gu
|
||||
? _value.gu
|
||||
: gu // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$HierarchyMetaImpl implements _HierarchyMeta {
|
||||
const _$HierarchyMetaImpl({required this.total, this.sido, this.gu});
|
||||
|
||||
factory _$HierarchyMetaImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$HierarchyMetaImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int total;
|
||||
@override
|
||||
final String? sido;
|
||||
@override
|
||||
final String? gu;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'HierarchyMeta(total: $total, sido: $sido, gu: $gu)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$HierarchyMetaImpl &&
|
||||
(identical(other.total, total) || other.total == total) &&
|
||||
(identical(other.sido, sido) || other.sido == sido) &&
|
||||
(identical(other.gu, gu) || other.gu == gu));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, total, sido, gu);
|
||||
|
||||
/// Create a copy of HierarchyMeta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$HierarchyMetaImplCopyWith<_$HierarchyMetaImpl> get copyWith =>
|
||||
__$$HierarchyMetaImplCopyWithImpl<_$HierarchyMetaImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$HierarchyMetaImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _HierarchyMeta implements HierarchyMeta {
|
||||
const factory _HierarchyMeta(
|
||||
{required final int total,
|
||||
final String? sido,
|
||||
final String? gu}) = _$HierarchyMetaImpl;
|
||||
|
||||
factory _HierarchyMeta.fromJson(Map<String, dynamic> json) =
|
||||
_$HierarchyMetaImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get total;
|
||||
@override
|
||||
String? get sido;
|
||||
@override
|
||||
String? get gu;
|
||||
|
||||
/// Create a copy of HierarchyMeta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$HierarchyMetaImplCopyWith<_$HierarchyMetaImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
HierarchyResponse _$HierarchyResponseFromJson(Map<String, dynamic> json) {
|
||||
return _HierarchyResponse.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$HierarchyResponse {
|
||||
@JsonKey(name: 'data')
|
||||
List<String> get data => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'meta')
|
||||
HierarchyMeta get meta => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this HierarchyResponse to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of HierarchyResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$HierarchyResponseCopyWith<HierarchyResponse> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $HierarchyResponseCopyWith<$Res> {
|
||||
factory $HierarchyResponseCopyWith(
|
||||
HierarchyResponse value, $Res Function(HierarchyResponse) then) =
|
||||
_$HierarchyResponseCopyWithImpl<$Res, HierarchyResponse>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<String> data,
|
||||
@JsonKey(name: 'meta') HierarchyMeta meta});
|
||||
|
||||
$HierarchyMetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$HierarchyResponseCopyWithImpl<$Res, $Val extends HierarchyResponse>
|
||||
implements $HierarchyResponseCopyWith<$Res> {
|
||||
_$HierarchyResponseCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of HierarchyResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? data = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
data: null == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as HierarchyMeta,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of HierarchyResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$HierarchyMetaCopyWith<$Res> get meta {
|
||||
return $HierarchyMetaCopyWith<$Res>(_value.meta, (value) {
|
||||
return _then(_value.copyWith(meta: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$HierarchyResponseImplCopyWith<$Res>
|
||||
implements $HierarchyResponseCopyWith<$Res> {
|
||||
factory _$$HierarchyResponseImplCopyWith(_$HierarchyResponseImpl value,
|
||||
$Res Function(_$HierarchyResponseImpl) then) =
|
||||
__$$HierarchyResponseImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<String> data,
|
||||
@JsonKey(name: 'meta') HierarchyMeta meta});
|
||||
|
||||
@override
|
||||
$HierarchyMetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$HierarchyResponseImplCopyWithImpl<$Res>
|
||||
extends _$HierarchyResponseCopyWithImpl<$Res, _$HierarchyResponseImpl>
|
||||
implements _$$HierarchyResponseImplCopyWith<$Res> {
|
||||
__$$HierarchyResponseImplCopyWithImpl(_$HierarchyResponseImpl _value,
|
||||
$Res Function(_$HierarchyResponseImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of HierarchyResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? data = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_$HierarchyResponseImpl(
|
||||
data: null == data
|
||||
? _value._data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as HierarchyMeta,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$HierarchyResponseImpl implements _HierarchyResponse {
|
||||
const _$HierarchyResponseImpl(
|
||||
{@JsonKey(name: 'data') required final List<String> data,
|
||||
@JsonKey(name: 'meta') required this.meta})
|
||||
: _data = data;
|
||||
|
||||
factory _$HierarchyResponseImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$HierarchyResponseImplFromJson(json);
|
||||
|
||||
final List<String> _data;
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<String> get data {
|
||||
if (_data is EqualUnmodifiableListView) return _data;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_data);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'meta')
|
||||
final HierarchyMeta meta;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'HierarchyResponse(data: $data, meta: $meta)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$HierarchyResponseImpl &&
|
||||
const DeepCollectionEquality().equals(other._data, _data) &&
|
||||
(identical(other.meta, meta) || other.meta == meta));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_data), meta);
|
||||
|
||||
/// Create a copy of HierarchyResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$HierarchyResponseImplCopyWith<_$HierarchyResponseImpl> get copyWith =>
|
||||
__$$HierarchyResponseImplCopyWithImpl<_$HierarchyResponseImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$HierarchyResponseImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _HierarchyResponse implements HierarchyResponse {
|
||||
const factory _HierarchyResponse(
|
||||
{@JsonKey(name: 'data') required final List<String> data,
|
||||
@JsonKey(name: 'meta') required final HierarchyMeta meta}) =
|
||||
_$HierarchyResponseImpl;
|
||||
|
||||
factory _HierarchyResponse.fromJson(Map<String, dynamic> json) =
|
||||
_$HierarchyResponseImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<String> get data;
|
||||
@override
|
||||
@JsonKey(name: 'meta')
|
||||
HierarchyMeta get meta;
|
||||
|
||||
/// Create a copy of HierarchyResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$HierarchyResponseImplCopyWith<_$HierarchyResponseImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -53,3 +53,31 @@ Map<String, dynamic> _$$ZipcodeListResponseImplToJson(
|
||||
'total_pages': instance.totalPages,
|
||||
'page_size': instance.pageSize,
|
||||
};
|
||||
|
||||
_$HierarchyMetaImpl _$$HierarchyMetaImplFromJson(Map<String, dynamic> json) =>
|
||||
_$HierarchyMetaImpl(
|
||||
total: (json['total'] as num).toInt(),
|
||||
sido: json['sido'] as String?,
|
||||
gu: json['gu'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$HierarchyMetaImplToJson(_$HierarchyMetaImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'total': instance.total,
|
||||
'sido': instance.sido,
|
||||
'gu': instance.gu,
|
||||
};
|
||||
|
||||
_$HierarchyResponseImpl _$$HierarchyResponseImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$HierarchyResponseImpl(
|
||||
data: (json['data'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
meta: HierarchyMeta.fromJson(json['meta'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$HierarchyResponseImplToJson(
|
||||
_$HierarchyResponseImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user