Rewards
Platform smile rewards vs challenge smile rewards
Platform smile rewards are rows in smile_rewards, modeled by Domain/SmileRewards/Models/SmileReward.php. They have no store_id. They are enabled on the platform (CanBeEnabledOnPlatforms). Challenge smile rewards are not that table. The amount sits on the challenge as smiles_reward_count, with has_auto_smiles_reward. Whether a given signup was paid is a user_challenge_smile_rewards row (Domain/Challenges/Models/UserChallengeSmileReward.php).
Platform smile rewards are given when a questionnaire or a factor (sub-questionnaire) is completed. Challenge smile rewards are given when a user completes a challenge, and only when has_auto_smiles_reward is true (RewardEmployeeWithSmilesOnChallengeCompletion listens for UserCompletedAChallenge).
Challenge smile rewards
The challenge stores the smile amount. user_challenge_smile_rewards records that this signup already received it. Activity log tracking codes also record the reward.
Platform smile rewards
Domain/SmileRewards/Enums/SmileRewardType.php has two cases: questionnaire and factor.
A factor reward can point at more than one factor. Completing one of those factors is enough.
A user can receive a given reward once per validity period.