Skip to content

Commit 8a8727c

Browse files
committed
SCG: 1.0.0 : NA #4 fixed issue
1 parent 73d74c6 commit 8a8727c

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

.env.example

Whitespace-only changes.

docker-compose.yml

Whitespace-only changes.

requirements.txt

Whitespace-only changes.

src/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
from collections import namedtuple
22
from decimal import Decimal
33

4+
45
Order = namedtuple('Order', 'id, items')
56
Item = namedtuple('Item', 'type, description, amount, quantity')
67

8+
79
MAX_ITEM_AMOUNT = 100000 # maximum price of item in the shop
810
MAX_QUANTITY = 100 # maximum quantity of an item in the shop
911
MIN_QUANTITY = 0 # minimum quantity of an item in the shop
1012
MAX_TOTAL = 1e6 # maximum total amount accepted for an order
1113

14+
1215
def validorder(order):
1316
payments = Decimal('0')
1417
expenses = Decimal('0')
1518

19+
1620
for item in order.items:
1721
if item.type == 'payment':
1822
# Sets a reasonable min & max value for the invoice amounts

0 commit comments

Comments
 (0)