feat: add stickers
This commit is contained in:
@@ -398,6 +398,28 @@ func (s *SadhnaService) Rewards(ctx context.Context, userID string) ([]model.Sad
|
||||
|
||||
// AckRewards clears the user's pending celebration(s) after the client has
|
||||
// shown the confetti.
|
||||
// OpenGift un-blurs one gift after the devotee has seen its celebration.
|
||||
//
|
||||
// Per gift, not per user: someone with two waiting should open them one at a
|
||||
// time rather than have the first dismissal clear both.
|
||||
func (s *SadhnaService) OpenGift(ctx context.Context, userID, rewardKey string) error {
|
||||
return s.rewards.OpenGift(ctx, userID, rewardKey)
|
||||
}
|
||||
|
||||
// GiftToEveryone hands a reward to every account. Returns how many it reached.
|
||||
func (s *SadhnaService) GiftToEveryone(ctx context.Context, rewardKey string) (int64, error) {
|
||||
reward, err := s.rewards.ByKey(ctx, rewardKey)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return s.rewards.GrantGiftToEveryone(ctx, reward.ID)
|
||||
}
|
||||
|
||||
// GiftableRewards is the catalog an admin picks from.
|
||||
func (s *SadhnaService) GiftableRewards(ctx context.Context) ([]model.SadhnaReward, error) {
|
||||
return s.rewards.ListGiftable(ctx)
|
||||
}
|
||||
|
||||
func (s *SadhnaService) AckRewards(ctx context.Context, userID string) error {
|
||||
return s.rewards.MarkCelebrated(ctx, userID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user