Documentation
¶
Index ¶
- type Service
- func (s *Service) GetUserSubscription(ctx context.Context, userUuid uuid.UUID) (domain.Subscription, domain.EffectiveSubscription, error)
- func (s *Service) ListPlans(ctx context.Context) ([]domain.SubscriptionPlan, error)
- func (s *Service) UpdateUserSubscription(ctx context.Context, sub domain.Subscription) (domain.EffectiveSubscription, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(plans repository.SubscriptionPlansRepo, subscriptions repository.Subscriptions) *Service
func (*Service) GetUserSubscription ¶
func (s *Service) GetUserSubscription( ctx context.Context, userUuid uuid.UUID, ) (domain.Subscription, domain.EffectiveSubscription, error)
func (*Service) UpdateUserSubscription ¶
func (s *Service) UpdateUserSubscription( ctx context.Context, sub domain.Subscription, ) (domain.EffectiveSubscription, error)
UpdateUserSubscription writes the admin-supplied active flag, plan assignment, and overrides in place — the two writes aren't transactional, but they're both idempotent full-replace upserts on the same row, so a failure between them just leaves the next admin save to retry.
Click to show internal directories.
Click to hide internal directories.