refactor: 인벤토리 테이블 스펙과 도메인 계층 정비

This commit is contained in:
JiWoong Sul
2025-10-14 18:09:26 +09:00
parent 8d3b2c1e20
commit 1325109fba
32 changed files with 5550 additions and 290 deletions

View File

@@ -0,0 +1,82 @@
import 'package:superport_v2/widgets/components/responsive.dart';
/// 입고 테이블과 필터 구성에 사용되는 정적 스펙 모음.
class InboundTableSpec {
const InboundTableSpec._();
/// 목록 헤더 라벨.
static const List<String> headers = [
'번호',
'처리일자',
'창고',
'트랜잭션번호',
'제품',
'제조사',
'단위',
'수량',
'단가',
'상태',
'작성자',
'품목수',
'총수량',
'비고',
];
/// 기본 정렬에서 허용하는 페이지당 항목 수 옵션.
static const List<int> pageSizeOptions = [10, 20, 50];
/// API include 파라미터 기본값.
static const List<String> defaultIncludeOptions = ['lines'];
/// 백엔드에서 상태 목록을 내려주지 않을 때 사용되는 기본 상태 라벨.
static const List<String> fallbackStatusOptions = ['작성중', '승인대기', '승인완료'];
/// 입고 트랜잭션 타입을 식별하기 위한 키워드.
static const List<String> transactionTypeKeywords = ['입고', 'inbound'];
/// 검색 입력 필드 플레이스홀더.
static const String searchPlaceholder = '트랜잭션번호, 작성자, 제품 검색';
/// 창고 전체 선택 라벨.
static const String allWarehouseLabel = '전체 창고';
/// 상태 전체 선택 라벨.
static const String allStatusLabel = '전체 상태';
/// include 옵션이 선택되지 않았을 때 표시하는 기본 라벨.
static const String includeEmptyLabel = 'Include 없음';
/// 테이블 열 폭 계산을 위한 기준 값.
static const double columnSpanWidth = 140;
/// 테이블 행 높이 계산을 위한 기준 값.
static const double rowSpanHeight = 56;
/// 날짜 필터의 시작 범위.
static final DateTime dateRangeFirstDate = DateTime(2020);
/// 날짜 필터의 종료 범위.
static final DateTime dateRangeLastDate = DateTime(2030);
/// 반응형 브레이크포인트에 따른 가시 열 인덱스.
static List<int> visibleColumns(DeviceBreakpoint breakpoint) {
switch (breakpoint) {
case DeviceBreakpoint.desktop:
return List<int>.generate(headers.length, (index) => index);
case DeviceBreakpoint.tablet:
return const [0, 1, 2, 3, 4, 7, 8, 9, 10, 11, 12];
case DeviceBreakpoint.mobile:
return const [0, 1, 2, 9, 10];
}
}
/// include 파라미터별 사용자 노출 라벨.
static String includeLabel(String value) {
switch (value) {
case 'lines':
return '라인 포함';
default:
return value;
}
}
}