c670b9e454
- 确定性领域引擎(分类/评分/分级/红线/费用/裁决)+LLM(通义千问)语言理解 - 6步评估向导、服务端草稿持久化(跨设备/编辑草稿保护) - 工作流(草稿→风控→管理层)、RBAC、报告导出、校准、客户/费率/红线/最低工资管理 - 专业图标体系替换全部emoji、看板美化 - 生产化:API_BASE可配置(同源反代)、auth密钥惰性读取修复RBAC - 444单测+204前端测试+51 e2e
25 lines
799 B
JavaScript
25 lines
799 B
JavaScript
/* eslint-disable */
|
|
/**
|
|
* 客户回款记录:记录应收发票的到期日与实际回款日,用于自动计算客户平均逾期天数,
|
|
* 替代人工维护的 avg_overdue_days,并驱动"客户逾期超N天"红线。
|
|
*/
|
|
|
|
exports.up = (pgm) => {
|
|
pgm.sql(`
|
|
CREATE TABLE IF NOT EXISTS customer_payments (
|
|
id SERIAL PRIMARY KEY,
|
|
customer_id TEXT NOT NULL REFERENCES customers(id) ON DELETE CASCADE,
|
|
invoice_amount DOUBLE PRECISION NOT NULL DEFAULT 0,
|
|
due_date DATE NOT NULL,
|
|
paid_date DATE,
|
|
note TEXT,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|
|
CREATE INDEX IF NOT EXISTS idx_customer_payments_cust ON customer_payments(customer_id);
|
|
`);
|
|
};
|
|
|
|
exports.down = (pgm) => {
|
|
pgm.sql(`DROP TABLE IF EXISTS customer_payments;`);
|
|
};
|