feat(收口): 补齐 8 月迭代缺口并同步 Spec 与证据链
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
- 新增六对成对迁移 000232–000237:H5 弹窗类型、退款结算标识与申请人备注、优先轮询事实字段与两个新终态、通道阈值命中留痕、手机号最近解绑人、提现资格校验留痕 - 退款:原因必填与申请人备注、来源支付与渠道流水冻结、线下处理流水号补录审计、按订单查询可选退款方式、企微审批材料补齐且新增字段缺失映射即明确失败 - 优先轮询:人工关闭、有效期到期独立周期任务、失败与过期人工重触发、事实字段与异常重试查询、资产解析端点只读投影 - 通道阈值:命中事实同事务留痕与命中记录查询;员工账单:列表筛选与详情投影;商户池:列表投影与统计周期语义;H5:弹窗类型与类别排序 - 手机号:有效关联数量与最近解绑人、短信验证码失败次数限制;导出:佣金明细十五列与报表序号列 - 时间筛选:三处新增筛选纳入统一严格解析契约,员工账单产生时间参数改名 - 同步 12 份主 Spec 需求、两端点与异步任务证据链,门禁 context-health 与 OpenSpec 校验通过
This commit is contained in:
@@ -55,27 +55,37 @@ type EmployeeCollectionPaymentMethodListResponse struct {
|
||||
// 枚举说明:source_type 对应 constants.EmployeeCollectionSourceTypeOrder/Recharge,
|
||||
// status 对应 constants.EmployeeCollectionBillStatusPending/Partial/Settled/Closed。
|
||||
type EmployeeCollectionBillListRequest struct {
|
||||
Page int `json:"page" query:"page" validate:"omitempty,min=1" minimum:"1" description:"页码,默认1"`
|
||||
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100" minimum:"1" maximum:"100" description:"每页条数,默认20,最大100"`
|
||||
SourceType *string `json:"source_type" query:"source_type" validate:"omitempty,oneof=order recharge" enum:"order,recharge" description:"按来源类型过滤 (order:后台线下套餐订单, recharge:代理线下充值)"`
|
||||
SourceNo *string `json:"source_no" query:"source_no" validate:"omitempty,max=64" maxLength:"64" description:"按来源单号精确过滤"`
|
||||
Status *int `json:"status" query:"status" validate:"omitempty,oneof=0 1 2 3" enum:"0,1,2,3" description:"按账单状态过滤 (0:待核销, 1:部分核销, 2:已核销, 3:已关闭)"`
|
||||
DebtorAccountID *uint `json:"debtor_account_id" query:"debtor_account_id" description:"按欠款人后台账号ID过滤;非超级管理员固定为当前账号,该参数被忽略"`
|
||||
CustomerID *uint `json:"customer_id" query:"customer_id" description:"按来源客户或店铺ID过滤,匹配来源订单买家或充值归属店铺"`
|
||||
CreatedFrom *string `json:"created_from" query:"created_from" description:"创建时间起始(YYYY-MM-DD,含当日 00:00:00)"`
|
||||
CreatedTo *string `json:"created_to" query:"created_to" description:"创建时间截止(YYYY-MM-DD,含当日 23:59:59)"`
|
||||
Page int `json:"page" query:"page" validate:"omitempty,min=1" minimum:"1" description:"页码,默认1"`
|
||||
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100" minimum:"1" maximum:"100" description:"每页条数,默认20,最大100"`
|
||||
BillID *uint `json:"bill_id" query:"bill_id" validate:"omitempty,min=1" minimum:"1" description:"按账单编号精确过滤;账单编号即账单记录标识(主键ID)"`
|
||||
SourceType *string `json:"source_type" query:"source_type" validate:"omitempty,oneof=order recharge" enum:"order,recharge" description:"按来源类型过滤 (order:后台线下套餐订单, recharge:代理线下充值)"`
|
||||
SourceNo *string `json:"source_no" query:"source_no" validate:"omitempty,max=64" maxLength:"64" description:"按来源单号精确过滤"`
|
||||
Status *int `json:"status" query:"status" validate:"omitempty,oneof=0 1 2 3" enum:"0,1,2,3" description:"按账单状态过滤 (0:待核销, 1:部分核销, 2:已核销, 3:已关闭)"`
|
||||
DebtorAccountID *uint `json:"debtor_account_id" query:"debtor_account_id" description:"按欠款人后台账号ID过滤;非超级管理员固定为当前账号,该参数被忽略"`
|
||||
DebtorKeyword *string `json:"debtor_keyword" query:"debtor_keyword" validate:"omitempty,max=50" maxLength:"50" description:"按欠款人姓名或账号模糊过滤,取去空白后的子串匹配,最多 50 字符;无需先取得账号ID"`
|
||||
CustomerKeyword *string `json:"customer_keyword" query:"customer_keyword" validate:"omitempty,max=50" maxLength:"50" description:"按客户名称模糊过滤,取去空白后的子串匹配,最多 50 字符;无需先取得客户ID"`
|
||||
CustomerID *uint `json:"customer_id" query:"customer_id" description:"按来源客户或店铺ID过滤,匹配来源订单买家或充值归属店铺"`
|
||||
StartTime *string `json:"start_time" query:"start_time" description:"账单产生时间起始,必须是带显式时区的 RFC3339 秒级时间(如 2026-09-01T00:00:00+08:00),闭区间含该时刻"`
|
||||
EndTime *string `json:"end_time" query:"end_time" description:"账单产生时间截止,必须是带显式时区的 RFC3339 秒级时间,闭区间含该时刻"`
|
||||
DecidedStartTime *string `json:"decided_start_time" query:"decided_start_time" description:"核销通过时间起始,取该账单已通过分摊关联的申请表审批终态时间;格式与 start_time 相同,闭区间含该时刻"`
|
||||
DecidedEndTime *string `json:"decided_end_time" query:"decided_end_time" description:"核销通过时间截止,取该账单已通过分摊关联的申请表审批终态时间;格式与 end_time 相同,闭区间含该时刻"`
|
||||
}
|
||||
|
||||
// EmployeeCollectionBillStatisticsRequest 查询员工代收款账单统计请求。
|
||||
// 与账单列表使用同一批筛选字段与可见性范围,但不接受分页参数。
|
||||
type EmployeeCollectionBillStatisticsRequest struct {
|
||||
SourceType *string `json:"source_type" query:"source_type" validate:"omitempty,oneof=order recharge" enum:"order,recharge" description:"按来源类型过滤 (order:后台线下套餐订单, recharge:代理线下充值)"`
|
||||
SourceNo *string `json:"source_no" query:"source_no" validate:"omitempty,max=64" maxLength:"64" description:"按来源单号精确过滤"`
|
||||
Status *int `json:"status" query:"status" validate:"omitempty,oneof=0 1 2 3" enum:"0,1,2,3" description:"按账单状态过滤 (0:待核销, 1:部分核销, 2:已核销, 3:已关闭)"`
|
||||
DebtorAccountID *uint `json:"debtor_account_id" query:"debtor_account_id" description:"按欠款人后台账号ID过滤;非超级管理员固定为当前账号,该参数被忽略"`
|
||||
CustomerID *uint `json:"customer_id" query:"customer_id" description:"按来源客户或店铺ID过滤,匹配来源订单买家或充值归属店铺"`
|
||||
CreatedFrom *string `json:"created_from" query:"created_from" description:"创建时间起始(YYYY-MM-DD,含当日 00:00:00)"`
|
||||
CreatedTo *string `json:"created_to" query:"created_to" description:"创建时间截止(YYYY-MM-DD,含当日 23:59:59)"`
|
||||
BillID *uint `json:"bill_id" query:"bill_id" validate:"omitempty,min=1" minimum:"1" description:"按账单编号精确过滤;账单编号即账单记录标识(主键ID)"`
|
||||
SourceType *string `json:"source_type" query:"source_type" validate:"omitempty,oneof=order recharge" enum:"order,recharge" description:"按来源类型过滤 (order:后台线下套餐订单, recharge:代理线下充值)"`
|
||||
SourceNo *string `json:"source_no" query:"source_no" validate:"omitempty,max=64" maxLength:"64" description:"按来源单号精确过滤"`
|
||||
Status *int `json:"status" query:"status" validate:"omitempty,oneof=0 1 2 3" enum:"0,1,2,3" description:"按账单状态过滤 (0:待核销, 1:部分核销, 2:已核销, 3:已关闭)"`
|
||||
DebtorAccountID *uint `json:"debtor_account_id" query:"debtor_account_id" description:"按欠款人后台账号ID过滤;非超级管理员固定为当前账号,该参数被忽略"`
|
||||
DebtorKeyword *string `json:"debtor_keyword" query:"debtor_keyword" validate:"omitempty,max=50" maxLength:"50" description:"按欠款人姓名或账号模糊过滤,取去空白后的子串匹配,最多 50 字符;无需先取得账号ID"`
|
||||
CustomerKeyword *string `json:"customer_keyword" query:"customer_keyword" validate:"omitempty,max=50" maxLength:"50" description:"按客户名称模糊过滤,取去空白后的子串匹配,最多 50 字符;无需先取得客户ID"`
|
||||
CustomerID *uint `json:"customer_id" query:"customer_id" description:"按来源客户或店铺ID过滤,匹配来源订单买家或充值归属店铺"`
|
||||
StartTime *string `json:"start_time" query:"start_time" description:"账单产生时间起始,必须是带显式时区的 RFC3339 秒级时间(如 2026-09-01T00:00:00+08:00),闭区间含该时刻"`
|
||||
EndTime *string `json:"end_time" query:"end_time" description:"账单产生时间截止,必须是带显式时区的 RFC3339 秒级时间,闭区间含该时刻"`
|
||||
DecidedStartTime *string `json:"decided_start_time" query:"decided_start_time" description:"核销通过时间起始,取该账单已通过分摊关联的申请表审批终态时间;格式与 start_time 相同,闭区间含该时刻"`
|
||||
DecidedEndTime *string `json:"decided_end_time" query:"decided_end_time" description:"核销通过时间截止,取该账单已通过分摊关联的申请表审批终态时间;格式与 end_time 相同,闭区间含该时刻"`
|
||||
}
|
||||
|
||||
// EmployeeCollectionBillResponse 员工代收款账单行响应。
|
||||
@@ -90,6 +100,7 @@ type EmployeeCollectionBillResponse struct {
|
||||
CustomerSnapshot map[string]any `json:"customer_snapshot" description:"来源客户或店铺只读快照,不含付款凭证内容"`
|
||||
ReceivableAmount int64 `json:"receivable_amount" description:"应收金额(分)"`
|
||||
ReceivedAmount int64 `json:"received_amount" description:"已核销金额(分),仅企业微信最终通过的分摊计入"`
|
||||
UnsettledAmount int64 `json:"unsettled_amount" description:"未核销金额(分),应收金额减已核销金额;已关闭账单为 0"`
|
||||
ReservedAmount int64 `json:"reserved_amount" description:"审批中预占金额(分)"`
|
||||
RemainingAmount int64 `json:"remaining_amount" description:"剩余可核销金额(分),已关闭账单为 0"`
|
||||
Status int `json:"status" description:"账单状态 (0:待核销, 1:部分核销, 2:已核销, 3:已关闭)"`
|
||||
@@ -194,10 +205,37 @@ type EmployeeCollectionBillApplicationResponse struct {
|
||||
|
||||
// EmployeeCollectionBillDetailResponse 员工代收款账单详情响应。
|
||||
type EmployeeCollectionBillDetailResponse struct {
|
||||
Bill *EmployeeCollectionBillResponse `json:"bill" description:"账单事实"`
|
||||
Refunds []*EmployeeCollectionBillRefundResponse `json:"refunds" description:"来源订单退款冲销关联"`
|
||||
Allocations []*EmployeeCollectionBillAllocationResponse `json:"allocations" description:"该账单的核销分摊"`
|
||||
Applications []*EmployeeCollectionBillApplicationResponse `json:"applications" description:"涉及该账单的核销申请与审批历史"`
|
||||
Bill *EmployeeCollectionBillResponse `json:"bill" description:"账单事实"`
|
||||
Refunds []*EmployeeCollectionBillRefundResponse `json:"refunds" description:"来源订单退款冲销关联"`
|
||||
Allocations []*EmployeeCollectionBillAllocationResponse `json:"allocations" description:"该账单的核销分摊"`
|
||||
Applications []*EmployeeCollectionBillApplicationResponse `json:"applications" description:"涉及该账单的核销申请与审批历史"`
|
||||
Operations []*EmployeeCollectionBillOperationLogResponse `json:"operations" description:"该账单的操作日志投影,按操作时间升序;仅含安全摘要,不含凭证内容与完整收款原文"`
|
||||
SourceOrder *EmployeeCollectionBillSourceSnapshotResponse `json:"source_order" description:"来源订单或来源充值记录的只读快照;来源不可读或字段缺失时对应字段为空值,不影响详情其余内容"`
|
||||
}
|
||||
|
||||
// EmployeeCollectionBillOperationLogResponse 是账单维度既有审计事实的安全投影。
|
||||
// 只返回动作、操作账号名称快照、操作时间与变更前后摘要(白名单字段),
|
||||
// MUST NOT 返回支付凭证内容、完整收款信息或其它敏感原文。
|
||||
type EmployeeCollectionBillOperationLogResponse struct {
|
||||
ActionCode string `json:"action_code" description:"稳定动作编码"`
|
||||
ActionName string `json:"action_name" description:"动作中文名称"`
|
||||
Summary string `json:"summary" description:"事件中文摘要"`
|
||||
OperatorName string `json:"operator_name" description:"操作账号名称快照"`
|
||||
OccurredAt time.Time `json:"occurred_at" description:"操作发生时间"`
|
||||
Result string `json:"result" description:"操作结果 (success:成功, failed:失败, denied:拒绝, partial:部分成功, unknown:未知)"`
|
||||
BeforeSummary map[string]any `json:"before_summary" description:"变更前安全摘要,只包含允许展示的账单字段"`
|
||||
AfterSummary map[string]any `json:"after_summary" description:"变更后安全摘要,只包含允许展示的账单字段"`
|
||||
}
|
||||
|
||||
// EmployeeCollectionBillSourceSnapshotResponse 是来源订单或来源充值记录的只读快照投影。
|
||||
// 来源记录已不可读或字段缺失时对应字段为空值,详情其余内容正常返回。
|
||||
type EmployeeCollectionBillSourceSnapshotResponse struct {
|
||||
SourceType string `json:"source_type" description:"来源业务类型 (order:后台线下套餐订单, recharge:代理线下充值)"`
|
||||
SourceTypeName string `json:"source_type_name" description:"来源业务类型中文名称"`
|
||||
SourceNo string `json:"source_no" description:"来源单号"`
|
||||
Amount int64 `json:"amount" description:"来源实收金额或充值金额(分)"`
|
||||
CreatedAt *time.Time `json:"created_at,omitempty" description:"来源记录创建时间"`
|
||||
AssetIdentifier string `json:"asset_identifier" description:"来源资产标识(卡为ICCID,设备优先虚拟号其次IMEI);来源无资产维度或不可读时为空"`
|
||||
}
|
||||
|
||||
// CloseEmployeeCollectionBillRequest 关闭员工代收款账单请求
|
||||
|
||||
Reference in New Issue
Block a user