Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2571f6fe5b | |||
| b8b384ed67 |
@@ -113,8 +113,8 @@ WSL 已验证:EMQX `5.8.9`、MQTTX CLI `1.13.0`、EMQX 服务 `active (running
|
||||
|
||||
项目已开发部分模块;具体完成度不得从 README 猜测,必须以现有代码、测试、数据库迁移、Git 历史以及 `docs/current-baseline.md`、`docs/module-status.md`、`docs/feature-status.md` 为准。
|
||||
|
||||
- 最近工程提交:`e069c50 feat(M01-B): 增加迁移执行器与旧库只读兼容层`。
|
||||
- 下一工程目标:以 `docs/current-baseline.md` 的 `next_engineering_target` 为准,当前为 M01-B 一次性 MySQL 往返迁移验证与旧 DECIMAL 金额边界转换。
|
||||
- 最近工程提交:`b8b384e feat(M01-B): 严格转换旧库订单金额`。
|
||||
- 下一工程目标:以 `docs/current-baseline.md` 的 `next_engineering_target` 为准,当前为 M01-B 一次性 MySQL 8 往返迁移验证。
|
||||
- 开发纪律:普通“继续开发”必须产生工程文件变化、测试、commit 和 push;只改 Markdown 不计入模块进度。
|
||||
|
||||
## 版本递进
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"db:migrate:up": "npm run build && node dist/db/migrate-cli.js up",
|
||||
"db:migrate:verify": "npm run build && node dist/db/migrate-cli.js verify",
|
||||
"db:migrate:down": "npm run build && node dist/db/migrate-cli.js down",
|
||||
"test": "npm run build && node tests/backend-contract.test.mjs && node tests/migration-contract.test.mjs && node tests/mysql-pool-contract.test.mjs && node tests/migration-runner.test.mjs && node tests/legacy-read-repository.test.mjs"
|
||||
"test": "npm run build && node tests/backend-contract.test.mjs && node tests/migration-contract.test.mjs && node tests/mysql-pool-contract.test.mjs && node tests/migration-runner.test.mjs && node tests/legacy-money.test.mjs && node tests/legacy-read-repository.test.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fastify/cors": "^11.2.0",
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
export const MYSQL_UNSIGNED_INT_MAX = 4_294_967_295;
|
||||
|
||||
export interface LegacyMoneyOptions {
|
||||
nullable?: boolean;
|
||||
maxCents?: number;
|
||||
field?: string;
|
||||
}
|
||||
|
||||
function describeField(field: string | undefined): string {
|
||||
return field ? ` for ${field}` : '';
|
||||
}
|
||||
|
||||
export function legacyDecimalToCents(
|
||||
value: unknown,
|
||||
options: LegacyMoneyOptions = {}
|
||||
): number | null {
|
||||
const field = describeField(options.field);
|
||||
|
||||
if (value === null || value === undefined) {
|
||||
if (options.nullable) {
|
||||
return null;
|
||||
}
|
||||
throw new Error(`Legacy money value${field} cannot be null.`);
|
||||
}
|
||||
|
||||
if (typeof value !== 'string' && typeof value !== 'number') {
|
||||
throw new Error(`Legacy money value${field} must be a decimal string or number.`);
|
||||
}
|
||||
|
||||
if (typeof value === 'number' && !Number.isFinite(value)) {
|
||||
throw new Error(`Legacy money value${field} must be finite.`);
|
||||
}
|
||||
|
||||
const decimal = String(value);
|
||||
const match = /^(\d+)(?:\.(\d{1,2}))?$/.exec(decimal);
|
||||
if (!match) {
|
||||
throw new Error(
|
||||
`Legacy money value${field} must be a non-negative decimal with at most two fractional digits.`
|
||||
);
|
||||
}
|
||||
|
||||
const wholeCents = BigInt(match[1]) * 100n;
|
||||
const fraction = (match[2] ?? '').padEnd(2, '0');
|
||||
const cents = wholeCents + BigInt(fraction || '0');
|
||||
const maxCents = options.maxCents ?? MYSQL_UNSIGNED_INT_MAX;
|
||||
|
||||
if (!Number.isSafeInteger(maxCents) || maxCents < 0) {
|
||||
throw new Error('Legacy money maxCents must be a non-negative safe integer.');
|
||||
}
|
||||
|
||||
if (cents > BigInt(maxCents)) {
|
||||
throw new Error(`Legacy money value${field} exceeds the target cents column limit.`);
|
||||
}
|
||||
|
||||
return Number(cents);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { MySqlPool } from './mysql.js';
|
||||
import { legacyDecimalToCents } from './legacy-money.js';
|
||||
|
||||
type LegacyEntity = 'stores' | 'rooms' | 'orders' | 'devices';
|
||||
|
||||
@@ -12,6 +13,11 @@ export interface LegacyTableMapping {
|
||||
codeColumn?: string;
|
||||
startColumn?: string;
|
||||
endColumn?: string;
|
||||
totalAmountColumn?: string;
|
||||
paidAmountColumn?: string;
|
||||
renewalAmountColumn?: string;
|
||||
groupAmountColumn?: string;
|
||||
refundAmountColumn?: string;
|
||||
}
|
||||
|
||||
export interface LegacyReadOptions {
|
||||
@@ -29,6 +35,11 @@ export interface LegacyRecord {
|
||||
status: string | null;
|
||||
startAt: Date | string | null;
|
||||
endAt: Date | string | null;
|
||||
totalAmountCents: number | null;
|
||||
paidAmountCents: number | null;
|
||||
renewalAmountCents: number | null;
|
||||
groupAmountCents: number | null;
|
||||
refundAmountCents: number | null;
|
||||
}
|
||||
|
||||
export const defaultLegacyMappings: Record<LegacyEntity, LegacyTableMapping> = {
|
||||
@@ -56,7 +67,12 @@ export const defaultLegacyMappings: Record<LegacyEntity, LegacyTableMapping> = {
|
||||
codeColumn: 'order_no',
|
||||
statusColumn: 'status',
|
||||
startColumn: 'start_time',
|
||||
endColumn: 'end_time'
|
||||
endColumn: 'end_time',
|
||||
totalAmountColumn: 'price',
|
||||
paidAmountColumn: 'pay_price',
|
||||
renewalAmountColumn: 'renew_price',
|
||||
groupAmountColumn: 'group_pay_price',
|
||||
refundAmountColumn: 'refund_price'
|
||||
},
|
||||
devices: {
|
||||
table: 'member_device_info',
|
||||
@@ -89,6 +105,81 @@ function normalizeLimit(limit = 100): number {
|
||||
return limit;
|
||||
}
|
||||
|
||||
interface LegacyQueryRow extends Omit<
|
||||
LegacyRecord,
|
||||
| 'totalAmountCents'
|
||||
| 'paidAmountCents'
|
||||
| 'renewalAmountCents'
|
||||
| 'groupAmountCents'
|
||||
| 'refundAmountCents'
|
||||
> {
|
||||
totalAmountDecimal: unknown;
|
||||
paidAmountDecimal: unknown;
|
||||
renewalAmountDecimal: unknown;
|
||||
groupAmountDecimal: unknown;
|
||||
refundAmountDecimal: unknown;
|
||||
}
|
||||
|
||||
function normalizeMoney(
|
||||
value: unknown,
|
||||
mapping: LegacyTableMapping,
|
||||
column: string | undefined,
|
||||
nullable: boolean
|
||||
): number | null {
|
||||
if (!column) {
|
||||
return null;
|
||||
}
|
||||
return legacyDecimalToCents(value, {
|
||||
field: `${mapping.table}.${column}`,
|
||||
nullable
|
||||
});
|
||||
}
|
||||
|
||||
function normalizeRecord(row: LegacyQueryRow, mapping: LegacyTableMapping): LegacyRecord {
|
||||
const {
|
||||
totalAmountDecimal,
|
||||
paidAmountDecimal,
|
||||
renewalAmountDecimal,
|
||||
groupAmountDecimal,
|
||||
refundAmountDecimal,
|
||||
...record
|
||||
} = row;
|
||||
|
||||
return {
|
||||
...record,
|
||||
totalAmountCents: normalizeMoney(
|
||||
totalAmountDecimal,
|
||||
mapping,
|
||||
mapping.totalAmountColumn,
|
||||
false
|
||||
),
|
||||
paidAmountCents: normalizeMoney(
|
||||
paidAmountDecimal,
|
||||
mapping,
|
||||
mapping.paidAmountColumn,
|
||||
true
|
||||
),
|
||||
renewalAmountCents: normalizeMoney(
|
||||
renewalAmountDecimal,
|
||||
mapping,
|
||||
mapping.renewalAmountColumn,
|
||||
true
|
||||
),
|
||||
groupAmountCents: normalizeMoney(
|
||||
groupAmountDecimal,
|
||||
mapping,
|
||||
mapping.groupAmountColumn,
|
||||
true
|
||||
),
|
||||
refundAmountCents: normalizeMoney(
|
||||
refundAmountDecimal,
|
||||
mapping,
|
||||
mapping.refundAmountColumn,
|
||||
true
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
export class LegacyReadRepository {
|
||||
constructor(
|
||||
private readonly pool: Pick<MySqlPool, 'query'>,
|
||||
@@ -132,7 +223,12 @@ export class LegacyReadRepository {
|
||||
`${selectedColumn(mapping.codeColumn, 'code')},`,
|
||||
`${selectedColumn(mapping.statusColumn, 'status')},`,
|
||||
`${selectedColumn(mapping.startColumn, 'startAt')},`,
|
||||
selectedColumn(mapping.endColumn, 'endAt'),
|
||||
`${selectedColumn(mapping.endColumn, 'endAt')},`,
|
||||
`${selectedColumn(mapping.totalAmountColumn, 'totalAmountDecimal')},`,
|
||||
`${selectedColumn(mapping.paidAmountColumn, 'paidAmountDecimal')},`,
|
||||
`${selectedColumn(mapping.renewalAmountColumn, 'renewalAmountDecimal')},`,
|
||||
`${selectedColumn(mapping.groupAmountColumn, 'groupAmountDecimal')},`,
|
||||
selectedColumn(mapping.refundAmountColumn, 'refundAmountDecimal'),
|
||||
`FROM ${quoteIdentifier(mapping.table)}`,
|
||||
`WHERE ${clauses.join(' AND ')}`,
|
||||
`ORDER BY ${quoteIdentifier(mapping.idColumn)} ASC`,
|
||||
@@ -140,6 +236,6 @@ export class LegacyReadRepository {
|
||||
].join(' ');
|
||||
|
||||
const [rows] = await this.pool.query(sql, parameters);
|
||||
return rows as LegacyRecord[];
|
||||
return (rows as LegacyQueryRow[]).map((row) => normalizeRecord(row, mapping));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
legacyDecimalToCents,
|
||||
MYSQL_UNSIGNED_INT_MAX
|
||||
} from '../dist/db/legacy-money.js';
|
||||
|
||||
assert.equal(legacyDecimalToCents('0'), 0);
|
||||
assert.equal(legacyDecimalToCents('0.01'), 1);
|
||||
assert.equal(legacyDecimalToCents('12.3'), 1230);
|
||||
assert.equal(legacyDecimalToCents('12.34'), 1234);
|
||||
assert.equal(legacyDecimalToCents(12.34), 1234);
|
||||
assert.equal(legacyDecimalToCents('42949672.95'), MYSQL_UNSIGNED_INT_MAX);
|
||||
assert.equal(legacyDecimalToCents(null, { nullable: true }), null);
|
||||
|
||||
for (const invalidValue of [
|
||||
'',
|
||||
' 1.00',
|
||||
'1.00 ',
|
||||
'-0.01',
|
||||
'+1.00',
|
||||
'1.001',
|
||||
'1e2',
|
||||
'NaN',
|
||||
Number.NaN,
|
||||
Number.POSITIVE_INFINITY,
|
||||
{},
|
||||
null
|
||||
]) {
|
||||
assert.throws(
|
||||
() => legacyDecimalToCents(invalidValue),
|
||||
/Legacy money/
|
||||
);
|
||||
}
|
||||
|
||||
assert.throws(
|
||||
() => legacyDecimalToCents('42949672.96', { field: 'member_order_info.price' }),
|
||||
/member_order_info\.price.*exceeds/
|
||||
);
|
||||
|
||||
assert.throws(
|
||||
() => legacyDecimalToCents('1.00', { maxCents: Number.MAX_SAFE_INTEGER + 1 }),
|
||||
/maxCents/
|
||||
);
|
||||
|
||||
console.log('PASS: legacy DECIMAL money conversion is exact and bounded.');
|
||||
@@ -5,6 +5,7 @@ const calls = [];
|
||||
const fakePool = {
|
||||
async query(sql, parameters) {
|
||||
calls.push({ sql, parameters });
|
||||
const isOrderQuery = /FROM `member_order_info`/.test(sql);
|
||||
return [[{
|
||||
legacyId: '7',
|
||||
tenantId: '2',
|
||||
@@ -13,7 +14,12 @@ const fakePool = {
|
||||
code: 'A01',
|
||||
status: 'OPEN',
|
||||
startAt: null,
|
||||
endAt: null
|
||||
endAt: null,
|
||||
totalAmountDecimal: isOrderQuery ? '25.80' : null,
|
||||
paidAmountDecimal: isOrderQuery ? '20.00' : null,
|
||||
renewalAmountDecimal: isOrderQuery ? '5.8' : null,
|
||||
groupAmountDecimal: isOrderQuery ? '0.00' : null,
|
||||
refundAmountDecimal: null
|
||||
}], []];
|
||||
}
|
||||
};
|
||||
@@ -22,6 +28,11 @@ const repository = new LegacyReadRepository(fakePool);
|
||||
const rooms = await repository.listRooms({ tenantId: 2, parentId: 3, limit: 25 });
|
||||
|
||||
assert.equal(rooms.length, 1);
|
||||
assert.equal(rooms[0].totalAmountCents, null);
|
||||
assert.equal(rooms[0].paidAmountCents, null);
|
||||
assert.equal(rooms[0].renewalAmountCents, null);
|
||||
assert.equal(rooms[0].groupAmountCents, null);
|
||||
assert.equal(rooms[0].refundAmountCents, null);
|
||||
assert.equal(calls.length, 1);
|
||||
assert.match(calls[0].sql, /FROM `member_room_info`/);
|
||||
assert.match(calls[0].sql, /`tenant_id` = \?/);
|
||||
@@ -30,6 +41,16 @@ assert.match(calls[0].sql, /ORDER BY `id` ASC LIMIT \?/);
|
||||
assert.deepEqual(calls[0].parameters, [2, 3, 25]);
|
||||
assert.doesNotMatch(calls[0].sql, /\b(?:INSERT|UPDATE|DELETE|REPLACE)\b/i);
|
||||
|
||||
const orders = await repository.listOrders({ tenantId: 2, parentId: 3, limit: 10 });
|
||||
assert.equal(orders[0].totalAmountCents, 2580);
|
||||
assert.equal(orders[0].paidAmountCents, 2000);
|
||||
assert.equal(orders[0].renewalAmountCents, 580);
|
||||
assert.equal(orders[0].groupAmountCents, 0);
|
||||
assert.equal(orders[0].refundAmountCents, null);
|
||||
assert.match(calls[1].sql, /`price` AS `totalAmountDecimal`/);
|
||||
assert.match(calls[1].sql, /`pay_price` AS `paidAmountDecimal`/);
|
||||
assert.match(calls[1].sql, /`refund_price` AS `refundAmountDecimal`/);
|
||||
|
||||
await assert.rejects(
|
||||
() => repository.listStores({ tenantId: 2, limit: 501 }),
|
||||
/between 1 and 500/
|
||||
@@ -63,4 +84,54 @@ await assert.rejects(
|
||||
/Unsafe legacy SQL identifier/
|
||||
);
|
||||
|
||||
const invalidMoneyRepository = new LegacyReadRepository({
|
||||
async query() {
|
||||
return [[{
|
||||
legacyId: '8',
|
||||
tenantId: '2',
|
||||
parentId: '3',
|
||||
name: null,
|
||||
code: 'ORDER-8',
|
||||
status: 'PAID',
|
||||
startAt: null,
|
||||
endAt: null,
|
||||
totalAmountDecimal: '1.001',
|
||||
paidAmountDecimal: '1.00',
|
||||
renewalAmountDecimal: '0.00',
|
||||
groupAmountDecimal: '0.00',
|
||||
refundAmountDecimal: '0.00'
|
||||
}], []];
|
||||
}
|
||||
});
|
||||
|
||||
await assert.rejects(
|
||||
() => invalidMoneyRepository.listOrders({ tenantId: 2 }),
|
||||
/member_order_info\.price/
|
||||
);
|
||||
|
||||
const missingRequiredMoneyRepository = new LegacyReadRepository({
|
||||
async query() {
|
||||
return [[{
|
||||
legacyId: '9',
|
||||
tenantId: '2',
|
||||
parentId: '3',
|
||||
name: null,
|
||||
code: 'ORDER-9',
|
||||
status: 'PAID',
|
||||
startAt: null,
|
||||
endAt: null,
|
||||
totalAmountDecimal: null,
|
||||
paidAmountDecimal: null,
|
||||
renewalAmountDecimal: null,
|
||||
groupAmountDecimal: null,
|
||||
refundAmountDecimal: null
|
||||
}], []];
|
||||
}
|
||||
});
|
||||
|
||||
await assert.rejects(
|
||||
() => missingRequiredMoneyRepository.listOrders({ tenantId: 2 }),
|
||||
/member_order_info\.price.*cannot be null/
|
||||
);
|
||||
|
||||
console.log('PASS: legacy read-only repository contracts are present.');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# 当前开发成果基线
|
||||
|
||||
> V5.0 首次核验日期:2026-06-16
|
||||
> audited_commit: `e069c50`
|
||||
> next_engineering_target: M01-B 在一次性 MySQL 中执行 up/verify/down,并补旧 DECIMAL 金额边界转换
|
||||
> audited_commit: `b8b384e`
|
||||
> next_engineering_target: M01-B 在一次性 MySQL 8 中执行 up/verify/down/再次 up,并保存可复现结果
|
||||
> 事实源:当前工作区、Git 历史、状态文档、Windows/WSL 检查脚本。
|
||||
|
||||
## 总体结论
|
||||
@@ -11,7 +11,7 @@
|
||||
|---|---|---|---|
|
||||
| 总纲版本 | V5.2 已成为当前权威总纲,V5.1/V5.0/V4.8 已保留为历史备份 | 根目录存在 `V5.2.md`、`V5.1.md`、`V5.0.md` 和 `V4.8.md` | 可继续按 V5.2 开发 |
|
||||
| Git 远端 | `origin=ssh://git@git.txyundm.cn:2222/panda/qipai.git`,分支 `main` | `git rev-list main...origin/main` 为 `0 0` | 本地与远端同步 |
|
||||
| 正式后端 | 已新增 Fastify 5 + TypeScript 最小骨架、健康/就绪/版本路由、配置模板、依赖锁文件、契约测试、TypeScript 编译、真实 HTTP 健康检查、MySQL 连接池、迁移 CLI 和旧表只读兼容 Repository | `backend/package.json`、`backend/package-lock.json`、`backend/src/**`、`backend/tests/**`、`scripts/dev/windows/check-backend.ps1` | M01-B PARTIAL;迁移 plan、SQL 拆分、执行和 verify 结果门禁已实现,旧表门店/房间/订单/设备只读查询已提供;一次性真实 MySQL 执行、旧 DECIMAL 转整数分、鉴权和业务接口未完成 |
|
||||
| 正式后端 | 已新增 Fastify 5 + TypeScript 最小骨架、健康/就绪/版本路由、配置模板、依赖锁文件、契约测试、TypeScript 编译、真实 HTTP 健康检查、MySQL 连接池、迁移 CLI、旧表只读兼容 Repository 和旧订单金额严格转换 | `backend/package.json`、`backend/package-lock.json`、`backend/src/**`、`backend/tests/**`、`scripts/dev/windows/check-backend.ps1` | M01-B PARTIAL;迁移 plan、SQL 拆分、执行和 verify 结果门禁已实现,旧表门店/房间/订单/设备只读查询已提供,订单 DECIMAL 金额已按整数分精确转换并检查格式、空值和无符号整数上限;一次性真实 MySQL 执行、鉴权和业务接口未完成 |
|
||||
| 后台管理端 | 仅有 `admin/.gitkeep` | 当前文件扫描 | M09 未开始,不能标记 DONE |
|
||||
| 微信小程序 | 仅有 `miniapp/.gitkeep` | 当前文件扫描 | M08 未开始,不能标记 DONE |
|
||||
| 数据库迁移 | 已新增 M01-B 核心 schema up/down/verify SQL、最小脱敏 seed、迁移计划/执行 CLI 和验证结果数量门禁 | `database/migrations/2026061601_m01b_core_schema.*.sql`、`database/seeds/2026061601_m01b_minimal_seed.sql`、`backend/src/db/migration-runner.ts`、`backend/src/db/migrate-cli.ts` | PARTIAL;dry-run 已验证 11 条 up 语句和 SHA-256,尚未连接一次性真实 MySQL 执行 up/verify/down,旧数据写入迁移脚本未生成 |
|
||||
@@ -36,6 +36,5 @@
|
||||
## 下一步
|
||||
|
||||
1. 继续 M01-B:在一次性 MySQL 8 环境实际执行 up、verify、down,再次 up 并保存可复现结果。
|
||||
2. 在旧表兼容 Repository 边界补充旧 DECIMAL 金额到整数分的严格转换与异常测试。
|
||||
3. 评估 Kysely 安全修复版的 Node 22 要求;未升级运行时前继续使用 `mysql2/promise`。
|
||||
4. 保持 `scripts/dev/windows/check-backend.ps1` 的契约测试、迁移计划、编译和 HTTP 健康检查作为 M01 后续提交门禁。
|
||||
2. 评估 Kysely 安全修复版的 Node 22 要求;未升级运行时前继续使用 `mysql2/promise`。
|
||||
3. 保持 `scripts/dev/windows/check-backend.ps1` 的契约测试、迁移计划、编译和 HTTP 健康检查作为 M01 后续提交门禁。
|
||||
|
||||
@@ -92,3 +92,17 @@ release manifest dry-run 已能记录 `databaseMigration=PROJECT_PRESENT_MIGRATI
|
||||
- 工程提交:`e069c50 feat(M01-B): 增加迁移执行器与旧库只读兼容层`。
|
||||
- 未执行真实 MySQL up/verify/down:当前工作区未配置可丢弃测试库凭据,M01-B 保持 `PARTIAL`。
|
||||
- 下一步:在一次性 MySQL 8 环境往返执行迁移,并实现旧 DECIMAL 金额到整数分的严格转换。
|
||||
|
||||
## 13. 2026-06-18 续开发:旧订单金额严格转换
|
||||
|
||||
- 新增 `legacyDecimalToCents`,直接按十进制字符串拆分并使用 `BigInt` 计算整数分,避免 `Number * 100` 的浮点误差。
|
||||
- 旧订单兼容查询新增 `price`、`pay_price`、`renew_price`、`group_pay_price`、`refund_price` 映射,统一输出对应的 `*Cents` 字段。
|
||||
- 拒绝负数、科学计数法、前后空格、超过两位小数、非有限数字和非数字类型。
|
||||
- `price` 按旧表 `NOT NULL` 约束处理;其余可空金额保留 `null`。
|
||||
- 目标列按 MySQL `INT UNSIGNED` 上限 `4294967295` 分执行溢出检查。
|
||||
- `npm test`:通过,包含精确值、边界值、空值、格式错误、溢出和 Repository 集成测试。
|
||||
- `scripts/dev/windows/check-backend.ps1`:通过,包含编译、全部契约测试、迁移 dry-run 和真实 HTTP 健康检查。
|
||||
- `scripts/dev/windows/check-secrets.ps1`:通过。
|
||||
- 工程提交:`b8b384e feat(M01-B): 严格转换旧库订单金额`。
|
||||
- 未执行真实 MySQL up/verify/down:当前工作区仍未配置可丢弃 MySQL 8 测试库,M01-B 保持 `PARTIAL`。
|
||||
- 下一步:在一次性 MySQL 8 中执行 up、verify、down、再次 up,并保存可复现结果。
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
| REF-001 | 参考资料完整纳管 | M00-A | PARTIAL | `7bb4338` | 已生成哈希清单、脱敏日志、页面地图、接口线索和旧数据库结构清单;含秘密/依赖/真实数据风险的原始包和 SQL 已移出 Git 跟踪;仓库完整性门禁已覆盖意外 untracked、嵌套 Git 和 forbidden tracked 文件。 | 后续仍需按模块生成正式源码/迁移,旧 xjar 需大文件策略。 | 进入 M00-B/M00-C 前继续保持原包忽略和摘要可追溯。 |
|
||||
| SCM-001 | 模块完成即完整推送 | M00-B/M00-C | PARTIAL | `ef0edda` | 首次 main push 成功,`HEAD == origin/main` 校验通过;推送脚本已生成;仓库完整性脚本已升级为提交前门禁并接入 `test-all.ps1`;`push-module.ps1` 已改为先暂存显式路径再运行门禁;状态文档枚举和临时占位检查已接入。 | 后续模块仍需逐次执行并记录。 | 继续在每轮提交前执行完整性、敏感信息、大文件、状态文档和远端一致性检查。 |
|
||||
| WSL-001 | WSL 隔离辅助验证 | M00-C | PARTIAL | `a690e85` | WSL 基础脚本已执行通过;本地 MQTT 服务级核验通过;认证/ACL 冒烟脚本入口、配置自检、可选 TLS/遗嘱/重复消息探测入口已生成;V5.0 点名的 WSL EMQX 检查/启动/停止入口已补齐。 | 正式后端/后台尚未生成,无法执行完整 Linux 构建;MQTT 本地账号未配置,认证/ACL/TLS/遗嘱/幂等未验收;生产 EMQX 不由 WSL 脚本管理。 | M01/M09 生成项目后在 WSL 原生临时副本执行完整构建;配置本地 MQTT 最小权限账号后执行冒烟和可选探测。 |
|
||||
| API-001 | 固定 HTTPS API 域名 | M00-E/M01/M08/M10 | PARTIAL | `e069c50` | 已新增 Windows 检查脚本、Ubuntu 菜单检查和固定域名 Nginx 模板;M01-A 已通过 `/app-api/health` 与 `/admin-api/health` 源码契约、TypeScript 编译和本地真实 HTTP 请求检查;M01-B 已新增 MySQL 连接池、迁移 CLI/dry-run/verify 门禁和旧表只读兼容 Repository,相关契约测试与秘密扫描通过。 | DNS/HTTPS 生产验证未执行,当前 Windows Node 为 18、生产 Node 20+ 环境未验收,一次性真实 MySQL 往返迁移、业务接口和鉴权未接入。 | 继续 M01-B 真实 MySQL up/verify/down 与旧金额转换;后续在 M10 接入生产域名、证书和 Nginx 真实验收。 |
|
||||
| API-001 | 固定 HTTPS API 域名 | M00-E/M01/M08/M10 | PARTIAL | `b8b384e` | 已新增 Windows 检查脚本、Ubuntu 菜单检查和固定域名 Nginx 模板;M01-A 已通过 `/app-api/health` 与 `/admin-api/health` 源码契约、TypeScript 编译和本地真实 HTTP 请求检查;M01-B 已新增 MySQL 连接池、迁移 CLI/dry-run/verify 门禁、旧表只读兼容 Repository,以及旧订单 DECIMAL 金额到整数分的精确转换、格式/空值/溢出测试,相关契约测试与秘密扫描通过。 | DNS/HTTPS 生产验证未执行,当前 Windows Node 为 18、生产 Node 20+ 环境未验收,一次性真实 MySQL 往返迁移、业务接口和鉴权未接入。 | 继续 M01-B 真实 MySQL up/verify/down/再次 up;后续在 M10 接入生产域名、证书和 Nginx 真实验收。 |
|
||||
| TLS-001 | Nginx 与证书自动化 | M00-E/M10 | PARTIAL | `4cb3ab6` | 已生成 Nginx 模板、Certbot 命令说明和菜单第 4 项检查,可检查模板、站点启用、TLS、健康端点、证书文件、续期配置和 `certbot.timer`。 | 证书申请/续期 dry-run、80/443 生产验证未执行。 | 在生产 Ubuntu 执行证书签发、续期 dry-run 和 Nginx 安装记录。 |
|
||||
| WXNET-001 | 微信合法域名与真机验证 | M00-E/M08/M10 | TODO | - | 已补 API 域名报告入口,但未做微信后台或真机验证。 | 微信后台/真机未验证。 | 后续导入小程序后执行合法域名和真机验证。 |
|
||||
| OPS-001 | 固定 `/opt/apps` 目录 | M00-D/M10 | PARTIAL | `292ab7f` | `scripts/setup/init-layout.sh` 已生成目录布局、uploads 目录和 manifest;WSL 检查脚本通过,未在生产 Ubuntu 执行。 | 生产操作未执行。 | 由管理员在 Ubuntu 菜单执行并记录结果。 |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
| 模块 | 状态 | 最近提交 | 最近开发日志 | 备注 |
|
||||
|---|---|---|---|---|
|
||||
| M00 单仓库与服务器基础骨架 | PARTIAL | `ef0edda` | docs/devlogs/2026-06-16-M00-V5-基线核验.md | V5.2 已接入;已有成果基线、仓库完整性门禁、状态文档门禁、显式路径模块推送脚本、release manifest dry-run 检查、WSL 本地 MQTT 服务级核验、认证/ACL 冒烟入口、配置自检、可选 TLS/遗嘱/重复消息探测入口和 WSL EMQX 检查/启动/停止入口已补;生产部署、账号配置、真实验收仍未完成。 |
|
||||
| M01 后端 API 基础工程 | PARTIAL | `e069c50` | docs/devlogs/2026-06-16-M01-B-数据库迁移与兼容层.md | M01-A Fastify 5 + TypeScript 后端骨架、依赖锁定、编译和真实 HTTP 健康检查已通过;M01-B 已新增核心 schema、MySQL 连接池、迁移 plan/up/verify/down CLI、verify 结果门禁和门店/房间/订单/设备旧表只读兼容 Repository。一次性真实 MySQL 往返执行、旧 DECIMAL 金额转换、鉴权和业务接口仍未完成。 |
|
||||
| M01 后端 API 基础工程 | PARTIAL | `b8b384e` | docs/devlogs/2026-06-16-M01-B-数据库迁移与兼容层.md | M01-A Fastify 5 + TypeScript 后端骨架、依赖锁定、编译和真实 HTTP 健康检查已通过;M01-B 已新增核心 schema、MySQL 连接池、迁移 plan/up/verify/down CLI、verify 结果门禁、门店/房间/订单/设备旧表只读兼容 Repository,以及订单 DECIMAL 金额到整数分的严格转换和边界测试。一次性真实 MySQL 往返执行、鉴权和业务接口仍未完成。 |
|
||||
| M02 登录、租户、权限 | TODO | - | - | - |
|
||||
| M03 门店、房间、价格、营业时间 | TODO | - | - | - |
|
||||
| M04 订单、时段锁定、支付闭环 | TODO | - | - | - |
|
||||
|
||||
Reference in New Issue
Block a user