Files
hose-use/specs/hose-close-api/schemas/form-specification.schema.json
T
gitea bb703620f2 docs: 整理合思内部接口规范并移除历史迁移清单
将未跟踪的 specs/hose 改名为 specs/hose-close-api,纳入接口清单、维护说明和五份 JSON Schema,同步 Schema 标识及文档引用。
删除 README 的已迁移功能历史清单,补充 specs 的含义和新目录入口。临时抓包完整保留在本地并由 Git 忽略,避免提交租户业务资料。

验证:bun test(892 通过、0 失败)、bun run check、git diff --check;五份 Schema、17 个内部引用及相关文档链接校验通过。
2026-10-29 16:01:21 +08:00

137 lines
6.2 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://hose-use.local/specs/hose-close-api/schemas/form-specification.schema.json",
"title": "Form specification",
"description": "单据模板(specification)对象。以 src/domains/bill/types.ts 的 FormSpecificationSchema 为主,结合 _tmp-captured 中的响应载荷校准。字段 key 统一使用 field。",
"x-source": [
"code-derived: src/domains/bill/types.ts:42",
"reference: _tmp-captured/raw/GET-api-form-v2-specifications-id-payment.json",
"reference: _tmp-captured/raw/GET-api-form-v2-specifications-id-invoice.json"
],
"type": "object",
"required": ["id", "name", "type", "components"],
"properties": {
"id": { "type": "string" },
"name": { "type": "string", "description": "模板名称,例如 付款单 / 发票核销单。" },
"enName": { "type": "string" },
"type": { "type": "string", "description": "单据类型,例如 expense、requisition。", "examples": ["expense", "requisition"] },
"active": { "type": "boolean" },
"systemPreset": { "type": "boolean" },
"specificationGroupId": { "type": "string" },
"appId": { "type": "string" },
"color": { "type": "string" },
"icon": { "type": "string" },
"visibility": { "$ref": "#/$defs/Visibility" },
"state": { "type": "string", "description": "抓包观察值:PUBLISHED。" },
"configs": {
"type": "array",
"description": "按 ability 区分的模板能力配置。",
"items": {
"type": "object",
"required": ["ability"],
"properties": { "ability": { "type": "string" } },
"additionalProperties": true
}
},
"components": {
"type": "array",
"description": "模板字段组件列表。field 是字段 key,不是 key/name。",
"items": { "$ref": "#/$defs/Component" }
},
"rules": { "type": "array", "items": { "type": "object" } },
"pri": { "type": "number" },
"mustUpdateTemplate": { "type": "boolean" },
"description": { "type": "string" },
"budgetPermitAllowEdit": { "type": "boolean" },
"forbidSubmit": { "type": "boolean" },
"usageMode": { "type": "string" },
"pipeline": { "type": "number" },
"grayver": { "type": "string" },
"dbVersion": { "type": "number" },
"threadId": { "type": "string" },
"version": { "type": "number" },
"createTime": { "type": "number", "description": "毫秒时间戳。" },
"updateTime": { "type": "number", "description": "毫秒时间戳。" },
"nameSpell": { "type": "string" },
"code": { "type": "string" },
"corporationId": { "type": "string" },
"sourceCorporationId": { "type": ["string", "null"] },
"dataCorporationId": { "type": ["string", "null"] },
"editorId": { "type": "string" },
"flowPlanConfigId": { "type": ["string", "null"] },
"warnings": { "type": "array", "items": { "type": "string" } }
},
"additionalProperties": true,
"$defs": {
"Component": {
"type": "object",
"description": "模板字段组件。示例:{\"field\":\"u_单据编号\",\"label\":\"关联发票核销单号\",\"type\":\"text\",\"optional\":true,\"maxLength\":140}。separator 类型没有 field。",
"required": ["type"],
"properties": {
"field": { "type": "string", "description": "字段 key,例如 u_单据编号、u_所属供应商、title、details。不是 key,也不是 name。" },
"label": { "type": "string" },
"cnLabel": { "type": "string" },
"enLabel": { "type": ["string", "null"] },
"type": {
"type": "string",
"description": "组件类型。观察值:text、textarea、select、date、money、dataLink、payeeInfo、details、requisitionDetails、separator。",
"examples": ["text", "textarea", "select", "date", "money", "dataLink", "payeeInfo", "details", "requisitionDetails", "separator"]
},
"optional": { "type": "boolean" },
"editable": { "type": "boolean" },
"readonly": { "type": "boolean" },
"hidden": { "type": "boolean" },
"hide": { "type": "boolean" },
"isLinkageAssignment": { "type": "boolean" },
"assignmentRule": { "type": ["string", "null"] },
"priority": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": "string" },
"value": { "type": "number" }
},
"additionalProperties": true
}
},
"defaultValue": { "type": "object", "additionalProperties": true },
"placeholder": { "type": "string" },
"cnPlaceholder": { "type": ["string", "null"] },
"enPlaceholder": { "type": ["string", "null"] },
"maxLength": { "type": "number" },
"minLength": { "type": "number" },
"showInDetails": { "type": "boolean" },
"selectRange": { "type": "string" },
"multiple": { "type": "boolean" },
"dependence": { "type": ["object", "null"] },
"onlyBelongDepartment": { "type": "boolean" },
"allowExternalStaff": { "type": "boolean" },
"inheritedFieldDependency": { "type": "boolean" },
"hideVisibility": { "$ref": "#/$defs/Visibility" },
"hideBlacklistVisibility": { "$ref": "#/$defs/Visibility" },
"configs": { "type": "array", "items": { "type": "object" } },
"referenceData": { "type": "string", "description": "dataLink 引用的业务对象实体 ID。" },
"filterId": { "type": ["string", "null"] },
"subTypeId": { "type": ["string", "null"] },
"isMcFiled": { "type": "boolean" },
"defaultField": { "type": "boolean" },
"copyable": { "type": "boolean" },
"exceedConfigs": { "type": ["object", "null"] }
},
"additionalProperties": true
},
"Visibility": {
"type": "object",
"properties": {
"fullVisible": { "type": "boolean" },
"staffs": { "type": "array", "items": { "type": "string" } },
"roles": { "type": "array", "items": { "type": "string" } },
"departments": { "type": "array", "items": { "type": "string" } },
"departmentsIncludeChildren": { "type": "boolean" }
},
"additionalProperties": true
}
}
}