## Review Code: viethung2281996
### Domain
- Tính đúng sai:
- Kiến trúc:
- model
- handler (hầu hết logic ở đây)
- view
- Test: không test
- Python:
- Code có nhiều đoạn có thể sử dụng List comprehension nhưng không thấy dùng => Không biết có biết hay không (ví dụ các hàm get_stock, get_priorities, get_orders,..)
```python
payed_orders = []
for order in self.orders:
if order.status == 'SHIPPING':
payed_orders.append(order)
return payed_orders
```
better:
```python
return [
order for order in self.orders
if order.status == 'SHIPPING'
]
```
- phức tạp hóa =))
```python
return True if self.agent_stock[agent] >= quanlity else False
```
- phức tạp hóa (do không hiểu bản chất):
```python
reader = csv.DictReader(csvfile, delimiter=',', quotechar='|')
headers = reader.fieldnames
for row in reader:
item = {}
for header in headers:
item[header] = row[header]
data.append(item)
return data
```
better:
```python
csvfile = (line.decode('utf8') for line in file)
reader = csv.DictReader(csvfile, delimiter=',', quotechar='|')
return list(reader)
```