feat: BP-MES Phase 1 - products/product_components 테이블 확장

- products 테이블에 33개 필드 추가
  - 공통: is_active, margin_rate, costs, safety_stock, lead_time, is_variable_size
  - FG 전용: product_category, lot_abbreviation, note
  - PT 전용: part_type, part_usage, installation_type, assembly_type,
    side_spec_width, side_spec_height, assembly_length,
    guide_rail_model_type, guide_rail_model
  - 절곡품: bending_diagram, bending_details, material, length, bending_length
  - 인증: certification_number, start/end_date, specification/certification files
  - 동적 확장: options (JSON)

- product_components 테이블에 5개 필드 추가
  - 수식 계산: quantity_formula
  - 조건부 BOM: condition
  - 절곡품: is_bending, bending_diagram, bending_details

- Product/ProductComponent 모델 fillable/casts 업데이트
- 인덱스 추가: is_active, product_category, part_type, part_usage, is_bending
This commit is contained in:
2025-11-14 09:07:33 +09:00
parent 287b39515b
commit d5bfb24ef9
5 changed files with 507 additions and 1 deletions

View File

@@ -19,6 +19,23 @@ class Product extends Model
'product_type', // 라벨/분류용
'attributes', 'description',
'is_sellable', 'is_purchasable', 'is_producible', 'is_active',
// BP-MES: 공통 필드
'margin_rate', 'processing_cost', 'labor_cost', 'install_cost',
'safety_stock', 'lead_time', 'is_variable_size',
// BP-MES: FG 전용
'product_category', 'lot_abbreviation', 'note',
// BP-MES: PT 전용
'part_type', 'part_usage', 'installation_type', 'assembly_type',
'side_spec_width', 'side_spec_height', 'assembly_length',
'guide_rail_model_type', 'guide_rail_model',
// BP-MES: 절곡품
'bending_diagram', 'bending_details', 'material', 'length', 'bending_length',
// BP-MES: 인증
'certification_number', 'certification_start_date', 'certification_end_date',
'specification_file', 'specification_file_name',
'certification_file', 'certification_file_name',
// BP-MES: 동적 확장
'options',
'created_by', 'updated_by',
];
@@ -28,6 +45,14 @@ class Product extends Model
'is_purchasable' => 'boolean',
'is_producible' => 'boolean',
'is_active' => 'boolean',
// BP-MES: 추가 boolean 필드
'is_variable_size' => 'boolean',
// BP-MES: JSON 필드
'bending_details' => 'array',
'options' => 'array',
// BP-MES: Date 필드
'certification_start_date' => 'date',
'certification_end_date' => 'date',
];
protected $hidden = [

View File

@@ -23,6 +23,13 @@ class ProductComponent extends Model
'ref_id',
'quantity',
'sort_order',
// BP-MES: 수식 계산 및 조건부 BOM
'quantity_formula',
'condition',
// BP-MES: 절곡품
'is_bending',
'bending_diagram',
'bending_details',
'created_by',
'updated_by',
];
@@ -32,6 +39,9 @@ class ProductComponent extends Model
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
// BP-MES: 추가 타입 캐스팅
'is_bending' => 'boolean',
'bending_details' => 'array',
];
protected $hidden = [