feat: 延期资格返回套餐名称、资产、订购时间、到期时间与沉默期截止时间
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 25m44s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 25m44s
This commit is contained in:
@@ -270,7 +270,21 @@ func (s *ExtensionService) Eligibility(ctx context.Context, usageID uint, scope
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return eligibilityResponse(facts), nil
|
||||
resp := eligibilityResponse(facts)
|
||||
// 办理延期时一并展示套餐订购时间、到期时间与沉默期截止时间
|
||||
resp.PackageName = usage.PackageName
|
||||
resp.PurchasedAt = usage.SilenceStartAt
|
||||
if resp.PurchasedAt == nil {
|
||||
createdAt := usage.CreatedAt
|
||||
resp.PurchasedAt = &createdAt
|
||||
}
|
||||
resp.ActivatedAt = usage.ActivatedAt
|
||||
resp.ExpiresAt = usage.ExpiresAt
|
||||
resp.SilenceDeadlineAt = usage.SilenceDeadlineAt
|
||||
if identifier, idErr := assetIdentifier(ctx, s.db, usage); idErr == nil {
|
||||
resp.AssetIdentifier = identifier
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// Quote 按输入天数试算付费延期。
|
||||
|
||||
@@ -115,6 +115,12 @@ type SilenceExtensionOption struct {
|
||||
// SilenceEligibilityResponse 延期资格(技术方案 §12.2),金额与月数全部由后端计算。
|
||||
type SilenceEligibilityResponse struct {
|
||||
PackageUsageID uint `json:"package_usage_id" description:"套餐记录 ID"`
|
||||
PackageName string `json:"package_name,omitempty" description:"套餐名称"`
|
||||
AssetIdentifier string `json:"asset_identifier,omitempty" description:"资产标识"`
|
||||
PurchasedAt *time.Time `json:"purchased_at,omitempty" description:"套餐订购时间(购买支付成功时间)"`
|
||||
ActivatedAt *time.Time `json:"activated_at,omitempty" description:"套餐生效时间(未实名激活时为空)"`
|
||||
ExpiresAt *time.Time `json:"expires_at,omitempty" description:"套餐到期时间(未实名激活时为空)"`
|
||||
SilenceDeadlineAt *time.Time `json:"silence_deadline_at,omitempty" description:"沉默期截止时间(截止日 23:59:59)"`
|
||||
SilenceStatus string `json:"silence_status" description:"沉默期状态(待实名但已到期的先判定为过期)"`
|
||||
CanExtend bool `json:"can_extend" description:"能否办理付费延期"`
|
||||
SpecialExtensionAvailable bool `json:"special_extension_available" description:"能否申请特殊延期(只要求套餐已过期)"`
|
||||
|
||||
Reference in New Issue
Block a user