API v4 계약 반영하고 보고서·입출고 화면 실연동 강화
This commit is contained in:
@@ -11,6 +11,7 @@ class StockTransactionCreateInput {
|
||||
this.expectedReturnDate,
|
||||
this.lines = const [],
|
||||
this.customers = const [],
|
||||
this.approval,
|
||||
});
|
||||
|
||||
final String? transactionNo;
|
||||
@@ -23,6 +24,7 @@ class StockTransactionCreateInput {
|
||||
final DateTime? expectedReturnDate;
|
||||
final List<TransactionLineCreateInput> lines;
|
||||
final List<TransactionCustomerCreateInput> customers;
|
||||
final StockTransactionApprovalInput? approval;
|
||||
|
||||
Map<String, dynamic> toPayload() {
|
||||
return {
|
||||
@@ -42,6 +44,7 @@ class StockTransactionCreateInput {
|
||||
'customers': customers
|
||||
.map((customer) => customer.toJson())
|
||||
.toList(growable: false),
|
||||
if (approval != null) 'approval': approval!.toJson(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -200,3 +203,27 @@ class StockTransactionListFilter {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// 재고 트랜잭션 생성 시 결재(Approval) 정보를 담는 입력 모델.
|
||||
class StockTransactionApprovalInput {
|
||||
StockTransactionApprovalInput({
|
||||
required this.approvalNo,
|
||||
required this.requestedById,
|
||||
this.approvalStatusId,
|
||||
this.note,
|
||||
});
|
||||
|
||||
final String approvalNo;
|
||||
final int requestedById;
|
||||
final int? approvalStatusId;
|
||||
final String? note;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'approval_no': approvalNo,
|
||||
if (approvalStatusId != null) 'approval_status_id': approvalStatusId,
|
||||
'requested_by_id': requestedById,
|
||||
if (note != null && note!.trim().isNotEmpty) 'note': note,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ abstract class StockTransactionRepository {
|
||||
/// 재고 트랜잭션 라인 저장소 인터페이스.
|
||||
abstract class TransactionLineRepository {
|
||||
/// 라인을 추가한다.
|
||||
Future<List<StockTransactionLine>> addLines(
|
||||
Future<void> addLines(
|
||||
int transactionId,
|
||||
List<TransactionLineCreateInput> lines,
|
||||
);
|
||||
|
||||
/// 라인 정보를 일괄 수정한다.
|
||||
Future<List<StockTransactionLine>> updateLines(
|
||||
Future<void> updateLines(
|
||||
int transactionId,
|
||||
List<TransactionLineUpdateInput> lines,
|
||||
);
|
||||
@@ -62,19 +62,19 @@ abstract class TransactionLineRepository {
|
||||
Future<void> deleteLine(int lineId);
|
||||
|
||||
/// 삭제된 라인을 복구한다.
|
||||
Future<StockTransactionLine> restoreLine(int lineId);
|
||||
Future<void> restoreLine(int lineId);
|
||||
}
|
||||
|
||||
/// 재고 트랜잭션 고객 연결 저장소 인터페이스.
|
||||
abstract class TransactionCustomerRepository {
|
||||
/// 고객 연결을 추가한다.
|
||||
Future<List<StockTransactionCustomer>> addCustomers(
|
||||
Future<void> addCustomers(
|
||||
int transactionId,
|
||||
List<TransactionCustomerCreateInput> customers,
|
||||
);
|
||||
|
||||
/// 고객 연결 정보를 수정한다.
|
||||
Future<List<StockTransactionCustomer>> updateCustomers(
|
||||
Future<void> updateCustomers(
|
||||
int transactionId,
|
||||
List<TransactionCustomerUpdateInput> customers,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user