Implement FCM
This commit is contained in:
@@ -253,3 +253,17 @@ func (p *UserProcessorImpl) UpdateUserOutlet(ctx context.Context, userID uuid.UU
|
||||
|
||||
return mappers.UserEntityToResponse(existingUser), nil
|
||||
}
|
||||
|
||||
func (p *UserProcessorImpl) UpdateFcmToken(ctx context.Context, userID uuid.UUID, fcmToken string) error {
|
||||
_, err := p.userRepo.GetByID(ctx, userID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("user not found: %w", err)
|
||||
}
|
||||
|
||||
err = p.userRepo.UpdateFcmToken(ctx, userID, fcmToken)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update FCM token: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -19,4 +19,6 @@ type UserRepository interface {
|
||||
UpdateActiveStatus(ctx context.Context, id uuid.UUID, isActive bool) error
|
||||
List(ctx context.Context, filters map[string]interface{}, limit, offset int) ([]*entities.User, int64, error)
|
||||
Count(ctx context.Context, filters map[string]interface{}) (int64, error)
|
||||
UpdateFcmToken(ctx context.Context, id uuid.UUID, fcmToken string) error
|
||||
GetUsersWithFcmTokenByOrganization(ctx context.Context, organizationID uuid.UUID) ([]*entities.User, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user