S++Core systems, human-reviewable
DEMO SOURCE · SPP / APP / PHYRead the book

petshop-05-checks.spp

petshop/membership/petshop-05-checks.spp

Download original file · Petstore source contents

1domain petshop;23atomic check checkProfileAgreementInput(ProfileAgreement) {4    require(profileAgreement.newName != BLANK, RejectionCode.NAME_REQUIRED);5    require(profileAgreement.newEmail != BLANK, RejectionCode.EMAIL_REQUIRED);6    require(profileAgreement.newAddress != BLANK, RejectionCode.ADDRESS_REQUIRED);7    require(8        profileAgreement.newTier == MemberTier.NORMAL || profileAgreement.newTier == MemberTier.VIP,9        RejectionCode.INVALID_MEMBER_TIER10    );11}