feat: V/R 유지보수 시스템 전환 및 대시보드 테이블 형태 완성
- V/R 시스템 완전 전환: WARRANTY/CONTRACT/INSPECTION → V(방문)/R(원격) - 유지보수 대시보드 카드 → StandardDataTable 테이블 형태 전환 - "조회중..." 문제 해결: 백엔드 직접 필드 사용 (equipment_model, company_name) - MaintenanceDto 신규 필드 추가: company_id, company_name, equipment_serial, equipment_model - preloadEquipmentData 비활성화로 불필요한 equipment-history API 호출 제거 - CO-STAR 프레임워크 적용 및 CLAUDE.md v3.0 업데이트 - Flutter Analyze ERROR: 0 유지, 100% shadcn_ui 컴플라이언스 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ class MaintenanceDto with _$MaintenanceDto {
|
||||
@JsonKey(name: 'started_at') required DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') @Default(1) int periodMonth,
|
||||
@JsonKey(name: 'maintenance_type') @Default('WARRANTY') String maintenanceType, // WARRANTY|CONTRACT|INSPECTION
|
||||
@JsonKey(name: 'maintenance_type') @Default('V') String maintenanceType, // V: 방문, R: 원격
|
||||
@JsonKey(name: 'is_deleted') @Default(false) bool isDeleted,
|
||||
@JsonKey(name: 'registered_at') required DateTime registeredAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
@@ -22,6 +22,8 @@ class MaintenanceDto with _$MaintenanceDto {
|
||||
// 백엔드 추가 필드들 (계산된 값)
|
||||
@JsonKey(name: 'equipment_serial') String? equipmentSerial,
|
||||
@JsonKey(name: 'equipment_model') String? equipmentModel,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'days_remaining') int? daysRemaining,
|
||||
@JsonKey(name: 'is_expired') @Default(false) bool isExpired,
|
||||
|
||||
@@ -43,7 +45,7 @@ class MaintenanceRequestDto with _$MaintenanceRequestDto {
|
||||
@JsonKey(name: 'started_at') required DateTime startedAt,
|
||||
@JsonKey(name: 'ended_at') required DateTime endedAt,
|
||||
@JsonKey(name: 'period_month') @Default(1) int periodMonth,
|
||||
@JsonKey(name: 'maintenance_type') @Default('WARRANTY') String maintenanceType, // WARRANTY|CONTRACT|INSPECTION
|
||||
@JsonKey(name: 'maintenance_type') @Default('V') String maintenanceType, // V: 방문, R: 원격
|
||||
}) = _MaintenanceRequestDto;
|
||||
|
||||
factory MaintenanceRequestDto.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -93,30 +95,26 @@ class MaintenanceQueryDto with _$MaintenanceQueryDto {
|
||||
_$MaintenanceQueryDtoFromJson(json);
|
||||
}
|
||||
|
||||
// Maintenance Type 헬퍼 (백엔드와 일치)
|
||||
// Maintenance Type 헬퍼 (V/R 시스템)
|
||||
class MaintenanceType {
|
||||
static const String warranty = 'WARRANTY';
|
||||
static const String contract = 'CONTRACT';
|
||||
static const String inspection = 'INSPECTION';
|
||||
static const String visit = 'V'; // 방문 유지보수
|
||||
static const String remote = 'R'; // 원격 유지보수
|
||||
|
||||
static String getDisplayName(String type) {
|
||||
switch (type) {
|
||||
case warranty:
|
||||
return '무상 보증';
|
||||
case contract:
|
||||
return '유상 계약';
|
||||
case inspection:
|
||||
return '점검';
|
||||
case visit:
|
||||
return '방문';
|
||||
case remote:
|
||||
return '원격';
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
static List<String> get allTypes => [warranty, contract, inspection];
|
||||
static List<String> get allTypes => [visit, remote];
|
||||
|
||||
static List<Map<String, String>> get typeOptions => [
|
||||
{'value': warranty, 'label': '무상 보증'},
|
||||
{'value': contract, 'label': '유상 계약'},
|
||||
{'value': inspection, 'label': '점검'},
|
||||
{'value': visit, 'label': '방문'},
|
||||
{'value': remote, 'label': '원격'},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user