fix: seed IT customer qualifications

This commit is contained in:
2026-08-14 09:46:50 +08:00
parent db80701534
commit 0bc752a2be
3 changed files with 41 additions and 0 deletions
@@ -3,6 +3,7 @@ import { readFileSync } from 'node:fs'
import test from 'node:test'
const sql = readFileSync(new URL('../../deploy/sql/头程数据库统一增量-MySQL8.sql', import.meta.url), 'utf8')
const iamSeed = readFileSync(new URL('../../iam/src/main/resources/db/phase1-admin-rbac.sql', import.meta.url), 'utf8')
test('统一初始化 SQL 保留最小登录与客户主体', () => {
assert.match(sql, /一个平台系统管理员和一个 IT 测试客户管理员/)
@@ -11,6 +12,14 @@ test('统一初始化 SQL 保留最小登录与客户主体', () => {
assert.match(sql, /\(10001, 'IT_TEST', 'IT 测试客户'/)
})
test('IT 测试客户初始化后具备已审核的必填资质和下单资格', () => {
for (const source of [sql, iamSeed]) {
assert.match(source, /\(2100001, 10001, 'BUSINESS_LICENSE', '91310000ITTEST0001', NULL,[\s\S]*?'APPROVED'/)
assert.match(source, /\(2100002, 10001, 'LEGAL_PERSON_ID', NULL, NULL,[\s\S]*?'APPROVED'/)
assert.match(source, /status = 'APPROVED'/)
}
})
test('统一初始化 SQL 提供人工验收所需公共仓储主数据', () => {
for (const marker of [
"'TP-001'", "'TP-002'", "'A1 普通库位'", "'A0 共享溢出位'",