Documentation
¶
Overview ¶
Package trial grants the registration trial subscription. It consumes the identity.user_registered event: the grant runs in a subscription-domain transaction, idempotent via the inbox marker, serialized per user by the subscription serial lock. Only the module facade may reach it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Plans repository.SubscribeRepo
Cache repository.UserCacheRepo
Store repository.Store
// TrialPolicy snapshots the runtime-mutable trial settings per call.
TrialPolicy func() Policy
}
Deps declares the subdomain's dependencies; the module facade forwards them from the composition root.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the trial-grant entry point used by the subscription facade.
func NewService ¶
func (*Service) GrantTrial ¶
GrantTrial applies the registration trial exactly once for the user. A disabled trial still consumes the event (the marker records the decision), so a later policy change never retroactively grants trials to old registrations — matching the old in-transaction behavior where the policy was evaluated at registration time.