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

@@ -4,6 +4,7 @@ import (
dto "quyun/v2/app/http/super/v1/dto"
"quyun/v2/app/requests"
"quyun/v2/app/services"
"quyun/v2/database/models"
"github.com/gofiber/fiber/v3"
)
@@ -42,6 +43,42 @@ func (c *orders) Get(ctx fiber.Ctx, id int64) (*dto.SuperOrderDetail, error) {
return services.Super.GetOrder(ctx, id)
}
// Flag order
//
// @Router /super/v1/orders/:id<int>/flag [post]
// @Summary Flag order
// @Description Flag or unflag an order as problematic
// @Tags Order
// @Accept json
// @Produce json
// @Param id path int64 true "Order ID"
// @Param form body dto.SuperOrderFlagForm true "Flag form"
// @Success 200 {string} string "OK"
// @Bind user local key(__ctx_user)
// @Bind id path
// @Bind form body
func (c *orders) Flag(ctx fiber.Ctx, user *models.User, id int64, form *dto.SuperOrderFlagForm) error {
return services.Super.FlagOrder(ctx, user.ID, id, form)
}
// Reconcile order
//
// @Router /super/v1/orders/:id<int>/reconcile [post]
// @Summary Reconcile order
// @Description Mark or unmark order reconciliation status
// @Tags Order
// @Accept json
// @Produce json
// @Param id path int64 true "Order ID"
// @Param form body dto.SuperOrderReconcileForm true "Reconcile form"
// @Success 200 {string} string "OK"
// @Bind user local key(__ctx_user)
// @Bind id path
// @Bind form body
func (c *orders) Reconcile(ctx fiber.Ctx, user *models.User, id int64, form *dto.SuperOrderReconcileForm) error {
return services.Super.ReconcileOrder(ctx, user.ID, id, form)
}
// Refund order
//
// @Router /super/v1/orders/:id<int>/refund [post]