상품·주문·수동 결제 승인·권리·청구·축소·해지·AI Wallet 표시·사용량 배정 화면·경고 엔진 (§6·§13·§27)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
zzabisagent-lab
2026-10-26 11:26:35 +00:00
co-authored by Claude Fable 5.1
parent c90ac27596
commit c397452acd
21 changed files with 1147 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
/**
* portal/commerce/seed.mjs — 출시 검증용 Catalog 시드 명령.
* node portal/commerce/seed.mjs [catalog 파일] (DB 위치는 ARIWEB_PORTAL_DATA 또는 ./data)
* 같은 (product_id, version) 이 있으면 건너뛴다. 검증 실패면 아무것도 넣지 않고 종료 코드 1.
*/
import { openDb } from '../../lib/db.mjs';
import { allMigrations } from '../schema.mjs';
import { loadConfig } from '../config.mjs';
import { seedCatalog, loadCatalogFile, CATALOG_FILE } from './catalog.mjs';
import { join } from 'node:path';
const cfg = loadConfig();
const store = openDb(join(cfg.dataDir, 'portal.sqlite'), await allMigrations());
const file = process.argv[2] || CATALOG_FILE;
const r = seedCatalog(store, loadCatalogFile(file), 'seed-cli');
if (r.problems.length) { console.error('Catalog 검증 실패:\n - ' + r.problems.join('\n - ')); process.exit(1); }
console.log(`Catalog 시드 완료(${file}): 추가 ${r.inserted} · 이미 있음 ${r.skipped}`);