- numbering_rules 테이블: JSON 패턴 기반 채번 규칙 저장 (tenant별)
- numbering_sequences 테이블: MySQL UPSERT 기반 atomic 시퀀스 관리
- NumberingService: generate/preview/nextSequence 핵심 서비스
- QuoteNumberService: NumberingService 우선, 폴백 QT{YYYYMMDD}{NNNN}
- OrderService: NumberingService 우선 (pair_code 지원), 폴백 ORD{YYYYMMDD}{NNNN}
- StoreOrderRequest: pair_code 필드 추가
- NumberingRuleSeeder: tenant_id=287 견적(KD-PR)/수주(KD-{pairCode}) 규칙
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
542 B
PHP
29 lines
542 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\BelongsToTenant;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class NumberingRule extends Model
|
|
{
|
|
use BelongsToTenant;
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'document_type',
|
|
'rule_name',
|
|
'pattern',
|
|
'reset_period',
|
|
'sequence_padding',
|
|
'is_active',
|
|
'created_by',
|
|
'updated_by',
|
|
];
|
|
|
|
protected $casts = [
|
|
'pattern' => 'array',
|
|
'is_active' => 'boolean',
|
|
'sequence_padding' => 'integer',
|
|
];
|
|
} |