feat: 장비 관리 API 연동 구현
- Equipment 관련 DTO 모델 생성 (Request/Response/List/History/In/Out/IO) - EquipmentRemoteDataSource 구현 (10개 API 엔드포인트) - EquipmentService 비즈니스 로직 구현 - Controller를 ChangeNotifier 패턴으로 개선 - 장비 목록 화면에 Provider 패턴 및 무한 스크롤 적용 - 장비 입고 화면 API 연동 및 비동기 처리 - DI 컨테이너에 Equipment 관련 의존성 등록 - API/Mock 데이터 소스 전환 가능 (Feature Flag) - API 통합 진행 상황 문서 업데이트
This commit is contained in:
290
lib/data/datasources/remote/equipment_remote_datasource.dart
Normal file
290
lib/data/datasources/remote/equipment_remote_datasource.dart
Normal file
@@ -0,0 +1,290 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:superport/core/constants/api_endpoints.dart';
|
||||
import 'package:superport/core/errors/exceptions.dart';
|
||||
import 'package:superport/data/datasources/remote/api_client.dart';
|
||||
import 'package:superport/data/models/equipment/equipment_history_dto.dart';
|
||||
import 'package:superport/data/models/equipment/equipment_in_request.dart';
|
||||
import 'package:superport/data/models/equipment/equipment_io_response.dart';
|
||||
import 'package:superport/data/models/equipment/equipment_list_dto.dart';
|
||||
import 'package:superport/data/models/equipment/equipment_out_request.dart';
|
||||
import 'package:superport/data/models/equipment/equipment_request.dart';
|
||||
import 'package:superport/data/models/equipment/equipment_response.dart';
|
||||
|
||||
abstract class EquipmentRemoteDataSource {
|
||||
Future<List<EquipmentListDto>> getEquipments({
|
||||
int page = 1,
|
||||
int perPage = 20,
|
||||
String? status,
|
||||
int? companyId,
|
||||
int? warehouseLocationId,
|
||||
});
|
||||
|
||||
Future<EquipmentResponse> createEquipment(CreateEquipmentRequest request);
|
||||
|
||||
Future<EquipmentResponse> getEquipmentDetail(int id);
|
||||
|
||||
Future<EquipmentResponse> updateEquipment(int id, UpdateEquipmentRequest request);
|
||||
|
||||
Future<void> deleteEquipment(int id);
|
||||
|
||||
Future<EquipmentResponse> changeEquipmentStatus(int id, String status, String? reason);
|
||||
|
||||
Future<EquipmentHistoryDto> addEquipmentHistory(int equipmentId, CreateHistoryRequest request);
|
||||
|
||||
Future<List<EquipmentHistoryDto>> getEquipmentHistory(int equipmentId, {int page = 1, int perPage = 20});
|
||||
|
||||
Future<EquipmentIoResponse> equipmentIn(EquipmentInRequest request);
|
||||
|
||||
Future<EquipmentIoResponse> equipmentOut(EquipmentOutRequest request);
|
||||
}
|
||||
|
||||
class EquipmentRemoteDataSourceImpl implements EquipmentRemoteDataSource {
|
||||
final ApiClient _apiClient = GetIt.instance<ApiClient>();
|
||||
|
||||
@override
|
||||
Future<List<EquipmentListDto>> getEquipments({
|
||||
int page = 1,
|
||||
int perPage = 20,
|
||||
String? status,
|
||||
int? companyId,
|
||||
int? warehouseLocationId,
|
||||
}) async {
|
||||
try {
|
||||
final queryParams = {
|
||||
'page': page,
|
||||
'per_page': perPage,
|
||||
if (status != null) 'status': status,
|
||||
if (companyId != null) 'company_id': companyId,
|
||||
if (warehouseLocationId != null) 'warehouse_location_id': warehouseLocationId,
|
||||
};
|
||||
|
||||
final response = await _apiClient.get(
|
||||
ApiEndpoints.equipment,
|
||||
queryParameters: queryParams,
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
final List<dynamic> data = response.data['data'];
|
||||
return data.map((json) => EquipmentListDto.fromJson(json)).toList();
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to fetch equipment list',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EquipmentResponse> createEquipment(CreateEquipmentRequest request) async {
|
||||
try {
|
||||
final response = await _apiClient.post(
|
||||
ApiEndpoints.equipment,
|
||||
data: request.toJson(),
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
return EquipmentResponse.fromJson(response.data['data']);
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to create equipment',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EquipmentResponse> getEquipmentDetail(int id) async {
|
||||
try {
|
||||
final response = await _apiClient.get('${ApiEndpoints.equipment}/$id');
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
return EquipmentResponse.fromJson(response.data['data']);
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to fetch equipment detail',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EquipmentResponse> updateEquipment(int id, UpdateEquipmentRequest request) async {
|
||||
try {
|
||||
final response = await _apiClient.put(
|
||||
'${ApiEndpoints.equipment}/$id',
|
||||
data: request.toJson(),
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
return EquipmentResponse.fromJson(response.data['data']);
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to update equipment',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteEquipment(int id) async {
|
||||
try {
|
||||
final response = await _apiClient.delete('${ApiEndpoints.equipment}/$id');
|
||||
|
||||
if (response.data['success'] != true) {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to delete equipment',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EquipmentResponse> changeEquipmentStatus(int id, String status, String? reason) async {
|
||||
try {
|
||||
final response = await _apiClient.patch(
|
||||
'${ApiEndpoints.equipment}/$id/status',
|
||||
data: {
|
||||
'status': status,
|
||||
if (reason != null) 'reason': reason,
|
||||
},
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
return EquipmentResponse.fromJson(response.data['data']);
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to change equipment status',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EquipmentHistoryDto> addEquipmentHistory(int equipmentId, CreateHistoryRequest request) async {
|
||||
try {
|
||||
final response = await _apiClient.post(
|
||||
'${ApiEndpoints.equipment}/$equipmentId/history',
|
||||
data: request.toJson(),
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
return EquipmentHistoryDto.fromJson(response.data['data']);
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to add equipment history',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<EquipmentHistoryDto>> getEquipmentHistory(int equipmentId, {int page = 1, int perPage = 20}) async {
|
||||
try {
|
||||
final queryParams = {
|
||||
'page': page,
|
||||
'per_page': perPage,
|
||||
};
|
||||
|
||||
final response = await _apiClient.get(
|
||||
'${ApiEndpoints.equipment}/$equipmentId/history',
|
||||
queryParameters: queryParams,
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
final List<dynamic> data = response.data['data'];
|
||||
return data.map((json) => EquipmentHistoryDto.fromJson(json)).toList();
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to fetch equipment history',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EquipmentIoResponse> equipmentIn(EquipmentInRequest request) async {
|
||||
try {
|
||||
final response = await _apiClient.post(
|
||||
'${ApiEndpoints.equipment}/in',
|
||||
data: request.toJson(),
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
return EquipmentIoResponse.fromJson(response.data['data']);
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to process equipment in',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EquipmentIoResponse> equipmentOut(EquipmentOutRequest request) async {
|
||||
try {
|
||||
final response = await _apiClient.post(
|
||||
'${ApiEndpoints.equipment}/out',
|
||||
data: request.toJson(),
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
return EquipmentIoResponse.fromJson(response.data['data']);
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to process equipment out',
|
||||
);
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw ServerException(
|
||||
message: e.response?.data['message'] ?? 'Network error occurred',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
49
lib/data/models/equipment/equipment_history_dto.dart
Normal file
49
lib/data/models/equipment/equipment_history_dto.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'equipment_history_dto.freezed.dart';
|
||||
part 'equipment_history_dto.g.dart';
|
||||
|
||||
@freezed
|
||||
class EquipmentHistoryDto with _$EquipmentHistoryDto {
|
||||
const factory EquipmentHistoryDto({
|
||||
required int id,
|
||||
required int equipmentId,
|
||||
required String transactionType,
|
||||
required int quantity,
|
||||
required DateTime transactionDate,
|
||||
String? remarks,
|
||||
int? createdBy,
|
||||
int? userId,
|
||||
required DateTime createdAt,
|
||||
// 추가 정보
|
||||
String? userName,
|
||||
String? performedBy,
|
||||
}) = _EquipmentHistoryDto;
|
||||
|
||||
factory EquipmentHistoryDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$EquipmentHistoryDtoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class CreateHistoryRequest with _$CreateHistoryRequest {
|
||||
const factory CreateHistoryRequest({
|
||||
required String transactionType,
|
||||
required int quantity,
|
||||
DateTime? transactionDate,
|
||||
String? remarks,
|
||||
int? userId,
|
||||
}) = _CreateHistoryRequest;
|
||||
|
||||
factory CreateHistoryRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$CreateHistoryRequestFromJson(json);
|
||||
}
|
||||
|
||||
// 트랜잭션 타입 상수
|
||||
class TransactionType {
|
||||
static const String checkIn = 'I'; // 입고
|
||||
static const String checkOut = 'O'; // 출고
|
||||
static const String maintenance = 'maintenance';
|
||||
static const String repair = 'repair';
|
||||
static const String inspection = 'inspection';
|
||||
static const String transfer = 'transfer';
|
||||
}
|
||||
630
lib/data/models/equipment/equipment_history_dto.freezed.dart
Normal file
630
lib/data/models/equipment/equipment_history_dto.freezed.dart
Normal file
@@ -0,0 +1,630 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'equipment_history_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');
|
||||
|
||||
EquipmentHistoryDto _$EquipmentHistoryDtoFromJson(Map<String, dynamic> json) {
|
||||
return _EquipmentHistoryDto.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$EquipmentHistoryDto {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
int get equipmentId => throw _privateConstructorUsedError;
|
||||
String get transactionType => throw _privateConstructorUsedError;
|
||||
int get quantity => throw _privateConstructorUsedError;
|
||||
DateTime get transactionDate => throw _privateConstructorUsedError;
|
||||
String? get remarks => throw _privateConstructorUsedError;
|
||||
int? get createdBy => throw _privateConstructorUsedError;
|
||||
int? get userId => throw _privateConstructorUsedError;
|
||||
DateTime get createdAt => throw _privateConstructorUsedError; // 추가 정보
|
||||
String? get userName => throw _privateConstructorUsedError;
|
||||
String? get performedBy => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentHistoryDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of EquipmentHistoryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$EquipmentHistoryDtoCopyWith<EquipmentHistoryDto> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $EquipmentHistoryDtoCopyWith<$Res> {
|
||||
factory $EquipmentHistoryDtoCopyWith(
|
||||
EquipmentHistoryDto value, $Res Function(EquipmentHistoryDto) then) =
|
||||
_$EquipmentHistoryDtoCopyWithImpl<$Res, EquipmentHistoryDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
int equipmentId,
|
||||
String transactionType,
|
||||
int quantity,
|
||||
DateTime transactionDate,
|
||||
String? remarks,
|
||||
int? createdBy,
|
||||
int? userId,
|
||||
DateTime createdAt,
|
||||
String? userName,
|
||||
String? performedBy});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$EquipmentHistoryDtoCopyWithImpl<$Res, $Val extends EquipmentHistoryDto>
|
||||
implements $EquipmentHistoryDtoCopyWith<$Res> {
|
||||
_$EquipmentHistoryDtoCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of EquipmentHistoryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? equipmentId = null,
|
||||
Object? transactionType = null,
|
||||
Object? quantity = null,
|
||||
Object? transactionDate = null,
|
||||
Object? remarks = freezed,
|
||||
Object? createdBy = freezed,
|
||||
Object? userId = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? userName = freezed,
|
||||
Object? performedBy = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentId: null == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
transactionType: null == transactionType
|
||||
? _value.transactionType
|
||||
: transactionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
transactionDate: null == transactionDate
|
||||
? _value.transactionDate
|
||||
: transactionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
remarks: freezed == remarks
|
||||
? _value.remarks
|
||||
: remarks // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
createdBy: freezed == createdBy
|
||||
? _value.createdBy
|
||||
: createdBy // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
userId: freezed == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
userName: freezed == userName
|
||||
? _value.userName
|
||||
: userName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
performedBy: freezed == performedBy
|
||||
? _value.performedBy
|
||||
: performedBy // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$EquipmentHistoryDtoImplCopyWith<$Res>
|
||||
implements $EquipmentHistoryDtoCopyWith<$Res> {
|
||||
factory _$$EquipmentHistoryDtoImplCopyWith(_$EquipmentHistoryDtoImpl value,
|
||||
$Res Function(_$EquipmentHistoryDtoImpl) then) =
|
||||
__$$EquipmentHistoryDtoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
int equipmentId,
|
||||
String transactionType,
|
||||
int quantity,
|
||||
DateTime transactionDate,
|
||||
String? remarks,
|
||||
int? createdBy,
|
||||
int? userId,
|
||||
DateTime createdAt,
|
||||
String? userName,
|
||||
String? performedBy});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$EquipmentHistoryDtoImplCopyWithImpl<$Res>
|
||||
extends _$EquipmentHistoryDtoCopyWithImpl<$Res, _$EquipmentHistoryDtoImpl>
|
||||
implements _$$EquipmentHistoryDtoImplCopyWith<$Res> {
|
||||
__$$EquipmentHistoryDtoImplCopyWithImpl(_$EquipmentHistoryDtoImpl _value,
|
||||
$Res Function(_$EquipmentHistoryDtoImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of EquipmentHistoryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? equipmentId = null,
|
||||
Object? transactionType = null,
|
||||
Object? quantity = null,
|
||||
Object? transactionDate = null,
|
||||
Object? remarks = freezed,
|
||||
Object? createdBy = freezed,
|
||||
Object? userId = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? userName = freezed,
|
||||
Object? performedBy = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentHistoryDtoImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentId: null == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
transactionType: null == transactionType
|
||||
? _value.transactionType
|
||||
: transactionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
transactionDate: null == transactionDate
|
||||
? _value.transactionDate
|
||||
: transactionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
remarks: freezed == remarks
|
||||
? _value.remarks
|
||||
: remarks // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
createdBy: freezed == createdBy
|
||||
? _value.createdBy
|
||||
: createdBy // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
userId: freezed == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
userName: freezed == userName
|
||||
? _value.userName
|
||||
: userName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
performedBy: freezed == performedBy
|
||||
? _value.performedBy
|
||||
: performedBy // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$EquipmentHistoryDtoImpl implements _EquipmentHistoryDto {
|
||||
const _$EquipmentHistoryDtoImpl(
|
||||
{required this.id,
|
||||
required this.equipmentId,
|
||||
required this.transactionType,
|
||||
required this.quantity,
|
||||
required this.transactionDate,
|
||||
this.remarks,
|
||||
this.createdBy,
|
||||
this.userId,
|
||||
required this.createdAt,
|
||||
this.userName,
|
||||
this.performedBy});
|
||||
|
||||
factory _$EquipmentHistoryDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$EquipmentHistoryDtoImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final int equipmentId;
|
||||
@override
|
||||
final String transactionType;
|
||||
@override
|
||||
final int quantity;
|
||||
@override
|
||||
final DateTime transactionDate;
|
||||
@override
|
||||
final String? remarks;
|
||||
@override
|
||||
final int? createdBy;
|
||||
@override
|
||||
final int? userId;
|
||||
@override
|
||||
final DateTime createdAt;
|
||||
// 추가 정보
|
||||
@override
|
||||
final String? userName;
|
||||
@override
|
||||
final String? performedBy;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentHistoryDto(id: $id, equipmentId: $equipmentId, transactionType: $transactionType, quantity: $quantity, transactionDate: $transactionDate, remarks: $remarks, createdBy: $createdBy, userId: $userId, createdAt: $createdAt, userName: $userName, performedBy: $performedBy)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$EquipmentHistoryDtoImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.equipmentId, equipmentId) ||
|
||||
other.equipmentId == equipmentId) &&
|
||||
(identical(other.transactionType, transactionType) ||
|
||||
other.transactionType == transactionType) &&
|
||||
(identical(other.quantity, quantity) ||
|
||||
other.quantity == quantity) &&
|
||||
(identical(other.transactionDate, transactionDate) ||
|
||||
other.transactionDate == transactionDate) &&
|
||||
(identical(other.remarks, remarks) || other.remarks == remarks) &&
|
||||
(identical(other.createdBy, createdBy) ||
|
||||
other.createdBy == createdBy) &&
|
||||
(identical(other.userId, userId) || other.userId == userId) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.userName, userName) ||
|
||||
other.userName == userName) &&
|
||||
(identical(other.performedBy, performedBy) ||
|
||||
other.performedBy == performedBy));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
equipmentId,
|
||||
transactionType,
|
||||
quantity,
|
||||
transactionDate,
|
||||
remarks,
|
||||
createdBy,
|
||||
userId,
|
||||
createdAt,
|
||||
userName,
|
||||
performedBy);
|
||||
|
||||
/// Create a copy of EquipmentHistoryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$EquipmentHistoryDtoImplCopyWith<_$EquipmentHistoryDtoImpl> get copyWith =>
|
||||
__$$EquipmentHistoryDtoImplCopyWithImpl<_$EquipmentHistoryDtoImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$EquipmentHistoryDtoImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _EquipmentHistoryDto implements EquipmentHistoryDto {
|
||||
const factory _EquipmentHistoryDto(
|
||||
{required final int id,
|
||||
required final int equipmentId,
|
||||
required final String transactionType,
|
||||
required final int quantity,
|
||||
required final DateTime transactionDate,
|
||||
final String? remarks,
|
||||
final int? createdBy,
|
||||
final int? userId,
|
||||
required final DateTime createdAt,
|
||||
final String? userName,
|
||||
final String? performedBy}) = _$EquipmentHistoryDtoImpl;
|
||||
|
||||
factory _EquipmentHistoryDto.fromJson(Map<String, dynamic> json) =
|
||||
_$EquipmentHistoryDtoImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
int get equipmentId;
|
||||
@override
|
||||
String get transactionType;
|
||||
@override
|
||||
int get quantity;
|
||||
@override
|
||||
DateTime get transactionDate;
|
||||
@override
|
||||
String? get remarks;
|
||||
@override
|
||||
int? get createdBy;
|
||||
@override
|
||||
int? get userId;
|
||||
@override
|
||||
DateTime get createdAt; // 추가 정보
|
||||
@override
|
||||
String? get userName;
|
||||
@override
|
||||
String? get performedBy;
|
||||
|
||||
/// Create a copy of EquipmentHistoryDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$EquipmentHistoryDtoImplCopyWith<_$EquipmentHistoryDtoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
CreateHistoryRequest _$CreateHistoryRequestFromJson(Map<String, dynamic> json) {
|
||||
return _CreateHistoryRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreateHistoryRequest {
|
||||
String get transactionType => throw _privateConstructorUsedError;
|
||||
int get quantity => throw _privateConstructorUsedError;
|
||||
DateTime? get transactionDate => throw _privateConstructorUsedError;
|
||||
String? get remarks => throw _privateConstructorUsedError;
|
||||
int? get userId => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CreateHistoryRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CreateHistoryRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CreateHistoryRequestCopyWith<CreateHistoryRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CreateHistoryRequestCopyWith<$Res> {
|
||||
factory $CreateHistoryRequestCopyWith(CreateHistoryRequest value,
|
||||
$Res Function(CreateHistoryRequest) then) =
|
||||
_$CreateHistoryRequestCopyWithImpl<$Res, CreateHistoryRequest>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String transactionType,
|
||||
int quantity,
|
||||
DateTime? transactionDate,
|
||||
String? remarks,
|
||||
int? userId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CreateHistoryRequestCopyWithImpl<$Res,
|
||||
$Val extends CreateHistoryRequest>
|
||||
implements $CreateHistoryRequestCopyWith<$Res> {
|
||||
_$CreateHistoryRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CreateHistoryRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? transactionType = null,
|
||||
Object? quantity = null,
|
||||
Object? transactionDate = freezed,
|
||||
Object? remarks = freezed,
|
||||
Object? userId = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
transactionType: null == transactionType
|
||||
? _value.transactionType
|
||||
: transactionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
transactionDate: freezed == transactionDate
|
||||
? _value.transactionDate
|
||||
: transactionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remarks: freezed == remarks
|
||||
? _value.remarks
|
||||
: remarks // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
userId: freezed == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CreateHistoryRequestImplCopyWith<$Res>
|
||||
implements $CreateHistoryRequestCopyWith<$Res> {
|
||||
factory _$$CreateHistoryRequestImplCopyWith(_$CreateHistoryRequestImpl value,
|
||||
$Res Function(_$CreateHistoryRequestImpl) then) =
|
||||
__$$CreateHistoryRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String transactionType,
|
||||
int quantity,
|
||||
DateTime? transactionDate,
|
||||
String? remarks,
|
||||
int? userId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CreateHistoryRequestImplCopyWithImpl<$Res>
|
||||
extends _$CreateHistoryRequestCopyWithImpl<$Res, _$CreateHistoryRequestImpl>
|
||||
implements _$$CreateHistoryRequestImplCopyWith<$Res> {
|
||||
__$$CreateHistoryRequestImplCopyWithImpl(_$CreateHistoryRequestImpl _value,
|
||||
$Res Function(_$CreateHistoryRequestImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreateHistoryRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? transactionType = null,
|
||||
Object? quantity = null,
|
||||
Object? transactionDate = freezed,
|
||||
Object? remarks = freezed,
|
||||
Object? userId = freezed,
|
||||
}) {
|
||||
return _then(_$CreateHistoryRequestImpl(
|
||||
transactionType: null == transactionType
|
||||
? _value.transactionType
|
||||
: transactionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
transactionDate: freezed == transactionDate
|
||||
? _value.transactionDate
|
||||
: transactionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remarks: freezed == remarks
|
||||
? _value.remarks
|
||||
: remarks // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
userId: freezed == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CreateHistoryRequestImpl implements _CreateHistoryRequest {
|
||||
const _$CreateHistoryRequestImpl(
|
||||
{required this.transactionType,
|
||||
required this.quantity,
|
||||
this.transactionDate,
|
||||
this.remarks,
|
||||
this.userId});
|
||||
|
||||
factory _$CreateHistoryRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CreateHistoryRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String transactionType;
|
||||
@override
|
||||
final int quantity;
|
||||
@override
|
||||
final DateTime? transactionDate;
|
||||
@override
|
||||
final String? remarks;
|
||||
@override
|
||||
final int? userId;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateHistoryRequest(transactionType: $transactionType, quantity: $quantity, transactionDate: $transactionDate, remarks: $remarks, userId: $userId)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CreateHistoryRequestImpl &&
|
||||
(identical(other.transactionType, transactionType) ||
|
||||
other.transactionType == transactionType) &&
|
||||
(identical(other.quantity, quantity) ||
|
||||
other.quantity == quantity) &&
|
||||
(identical(other.transactionDate, transactionDate) ||
|
||||
other.transactionDate == transactionDate) &&
|
||||
(identical(other.remarks, remarks) || other.remarks == remarks) &&
|
||||
(identical(other.userId, userId) || other.userId == userId));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, transactionType, quantity, transactionDate, remarks, userId);
|
||||
|
||||
/// Create a copy of CreateHistoryRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreateHistoryRequestImplCopyWith<_$CreateHistoryRequestImpl>
|
||||
get copyWith =>
|
||||
__$$CreateHistoryRequestImplCopyWithImpl<_$CreateHistoryRequestImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CreateHistoryRequestImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CreateHistoryRequest implements CreateHistoryRequest {
|
||||
const factory _CreateHistoryRequest(
|
||||
{required final String transactionType,
|
||||
required final int quantity,
|
||||
final DateTime? transactionDate,
|
||||
final String? remarks,
|
||||
final int? userId}) = _$CreateHistoryRequestImpl;
|
||||
|
||||
factory _CreateHistoryRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$CreateHistoryRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get transactionType;
|
||||
@override
|
||||
int get quantity;
|
||||
@override
|
||||
DateTime? get transactionDate;
|
||||
@override
|
||||
String? get remarks;
|
||||
@override
|
||||
int? get userId;
|
||||
|
||||
/// Create a copy of CreateHistoryRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CreateHistoryRequestImplCopyWith<_$CreateHistoryRequestImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
61
lib/data/models/equipment/equipment_history_dto.g.dart
Normal file
61
lib/data/models/equipment/equipment_history_dto.g.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'equipment_history_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$EquipmentHistoryDtoImpl _$$EquipmentHistoryDtoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$EquipmentHistoryDtoImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
equipmentId: (json['equipmentId'] as num).toInt(),
|
||||
transactionType: json['transactionType'] as String,
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
transactionDate: DateTime.parse(json['transactionDate'] as String),
|
||||
remarks: json['remarks'] as String?,
|
||||
createdBy: (json['createdBy'] as num?)?.toInt(),
|
||||
userId: (json['userId'] as num?)?.toInt(),
|
||||
createdAt: DateTime.parse(json['createdAt'] as String),
|
||||
userName: json['userName'] as String?,
|
||||
performedBy: json['performedBy'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$EquipmentHistoryDtoImplToJson(
|
||||
_$EquipmentHistoryDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'equipmentId': instance.equipmentId,
|
||||
'transactionType': instance.transactionType,
|
||||
'quantity': instance.quantity,
|
||||
'transactionDate': instance.transactionDate.toIso8601String(),
|
||||
'remarks': instance.remarks,
|
||||
'createdBy': instance.createdBy,
|
||||
'userId': instance.userId,
|
||||
'createdAt': instance.createdAt.toIso8601String(),
|
||||
'userName': instance.userName,
|
||||
'performedBy': instance.performedBy,
|
||||
};
|
||||
|
||||
_$CreateHistoryRequestImpl _$$CreateHistoryRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CreateHistoryRequestImpl(
|
||||
transactionType: json['transactionType'] as String,
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
transactionDate: json['transactionDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['transactionDate'] as String),
|
||||
remarks: json['remarks'] as String?,
|
||||
userId: (json['userId'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CreateHistoryRequestImplToJson(
|
||||
_$CreateHistoryRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'transactionType': instance.transactionType,
|
||||
'quantity': instance.quantity,
|
||||
'transactionDate': instance.transactionDate?.toIso8601String(),
|
||||
'remarks': instance.remarks,
|
||||
'userId': instance.userId,
|
||||
};
|
||||
17
lib/data/models/equipment/equipment_in_request.dart
Normal file
17
lib/data/models/equipment/equipment_in_request.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'equipment_in_request.freezed.dart';
|
||||
part 'equipment_in_request.g.dart';
|
||||
|
||||
@freezed
|
||||
class EquipmentInRequest with _$EquipmentInRequest {
|
||||
const factory EquipmentInRequest({
|
||||
required int equipmentId,
|
||||
required int quantity,
|
||||
int? warehouseLocationId,
|
||||
String? notes,
|
||||
}) = _EquipmentInRequest;
|
||||
|
||||
factory EquipmentInRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$EquipmentInRequestFromJson(json);
|
||||
}
|
||||
227
lib/data/models/equipment/equipment_in_request.freezed.dart
Normal file
227
lib/data/models/equipment/equipment_in_request.freezed.dart
Normal file
@@ -0,0 +1,227 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'equipment_in_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
EquipmentInRequest _$EquipmentInRequestFromJson(Map<String, dynamic> json) {
|
||||
return _EquipmentInRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$EquipmentInRequest {
|
||||
int get equipmentId => throw _privateConstructorUsedError;
|
||||
int get quantity => throw _privateConstructorUsedError;
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
String? get notes => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentInRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of EquipmentInRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$EquipmentInRequestCopyWith<EquipmentInRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $EquipmentInRequestCopyWith<$Res> {
|
||||
factory $EquipmentInRequestCopyWith(
|
||||
EquipmentInRequest value, $Res Function(EquipmentInRequest) then) =
|
||||
_$EquipmentInRequestCopyWithImpl<$Res, EquipmentInRequest>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int equipmentId, int quantity, int? warehouseLocationId, String? notes});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$EquipmentInRequestCopyWithImpl<$Res, $Val extends EquipmentInRequest>
|
||||
implements $EquipmentInRequestCopyWith<$Res> {
|
||||
_$EquipmentInRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of EquipmentInRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentId = null,
|
||||
Object? quantity = null,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? notes = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
equipmentId: null == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
notes: freezed == notes
|
||||
? _value.notes
|
||||
: notes // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$EquipmentInRequestImplCopyWith<$Res>
|
||||
implements $EquipmentInRequestCopyWith<$Res> {
|
||||
factory _$$EquipmentInRequestImplCopyWith(_$EquipmentInRequestImpl value,
|
||||
$Res Function(_$EquipmentInRequestImpl) then) =
|
||||
__$$EquipmentInRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int equipmentId, int quantity, int? warehouseLocationId, String? notes});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$EquipmentInRequestImplCopyWithImpl<$Res>
|
||||
extends _$EquipmentInRequestCopyWithImpl<$Res, _$EquipmentInRequestImpl>
|
||||
implements _$$EquipmentInRequestImplCopyWith<$Res> {
|
||||
__$$EquipmentInRequestImplCopyWithImpl(_$EquipmentInRequestImpl _value,
|
||||
$Res Function(_$EquipmentInRequestImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of EquipmentInRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentId = null,
|
||||
Object? quantity = null,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? notes = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentInRequestImpl(
|
||||
equipmentId: null == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
notes: freezed == notes
|
||||
? _value.notes
|
||||
: notes // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$EquipmentInRequestImpl implements _EquipmentInRequest {
|
||||
const _$EquipmentInRequestImpl(
|
||||
{required this.equipmentId,
|
||||
required this.quantity,
|
||||
this.warehouseLocationId,
|
||||
this.notes});
|
||||
|
||||
factory _$EquipmentInRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$EquipmentInRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int equipmentId;
|
||||
@override
|
||||
final int quantity;
|
||||
@override
|
||||
final int? warehouseLocationId;
|
||||
@override
|
||||
final String? notes;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentInRequest(equipmentId: $equipmentId, quantity: $quantity, warehouseLocationId: $warehouseLocationId, notes: $notes)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$EquipmentInRequestImpl &&
|
||||
(identical(other.equipmentId, equipmentId) ||
|
||||
other.equipmentId == equipmentId) &&
|
||||
(identical(other.quantity, quantity) ||
|
||||
other.quantity == quantity) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.notes, notes) || other.notes == notes));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, equipmentId, quantity, warehouseLocationId, notes);
|
||||
|
||||
/// Create a copy of EquipmentInRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$EquipmentInRequestImplCopyWith<_$EquipmentInRequestImpl> get copyWith =>
|
||||
__$$EquipmentInRequestImplCopyWithImpl<_$EquipmentInRequestImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$EquipmentInRequestImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _EquipmentInRequest implements EquipmentInRequest {
|
||||
const factory _EquipmentInRequest(
|
||||
{required final int equipmentId,
|
||||
required final int quantity,
|
||||
final int? warehouseLocationId,
|
||||
final String? notes}) = _$EquipmentInRequestImpl;
|
||||
|
||||
factory _EquipmentInRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$EquipmentInRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get equipmentId;
|
||||
@override
|
||||
int get quantity;
|
||||
@override
|
||||
int? get warehouseLocationId;
|
||||
@override
|
||||
String? get notes;
|
||||
|
||||
/// Create a copy of EquipmentInRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$EquipmentInRequestImplCopyWith<_$EquipmentInRequestImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
25
lib/data/models/equipment/equipment_in_request.g.dart
Normal file
25
lib/data/models/equipment/equipment_in_request.g.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'equipment_in_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$EquipmentInRequestImpl _$$EquipmentInRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$EquipmentInRequestImpl(
|
||||
equipmentId: (json['equipmentId'] as num).toInt(),
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
warehouseLocationId: (json['warehouseLocationId'] as num?)?.toInt(),
|
||||
notes: json['notes'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$EquipmentInRequestImplToJson(
|
||||
_$EquipmentInRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'equipmentId': instance.equipmentId,
|
||||
'quantity': instance.quantity,
|
||||
'warehouseLocationId': instance.warehouseLocationId,
|
||||
'notes': instance.notes,
|
||||
};
|
||||
20
lib/data/models/equipment/equipment_io_response.dart
Normal file
20
lib/data/models/equipment/equipment_io_response.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'equipment_io_response.freezed.dart';
|
||||
part 'equipment_io_response.g.dart';
|
||||
|
||||
@freezed
|
||||
class EquipmentIoResponse with _$EquipmentIoResponse {
|
||||
const factory EquipmentIoResponse({
|
||||
required bool success,
|
||||
required String message,
|
||||
required int transactionId,
|
||||
required int equipmentId,
|
||||
required int quantity,
|
||||
required String transactionType,
|
||||
required DateTime transactionDate,
|
||||
}) = _EquipmentIoResponse;
|
||||
|
||||
factory EquipmentIoResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$EquipmentIoResponseFromJson(json);
|
||||
}
|
||||
295
lib/data/models/equipment/equipment_io_response.freezed.dart
Normal file
295
lib/data/models/equipment/equipment_io_response.freezed.dart
Normal file
@@ -0,0 +1,295 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'equipment_io_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
EquipmentIoResponse _$EquipmentIoResponseFromJson(Map<String, dynamic> json) {
|
||||
return _EquipmentIoResponse.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$EquipmentIoResponse {
|
||||
bool get success => throw _privateConstructorUsedError;
|
||||
String get message => throw _privateConstructorUsedError;
|
||||
int get transactionId => throw _privateConstructorUsedError;
|
||||
int get equipmentId => throw _privateConstructorUsedError;
|
||||
int get quantity => throw _privateConstructorUsedError;
|
||||
String get transactionType => throw _privateConstructorUsedError;
|
||||
DateTime get transactionDate => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentIoResponse to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of EquipmentIoResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$EquipmentIoResponseCopyWith<EquipmentIoResponse> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $EquipmentIoResponseCopyWith<$Res> {
|
||||
factory $EquipmentIoResponseCopyWith(
|
||||
EquipmentIoResponse value, $Res Function(EquipmentIoResponse) then) =
|
||||
_$EquipmentIoResponseCopyWithImpl<$Res, EquipmentIoResponse>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool success,
|
||||
String message,
|
||||
int transactionId,
|
||||
int equipmentId,
|
||||
int quantity,
|
||||
String transactionType,
|
||||
DateTime transactionDate});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$EquipmentIoResponseCopyWithImpl<$Res, $Val extends EquipmentIoResponse>
|
||||
implements $EquipmentIoResponseCopyWith<$Res> {
|
||||
_$EquipmentIoResponseCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of EquipmentIoResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? success = null,
|
||||
Object? message = null,
|
||||
Object? transactionId = null,
|
||||
Object? equipmentId = null,
|
||||
Object? quantity = null,
|
||||
Object? transactionType = null,
|
||||
Object? transactionDate = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
success: null == success
|
||||
? _value.success
|
||||
: success // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
transactionId: null == transactionId
|
||||
? _value.transactionId
|
||||
: transactionId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentId: null == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
transactionType: null == transactionType
|
||||
? _value.transactionType
|
||||
: transactionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
transactionDate: null == transactionDate
|
||||
? _value.transactionDate
|
||||
: transactionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$EquipmentIoResponseImplCopyWith<$Res>
|
||||
implements $EquipmentIoResponseCopyWith<$Res> {
|
||||
factory _$$EquipmentIoResponseImplCopyWith(_$EquipmentIoResponseImpl value,
|
||||
$Res Function(_$EquipmentIoResponseImpl) then) =
|
||||
__$$EquipmentIoResponseImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool success,
|
||||
String message,
|
||||
int transactionId,
|
||||
int equipmentId,
|
||||
int quantity,
|
||||
String transactionType,
|
||||
DateTime transactionDate});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$EquipmentIoResponseImplCopyWithImpl<$Res>
|
||||
extends _$EquipmentIoResponseCopyWithImpl<$Res, _$EquipmentIoResponseImpl>
|
||||
implements _$$EquipmentIoResponseImplCopyWith<$Res> {
|
||||
__$$EquipmentIoResponseImplCopyWithImpl(_$EquipmentIoResponseImpl _value,
|
||||
$Res Function(_$EquipmentIoResponseImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of EquipmentIoResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? success = null,
|
||||
Object? message = null,
|
||||
Object? transactionId = null,
|
||||
Object? equipmentId = null,
|
||||
Object? quantity = null,
|
||||
Object? transactionType = null,
|
||||
Object? transactionDate = null,
|
||||
}) {
|
||||
return _then(_$EquipmentIoResponseImpl(
|
||||
success: null == success
|
||||
? _value.success
|
||||
: success // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
transactionId: null == transactionId
|
||||
? _value.transactionId
|
||||
: transactionId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentId: null == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
transactionType: null == transactionType
|
||||
? _value.transactionType
|
||||
: transactionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
transactionDate: null == transactionDate
|
||||
? _value.transactionDate
|
||||
: transactionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$EquipmentIoResponseImpl implements _EquipmentIoResponse {
|
||||
const _$EquipmentIoResponseImpl(
|
||||
{required this.success,
|
||||
required this.message,
|
||||
required this.transactionId,
|
||||
required this.equipmentId,
|
||||
required this.quantity,
|
||||
required this.transactionType,
|
||||
required this.transactionDate});
|
||||
|
||||
factory _$EquipmentIoResponseImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$EquipmentIoResponseImplFromJson(json);
|
||||
|
||||
@override
|
||||
final bool success;
|
||||
@override
|
||||
final String message;
|
||||
@override
|
||||
final int transactionId;
|
||||
@override
|
||||
final int equipmentId;
|
||||
@override
|
||||
final int quantity;
|
||||
@override
|
||||
final String transactionType;
|
||||
@override
|
||||
final DateTime transactionDate;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentIoResponse(success: $success, message: $message, transactionId: $transactionId, equipmentId: $equipmentId, quantity: $quantity, transactionType: $transactionType, transactionDate: $transactionDate)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$EquipmentIoResponseImpl &&
|
||||
(identical(other.success, success) || other.success == success) &&
|
||||
(identical(other.message, message) || other.message == message) &&
|
||||
(identical(other.transactionId, transactionId) ||
|
||||
other.transactionId == transactionId) &&
|
||||
(identical(other.equipmentId, equipmentId) ||
|
||||
other.equipmentId == equipmentId) &&
|
||||
(identical(other.quantity, quantity) ||
|
||||
other.quantity == quantity) &&
|
||||
(identical(other.transactionType, transactionType) ||
|
||||
other.transactionType == transactionType) &&
|
||||
(identical(other.transactionDate, transactionDate) ||
|
||||
other.transactionDate == transactionDate));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, success, message, transactionId,
|
||||
equipmentId, quantity, transactionType, transactionDate);
|
||||
|
||||
/// Create a copy of EquipmentIoResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$EquipmentIoResponseImplCopyWith<_$EquipmentIoResponseImpl> get copyWith =>
|
||||
__$$EquipmentIoResponseImplCopyWithImpl<_$EquipmentIoResponseImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$EquipmentIoResponseImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _EquipmentIoResponse implements EquipmentIoResponse {
|
||||
const factory _EquipmentIoResponse(
|
||||
{required final bool success,
|
||||
required final String message,
|
||||
required final int transactionId,
|
||||
required final int equipmentId,
|
||||
required final int quantity,
|
||||
required final String transactionType,
|
||||
required final DateTime transactionDate}) = _$EquipmentIoResponseImpl;
|
||||
|
||||
factory _EquipmentIoResponse.fromJson(Map<String, dynamic> json) =
|
||||
_$EquipmentIoResponseImpl.fromJson;
|
||||
|
||||
@override
|
||||
bool get success;
|
||||
@override
|
||||
String get message;
|
||||
@override
|
||||
int get transactionId;
|
||||
@override
|
||||
int get equipmentId;
|
||||
@override
|
||||
int get quantity;
|
||||
@override
|
||||
String get transactionType;
|
||||
@override
|
||||
DateTime get transactionDate;
|
||||
|
||||
/// Create a copy of EquipmentIoResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$EquipmentIoResponseImplCopyWith<_$EquipmentIoResponseImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
31
lib/data/models/equipment/equipment_io_response.g.dart
Normal file
31
lib/data/models/equipment/equipment_io_response.g.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'equipment_io_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$EquipmentIoResponseImpl _$$EquipmentIoResponseImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$EquipmentIoResponseImpl(
|
||||
success: json['success'] as bool,
|
||||
message: json['message'] as String,
|
||||
transactionId: (json['transactionId'] as num).toInt(),
|
||||
equipmentId: (json['equipmentId'] as num).toInt(),
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
transactionType: json['transactionType'] as String,
|
||||
transactionDate: DateTime.parse(json['transactionDate'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$EquipmentIoResponseImplToJson(
|
||||
_$EquipmentIoResponseImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'success': instance.success,
|
||||
'message': instance.message,
|
||||
'transactionId': instance.transactionId,
|
||||
'equipmentId': instance.equipmentId,
|
||||
'quantity': instance.quantity,
|
||||
'transactionType': instance.transactionType,
|
||||
'transactionDate': instance.transactionDate.toIso8601String(),
|
||||
};
|
||||
27
lib/data/models/equipment/equipment_list_dto.dart
Normal file
27
lib/data/models/equipment/equipment_list_dto.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'equipment_list_dto.freezed.dart';
|
||||
part 'equipment_list_dto.g.dart';
|
||||
|
||||
@freezed
|
||||
class EquipmentListDto with _$EquipmentListDto {
|
||||
const factory EquipmentListDto({
|
||||
required int id,
|
||||
required String equipmentNumber,
|
||||
required String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
required String status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
required DateTime createdAt,
|
||||
// 추가 필드 (조인된 데이터)
|
||||
String? companyName,
|
||||
String? branchName,
|
||||
String? warehouseName,
|
||||
}) = _EquipmentListDto;
|
||||
|
||||
factory EquipmentListDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$EquipmentListDtoFromJson(json);
|
||||
}
|
||||
436
lib/data/models/equipment/equipment_list_dto.freezed.dart
Normal file
436
lib/data/models/equipment/equipment_list_dto.freezed.dart
Normal file
@@ -0,0 +1,436 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'equipment_list_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');
|
||||
|
||||
EquipmentListDto _$EquipmentListDtoFromJson(Map<String, dynamic> json) {
|
||||
return _EquipmentListDto.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$EquipmentListDto {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get equipmentNumber => throw _privateConstructorUsedError;
|
||||
String get manufacturer => throw _privateConstructorUsedError;
|
||||
String? get modelName => throw _privateConstructorUsedError;
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
String get status => throw _privateConstructorUsedError;
|
||||
int? get currentCompanyId => throw _privateConstructorUsedError;
|
||||
int? get currentBranchId => throw _privateConstructorUsedError;
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
DateTime get createdAt =>
|
||||
throw _privateConstructorUsedError; // 추가 필드 (조인된 데이터)
|
||||
String? get companyName => throw _privateConstructorUsedError;
|
||||
String? get branchName => throw _privateConstructorUsedError;
|
||||
String? get warehouseName => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentListDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of EquipmentListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$EquipmentListDtoCopyWith<EquipmentListDto> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $EquipmentListDtoCopyWith<$Res> {
|
||||
factory $EquipmentListDtoCopyWith(
|
||||
EquipmentListDto value, $Res Function(EquipmentListDto) then) =
|
||||
_$EquipmentListDtoCopyWithImpl<$Res, EquipmentListDto>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String equipmentNumber,
|
||||
String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
String status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
DateTime createdAt,
|
||||
String? companyName,
|
||||
String? branchName,
|
||||
String? warehouseName});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$EquipmentListDtoCopyWithImpl<$Res, $Val extends EquipmentListDto>
|
||||
implements $EquipmentListDtoCopyWith<$Res> {
|
||||
_$EquipmentListDtoCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of EquipmentListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? equipmentNumber = null,
|
||||
Object? manufacturer = null,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? status = null,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? companyName = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentNumber: null == equipmentNumber
|
||||
? _value.equipmentNumber
|
||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
manufacturer: null == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
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,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
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?,
|
||||
branchName: freezed == branchName
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$EquipmentListDtoImplCopyWith<$Res>
|
||||
implements $EquipmentListDtoCopyWith<$Res> {
|
||||
factory _$$EquipmentListDtoImplCopyWith(_$EquipmentListDtoImpl value,
|
||||
$Res Function(_$EquipmentListDtoImpl) then) =
|
||||
__$$EquipmentListDtoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String equipmentNumber,
|
||||
String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
String status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
DateTime createdAt,
|
||||
String? companyName,
|
||||
String? branchName,
|
||||
String? warehouseName});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$EquipmentListDtoImplCopyWithImpl<$Res>
|
||||
extends _$EquipmentListDtoCopyWithImpl<$Res, _$EquipmentListDtoImpl>
|
||||
implements _$$EquipmentListDtoImplCopyWith<$Res> {
|
||||
__$$EquipmentListDtoImplCopyWithImpl(_$EquipmentListDtoImpl _value,
|
||||
$Res Function(_$EquipmentListDtoImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of EquipmentListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? equipmentNumber = null,
|
||||
Object? manufacturer = null,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? status = null,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? companyName = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentListDtoImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentNumber: null == equipmentNumber
|
||||
? _value.equipmentNumber
|
||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
manufacturer: null == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
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,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
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?,
|
||||
branchName: freezed == branchName
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$EquipmentListDtoImpl implements _EquipmentListDto {
|
||||
const _$EquipmentListDtoImpl(
|
||||
{required this.id,
|
||||
required this.equipmentNumber,
|
||||
required this.manufacturer,
|
||||
this.modelName,
|
||||
this.serialNumber,
|
||||
required this.status,
|
||||
this.currentCompanyId,
|
||||
this.currentBranchId,
|
||||
this.warehouseLocationId,
|
||||
required this.createdAt,
|
||||
this.companyName,
|
||||
this.branchName,
|
||||
this.warehouseName});
|
||||
|
||||
factory _$EquipmentListDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$EquipmentListDtoImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String equipmentNumber;
|
||||
@override
|
||||
final String manufacturer;
|
||||
@override
|
||||
final String? modelName;
|
||||
@override
|
||||
final String? serialNumber;
|
||||
@override
|
||||
final String status;
|
||||
@override
|
||||
final int? currentCompanyId;
|
||||
@override
|
||||
final int? currentBranchId;
|
||||
@override
|
||||
final int? warehouseLocationId;
|
||||
@override
|
||||
final DateTime createdAt;
|
||||
// 추가 필드 (조인된 데이터)
|
||||
@override
|
||||
final String? companyName;
|
||||
@override
|
||||
final String? branchName;
|
||||
@override
|
||||
final String? warehouseName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentListDto(id: $id, equipmentNumber: $equipmentNumber, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, status: $status, currentCompanyId: $currentCompanyId, currentBranchId: $currentBranchId, warehouseLocationId: $warehouseLocationId, createdAt: $createdAt, companyName: $companyName, branchName: $branchName, warehouseName: $warehouseName)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$EquipmentListDtoImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.equipmentNumber, equipmentNumber) ||
|
||||
other.equipmentNumber == equipmentNumber) &&
|
||||
(identical(other.manufacturer, manufacturer) ||
|
||||
other.manufacturer == manufacturer) &&
|
||||
(identical(other.modelName, modelName) ||
|
||||
other.modelName == modelName) &&
|
||||
(identical(other.serialNumber, serialNumber) ||
|
||||
other.serialNumber == serialNumber) &&
|
||||
(identical(other.status, status) || other.status == status) &&
|
||||
(identical(other.currentCompanyId, currentCompanyId) ||
|
||||
other.currentCompanyId == currentCompanyId) &&
|
||||
(identical(other.currentBranchId, currentBranchId) ||
|
||||
other.currentBranchId == currentBranchId) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.branchName, branchName) ||
|
||||
other.branchName == branchName) &&
|
||||
(identical(other.warehouseName, warehouseName) ||
|
||||
other.warehouseName == warehouseName));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
equipmentNumber,
|
||||
manufacturer,
|
||||
modelName,
|
||||
serialNumber,
|
||||
status,
|
||||
currentCompanyId,
|
||||
currentBranchId,
|
||||
warehouseLocationId,
|
||||
createdAt,
|
||||
companyName,
|
||||
branchName,
|
||||
warehouseName);
|
||||
|
||||
/// Create a copy of EquipmentListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$EquipmentListDtoImplCopyWith<_$EquipmentListDtoImpl> get copyWith =>
|
||||
__$$EquipmentListDtoImplCopyWithImpl<_$EquipmentListDtoImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$EquipmentListDtoImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _EquipmentListDto implements EquipmentListDto {
|
||||
const factory _EquipmentListDto(
|
||||
{required final int id,
|
||||
required final String equipmentNumber,
|
||||
required final String manufacturer,
|
||||
final String? modelName,
|
||||
final String? serialNumber,
|
||||
required final String status,
|
||||
final int? currentCompanyId,
|
||||
final int? currentBranchId,
|
||||
final int? warehouseLocationId,
|
||||
required final DateTime createdAt,
|
||||
final String? companyName,
|
||||
final String? branchName,
|
||||
final String? warehouseName}) = _$EquipmentListDtoImpl;
|
||||
|
||||
factory _EquipmentListDto.fromJson(Map<String, dynamic> json) =
|
||||
_$EquipmentListDtoImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get equipmentNumber;
|
||||
@override
|
||||
String get manufacturer;
|
||||
@override
|
||||
String? get modelName;
|
||||
@override
|
||||
String? get serialNumber;
|
||||
@override
|
||||
String get status;
|
||||
@override
|
||||
int? get currentCompanyId;
|
||||
@override
|
||||
int? get currentBranchId;
|
||||
@override
|
||||
int? get warehouseLocationId;
|
||||
@override
|
||||
DateTime get createdAt; // 추가 필드 (조인된 데이터)
|
||||
@override
|
||||
String? get companyName;
|
||||
@override
|
||||
String? get branchName;
|
||||
@override
|
||||
String? get warehouseName;
|
||||
|
||||
/// Create a copy of EquipmentListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$EquipmentListDtoImplCopyWith<_$EquipmentListDtoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
43
lib/data/models/equipment/equipment_list_dto.g.dart
Normal file
43
lib/data/models/equipment/equipment_list_dto.g.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'equipment_list_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$EquipmentListDtoImpl _$$EquipmentListDtoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$EquipmentListDtoImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
equipmentNumber: json['equipmentNumber'] as String,
|
||||
manufacturer: json['manufacturer'] as String,
|
||||
modelName: json['modelName'] as String?,
|
||||
serialNumber: json['serialNumber'] as String?,
|
||||
status: json['status'] as String,
|
||||
currentCompanyId: (json['currentCompanyId'] as num?)?.toInt(),
|
||||
currentBranchId: (json['currentBranchId'] as num?)?.toInt(),
|
||||
warehouseLocationId: (json['warehouseLocationId'] as num?)?.toInt(),
|
||||
createdAt: DateTime.parse(json['createdAt'] as String),
|
||||
companyName: json['companyName'] as String?,
|
||||
branchName: json['branchName'] as String?,
|
||||
warehouseName: json['warehouseName'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$EquipmentListDtoImplToJson(
|
||||
_$EquipmentListDtoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'equipmentNumber': instance.equipmentNumber,
|
||||
'manufacturer': instance.manufacturer,
|
||||
'modelName': instance.modelName,
|
||||
'serialNumber': instance.serialNumber,
|
||||
'status': instance.status,
|
||||
'currentCompanyId': instance.currentCompanyId,
|
||||
'currentBranchId': instance.currentBranchId,
|
||||
'warehouseLocationId': instance.warehouseLocationId,
|
||||
'createdAt': instance.createdAt.toIso8601String(),
|
||||
'companyName': instance.companyName,
|
||||
'branchName': instance.branchName,
|
||||
'warehouseName': instance.warehouseName,
|
||||
};
|
||||
18
lib/data/models/equipment/equipment_out_request.dart
Normal file
18
lib/data/models/equipment/equipment_out_request.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'equipment_out_request.freezed.dart';
|
||||
part 'equipment_out_request.g.dart';
|
||||
|
||||
@freezed
|
||||
class EquipmentOutRequest with _$EquipmentOutRequest {
|
||||
const factory EquipmentOutRequest({
|
||||
required int equipmentId,
|
||||
required int quantity,
|
||||
required int companyId,
|
||||
int? branchId,
|
||||
String? notes,
|
||||
}) = _EquipmentOutRequest;
|
||||
|
||||
factory EquipmentOutRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$EquipmentOutRequestFromJson(json);
|
||||
}
|
||||
254
lib/data/models/equipment/equipment_out_request.freezed.dart
Normal file
254
lib/data/models/equipment/equipment_out_request.freezed.dart
Normal file
@@ -0,0 +1,254 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'equipment_out_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
EquipmentOutRequest _$EquipmentOutRequestFromJson(Map<String, dynamic> json) {
|
||||
return _EquipmentOutRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$EquipmentOutRequest {
|
||||
int get equipmentId => throw _privateConstructorUsedError;
|
||||
int get quantity => throw _privateConstructorUsedError;
|
||||
int get companyId => throw _privateConstructorUsedError;
|
||||
int? get branchId => throw _privateConstructorUsedError;
|
||||
String? get notes => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentOutRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of EquipmentOutRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$EquipmentOutRequestCopyWith<EquipmentOutRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $EquipmentOutRequestCopyWith<$Res> {
|
||||
factory $EquipmentOutRequestCopyWith(
|
||||
EquipmentOutRequest value, $Res Function(EquipmentOutRequest) then) =
|
||||
_$EquipmentOutRequestCopyWithImpl<$Res, EquipmentOutRequest>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int equipmentId,
|
||||
int quantity,
|
||||
int companyId,
|
||||
int? branchId,
|
||||
String? notes});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$EquipmentOutRequestCopyWithImpl<$Res, $Val extends EquipmentOutRequest>
|
||||
implements $EquipmentOutRequestCopyWith<$Res> {
|
||||
_$EquipmentOutRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of EquipmentOutRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentId = null,
|
||||
Object? quantity = null,
|
||||
Object? companyId = null,
|
||||
Object? branchId = freezed,
|
||||
Object? notes = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
equipmentId: null == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
companyId: null == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
branchId: freezed == branchId
|
||||
? _value.branchId
|
||||
: branchId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
notes: freezed == notes
|
||||
? _value.notes
|
||||
: notes // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$EquipmentOutRequestImplCopyWith<$Res>
|
||||
implements $EquipmentOutRequestCopyWith<$Res> {
|
||||
factory _$$EquipmentOutRequestImplCopyWith(_$EquipmentOutRequestImpl value,
|
||||
$Res Function(_$EquipmentOutRequestImpl) then) =
|
||||
__$$EquipmentOutRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int equipmentId,
|
||||
int quantity,
|
||||
int companyId,
|
||||
int? branchId,
|
||||
String? notes});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$EquipmentOutRequestImplCopyWithImpl<$Res>
|
||||
extends _$EquipmentOutRequestCopyWithImpl<$Res, _$EquipmentOutRequestImpl>
|
||||
implements _$$EquipmentOutRequestImplCopyWith<$Res> {
|
||||
__$$EquipmentOutRequestImplCopyWithImpl(_$EquipmentOutRequestImpl _value,
|
||||
$Res Function(_$EquipmentOutRequestImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of EquipmentOutRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentId = null,
|
||||
Object? quantity = null,
|
||||
Object? companyId = null,
|
||||
Object? branchId = freezed,
|
||||
Object? notes = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentOutRequestImpl(
|
||||
equipmentId: null == equipmentId
|
||||
? _value.equipmentId
|
||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
quantity: null == quantity
|
||||
? _value.quantity
|
||||
: quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
companyId: null == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
branchId: freezed == branchId
|
||||
? _value.branchId
|
||||
: branchId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
notes: freezed == notes
|
||||
? _value.notes
|
||||
: notes // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$EquipmentOutRequestImpl implements _EquipmentOutRequest {
|
||||
const _$EquipmentOutRequestImpl(
|
||||
{required this.equipmentId,
|
||||
required this.quantity,
|
||||
required this.companyId,
|
||||
this.branchId,
|
||||
this.notes});
|
||||
|
||||
factory _$EquipmentOutRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$EquipmentOutRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int equipmentId;
|
||||
@override
|
||||
final int quantity;
|
||||
@override
|
||||
final int companyId;
|
||||
@override
|
||||
final int? branchId;
|
||||
@override
|
||||
final String? notes;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentOutRequest(equipmentId: $equipmentId, quantity: $quantity, companyId: $companyId, branchId: $branchId, notes: $notes)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$EquipmentOutRequestImpl &&
|
||||
(identical(other.equipmentId, equipmentId) ||
|
||||
other.equipmentId == equipmentId) &&
|
||||
(identical(other.quantity, quantity) ||
|
||||
other.quantity == quantity) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.branchId, branchId) ||
|
||||
other.branchId == branchId) &&
|
||||
(identical(other.notes, notes) || other.notes == notes));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, equipmentId, quantity, companyId, branchId, notes);
|
||||
|
||||
/// Create a copy of EquipmentOutRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$EquipmentOutRequestImplCopyWith<_$EquipmentOutRequestImpl> get copyWith =>
|
||||
__$$EquipmentOutRequestImplCopyWithImpl<_$EquipmentOutRequestImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$EquipmentOutRequestImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _EquipmentOutRequest implements EquipmentOutRequest {
|
||||
const factory _EquipmentOutRequest(
|
||||
{required final int equipmentId,
|
||||
required final int quantity,
|
||||
required final int companyId,
|
||||
final int? branchId,
|
||||
final String? notes}) = _$EquipmentOutRequestImpl;
|
||||
|
||||
factory _EquipmentOutRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$EquipmentOutRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get equipmentId;
|
||||
@override
|
||||
int get quantity;
|
||||
@override
|
||||
int get companyId;
|
||||
@override
|
||||
int? get branchId;
|
||||
@override
|
||||
String? get notes;
|
||||
|
||||
/// Create a copy of EquipmentOutRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$EquipmentOutRequestImplCopyWith<_$EquipmentOutRequestImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
27
lib/data/models/equipment/equipment_out_request.g.dart
Normal file
27
lib/data/models/equipment/equipment_out_request.g.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'equipment_out_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$EquipmentOutRequestImpl _$$EquipmentOutRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$EquipmentOutRequestImpl(
|
||||
equipmentId: (json['equipmentId'] as num).toInt(),
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
companyId: (json['companyId'] as num).toInt(),
|
||||
branchId: (json['branchId'] as num?)?.toInt(),
|
||||
notes: json['notes'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$EquipmentOutRequestImplToJson(
|
||||
_$EquipmentOutRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'equipmentId': instance.equipmentId,
|
||||
'quantity': instance.quantity,
|
||||
'companyId': instance.companyId,
|
||||
'branchId': instance.branchId,
|
||||
'notes': instance.notes,
|
||||
};
|
||||
48
lib/data/models/equipment/equipment_request.dart
Normal file
48
lib/data/models/equipment/equipment_request.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'equipment_request.freezed.dart';
|
||||
part 'equipment_request.g.dart';
|
||||
|
||||
@freezed
|
||||
class CreateEquipmentRequest with _$CreateEquipmentRequest {
|
||||
const factory CreateEquipmentRequest({
|
||||
required String equipmentNumber,
|
||||
String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
required String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
String? remark,
|
||||
}) = _CreateEquipmentRequest;
|
||||
|
||||
factory CreateEquipmentRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$CreateEquipmentRequestFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class UpdateEquipmentRequest with _$UpdateEquipmentRequest {
|
||||
const factory UpdateEquipmentRequest({
|
||||
String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String? manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
String? barcode,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
String? status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
DateTime? lastInspectionDate,
|
||||
DateTime? nextInspectionDate,
|
||||
String? remark,
|
||||
}) = _UpdateEquipmentRequest;
|
||||
|
||||
factory UpdateEquipmentRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$UpdateEquipmentRequestFromJson(json);
|
||||
}
|
||||
863
lib/data/models/equipment/equipment_request.freezed.dart
Normal file
863
lib/data/models/equipment/equipment_request.freezed.dart
Normal file
@@ -0,0 +1,863 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'equipment_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
CreateEquipmentRequest _$CreateEquipmentRequestFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _CreateEquipmentRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreateEquipmentRequest {
|
||||
String get equipmentNumber => throw _privateConstructorUsedError;
|
||||
String? get category1 => throw _privateConstructorUsedError;
|
||||
String? get category2 => throw _privateConstructorUsedError;
|
||||
String? get category3 => throw _privateConstructorUsedError;
|
||||
String get manufacturer => throw _privateConstructorUsedError;
|
||||
String? get modelName => throw _privateConstructorUsedError;
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CreateEquipmentRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CreateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CreateEquipmentRequestCopyWith<CreateEquipmentRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CreateEquipmentRequestCopyWith<$Res> {
|
||||
factory $CreateEquipmentRequestCopyWith(CreateEquipmentRequest value,
|
||||
$Res Function(CreateEquipmentRequest) then) =
|
||||
_$CreateEquipmentRequestCopyWithImpl<$Res, CreateEquipmentRequest>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String equipmentNumber,
|
||||
String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
String? remark});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CreateEquipmentRequestCopyWithImpl<$Res,
|
||||
$Val extends CreateEquipmentRequest>
|
||||
implements $CreateEquipmentRequestCopyWith<$Res> {
|
||||
_$CreateEquipmentRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CreateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentNumber = null,
|
||||
Object? category1 = freezed,
|
||||
Object? category2 = freezed,
|
||||
Object? category3 = freezed,
|
||||
Object? manufacturer = null,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? remark = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
equipmentNumber: null == equipmentNumber
|
||||
? _value.equipmentNumber
|
||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
category1: freezed == category1
|
||||
? _value.category1
|
||||
: category1 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category2: freezed == category2
|
||||
? _value.category2
|
||||
: category2 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category3: freezed == category3
|
||||
? _value.category3
|
||||
: category3 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
manufacturer: null == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
serialNumber: freezed == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CreateEquipmentRequestImplCopyWith<$Res>
|
||||
implements $CreateEquipmentRequestCopyWith<$Res> {
|
||||
factory _$$CreateEquipmentRequestImplCopyWith(
|
||||
_$CreateEquipmentRequestImpl value,
|
||||
$Res Function(_$CreateEquipmentRequestImpl) then) =
|
||||
__$$CreateEquipmentRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String equipmentNumber,
|
||||
String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
String? remark});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CreateEquipmentRequestImplCopyWithImpl<$Res>
|
||||
extends _$CreateEquipmentRequestCopyWithImpl<$Res,
|
||||
_$CreateEquipmentRequestImpl>
|
||||
implements _$$CreateEquipmentRequestImplCopyWith<$Res> {
|
||||
__$$CreateEquipmentRequestImplCopyWithImpl(
|
||||
_$CreateEquipmentRequestImpl _value,
|
||||
$Res Function(_$CreateEquipmentRequestImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? equipmentNumber = null,
|
||||
Object? category1 = freezed,
|
||||
Object? category2 = freezed,
|
||||
Object? category3 = freezed,
|
||||
Object? manufacturer = null,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? remark = freezed,
|
||||
}) {
|
||||
return _then(_$CreateEquipmentRequestImpl(
|
||||
equipmentNumber: null == equipmentNumber
|
||||
? _value.equipmentNumber
|
||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
category1: freezed == category1
|
||||
? _value.category1
|
||||
: category1 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category2: freezed == category2
|
||||
? _value.category2
|
||||
: category2 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category3: freezed == category3
|
||||
? _value.category3
|
||||
: category3 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
manufacturer: null == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
serialNumber: freezed == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
|
||||
const _$CreateEquipmentRequestImpl(
|
||||
{required this.equipmentNumber,
|
||||
this.category1,
|
||||
this.category2,
|
||||
this.category3,
|
||||
required this.manufacturer,
|
||||
this.modelName,
|
||||
this.serialNumber,
|
||||
this.purchaseDate,
|
||||
this.purchasePrice,
|
||||
this.remark});
|
||||
|
||||
factory _$CreateEquipmentRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CreateEquipmentRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String equipmentNumber;
|
||||
@override
|
||||
final String? category1;
|
||||
@override
|
||||
final String? category2;
|
||||
@override
|
||||
final String? category3;
|
||||
@override
|
||||
final String manufacturer;
|
||||
@override
|
||||
final String? modelName;
|
||||
@override
|
||||
final String? serialNumber;
|
||||
@override
|
||||
final DateTime? purchaseDate;
|
||||
@override
|
||||
final double? purchasePrice;
|
||||
@override
|
||||
final String? remark;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateEquipmentRequest(equipmentNumber: $equipmentNumber, category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, remark: $remark)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CreateEquipmentRequestImpl &&
|
||||
(identical(other.equipmentNumber, equipmentNumber) ||
|
||||
other.equipmentNumber == equipmentNumber) &&
|
||||
(identical(other.category1, category1) ||
|
||||
other.category1 == category1) &&
|
||||
(identical(other.category2, category2) ||
|
||||
other.category2 == category2) &&
|
||||
(identical(other.category3, category3) ||
|
||||
other.category3 == category3) &&
|
||||
(identical(other.manufacturer, manufacturer) ||
|
||||
other.manufacturer == manufacturer) &&
|
||||
(identical(other.modelName, modelName) ||
|
||||
other.modelName == modelName) &&
|
||||
(identical(other.serialNumber, serialNumber) ||
|
||||
other.serialNumber == serialNumber) &&
|
||||
(identical(other.purchaseDate, purchaseDate) ||
|
||||
other.purchaseDate == purchaseDate) &&
|
||||
(identical(other.purchasePrice, purchasePrice) ||
|
||||
other.purchasePrice == purchasePrice) &&
|
||||
(identical(other.remark, remark) || other.remark == remark));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
equipmentNumber,
|
||||
category1,
|
||||
category2,
|
||||
category3,
|
||||
manufacturer,
|
||||
modelName,
|
||||
serialNumber,
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
remark);
|
||||
|
||||
/// Create a copy of CreateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreateEquipmentRequestImplCopyWith<_$CreateEquipmentRequestImpl>
|
||||
get copyWith => __$$CreateEquipmentRequestImplCopyWithImpl<
|
||||
_$CreateEquipmentRequestImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CreateEquipmentRequestImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CreateEquipmentRequest implements CreateEquipmentRequest {
|
||||
const factory _CreateEquipmentRequest(
|
||||
{required final String equipmentNumber,
|
||||
final String? category1,
|
||||
final String? category2,
|
||||
final String? category3,
|
||||
required final String manufacturer,
|
||||
final String? modelName,
|
||||
final String? serialNumber,
|
||||
final DateTime? purchaseDate,
|
||||
final double? purchasePrice,
|
||||
final String? remark}) = _$CreateEquipmentRequestImpl;
|
||||
|
||||
factory _CreateEquipmentRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$CreateEquipmentRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get equipmentNumber;
|
||||
@override
|
||||
String? get category1;
|
||||
@override
|
||||
String? get category2;
|
||||
@override
|
||||
String? get category3;
|
||||
@override
|
||||
String get manufacturer;
|
||||
@override
|
||||
String? get modelName;
|
||||
@override
|
||||
String? get serialNumber;
|
||||
@override
|
||||
DateTime? get purchaseDate;
|
||||
@override
|
||||
double? get purchasePrice;
|
||||
@override
|
||||
String? get remark;
|
||||
|
||||
/// Create a copy of CreateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CreateEquipmentRequestImplCopyWith<_$CreateEquipmentRequestImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
UpdateEquipmentRequest _$UpdateEquipmentRequestFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _UpdateEquipmentRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UpdateEquipmentRequest {
|
||||
String? get category1 => throw _privateConstructorUsedError;
|
||||
String? get category2 => throw _privateConstructorUsedError;
|
||||
String? get category3 => throw _privateConstructorUsedError;
|
||||
String? get manufacturer => throw _privateConstructorUsedError;
|
||||
String? get modelName => throw _privateConstructorUsedError;
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
String? get barcode => throw _privateConstructorUsedError;
|
||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
String? get status => throw _privateConstructorUsedError;
|
||||
int? get currentCompanyId => throw _privateConstructorUsedError;
|
||||
int? get currentBranchId => throw _privateConstructorUsedError;
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
DateTime? get lastInspectionDate => throw _privateConstructorUsedError;
|
||||
DateTime? get nextInspectionDate => throw _privateConstructorUsedError;
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this UpdateEquipmentRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of UpdateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$UpdateEquipmentRequestCopyWith<UpdateEquipmentRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $UpdateEquipmentRequestCopyWith<$Res> {
|
||||
factory $UpdateEquipmentRequestCopyWith(UpdateEquipmentRequest value,
|
||||
$Res Function(UpdateEquipmentRequest) then) =
|
||||
_$UpdateEquipmentRequestCopyWithImpl<$Res, UpdateEquipmentRequest>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String? manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
String? barcode,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
String? status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
DateTime? lastInspectionDate,
|
||||
DateTime? nextInspectionDate,
|
||||
String? remark});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$UpdateEquipmentRequestCopyWithImpl<$Res,
|
||||
$Val extends UpdateEquipmentRequest>
|
||||
implements $UpdateEquipmentRequestCopyWith<$Res> {
|
||||
_$UpdateEquipmentRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of UpdateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? category1 = freezed,
|
||||
Object? category2 = freezed,
|
||||
Object? category3 = freezed,
|
||||
Object? manufacturer = freezed,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? barcode = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? status = freezed,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
Object? remark = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
category1: freezed == category1
|
||||
? _value.category1
|
||||
: category1 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category2: freezed == category2
|
||||
? _value.category2
|
||||
: category2 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category3: freezed == category3
|
||||
? _value.category3
|
||||
: category3 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
manufacturer: freezed == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
serialNumber: freezed == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
barcode: freezed == barcode
|
||||
? _value.barcode
|
||||
: barcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
status: freezed == status
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
lastInspectionDate: freezed == lastInspectionDate
|
||||
? _value.lastInspectionDate
|
||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
nextInspectionDate: freezed == nextInspectionDate
|
||||
? _value.nextInspectionDate
|
||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$UpdateEquipmentRequestImplCopyWith<$Res>
|
||||
implements $UpdateEquipmentRequestCopyWith<$Res> {
|
||||
factory _$$UpdateEquipmentRequestImplCopyWith(
|
||||
_$UpdateEquipmentRequestImpl value,
|
||||
$Res Function(_$UpdateEquipmentRequestImpl) then) =
|
||||
__$$UpdateEquipmentRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String? manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
String? barcode,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
String? status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
DateTime? lastInspectionDate,
|
||||
DateTime? nextInspectionDate,
|
||||
String? remark});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>
|
||||
extends _$UpdateEquipmentRequestCopyWithImpl<$Res,
|
||||
_$UpdateEquipmentRequestImpl>
|
||||
implements _$$UpdateEquipmentRequestImplCopyWith<$Res> {
|
||||
__$$UpdateEquipmentRequestImplCopyWithImpl(
|
||||
_$UpdateEquipmentRequestImpl _value,
|
||||
$Res Function(_$UpdateEquipmentRequestImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of UpdateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? category1 = freezed,
|
||||
Object? category2 = freezed,
|
||||
Object? category3 = freezed,
|
||||
Object? manufacturer = freezed,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? barcode = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? status = freezed,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
Object? remark = freezed,
|
||||
}) {
|
||||
return _then(_$UpdateEquipmentRequestImpl(
|
||||
category1: freezed == category1
|
||||
? _value.category1
|
||||
: category1 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category2: freezed == category2
|
||||
? _value.category2
|
||||
: category2 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category3: freezed == category3
|
||||
? _value.category3
|
||||
: category3 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
manufacturer: freezed == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
serialNumber: freezed == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
barcode: freezed == barcode
|
||||
? _value.barcode
|
||||
: barcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
status: freezed == status
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
lastInspectionDate: freezed == lastInspectionDate
|
||||
? _value.lastInspectionDate
|
||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
nextInspectionDate: freezed == nextInspectionDate
|
||||
? _value.nextInspectionDate
|
||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
|
||||
const _$UpdateEquipmentRequestImpl(
|
||||
{this.category1,
|
||||
this.category2,
|
||||
this.category3,
|
||||
this.manufacturer,
|
||||
this.modelName,
|
||||
this.serialNumber,
|
||||
this.barcode,
|
||||
this.purchaseDate,
|
||||
this.purchasePrice,
|
||||
this.status,
|
||||
this.currentCompanyId,
|
||||
this.currentBranchId,
|
||||
this.warehouseLocationId,
|
||||
this.lastInspectionDate,
|
||||
this.nextInspectionDate,
|
||||
this.remark});
|
||||
|
||||
factory _$UpdateEquipmentRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$UpdateEquipmentRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String? category1;
|
||||
@override
|
||||
final String? category2;
|
||||
@override
|
||||
final String? category3;
|
||||
@override
|
||||
final String? manufacturer;
|
||||
@override
|
||||
final String? modelName;
|
||||
@override
|
||||
final String? serialNumber;
|
||||
@override
|
||||
final String? barcode;
|
||||
@override
|
||||
final DateTime? purchaseDate;
|
||||
@override
|
||||
final double? purchasePrice;
|
||||
@override
|
||||
final String? status;
|
||||
@override
|
||||
final int? currentCompanyId;
|
||||
@override
|
||||
final int? currentBranchId;
|
||||
@override
|
||||
final int? warehouseLocationId;
|
||||
@override
|
||||
final DateTime? lastInspectionDate;
|
||||
@override
|
||||
final DateTime? nextInspectionDate;
|
||||
@override
|
||||
final String? remark;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UpdateEquipmentRequest(category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, currentCompanyId: $currentCompanyId, currentBranchId: $currentBranchId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$UpdateEquipmentRequestImpl &&
|
||||
(identical(other.category1, category1) ||
|
||||
other.category1 == category1) &&
|
||||
(identical(other.category2, category2) ||
|
||||
other.category2 == category2) &&
|
||||
(identical(other.category3, category3) ||
|
||||
other.category3 == category3) &&
|
||||
(identical(other.manufacturer, manufacturer) ||
|
||||
other.manufacturer == manufacturer) &&
|
||||
(identical(other.modelName, modelName) ||
|
||||
other.modelName == modelName) &&
|
||||
(identical(other.serialNumber, serialNumber) ||
|
||||
other.serialNumber == serialNumber) &&
|
||||
(identical(other.barcode, barcode) || other.barcode == barcode) &&
|
||||
(identical(other.purchaseDate, purchaseDate) ||
|
||||
other.purchaseDate == purchaseDate) &&
|
||||
(identical(other.purchasePrice, purchasePrice) ||
|
||||
other.purchasePrice == purchasePrice) &&
|
||||
(identical(other.status, status) || other.status == status) &&
|
||||
(identical(other.currentCompanyId, currentCompanyId) ||
|
||||
other.currentCompanyId == currentCompanyId) &&
|
||||
(identical(other.currentBranchId, currentBranchId) ||
|
||||
other.currentBranchId == currentBranchId) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.lastInspectionDate, lastInspectionDate) ||
|
||||
other.lastInspectionDate == lastInspectionDate) &&
|
||||
(identical(other.nextInspectionDate, nextInspectionDate) ||
|
||||
other.nextInspectionDate == nextInspectionDate) &&
|
||||
(identical(other.remark, remark) || other.remark == remark));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
category1,
|
||||
category2,
|
||||
category3,
|
||||
manufacturer,
|
||||
modelName,
|
||||
serialNumber,
|
||||
barcode,
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
status,
|
||||
currentCompanyId,
|
||||
currentBranchId,
|
||||
warehouseLocationId,
|
||||
lastInspectionDate,
|
||||
nextInspectionDate,
|
||||
remark);
|
||||
|
||||
/// Create a copy of UpdateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$UpdateEquipmentRequestImplCopyWith<_$UpdateEquipmentRequestImpl>
|
||||
get copyWith => __$$UpdateEquipmentRequestImplCopyWithImpl<
|
||||
_$UpdateEquipmentRequestImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$UpdateEquipmentRequestImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _UpdateEquipmentRequest implements UpdateEquipmentRequest {
|
||||
const factory _UpdateEquipmentRequest(
|
||||
{final String? category1,
|
||||
final String? category2,
|
||||
final String? category3,
|
||||
final String? manufacturer,
|
||||
final String? modelName,
|
||||
final String? serialNumber,
|
||||
final String? barcode,
|
||||
final DateTime? purchaseDate,
|
||||
final double? purchasePrice,
|
||||
final String? status,
|
||||
final int? currentCompanyId,
|
||||
final int? currentBranchId,
|
||||
final int? warehouseLocationId,
|
||||
final DateTime? lastInspectionDate,
|
||||
final DateTime? nextInspectionDate,
|
||||
final String? remark}) = _$UpdateEquipmentRequestImpl;
|
||||
|
||||
factory _UpdateEquipmentRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$UpdateEquipmentRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
String? get category1;
|
||||
@override
|
||||
String? get category2;
|
||||
@override
|
||||
String? get category3;
|
||||
@override
|
||||
String? get manufacturer;
|
||||
@override
|
||||
String? get modelName;
|
||||
@override
|
||||
String? get serialNumber;
|
||||
@override
|
||||
String? get barcode;
|
||||
@override
|
||||
DateTime? get purchaseDate;
|
||||
@override
|
||||
double? get purchasePrice;
|
||||
@override
|
||||
String? get status;
|
||||
@override
|
||||
int? get currentCompanyId;
|
||||
@override
|
||||
int? get currentBranchId;
|
||||
@override
|
||||
int? get warehouseLocationId;
|
||||
@override
|
||||
DateTime? get lastInspectionDate;
|
||||
@override
|
||||
DateTime? get nextInspectionDate;
|
||||
@override
|
||||
String? get remark;
|
||||
|
||||
/// Create a copy of UpdateEquipmentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$UpdateEquipmentRequestImplCopyWith<_$UpdateEquipmentRequestImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
87
lib/data/models/equipment/equipment_request.g.dart
Normal file
87
lib/data/models/equipment/equipment_request.g.dart
Normal file
@@ -0,0 +1,87 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'equipment_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$CreateEquipmentRequestImpl _$$CreateEquipmentRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CreateEquipmentRequestImpl(
|
||||
equipmentNumber: json['equipmentNumber'] as String,
|
||||
category1: json['category1'] as String?,
|
||||
category2: json['category2'] as String?,
|
||||
category3: json['category3'] as String?,
|
||||
manufacturer: json['manufacturer'] as String,
|
||||
modelName: json['modelName'] as String?,
|
||||
serialNumber: json['serialNumber'] as String?,
|
||||
purchaseDate: json['purchaseDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchaseDate'] as String),
|
||||
purchasePrice: (json['purchasePrice'] as num?)?.toDouble(),
|
||||
remark: json['remark'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CreateEquipmentRequestImplToJson(
|
||||
_$CreateEquipmentRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'equipmentNumber': instance.equipmentNumber,
|
||||
'category1': instance.category1,
|
||||
'category2': instance.category2,
|
||||
'category3': instance.category3,
|
||||
'manufacturer': instance.manufacturer,
|
||||
'modelName': instance.modelName,
|
||||
'serialNumber': instance.serialNumber,
|
||||
'purchaseDate': instance.purchaseDate?.toIso8601String(),
|
||||
'purchasePrice': instance.purchasePrice,
|
||||
'remark': instance.remark,
|
||||
};
|
||||
|
||||
_$UpdateEquipmentRequestImpl _$$UpdateEquipmentRequestImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$UpdateEquipmentRequestImpl(
|
||||
category1: json['category1'] as String?,
|
||||
category2: json['category2'] as String?,
|
||||
category3: json['category3'] as String?,
|
||||
manufacturer: json['manufacturer'] as String?,
|
||||
modelName: json['modelName'] as String?,
|
||||
serialNumber: json['serialNumber'] as String?,
|
||||
barcode: json['barcode'] as String?,
|
||||
purchaseDate: json['purchaseDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchaseDate'] as String),
|
||||
purchasePrice: (json['purchasePrice'] as num?)?.toDouble(),
|
||||
status: json['status'] as String?,
|
||||
currentCompanyId: (json['currentCompanyId'] as num?)?.toInt(),
|
||||
currentBranchId: (json['currentBranchId'] as num?)?.toInt(),
|
||||
warehouseLocationId: (json['warehouseLocationId'] as num?)?.toInt(),
|
||||
lastInspectionDate: json['lastInspectionDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['lastInspectionDate'] as String),
|
||||
nextInspectionDate: json['nextInspectionDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['nextInspectionDate'] as String),
|
||||
remark: json['remark'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$UpdateEquipmentRequestImplToJson(
|
||||
_$UpdateEquipmentRequestImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'category1': instance.category1,
|
||||
'category2': instance.category2,
|
||||
'category3': instance.category3,
|
||||
'manufacturer': instance.manufacturer,
|
||||
'modelName': instance.modelName,
|
||||
'serialNumber': instance.serialNumber,
|
||||
'barcode': instance.barcode,
|
||||
'purchaseDate': instance.purchaseDate?.toIso8601String(),
|
||||
'purchasePrice': instance.purchasePrice,
|
||||
'status': instance.status,
|
||||
'currentCompanyId': instance.currentCompanyId,
|
||||
'currentBranchId': instance.currentBranchId,
|
||||
'warehouseLocationId': instance.warehouseLocationId,
|
||||
'lastInspectionDate': instance.lastInspectionDate?.toIso8601String(),
|
||||
'nextInspectionDate': instance.nextInspectionDate?.toIso8601String(),
|
||||
'remark': instance.remark,
|
||||
};
|
||||
37
lib/data/models/equipment/equipment_response.dart
Normal file
37
lib/data/models/equipment/equipment_response.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'equipment_response.freezed.dart';
|
||||
part 'equipment_response.g.dart';
|
||||
|
||||
@freezed
|
||||
class EquipmentResponse with _$EquipmentResponse {
|
||||
const factory EquipmentResponse({
|
||||
required int id,
|
||||
required String equipmentNumber,
|
||||
String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
required String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
String? barcode,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
required String status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
DateTime? lastInspectionDate,
|
||||
DateTime? nextInspectionDate,
|
||||
String? remark,
|
||||
required DateTime createdAt,
|
||||
required DateTime updatedAt,
|
||||
// 추가 필드 (조인된 데이터)
|
||||
String? companyName,
|
||||
String? branchName,
|
||||
String? warehouseName,
|
||||
}) = _EquipmentResponse;
|
||||
|
||||
factory EquipmentResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$EquipmentResponseFromJson(json);
|
||||
}
|
||||
655
lib/data/models/equipment/equipment_response.freezed.dart
Normal file
655
lib/data/models/equipment/equipment_response.freezed.dart
Normal file
@@ -0,0 +1,655 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'equipment_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
EquipmentResponse _$EquipmentResponseFromJson(Map<String, dynamic> json) {
|
||||
return _EquipmentResponse.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$EquipmentResponse {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get equipmentNumber => throw _privateConstructorUsedError;
|
||||
String? get category1 => throw _privateConstructorUsedError;
|
||||
String? get category2 => throw _privateConstructorUsedError;
|
||||
String? get category3 => throw _privateConstructorUsedError;
|
||||
String get manufacturer => throw _privateConstructorUsedError;
|
||||
String? get modelName => throw _privateConstructorUsedError;
|
||||
String? get serialNumber => throw _privateConstructorUsedError;
|
||||
String? get barcode => throw _privateConstructorUsedError;
|
||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
String get status => throw _privateConstructorUsedError;
|
||||
int? get currentCompanyId => throw _privateConstructorUsedError;
|
||||
int? get currentBranchId => throw _privateConstructorUsedError;
|
||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
||||
DateTime? get lastInspectionDate => throw _privateConstructorUsedError;
|
||||
DateTime? get nextInspectionDate => throw _privateConstructorUsedError;
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
DateTime get updatedAt =>
|
||||
throw _privateConstructorUsedError; // 추가 필드 (조인된 데이터)
|
||||
String? get companyName => throw _privateConstructorUsedError;
|
||||
String? get branchName => throw _privateConstructorUsedError;
|
||||
String? get warehouseName => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this EquipmentResponse to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of EquipmentResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$EquipmentResponseCopyWith<EquipmentResponse> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $EquipmentResponseCopyWith<$Res> {
|
||||
factory $EquipmentResponseCopyWith(
|
||||
EquipmentResponse value, $Res Function(EquipmentResponse) then) =
|
||||
_$EquipmentResponseCopyWithImpl<$Res, EquipmentResponse>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String equipmentNumber,
|
||||
String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
String? barcode,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
String status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
DateTime? lastInspectionDate,
|
||||
DateTime? nextInspectionDate,
|
||||
String? remark,
|
||||
DateTime createdAt,
|
||||
DateTime updatedAt,
|
||||
String? companyName,
|
||||
String? branchName,
|
||||
String? warehouseName});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
|
||||
implements $EquipmentResponseCopyWith<$Res> {
|
||||
_$EquipmentResponseCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of EquipmentResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? equipmentNumber = null,
|
||||
Object? category1 = freezed,
|
||||
Object? category2 = freezed,
|
||||
Object? category3 = freezed,
|
||||
Object? manufacturer = null,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? barcode = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? status = null,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
Object? remark = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? companyName = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentNumber: null == equipmentNumber
|
||||
? _value.equipmentNumber
|
||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
category1: freezed == category1
|
||||
? _value.category1
|
||||
: category1 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category2: freezed == category2
|
||||
? _value.category2
|
||||
: category2 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category3: freezed == category3
|
||||
? _value.category3
|
||||
: category3 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
manufacturer: null == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
serialNumber: freezed == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
barcode: freezed == barcode
|
||||
? _value.barcode
|
||||
: barcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
status: null == status
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
lastInspectionDate: freezed == lastInspectionDate
|
||||
? _value.lastInspectionDate
|
||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
nextInspectionDate: freezed == nextInspectionDate
|
||||
? _value.nextInspectionDate
|
||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
branchName: freezed == branchName
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$EquipmentResponseImplCopyWith<$Res>
|
||||
implements $EquipmentResponseCopyWith<$Res> {
|
||||
factory _$$EquipmentResponseImplCopyWith(_$EquipmentResponseImpl value,
|
||||
$Res Function(_$EquipmentResponseImpl) then) =
|
||||
__$$EquipmentResponseImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String equipmentNumber,
|
||||
String? category1,
|
||||
String? category2,
|
||||
String? category3,
|
||||
String manufacturer,
|
||||
String? modelName,
|
||||
String? serialNumber,
|
||||
String? barcode,
|
||||
DateTime? purchaseDate,
|
||||
double? purchasePrice,
|
||||
String status,
|
||||
int? currentCompanyId,
|
||||
int? currentBranchId,
|
||||
int? warehouseLocationId,
|
||||
DateTime? lastInspectionDate,
|
||||
DateTime? nextInspectionDate,
|
||||
String? remark,
|
||||
DateTime createdAt,
|
||||
DateTime updatedAt,
|
||||
String? companyName,
|
||||
String? branchName,
|
||||
String? warehouseName});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$EquipmentResponseImplCopyWithImpl<$Res>
|
||||
extends _$EquipmentResponseCopyWithImpl<$Res, _$EquipmentResponseImpl>
|
||||
implements _$$EquipmentResponseImplCopyWith<$Res> {
|
||||
__$$EquipmentResponseImplCopyWithImpl(_$EquipmentResponseImpl _value,
|
||||
$Res Function(_$EquipmentResponseImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of EquipmentResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? equipmentNumber = null,
|
||||
Object? category1 = freezed,
|
||||
Object? category2 = freezed,
|
||||
Object? category3 = freezed,
|
||||
Object? manufacturer = null,
|
||||
Object? modelName = freezed,
|
||||
Object? serialNumber = freezed,
|
||||
Object? barcode = freezed,
|
||||
Object? purchaseDate = freezed,
|
||||
Object? purchasePrice = freezed,
|
||||
Object? status = null,
|
||||
Object? currentCompanyId = freezed,
|
||||
Object? currentBranchId = freezed,
|
||||
Object? warehouseLocationId = freezed,
|
||||
Object? lastInspectionDate = freezed,
|
||||
Object? nextInspectionDate = freezed,
|
||||
Object? remark = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? companyName = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? warehouseName = freezed,
|
||||
}) {
|
||||
return _then(_$EquipmentResponseImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
equipmentNumber: null == equipmentNumber
|
||||
? _value.equipmentNumber
|
||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
category1: freezed == category1
|
||||
? _value.category1
|
||||
: category1 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category2: freezed == category2
|
||||
? _value.category2
|
||||
: category2 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
category3: freezed == category3
|
||||
? _value.category3
|
||||
: category3 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
manufacturer: null == manufacturer
|
||||
? _value.manufacturer
|
||||
: manufacturer // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
modelName: freezed == modelName
|
||||
? _value.modelName
|
||||
: modelName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
serialNumber: freezed == serialNumber
|
||||
? _value.serialNumber
|
||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
barcode: freezed == barcode
|
||||
? _value.barcode
|
||||
: barcode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
purchaseDate: freezed == purchaseDate
|
||||
? _value.purchaseDate
|
||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
purchasePrice: freezed == purchasePrice
|
||||
? _value.purchasePrice
|
||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
status: null == status
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
currentCompanyId: freezed == currentCompanyId
|
||||
? _value.currentCompanyId
|
||||
: currentCompanyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
currentBranchId: freezed == currentBranchId
|
||||
? _value.currentBranchId
|
||||
: currentBranchId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
warehouseLocationId: freezed == warehouseLocationId
|
||||
? _value.warehouseLocationId
|
||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
lastInspectionDate: freezed == lastInspectionDate
|
||||
? _value.lastInspectionDate
|
||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
nextInspectionDate: freezed == nextInspectionDate
|
||||
? _value.nextInspectionDate
|
||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
branchName: freezed == branchName
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
warehouseName: freezed == warehouseName
|
||||
? _value.warehouseName
|
||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$EquipmentResponseImpl implements _EquipmentResponse {
|
||||
const _$EquipmentResponseImpl(
|
||||
{required this.id,
|
||||
required this.equipmentNumber,
|
||||
this.category1,
|
||||
this.category2,
|
||||
this.category3,
|
||||
required this.manufacturer,
|
||||
this.modelName,
|
||||
this.serialNumber,
|
||||
this.barcode,
|
||||
this.purchaseDate,
|
||||
this.purchasePrice,
|
||||
required this.status,
|
||||
this.currentCompanyId,
|
||||
this.currentBranchId,
|
||||
this.warehouseLocationId,
|
||||
this.lastInspectionDate,
|
||||
this.nextInspectionDate,
|
||||
this.remark,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
this.companyName,
|
||||
this.branchName,
|
||||
this.warehouseName});
|
||||
|
||||
factory _$EquipmentResponseImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$EquipmentResponseImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String equipmentNumber;
|
||||
@override
|
||||
final String? category1;
|
||||
@override
|
||||
final String? category2;
|
||||
@override
|
||||
final String? category3;
|
||||
@override
|
||||
final String manufacturer;
|
||||
@override
|
||||
final String? modelName;
|
||||
@override
|
||||
final String? serialNumber;
|
||||
@override
|
||||
final String? barcode;
|
||||
@override
|
||||
final DateTime? purchaseDate;
|
||||
@override
|
||||
final double? purchasePrice;
|
||||
@override
|
||||
final String status;
|
||||
@override
|
||||
final int? currentCompanyId;
|
||||
@override
|
||||
final int? currentBranchId;
|
||||
@override
|
||||
final int? warehouseLocationId;
|
||||
@override
|
||||
final DateTime? lastInspectionDate;
|
||||
@override
|
||||
final DateTime? nextInspectionDate;
|
||||
@override
|
||||
final String? remark;
|
||||
@override
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
final DateTime updatedAt;
|
||||
// 추가 필드 (조인된 데이터)
|
||||
@override
|
||||
final String? companyName;
|
||||
@override
|
||||
final String? branchName;
|
||||
@override
|
||||
final String? warehouseName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'EquipmentResponse(id: $id, equipmentNumber: $equipmentNumber, category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, currentCompanyId: $currentCompanyId, currentBranchId: $currentBranchId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark, createdAt: $createdAt, updatedAt: $updatedAt, companyName: $companyName, branchName: $branchName, warehouseName: $warehouseName)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$EquipmentResponseImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.equipmentNumber, equipmentNumber) ||
|
||||
other.equipmentNumber == equipmentNumber) &&
|
||||
(identical(other.category1, category1) ||
|
||||
other.category1 == category1) &&
|
||||
(identical(other.category2, category2) ||
|
||||
other.category2 == category2) &&
|
||||
(identical(other.category3, category3) ||
|
||||
other.category3 == category3) &&
|
||||
(identical(other.manufacturer, manufacturer) ||
|
||||
other.manufacturer == manufacturer) &&
|
||||
(identical(other.modelName, modelName) ||
|
||||
other.modelName == modelName) &&
|
||||
(identical(other.serialNumber, serialNumber) ||
|
||||
other.serialNumber == serialNumber) &&
|
||||
(identical(other.barcode, barcode) || other.barcode == barcode) &&
|
||||
(identical(other.purchaseDate, purchaseDate) ||
|
||||
other.purchaseDate == purchaseDate) &&
|
||||
(identical(other.purchasePrice, purchasePrice) ||
|
||||
other.purchasePrice == purchasePrice) &&
|
||||
(identical(other.status, status) || other.status == status) &&
|
||||
(identical(other.currentCompanyId, currentCompanyId) ||
|
||||
other.currentCompanyId == currentCompanyId) &&
|
||||
(identical(other.currentBranchId, currentBranchId) ||
|
||||
other.currentBranchId == currentBranchId) &&
|
||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
||||
other.warehouseLocationId == warehouseLocationId) &&
|
||||
(identical(other.lastInspectionDate, lastInspectionDate) ||
|
||||
other.lastInspectionDate == lastInspectionDate) &&
|
||||
(identical(other.nextInspectionDate, nextInspectionDate) ||
|
||||
other.nextInspectionDate == nextInspectionDate) &&
|
||||
(identical(other.remark, remark) || other.remark == remark) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.branchName, branchName) ||
|
||||
other.branchName == branchName) &&
|
||||
(identical(other.warehouseName, warehouseName) ||
|
||||
other.warehouseName == warehouseName));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([
|
||||
runtimeType,
|
||||
id,
|
||||
equipmentNumber,
|
||||
category1,
|
||||
category2,
|
||||
category3,
|
||||
manufacturer,
|
||||
modelName,
|
||||
serialNumber,
|
||||
barcode,
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
status,
|
||||
currentCompanyId,
|
||||
currentBranchId,
|
||||
warehouseLocationId,
|
||||
lastInspectionDate,
|
||||
nextInspectionDate,
|
||||
remark,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
companyName,
|
||||
branchName,
|
||||
warehouseName
|
||||
]);
|
||||
|
||||
/// Create a copy of EquipmentResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$EquipmentResponseImplCopyWith<_$EquipmentResponseImpl> get copyWith =>
|
||||
__$$EquipmentResponseImplCopyWithImpl<_$EquipmentResponseImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$EquipmentResponseImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _EquipmentResponse implements EquipmentResponse {
|
||||
const factory _EquipmentResponse(
|
||||
{required final int id,
|
||||
required final String equipmentNumber,
|
||||
final String? category1,
|
||||
final String? category2,
|
||||
final String? category3,
|
||||
required final String manufacturer,
|
||||
final String? modelName,
|
||||
final String? serialNumber,
|
||||
final String? barcode,
|
||||
final DateTime? purchaseDate,
|
||||
final double? purchasePrice,
|
||||
required final String status,
|
||||
final int? currentCompanyId,
|
||||
final int? currentBranchId,
|
||||
final int? warehouseLocationId,
|
||||
final DateTime? lastInspectionDate,
|
||||
final DateTime? nextInspectionDate,
|
||||
final String? remark,
|
||||
required final DateTime createdAt,
|
||||
required final DateTime updatedAt,
|
||||
final String? companyName,
|
||||
final String? branchName,
|
||||
final String? warehouseName}) = _$EquipmentResponseImpl;
|
||||
|
||||
factory _EquipmentResponse.fromJson(Map<String, dynamic> json) =
|
||||
_$EquipmentResponseImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get equipmentNumber;
|
||||
@override
|
||||
String? get category1;
|
||||
@override
|
||||
String? get category2;
|
||||
@override
|
||||
String? get category3;
|
||||
@override
|
||||
String get manufacturer;
|
||||
@override
|
||||
String? get modelName;
|
||||
@override
|
||||
String? get serialNumber;
|
||||
@override
|
||||
String? get barcode;
|
||||
@override
|
||||
DateTime? get purchaseDate;
|
||||
@override
|
||||
double? get purchasePrice;
|
||||
@override
|
||||
String get status;
|
||||
@override
|
||||
int? get currentCompanyId;
|
||||
@override
|
||||
int? get currentBranchId;
|
||||
@override
|
||||
int? get warehouseLocationId;
|
||||
@override
|
||||
DateTime? get lastInspectionDate;
|
||||
@override
|
||||
DateTime? get nextInspectionDate;
|
||||
@override
|
||||
String? get remark;
|
||||
@override
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
DateTime get updatedAt; // 추가 필드 (조인된 데이터)
|
||||
@override
|
||||
String? get companyName;
|
||||
@override
|
||||
String? get branchName;
|
||||
@override
|
||||
String? get warehouseName;
|
||||
|
||||
/// Create a copy of EquipmentResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$EquipmentResponseImplCopyWith<_$EquipmentResponseImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
69
lib/data/models/equipment/equipment_response.g.dart
Normal file
69
lib/data/models/equipment/equipment_response.g.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'equipment_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$EquipmentResponseImpl _$$EquipmentResponseImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$EquipmentResponseImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
equipmentNumber: json['equipmentNumber'] as String,
|
||||
category1: json['category1'] as String?,
|
||||
category2: json['category2'] as String?,
|
||||
category3: json['category3'] as String?,
|
||||
manufacturer: json['manufacturer'] as String,
|
||||
modelName: json['modelName'] as String?,
|
||||
serialNumber: json['serialNumber'] as String?,
|
||||
barcode: json['barcode'] as String?,
|
||||
purchaseDate: json['purchaseDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchaseDate'] as String),
|
||||
purchasePrice: (json['purchasePrice'] as num?)?.toDouble(),
|
||||
status: json['status'] as String,
|
||||
currentCompanyId: (json['currentCompanyId'] as num?)?.toInt(),
|
||||
currentBranchId: (json['currentBranchId'] as num?)?.toInt(),
|
||||
warehouseLocationId: (json['warehouseLocationId'] as num?)?.toInt(),
|
||||
lastInspectionDate: json['lastInspectionDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['lastInspectionDate'] as String),
|
||||
nextInspectionDate: json['nextInspectionDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['nextInspectionDate'] as String),
|
||||
remark: json['remark'] as String?,
|
||||
createdAt: DateTime.parse(json['createdAt'] as String),
|
||||
updatedAt: DateTime.parse(json['updatedAt'] as String),
|
||||
companyName: json['companyName'] as String?,
|
||||
branchName: json['branchName'] as String?,
|
||||
warehouseName: json['warehouseName'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$EquipmentResponseImplToJson(
|
||||
_$EquipmentResponseImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'equipmentNumber': instance.equipmentNumber,
|
||||
'category1': instance.category1,
|
||||
'category2': instance.category2,
|
||||
'category3': instance.category3,
|
||||
'manufacturer': instance.manufacturer,
|
||||
'modelName': instance.modelName,
|
||||
'serialNumber': instance.serialNumber,
|
||||
'barcode': instance.barcode,
|
||||
'purchaseDate': instance.purchaseDate?.toIso8601String(),
|
||||
'purchasePrice': instance.purchasePrice,
|
||||
'status': instance.status,
|
||||
'currentCompanyId': instance.currentCompanyId,
|
||||
'currentBranchId': instance.currentBranchId,
|
||||
'warehouseLocationId': instance.warehouseLocationId,
|
||||
'lastInspectionDate': instance.lastInspectionDate?.toIso8601String(),
|
||||
'nextInspectionDate': instance.nextInspectionDate?.toIso8601String(),
|
||||
'remark': instance.remark,
|
||||
'createdAt': instance.createdAt.toIso8601String(),
|
||||
'updatedAt': instance.updatedAt.toIso8601String(),
|
||||
'companyName': instance.companyName,
|
||||
'branchName': instance.branchName,
|
||||
'warehouseName': instance.warehouseName,
|
||||
};
|
||||
Reference in New Issue
Block a user