stackin-python-sdk 0.8.0__py3-none-any.whl → 0.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
stackin/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Invoice __init__ module."""
2
2
 
3
- __version__ = "0.8.0"
3
+ __version__ = "0.9.0"
4
4
  __description__ = (
5
5
  "Python SDK for issuing, consulting and cancelling electronic invoices."
6
6
  )
stackin/br/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Brazil-specific document fields."""
2
2
 
3
- from stackin.br.product import PresumedCredit, Product
3
+ from stackin.br.product import IbsCbs, PresumedCredit, Product
4
4
  from stackin.br.tax import (
5
5
  CofinsAliq,
6
6
  CofinsNt,
@@ -42,6 +42,7 @@ from stackin.br.tax import (
42
42
 
43
43
  __all__ = [
44
44
  "Product",
45
+ "IbsCbs",
45
46
  "PresumedCredit",
46
47
  "Tax",
47
48
  "Icms00",
stackin/br/product.py CHANGED
@@ -10,6 +10,17 @@ from pydantic import BaseModel, Field
10
10
  from stackin.br.tax import Tax
11
11
 
12
12
 
13
+ class IbsCbs(BaseModel):
14
+ """The Reforma Tributária group for one item."""
15
+
16
+ cst: str = Field(pattern=r"^\d{3}$")
17
+ classification: str = Field(pattern=r"^\d{6}$")
18
+ base: float | None = Field(default=None, gt=0)
19
+ rate_state: float = Field(ge=0)
20
+ rate_city: float = Field(ge=0)
21
+ rate_federal: float = Field(ge=0)
22
+
23
+
13
24
  class PresumedCredit(BaseModel):
14
25
  """A presumed tax credit applied to this item."""
15
26
 
@@ -33,6 +44,7 @@ _BR_FIELDS = {
33
44
  "import_content_control_number",
34
45
  "recopi_number",
35
46
  "extra_groups",
47
+ "ibs_cbs",
36
48
  "tax",
37
49
  }
38
50
 
@@ -80,6 +92,7 @@ class Product(BaseModel):
80
92
  ),
81
93
  )
82
94
  recopi_number: str | None = Field(default=None, pattern=r"^\d{20}$")
95
+ ibs_cbs: IbsCbs | None = Field(default=None)
83
96
  extra_groups: dict[str, Any] | None = Field(default=None)
84
97
  tax: Tax | dict[str, Any] | None = Field(default=None)
85
98
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackin-python-sdk
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: Python SDK for issuing, consulting and cancelling electronic invoices.
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -137,7 +137,7 @@ invoice = client.issue(
137
137
  document_type=DocumentType.NFSE,
138
138
  client_name="John Doe",
139
139
  tax_id="00000000000",
140
- items=[Product(description="Software development", amount=5000.00)],
140
+ items=[Product(description="Software development", unit_price=Decimal("5000.00"))],
141
141
  )
142
142
 
143
143
  status = client.consult("ACCESS_KEY...", document_type=DocumentType.NFSE)
@@ -194,13 +194,15 @@ burned, and undoing it means cancelling, which has a deadline.
194
194
  Pass `idempotency_key` to make the retry safe:
195
195
 
196
196
  ```python
197
+ from decimal import Decimal
198
+
197
199
  key = str(uuid.uuid4())
198
200
 
199
201
  result = invoice.issue(
200
202
  document_type=DocumentType.NFSE,
201
203
  client_name="Maria Silva",
202
204
  tax_id="12345678909",
203
- items=[Product(description="Consultoria", amount=1500.00)],
205
+ items=[Product(description="Consultoria", unit_price=Decimal("1500.00"))],
204
206
  idempotency_key=key,
205
207
  )
206
208
  ```
@@ -1,13 +1,13 @@
1
- stackin/__init__.py,sha256=d07OH2vuFftm39TnZQmE1pIEWq3kHeTjkuRWFChVVE8,531
2
- stackin/br/__init__.py,sha256=ktBhaGVPE81n8r5jdIloERq4x9B2AE1k9-1IlzqVhVM,1184
3
- stackin/br/product.py,sha256=DrQ0DGIfQlJh8ANN1xK74y8LXnMLZGtN8bV_zsOpn14,4431
1
+ stackin/__init__.py,sha256=3t_IUn9nn3GSfJp-qb-h5xisouQu1jXmits5PONx1yA,531
2
+ stackin/br/__init__.py,sha256=-s-2-ZyCmGZA8jTR8KFgNOSoPjjgV57Ss_cdI-FjRRY,1206
3
+ stackin/br/product.py,sha256=4T5urNCi0LJrxs03Kt2vbXs1DBzYlRijBULWxi6bZ44,4830
4
4
  stackin/br/tax.py,sha256=UxcYX-kJw1HxUixB0hRABSgoHqT6CLoEjup4xIRFaYg,54747
5
5
  stackin/core/__init__.py,sha256=dxtOP1DopMSNFYGh3Hf12RVcs58R9xwLn-gqfKFo-HE,19
6
6
  stackin/core/address.py,sha256=-w5R3nzfU5T3VoxIeygu5Dq4DRb_lJHAGc0lmSMwEMU,616
7
7
  stackin/core/client.py,sha256=G80o4ORwNtazasIlmJBEhyrwG5VgTAsit9MTxK7FcEI,12086
8
8
  stackin/core/exceptions.py,sha256=ELn-uL8rwjAFsD1PgM8Zr-1if3Z5yOWU81chUs4k6tU,505
9
9
  stackin/core/types.py,sha256=NpfYVN58Ug9fEY7VYeQ2TC1eekoFGHZq_habvrqEeTY,604
10
- stackin_python_sdk-0.8.0.dist-info/METADATA,sha256=s_AljpFSzWMedZupxxXaCkcDbEf90TjdV4Zdb0Z8AsE,13101
11
- stackin_python_sdk-0.8.0.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
12
- stackin_python_sdk-0.8.0.dist-info/licenses/LICENSE,sha256=D-XHDcKFFhzEo9C5Dp4QPvt00pb_u__hi4Bc08zpxyU,1072
13
- stackin_python_sdk-0.8.0.dist-info/RECORD,,
10
+ stackin_python_sdk-0.9.0.dist-info/METADATA,sha256=zbT293Pa4yPTsivPQS46yx5NcIZU_YaT1npTt9dh8Jc,13160
11
+ stackin_python_sdk-0.9.0.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
12
+ stackin_python_sdk-0.9.0.dist-info/licenses/LICENSE,sha256=D-XHDcKFFhzEo9C5Dp4QPvt00pb_u__hi4Bc08zpxyU,1072
13
+ stackin_python_sdk-0.9.0.dist-info/RECORD,,