test(invitation): 建立邀请返利全状态全组合正交测试套件并修复布尔零值持久化缺陷

- 设计并落地 6 大测试组共 37 个组合场景(绑定准入、实名生命周期、周期滑窗阶梯、双边角色矩阵、分站独立继承、金额极值与幂等性)
- 修复 GORM 在 default:true 标签下忽略布尔零值导致分站关闭返利失效的缺陷
- 在 UpdateRebateConfig 中使用显式 Select 保证 Enabled 字段 100% 精确持久化
- 验证方式:go test -v ./internal/modules/invitation/... 全部通过,耗时约 1.2s
This commit is contained in:
yml2213
2026-10-10 14:07:48 +08:00
parent f5202c6080
commit f19c9f62b7
3 changed files with 821 additions and 3 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ type InvitationRebateConfig struct {
FirstMonthRate float64 `gorm:"type:decimal(6,4);not null;default:0.6000" json:"first_month_rate"`
SecondMonthRate float64 `gorm:"type:decimal(6,4);not null;default:0.3000" json:"second_month_rate"`
SubsequentRate float64 `gorm:"type:decimal(6,4);not null;default:0.1500" json:"subsequent_rate"`
Enabled bool `gorm:"not null;default:true" json:"enabled"`
Enabled bool `gorm:"not null" json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}