catala/examples/NSW_community_gaming/nsw_draw_lottery.catala_en
Louis Gesbert 71bb67163c Remove explicitely typed operators in tests and examples
Command used: `sed -i 's/\([-+*/><=]=\?\)[.$@^€$]/\1/g' **/*/*.catala_*`

The overload test, of course, is kept unchanged and ensures that explicit
operators still work.
2022-12-13 12:00:04 +01:00

53 lines
1.7 KiB
Plaintext

```catala
# Copyright © Aïda Ibrahim and Hugo Gimbert -- LaBRI/CNRS/Université de Bordeaux/Université de Nantes
```
```catala-metadata
declaration enumeration OrganisationType:
-- Charitable
--NonProfit
--NonCharitable
--ProfitOrg
declaration structure DrawLottery:
data typeOrg content OrganisationType
data grossProceeds content money
data totalValueOfThePrizes content money
data proceedsToBenefitingOrg content money
declaration scope GamingAuthorized:
input drawLottery content DrawLottery
output authorized condition
internal benefitingOrg content boolean
internal minimumProceeds content boolean
internal maxValueOfPrizes content boolean
```
A draw lottery is a permitted gaming activity for the purposes of section 10 of the Act
if the following requirements are complied with—
(a) the gaming activity is conducted by or on behalf of a charitable organisation
or a non-profit organisation,
```catala
scope GamingAuthorized:
definition benefitingOrg equals drawLottery.typeOrg with pattern OrganisationType.Charitable or drawLottery.typeOrg with pattern OrganisationType.NonProfit
```
(b) not less than 40% of the gross proceeds of the gaming activity are paid to the
benefiting organisation,
```catala
scope GamingAuthorized:
definition minimumProceeds equals drawLottery.proceedsToBenefitingOrg >= drawLottery.grossProceeds * 40 %
```
(c) the total value of all of the prizes does not exceed $30,000.
```catala
scope GamingAuthorized:
definition maxValueOfPrizes equals drawLottery.totalValueOfThePrizes <= $30,000
scope GamingAuthorized:
rule authorized
under condition benefitingOrg and minimumProceeds and maxValueOfPrizes
consequence fulfilled
```