feat(consumable): 소모품 마스터에 "규격(spec)" 필드 추가

품목의 규격 정보(예: 4" 용접, M16)를 분리 저장할 수 있도록 spec 컬럼 추가.
DB ALTER 필요: ALTER TABLE consumable_items ADD COLUMN spec VARCHAR(200) DEFAULT NULL AFTER item_name;

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-16 13:34:43 +09:00
parent cc47d25851
commit 0a05bd8d76
10 changed files with 40 additions and 23 deletions

View File

@@ -6,7 +6,7 @@ const PurchaseModel = {
async getAll(filters = {}) {
const db = await getDb();
let sql = `
SELECT p.*, ci.item_name, ci.maker, ci.category, ci.unit, ci.photo_path,
SELECT p.*, ci.item_name, ci.spec, ci.maker, ci.category, ci.unit, ci.photo_path,
v.vendor_name, su.name AS purchaser_name
FROM purchases p
JOIN consumable_items ci ON p.item_id = ci.item_id
@@ -122,7 +122,7 @@ const PurchaseModel = {
// 소모품 목록 (구매신청용)
async getConsumableItems(activeOnly = true) {
const db = await getDb();
let sql = 'SELECT item_id, item_name, maker, category, base_price, unit, photo_path FROM consumable_items';
let sql = 'SELECT item_id, item_name, spec, maker, category, base_price, unit, photo_path FROM consumable_items';
if (activeOnly) sql += ' WHERE is_active = 1';
sql += ' ORDER BY category, item_name';
const [rows] = await db.query(sql);