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:
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';
|
||||
}
|
||||
Reference in New Issue
Block a user