chore: 통합 테스트 환경과 보고서 리모트 구성
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
/// 보고서 다운로드 요청 결과 모델.
|
||||
class ReportDownloadResult {
|
||||
const ReportDownloadResult({
|
||||
this.downloadUrl,
|
||||
this.filename,
|
||||
this.mimeType,
|
||||
this.bytes,
|
||||
this.expiresAt,
|
||||
});
|
||||
|
||||
/// 사전 서명된 다운로드 URL.
|
||||
final Uri? downloadUrl;
|
||||
|
||||
/// 서버가 제안한 파일명.
|
||||
final String? filename;
|
||||
|
||||
/// 응답 콘텐츠 타입.
|
||||
final String? mimeType;
|
||||
|
||||
/// 서버가 직접 전송한 파일 데이터(옵션).
|
||||
final Uint8List? bytes;
|
||||
|
||||
/// 다운로드 링크 또는 토큰의 만료 시각.
|
||||
final DateTime? expiresAt;
|
||||
|
||||
/// URL 기반 다운로드가 가능한지 여부.
|
||||
bool get hasDownloadUrl => downloadUrl != null;
|
||||
|
||||
/// 바이너리 데이터가 포함되어 있는지 여부.
|
||||
bool get hasBytes => bytes != null && bytes!.isNotEmpty;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/// 보고서 내보내기 파일 형식.
|
||||
enum ReportExportFormat { xlsx, pdf }
|
||||
|
||||
extension ReportExportFormatX on ReportExportFormat {
|
||||
/// API 요청에 전달되는 문자열 포맷.
|
||||
String get apiValue => switch (this) {
|
||||
ReportExportFormat.xlsx => 'xlsx',
|
||||
ReportExportFormat.pdf => 'pdf',
|
||||
};
|
||||
|
||||
/// 사용자에게 노출되는 레이블.
|
||||
String get label => switch (this) {
|
||||
ReportExportFormat.xlsx => 'XLSX',
|
||||
ReportExportFormat.pdf => 'PDF',
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import 'package:superport_v2/features/reporting/domain/entities/report_export_format.dart';
|
||||
|
||||
/// 보고서 내보내기 요청을 표현하는 모델.
|
||||
class ReportExportRequest {
|
||||
const ReportExportRequest({
|
||||
required this.from,
|
||||
required this.to,
|
||||
required this.format,
|
||||
this.transactionTypeId,
|
||||
this.statusId,
|
||||
this.warehouseId,
|
||||
});
|
||||
|
||||
/// 조회 시작 일자.
|
||||
final DateTime from;
|
||||
|
||||
/// 조회 종료 일자.
|
||||
final DateTime to;
|
||||
|
||||
/// 내보내기 파일 형식.
|
||||
final ReportExportFormat format;
|
||||
|
||||
/// 재고 트랜잭션 유형 식별자.
|
||||
final int? transactionTypeId;
|
||||
|
||||
/// 결재 상태 식별자.
|
||||
final int? statusId;
|
||||
|
||||
/// 창고 식별자.
|
||||
final int? warehouseId;
|
||||
}
|
||||
Reference in New Issue
Block a user