catala/examples/NSW_community_gaming/nsw_no_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

60 lines
2.0 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 NoDrawLottery:
data typeOrg content OrganisationType
data grossProceeds content money
data totalValueOfThePrizes content money
data proceedsToBenefitingOrg content money
data maxTickets content integer
declaration scope GamingAuthorized:
input noDrawLottery content NoDrawLottery
output authorized condition
internal benefitingOrg content boolean
internal minimumProceeds content boolean
internal maxValueOfPrizes content boolean
internal maxTicketsProduced content boolean
```
A no-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 noDrawLottery.typeOrg with pattern OrganisationType.Charitable
or noDrawLottery.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 noDrawLottery.proceedsToBenefitingOrg >= noDrawLottery.grossProceeds * 40 %
```
(c) the total value of all of the prizes does not exceed $5,000,
```catala
scope GamingAuthorized:
definition maxValueOfPrizes equals noDrawLottery.totalValueOfThePrizes <= $5,000
```
(d) the total number of tickets produced or obtained for sale for the lottery does
not exceed 3,000.
```catala
scope GamingAuthorized:
definition maxTicketsProduced equals noDrawLottery.maxTickets <= 3000
scope GamingAuthorized:
rule authorized
under condition benefitingOrg and minimumProceeds and maxValueOfPrizes and maxTicketsProduced
consequence fulfilled
```