9
9
__all__ = [
10
10
"CreditNote" ,
11
11
"Customer" ,
12
- "Discount" ,
13
- "DiscountAppliesToPrice" ,
14
12
"LineItem" ,
15
- "LineItemDiscount" ,
16
13
"LineItemTaxAmount" ,
14
+ "LineItemDiscount" ,
17
15
"MaximumAmountAdjustment" ,
18
16
"MaximumAmountAdjustmentAppliesToPrice" ,
17
+ "Discount" ,
18
+ "DiscountAppliesToPrice" ,
19
19
]
20
20
21
21
@@ -25,22 +25,15 @@ class Customer(BaseModel):
25
25
external_customer_id : Optional [str ] = None
26
26
27
27
28
- class DiscountAppliesToPrice (BaseModel ):
29
- id : str
30
-
31
- name : str
32
-
33
-
34
- class Discount (BaseModel ):
35
- amount_applied : str
36
-
37
- discount_type : Literal ["percentage" ]
38
-
39
- percentage_discount : float
28
+ class LineItemTaxAmount (BaseModel ):
29
+ amount : str
30
+ """The amount of additional tax incurred by this tax rate."""
40
31
41
- applies_to_prices : Optional [List [DiscountAppliesToPrice ]] = None
32
+ tax_rate_description : str
33
+ """The human-readable description of the applied tax rate."""
42
34
43
- reason : Optional [str ] = None
35
+ tax_rate_percentage : Optional [str ] = None
36
+ """The tax rate percentage, out of 100."""
44
37
45
38
46
39
class LineItemDiscount (BaseModel ):
@@ -59,27 +52,13 @@ class LineItemDiscount(BaseModel):
59
52
reason : Optional [str ] = None
60
53
61
54
62
- class LineItemTaxAmount (BaseModel ):
63
- amount : str
64
- """The amount of additional tax incurred by this tax rate."""
65
-
66
- tax_rate_description : str
67
- """The human-readable description of the applied tax rate."""
68
-
69
- tax_rate_percentage : Optional [str ] = None
70
- """The tax rate percentage, out of 100."""
71
-
72
-
73
55
class LineItem (BaseModel ):
74
56
id : str
75
57
"""The Orb id of this resource."""
76
58
77
59
amount : str
78
60
"""The amount of the line item, including any line item minimums and discounts."""
79
61
80
- discounts : List [LineItemDiscount ]
81
- """Any line item discounts from the invoice's line item."""
82
-
83
62
name : str
84
63
"""The name of the corresponding invoice line item."""
85
64
@@ -92,6 +71,9 @@ class LineItem(BaseModel):
92
71
tax_amounts : List [LineItemTaxAmount ]
93
72
"""Any tax amounts applied onto the line item."""
94
73
74
+ discounts : Optional [List [LineItemDiscount ]] = None
75
+ """Any line item discounts from the invoice's line item."""
76
+
95
77
96
78
class MaximumAmountAdjustmentAppliesToPrice (BaseModel ):
97
79
id : str
@@ -111,6 +93,24 @@ class MaximumAmountAdjustment(BaseModel):
111
93
reason : Optional [str ] = None
112
94
113
95
96
+ class DiscountAppliesToPrice (BaseModel ):
97
+ id : str
98
+
99
+ name : str
100
+
101
+
102
+ class Discount (BaseModel ):
103
+ amount_applied : str
104
+
105
+ discount_type : Literal ["percentage" ]
106
+
107
+ percentage_discount : float
108
+
109
+ applies_to_prices : Optional [List [DiscountAppliesToPrice ]] = None
110
+
111
+ reason : Optional [str ] = None
112
+
113
+
114
114
class CreditNote (BaseModel ):
115
115
id : str
116
116
"""The Orb id of this credit note."""
@@ -126,9 +126,6 @@ class CreditNote(BaseModel):
126
126
127
127
customer : Customer
128
128
129
- discounts : List [Discount ]
130
- """Any discounts applied on the original invoice."""
131
-
132
129
invoice_id : str
133
130
"""The id of the invoice resource that this credit note is applied to."""
134
131
@@ -156,3 +153,6 @@ class CreditNote(BaseModel):
156
153
157
154
voided_at : Optional [datetime ] = None
158
155
"""The time at which the credit note was voided in Orb, if applicable."""
156
+
157
+ discounts : Optional [List [Discount ]] = None
158
+ """Any discounts applied on the original invoice."""
0 commit comments