Skip to content

Instantly share code, notes, and snippets.

@JefClaes
Created March 15, 2015 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JefClaes/2ec6d6168353f099102f to your computer and use it in GitHub Desktop.
Save JefClaes/2ec6d6168353f099102f to your computer and use it in GitHub Desktop.
Scaling promotion codes I
public bool TryRedeem(UserId userId)
{
if (HasAlreadyBeenRedeemedByUser(userId)) return false;
if (NoLongerActive()) return false;
if (Depleted()) return false;
Apply(new PromotionCodeRedeemed(userId.Value));
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment