Total Complexity | 0 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | """ |
||
2 | byceps.services.shop.order.models.checkout |
||
3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
4 | |||
5 | :Copyright: 2014-2024 Jochen Kupperschmidt |
||
6 | :License: Revised BSD (see `LICENSE` file for details) |
||
7 | """ |
||
8 | |||
9 | 1 | from dataclasses import dataclass |
|
10 | from datetime import datetime |
||
11 | 1 | from decimal import Decimal |
|
12 | 1 | ||
13 | 1 | from moneyed import Money |
|
14 | |||
15 | 1 | from byceps.services.shop.article.models import ( |
|
16 | ArticleID, |
||
17 | 1 | ArticleNumber, |
|
18 | ArticleType, |
||
19 | ) |
||
20 | from byceps.services.shop.shop.models import ShopID |
||
21 | from byceps.services.shop.storefront.models import StorefrontID |
||
22 | 1 | ||
23 | 1 | from .order import LineItemID, Orderer, OrderID |
|
24 | |||
25 | 1 | ||
26 | @dataclass(frozen=True) |
||
27 | class IncomingLineItem: |
||
28 | 1 | id: LineItemID |
|
29 | 1 | article_id: ArticleID |
|
30 | 1 | article_number: ArticleNumber |
|
31 | 1 | article_type: ArticleType |
|
32 | 1 | name: str |
|
33 | 1 | unit_price: Money |
|
34 | 1 | tax_rate: Decimal |
|
35 | 1 | quantity: int |
|
36 | 1 | line_amount: Money |
|
37 | 1 | processing_required: bool |
|
38 | 1 | ||
39 | |||
40 | @dataclass(frozen=True) |
||
41 | 1 | class IncomingOrder: |
|
42 | 1 | id: OrderID |
|
43 | 1 | created_at: datetime |
|
44 | 1 | shop_id: ShopID |
|
45 | 1 | storefront_id: StorefrontID |
|
46 | 1 | orderer: Orderer |
|
47 | 1 | line_items: list[IncomingLineItem] |
|
48 | 1 | total_amount: Money |
|
49 | processing_required: bool |
||
50 |