2026-07-09 13:02:49 +08:00

87 lines
3.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 ledger
// HostSalarySettlementBatchCommand 是 cron 或测试触发结算批处理的最小输入。
type HostSalarySettlementBatchCommand struct {
AppCode string
RunID string
WorkerID string
BatchSize int
SettlementType string
// TriggerMode 只决定本次入账动作读取 automatic 还是 manual 政策;待结算账单展示可以同时读取两类政策。
TriggerMode string
// SettlementRole 为空或 all 时完整结算主播和代理权益;后台人工入口传 host/agency 时只推进对应身份钱包。
SettlementRole string
CycleKey string
// UserIDs 为空时扫描全量候选;后台人工批量结算会传入勾选主播,防止跨区域或跨周期误结算。
UserIDs []int64
NowMs int64
}
// HostSalarySettlementBatchResult 汇总一个结算批次的扫描和入账结果。
type HostSalarySettlementBatchResult struct {
ClaimedCount int
ProcessedCount int
SuccessCount int
FailureCount int
HasMore bool
}
// HostSalaryPolicy 是 wallet-service 结算读取的后台政策运行快照。
type HostSalaryPolicy struct {
PolicyID uint64
Name string
RegionID int64
Status string
SettlementMode string
SettlementTriggerMode string
GiftCoinToDiamondRatio string
ResidualDiamondToUSDRate string
EffectiveFromMs int64
EffectiveToMs int64
Levels []HostSalaryPolicyLevel
}
// HostSalaryPolicyLevel 使用累计值表达工资和奖励,结算时只发放“当前累计 - 已发累计”的差额。
type HostSalaryPolicyLevel struct {
LevelNo int
RequiredDiamonds int64
HostSalaryUSDMinor int64
HostCoinReward int64
AgencySalaryUSDMinor int64
Status string
SortOrder int
}
// HostSalaryProgress 是主播当前工资周期的钻石累计投影,用于 H5 按工资政策计算距离下一等级的差值。
type HostSalaryProgress struct {
HostUserID int64
CycleKey string
RegionID int64
AgencyOwnerUserID int64
TotalDiamonds int64
GiftDiamondTotal int64
UpdatedAtMS int64
}
// TeamHostSalaryStatsQuery 按 Agency 收款人集合聚合主播工资统计的查询条件。
// 收款人集合由调用方gateway从 user-service 组织树解析wallet 只按周期账户上的 agency_owner_user_id 快照聚合。
type TeamHostSalaryStatsQuery struct {
AgencyOwnerUserIDs []int64
CycleKeys []string
// NowMs 用于解析各区域当前生效的工资政策做档位估算。
NowMs int64
}
// TeamHostSalaryCycleStat 是一组 Agency 收款人名下主播在单个工资周期的工资统计。
// Estimated 是“预收入”口径:按当前累计钻石命中的档位累计工资 + 超出档位的剩余钻石按月底费率折美元,
// 与已结算累计取大;已关闭周期读出来即真实发放值,进行中周期是“立刻月结能拿多少”的估算。
type TeamHostSalaryCycleStat struct {
CycleKey string
EstimatedHostSalaryUSDMinor int64
// SettledHostSalaryUSDMinor 含月底剩余钻石折美元部分,等于该周期实际入账主播工资钱包的美元累计。
SettledHostSalaryUSDMinor int64
// ActiveHostCount 统计该周期内累计钻石大于 0 的主播数。
ActiveHostCount int
TotalDiamonds int64
}