feat: add order governance flags and reconciliation

This commit is contained in:
2026-01-16 13:29:59 +08:00
parent 7ead7fc11c
commit e5f40287c3
17 changed files with 1247 additions and 103 deletions

View File

@@ -1349,6 +1349,90 @@ const docTemplate = `{
}
}
},
"/super/v1/orders/{id}/flag": {
"post": {
"description": "Flag or unflag an order as problematic",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Order"
],
"summary": "Flag order",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Order ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Flag form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperOrderFlagForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/super/v1/orders/{id}/reconcile": {
"post": {
"description": "Mark or unmark order reconciliation status",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Order"
],
"summary": "Reconcile order",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Order ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Reconcile form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperOrderReconcileForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/super/v1/orders/{id}/refund": {
"post": {
"description": "Refund order",
@@ -8734,6 +8818,19 @@ const docTemplate = `{
}
}
},
"dto.SuperOrderFlagForm": {
"type": "object",
"properties": {
"is_flagged": {
"description": "IsFlagged 是否标记为问题订单。",
"type": "boolean"
},
"reason": {
"description": "Reason 标记原因(标记为问题时必填)。",
"type": "string"
}
}
},
"dto.SuperOrderItem": {
"type": "object",
"properties": {
@@ -8769,10 +8866,30 @@ const docTemplate = `{
}
]
},
"flag_reason": {
"description": "FlagReason 问题标记原因。",
"type": "string"
},
"flagged_at": {
"description": "FlaggedAt 标记时间RFC3339。",
"type": "string"
},
"flagged_by": {
"description": "FlaggedBy 标记操作者ID。",
"type": "integer"
},
"id": {
"description": "ID 订单ID。",
"type": "integer"
},
"is_flagged": {
"description": "IsFlagged 是否标记为问题订单。",
"type": "boolean"
},
"is_reconciled": {
"description": "IsReconciled 是否完成对账。",
"type": "boolean"
},
"items": {
"description": "Items 订单明细行,用于展示具体内容与金额拆分。",
"type": "array",
@@ -8784,6 +8901,18 @@ const docTemplate = `{
"description": "PaidAt 支付时间RFC3339。",
"type": "string"
},
"reconcile_note": {
"description": "ReconcileNote 对账说明。",
"type": "string"
},
"reconciled_at": {
"description": "ReconciledAt 对账时间RFC3339。",
"type": "string"
},
"reconciled_by": {
"description": "ReconciledBy 对账操作者ID。",
"type": "integer"
},
"refunded_at": {
"description": "RefundedAt 退款时间RFC3339。",
"type": "string"
@@ -8845,6 +8974,19 @@ const docTemplate = `{
}
}
},
"dto.SuperOrderReconcileForm": {
"type": "object",
"properties": {
"is_reconciled": {
"description": "IsReconciled 是否完成对账。",
"type": "boolean"
},
"note": {
"description": "Note 对账说明(可选)。",
"type": "string"
}
}
},
"dto.SuperOrderRefundForm": {
"type": "object",
"properties": {

View File

@@ -1343,6 +1343,90 @@
}
}
},
"/super/v1/orders/{id}/flag": {
"post": {
"description": "Flag or unflag an order as problematic",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Order"
],
"summary": "Flag order",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Order ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Flag form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperOrderFlagForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/super/v1/orders/{id}/reconcile": {
"post": {
"description": "Mark or unmark order reconciliation status",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Order"
],
"summary": "Reconcile order",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Order ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Reconcile form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SuperOrderReconcileForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/super/v1/orders/{id}/refund": {
"post": {
"description": "Refund order",
@@ -8728,6 +8812,19 @@
}
}
},
"dto.SuperOrderFlagForm": {
"type": "object",
"properties": {
"is_flagged": {
"description": "IsFlagged 是否标记为问题订单。",
"type": "boolean"
},
"reason": {
"description": "Reason 标记原因(标记为问题时必填)。",
"type": "string"
}
}
},
"dto.SuperOrderItem": {
"type": "object",
"properties": {
@@ -8763,10 +8860,30 @@
}
]
},
"flag_reason": {
"description": "FlagReason 问题标记原因。",
"type": "string"
},
"flagged_at": {
"description": "FlaggedAt 标记时间RFC3339。",
"type": "string"
},
"flagged_by": {
"description": "FlaggedBy 标记操作者ID。",
"type": "integer"
},
"id": {
"description": "ID 订单ID。",
"type": "integer"
},
"is_flagged": {
"description": "IsFlagged 是否标记为问题订单。",
"type": "boolean"
},
"is_reconciled": {
"description": "IsReconciled 是否完成对账。",
"type": "boolean"
},
"items": {
"description": "Items 订单明细行,用于展示具体内容与金额拆分。",
"type": "array",
@@ -8778,6 +8895,18 @@
"description": "PaidAt 支付时间RFC3339。",
"type": "string"
},
"reconcile_note": {
"description": "ReconcileNote 对账说明。",
"type": "string"
},
"reconciled_at": {
"description": "ReconciledAt 对账时间RFC3339。",
"type": "string"
},
"reconciled_by": {
"description": "ReconciledBy 对账操作者ID。",
"type": "integer"
},
"refunded_at": {
"description": "RefundedAt 退款时间RFC3339。",
"type": "string"
@@ -8839,6 +8968,19 @@
}
}
},
"dto.SuperOrderReconcileForm": {
"type": "object",
"properties": {
"is_reconciled": {
"description": "IsReconciled 是否完成对账。",
"type": "boolean"
},
"note": {
"description": "Note 对账说明(可选)。",
"type": "string"
}
}
},
"dto.SuperOrderRefundForm": {
"type": "object",
"properties": {

View File

@@ -1936,6 +1936,15 @@ definitions:
- $ref: '#/definitions/dto.OrderTenantLite'
description: Tenant 订单所属租户信息。
type: object
dto.SuperOrderFlagForm:
properties:
is_flagged:
description: IsFlagged 是否标记为问题订单。
type: boolean
reason:
description: Reason 标记原因(标记为问题时必填)。
type: string
type: object
dto.SuperOrderItem:
properties:
amount_discount:
@@ -1958,9 +1967,24 @@ definitions:
allOf:
- $ref: '#/definitions/consts.Currency'
description: Currency 币种。
flag_reason:
description: FlagReason 问题标记原因。
type: string
flagged_at:
description: FlaggedAt 标记时间RFC3339
type: string
flagged_by:
description: FlaggedBy 标记操作者ID。
type: integer
id:
description: ID 订单ID。
type: integer
is_flagged:
description: IsFlagged 是否标记为问题订单。
type: boolean
is_reconciled:
description: IsReconciled 是否完成对账。
type: boolean
items:
description: Items 订单明细行,用于展示具体内容与金额拆分。
items:
@@ -1969,6 +1993,15 @@ definitions:
paid_at:
description: PaidAt 支付时间RFC3339
type: string
reconcile_note:
description: ReconcileNote 对账说明。
type: string
reconciled_at:
description: ReconciledAt 对账时间RFC3339
type: string
reconciled_by:
description: ReconciledBy 对账操作者ID。
type: integer
refunded_at:
description: RefundedAt 退款时间RFC3339
type: string
@@ -2007,6 +2040,15 @@ definitions:
snapshot:
description: Snapshot 明细快照,用于展示内容标题等历史信息。
type: object
dto.SuperOrderReconcileForm:
properties:
is_reconciled:
description: IsReconciled 是否完成对账。
type: boolean
note:
description: Note 对账说明(可选)。
type: string
type: object
dto.SuperOrderRefundForm:
properties:
force:
@@ -4028,6 +4070,62 @@ paths:
summary: Get order
tags:
- Order
/super/v1/orders/{id}/flag:
post:
consumes:
- application/json
description: Flag or unflag an order as problematic
parameters:
- description: Order ID
format: int64
in: path
name: id
required: true
type: integer
- description: Flag form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.SuperOrderFlagForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: Flag order
tags:
- Order
/super/v1/orders/{id}/reconcile:
post:
consumes:
- application/json
description: Mark or unmark order reconciliation status
parameters:
- description: Order ID
format: int64
in: path
name: id
required: true
type: integer
- description: Reconcile form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.SuperOrderReconcileForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: Reconcile order
tags:
- Order
/super/v1/orders/{id}/refund:
post:
consumes: