환경 초기화 및 벤더 리포지토리 스켈레톤 도입

This commit is contained in:
JiWoong Sul
2025-09-22 17:38:51 +09:00
commit 5c9de2594a
171 changed files with 13304 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
/// 벤더(제조사) 도메인 엔티티
///
/// - SRP: 벤더의 속성 표현만 담당
/// - data/presentation 레이어에 의존하지 않음
class Vendor {
Vendor({
this.id,
required this.vendorCode,
required this.vendorName,
this.isActive = true,
this.isDeleted = false,
this.note,
this.createdAt,
this.updatedAt,
});
/// PK (DB bigint), 신규 생성 시 null
final int? id;
/// 벤더코드 (부분유니크: is_deleted=false)
final String vendorCode;
/// 벤더명
final String vendorName;
/// 사용 여부
final bool isActive;
/// 소프트 삭제 여부
final bool isDeleted;
/// 비고
final String? note;
/// 생성/변경 일시 (선택)
final DateTime? createdAt;
final DateTime? updatedAt;
Vendor copyWith({
int? id,
String? vendorCode,
String? vendorName,
bool? isActive,
bool? isDeleted,
String? note,
DateTime? createdAt,
DateTime? updatedAt,
}) {
return Vendor(
id: id ?? this.id,
vendorCode: vendorCode ?? this.vendorCode,
vendorName: vendorName ?? this.vendorName,
isActive: isActive ?? this.isActive,
isDeleted: isDeleted ?? this.isDeleted,
note: note ?? this.note,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
);
}
}

View File

@@ -0,0 +1,27 @@
import '../entities/vendor.dart';
/// 벤더 리포지토리 인터페이스
///
/// - presentation → domain → data 방향을 보장하기 위해 domain에 위치
/// - 실제 구현은 data 레이어에서 제공한다.
abstract class VendorRepository {
/// 벤더 목록 조회
///
/// - 표준 쿼리 파라미터: page, page_size, q, include
Future<List<Vendor>> list({
int page = 1,
int pageSize = 20,
String? query,
bool includeInactive = true,
});
/// 벤더 생성
Future<Vendor> create(Vendor vendor);
/// 벤더 수정 (부분 업데이트 포함)
Future<Vendor> update(Vendor vendor);
/// 벤더 소프트 삭제
Future<void> delete(int id);
}