feat(08-05-contract-detail-workspace): 完成合同详情与终止状态治理

这个提交包含在:
2026-08-08 02:02:52 +08:00
父节点 7546d372d6
当前提交 21851774dd
共修改 25 个文件,包含 2516 行新增和 1021 行删除
@@ -4,7 +4,7 @@ const { AppError } = require("../utils/AppError");
const { currentDateString, parseDateOnlyString } = require("../utils/date");
const CONTRACT_REGISTRY_TYPE_VALUES = ["purchase", "sales", "service", "framework", "other"];
const CONTRACT_REGISTRY_PERSISTED_STATUS_VALUES = ["draft", "active", "archived"];
const CONTRACT_REGISTRY_PERSISTED_STATUS_VALUES = ["draft", "active", "terminated", "archived"];
const CONTRACT_REGISTRY_EFFECTIVE_STATUS_VALUES = [...CONTRACT_REGISTRY_PERSISTED_STATUS_VALUES, "expired"];
const DATE_ONLY_SCHEMA = z.string().regex(/^\d{4}-\d{2}-\d{2}$/);
@@ -115,6 +115,10 @@ function buildEffectiveStatusWhere(status, today) {
return { status: "archived" };
}
if (status === "terminated") {
return { status: "terminated" };
}
if (status === "expired") {
return {
status: "active",
@@ -221,6 +225,7 @@ module.exports = {
CONTRACT_REGISTRY_PERSISTED_STATUS_VALUES,
CONTRACT_REGISTRY_TYPE_VALUES,
buildContractRegistryExpiringWhere,
buildContractRegistryScopeWhere,
buildContractRegistryValidationError,
buildContractRegistryWhere,
canManageContractRegistry,