Files
quyun-v2/backend/app/http/tenant/dto/order_admin.go
Rogee 1da84f2af3 feat: add TenantLedger model and query generation
- Introduced TenantLedger model with fields for managing tenant transactions, including ID, TenantID, UserID, OrderID, transaction Type, Amount, and balance details.
- Implemented CRUD operations for TenantLedger with methods for Create, Update, Delete, and Reload.
- Generated query methods for TenantLedger to facilitate database interactions, including filtering, pagination, and aggregation functions.
- Established relationships with Order model for foreign key references.
2025-12-18 13:12:26 +08:00

37 lines
1.4 KiB
Go
Raw 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.
package dto
import (
"quyun/v2/app/requests"
"quyun/v2/database/models"
"quyun/v2/pkg/consts"
)
// AdminOrderListFilter defines query filters for tenant-admin order listing.
type AdminOrderListFilter struct {
// Pagination controls paging parameters (page/limit).
requests.Pagination `json:",inline" query:",inline"`
// UserID filters orders by buyer user id.
UserID *int64 `json:"user_id,omitempty" query:"user_id"`
// Status filters orders by order status.
Status *consts.OrderStatus `json:"status,omitempty" query:"status"`
}
// AdminOrderRefundForm defines payload for tenant-admin to refund an order.
type AdminOrderRefundForm struct {
// Force indicates bypassing the default refund window check (paid_at + 24h).
// 强制退款true 表示绕过默认退款时间窗限制(需审计)。
Force bool `json:"force,omitempty"`
// Reason is the human-readable refund reason used for audit.
// 退款原因:建议必填(由业务侧校验);用于审计与追责。
Reason string `json:"reason,omitempty"`
// IdempotencyKey ensures refund request is processed at most once.
// 幂等键:同一笔退款重复请求时返回一致结果,避免重复退款/重复回滚。
IdempotencyKey string `json:"idempotency_key,omitempty"`
}
// AdminOrderDetail returns a tenant-admin order detail payload.
type AdminOrderDetail struct {
// Order is the order with items preloaded.
Order *models.Order `json:"order,omitempty"`
}