Files
hose-use/specs/hose-open-api/paths/bill.yaml
giteaandClaude 4b4a7049a0 feat(bill): 支持未提交草稿查询与 flowId 直读
- bill list --state=draft/草稿 改走 flows/my 草稿列表,修复草稿不在
  invoice/search 台账索引中导致 --state=draft 返回空的问题
- 新增 --template/--title/--staff/--page 过滤与分页;服务端 RQL 结合
  客户端兜底匹配,模板版本化 ID 自动剥离哈希
- bill get 新增 flowId 直读通道,工作流/他人创建的草稿无需 flows/my 可见
- 补充域层与 CLI 单测、bill 文档、Skill 与 OpenAPI 参数说明

Fixes #153

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-18 16:06:34 +08:00

129 lines
3.7 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
list:
get:
tags:
- Bills & Documents
summary: 检索费用单据与发票明细列表
description: 查询企业名下的费用单据、报销单、借款单与发票列表,支持按单号、阶段、状态过滤。
operationId: listBills
parameters:
- name: code
in: query
required: false
description: 按单据编号/单号过滤(如 jO1it3cIufDjNS)
schema:
type: string
- name: keyword
in: query
required: false
description: 按关键字搜索标题、名称或内容
schema:
type: string
- name: stage
in: query
required: false
description: 按业务阶段过滤(expense 报销, loan 借款, payment 付款)
schema:
type: string
- name: state
in: query
required: false
description: >-
按审批/支付状态过滤(paid 已支付, approving 审批中)。传 draft/草稿 时改用
「我发起」的 flows/my 草稿列表,因为草稿尚未进入台账索引。
schema:
type: string
- name: template
in: query
required: false
description: 草稿模式下按模板(表单规格)ID 过滤;版本化 ID 会剥离末尾哈希
schema:
type: string
- name: title
in: query
required: false
description: 草稿模式下按标题关键字过滤
schema:
type: string
- name: staff
in: query
required: false
description: 草稿模式下按提交人(员工 ID、工号或唯一姓名)过滤
schema:
type: string
- name: page
in: query
required: false
description: 页码,与 count 配合分页(从 1 开始)
schema:
type: integer
default: 1
- name: count
in: query
required: false
description: 返回条数限制
schema:
type: integer
default: 20
responses:
"200":
description: 格式化后的单据列表
content:
"application/json":
schema:
type: object
properties:
total:
type: integer
returned:
type: integer
items:
type: array
items:
$ref: "../components/schemas/index.yaml#/FormattedBill"
get:
get:
tags:
- Bills & Documents
summary: 根据单号或 ID 查询单据结构化详情
description: 自动结合 DataLink 字段字典将代码字段还原为业务中文字段。
operationId: getBillByCode
parameters:
- name: code
in: path
required: true
description: 单据编号(如 n0GMIM0dkQmKbS)或单据 ID(如 ID01TRzg7HMLcb)
schema:
type: string
responses:
"200":
description: 单据详情列表
content:
"application/json":
schema:
type: array
items:
$ref: "../components/schemas/index.yaml#/FormattedBill"
schema:
get:
tags:
- Bills & Documents
summary: 获取单据实体与数据模型字典
description: 获取企业全部表单实体、中文字段 Label 与类型定义。
operationId: getBillSchemas
responses:
"200":
description: 实体模型字典
content:
"application/json":
schema:
type: object
properties:
totalEntities:
type: integer
entities:
type: array
items:
type: object