feat(ECR-014): MembershipPlan 套餐配置并 Closed
membership_plans 表、admin 套餐页、Grant/CreateOrder 读表; Loop continuous 自动 Approve/Closed。Next:ECR-015 RedemptionCode。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -34,7 +34,17 @@ func (s *Service) CreateOrder(ctx context.Context, userID uuid.UUID, in CreateOr
|
||||
amount := 990
|
||||
plan := in.Plan
|
||||
if in.Kind == "membership" {
|
||||
amount = 2500
|
||||
if plan == "" {
|
||||
plan = "month"
|
||||
}
|
||||
a, err := s.Reports.MembershipPlanAmountCents(ctx, plan)
|
||||
if err != nil {
|
||||
return uuid.Nil, err
|
||||
}
|
||||
if a <= 0 {
|
||||
return uuid.Nil, errors.New("invalid membership plan")
|
||||
}
|
||||
amount = a
|
||||
}
|
||||
if in.Kind == "ask_pack" {
|
||||
if plan == "" {
|
||||
|
||||
Reference in New Issue
Block a user