feat(08-05-contract-detail-workspace): 完成合同详情与终止状态治理
这个提交包含在:
@@ -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,
|
||||
|
||||
在新工单中引用
屏蔽一个用户