feat: 매입유형(purchase_type) 필드 추가

- 마이그레이션: purchases 테이블에 purchase_type 컬럼 추가
- Purchase 모델: $fillable 및 PURCHASE_TYPES 상수 추가
- StorePurchaseRequest: purchase_type validation 추가
- UpdatePurchaseRequest: purchase_type validation 추가
- PurchaseService: store/update에 purchase_type 처리 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-27 16:47:26 +09:00
parent cdec2519d9
commit 71a33d79cc
5 changed files with 57 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ public function store(array $data): Purchase
$purchase->supply_amount = $data['supply_amount'];
$purchase->tax_amount = $data['tax_amount'];
$purchase->total_amount = $data['total_amount'];
$purchase->purchase_type = $data['purchase_type'] ?? null;
$purchase->description = $data['description'] ?? null;
$purchase->status = 'draft';
$purchase->withdrawal_id = $data['withdrawal_id'] ?? null;
@@ -147,6 +148,9 @@ public function update(int $id, array $data): Purchase
if (array_key_exists('withdrawal_id', $data)) {
$purchase->withdrawal_id = $data['withdrawal_id'];
}
if (array_key_exists('purchase_type', $data)) {
$purchase->purchase_type = $data['purchase_type'];
}
if (array_key_exists('tax_invoice_received', $data)) {
$purchase->tax_invoice_received = $data['tax_invoice_received'];
}