- 테이블 3개: bad_debts, bad_debt_documents, bad_debt_memos - 모델 3개: BadDebt, BadDebtDocument, BadDebtMemo - BadDebtService: CRUD, 요약 통계, 서류/메모 관리 - API 엔드포인트 11개 (목록, 등록, 상세, 수정, 삭제, 토글, 서류/메모 CRUD) - Swagger 문서 작성 완료
33 lines
598 B
PHP
33 lines
598 B
PHP
<?php
|
|
|
|
namespace App\Models\BadDebts;
|
|
|
|
use App\Models\Members\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class BadDebtMemo extends Model
|
|
{
|
|
protected $fillable = [
|
|
'bad_debt_id',
|
|
'content',
|
|
'created_by',
|
|
];
|
|
|
|
/**
|
|
* 악성채권 관계
|
|
*/
|
|
public function badDebt(): BelongsTo
|
|
{
|
|
return $this->belongsTo(BadDebt::class);
|
|
}
|
|
|
|
/**
|
|
* 작성자 관계
|
|
*/
|
|
public function creator(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
}
|