mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 08:47:14 +03:00
71bb67163c
Command used: `sed -i 's/\([-+*/><=]=\?\)[.$@^€$]/\1/g' **/*/*.catala_*` The overload test, of course, is kept unchanged and ensures that explicit operators still work.
64 lines
2.5 KiB
Plaintext
64 lines
2.5 KiB
Plaintext
###
|
|
```catala-metadata
|
|
|
|
declaration enumeration OrganisationType :
|
|
-- Charitable
|
|
-- NonCharitable
|
|
|
|
declaration structure CharityHousie :
|
|
data typeOrg content OrganisationType
|
|
data grossProceeds content money
|
|
data totalValueOfThePrizes content money
|
|
data totalValueOfExpenses content money
|
|
data maxTicketsPerParticipant content integer
|
|
data proceedsToBenefitingOrganisation content money
|
|
|
|
declaration scope GamingAuthorized:
|
|
input charityHousie content CharityHousie
|
|
output authorized condition
|
|
#context benefitingOrg content Charitable
|
|
internal benefitingOrg content boolean
|
|
internal minimumProceeds content boolean
|
|
internal expenses content boolean
|
|
internal prizesTotal content boolean
|
|
internal maxTickets content boolean
|
|
```
|
|
|
|
(a) the gaming activity is conducted by or on behalf of a charitable organisation,
|
|
```catala
|
|
scope GamingAuthorized:
|
|
definition benefitingOrg equals (charityHousie.typeOrg with pattern OrganisationType.Charitable)
|
|
#definition benefitingOrg equals Charitable
|
|
#benefitingOrg = (charityHousie.typeOrg = Charitable)
|
|
```
|
|
(b) not less than 12.5% of the gross proceeds of the gaming activity are paid to the benefiting org
|
|
```catala
|
|
scope GamingAuthorized:
|
|
definition minimumProceeds equals charityHousie.proceedsToBenefitingOrganisation >= charityHousie.grossProceeds * 12.5 %
|
|
```
|
|
(c)the total value of the expenses of conducting the gaming activity (excluding
|
|
the cost of prizes) does not exceed 12.5% of the gross proceeds of the gaming activity
|
|
```catala
|
|
scope GamingAuthorized:
|
|
definition expenses equals (charityHousie.totalValueOfExpenses - charityHousie.totalValueOfThePrizes)<= charityHousie.grossProceeds * 12.5 %
|
|
```
|
|
(d) the total value of all of the prizes for 1 session of the gaming activity does not
|
|
exceed $10,000 and does not exceed 75% of the gross proceeds from the gaming activity
|
|
```catala
|
|
scope GamingAuthorized:
|
|
definition prizesTotal equals (charityHousie.totalValueOfThePrizes <= $10,000)
|
|
and (charityHousie.totalValueOfThePrizes <= charityHousie.grossProceeds* 75 %)
|
|
#definition prizesTotal equals (charityHousie.totalValuePrizePerSession <= 10.000)
|
|
#and (charityHousie.totalValuePrizePerSession <= (charityHousie.grossProceeds* 75%))
|
|
```
|
|
(e)no more than 48 tickets are permitted to be sold to the same participant
|
|
```catala
|
|
scope GamingAuthorized:
|
|
definition maxTickets equals charityHousie.maxTicketsPerParticipant <= 48
|
|
|
|
scope GamingAuthorized:
|
|
rule authorized
|
|
under condition benefitingOrg and minimumProceeds and expenses and prizesTotal and maxTickets
|
|
consequence fulfilled
|
|
```
|