feat: [receiving] 입고 성적서 파일 연결 기능 추가

- receivings 테이블에 certificate_file_id 컬럼 추가 (마이그레이션)
- Receiving 모델에 certificateFile 관계 및 fillable/casts 추가
- Store/Update Request에 certificate_file_id 검증 규칙 추가
- ReceivingService index/show에 certificateFile eager loading 추가
- store/update 시 certificate_file_id 저장 처리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
유병철
2026-03-11 21:32:45 +09:00
parent 5828261dce
commit 2c9e5ae2da
5 changed files with 55 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ class Receiving extends Model
'status',
'remark',
'options',
'certificate_file_id',
'created_by',
'updated_by',
'deleted_by',
@@ -47,6 +48,7 @@ class Receiving extends Model
'receiving_qty' => 'decimal:2',
'item_id' => 'integer',
'options' => 'array',
'certificate_file_id' => 'integer',
];
/**
@@ -92,6 +94,14 @@ public function item(): BelongsTo
return $this->belongsTo(\App\Models\Items\Item::class);
}
/**
* 업체 제공 성적서 파일 관계
*/
public function certificateFile(): BelongsTo
{
return $this->belongsTo(\App\Models\Commons\File::class, 'certificate_file_id');
}
/**
* 생성자 관계
*/