cloudbeds-fiscal-document 1.10.0__py3-none-any.whl → 1.12.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.
- cloudbeds_fiscal_document/__init__.py +2 -1
- cloudbeds_fiscal_document/api/fiscal_documents_api.py +22 -388
- cloudbeds_fiscal_document/api_client.py +1 -1
- cloudbeds_fiscal_document/configuration.py +1 -1
- cloudbeds_fiscal_document/models/__init__.py +1 -0
- cloudbeds_fiscal_document/models/configs_response.py +1 -3
- cloudbeds_fiscal_document/models/configs_update_request.py +9 -5
- cloudbeds_fiscal_document/models/create_receipt_request.py +3 -5
- cloudbeds_fiscal_document/models/document_trigger_event.py +1 -0
- cloudbeds_fiscal_document/models/fiscal_document_kind.py +1 -1
- cloudbeds_fiscal_document/models/government_integration.py +3 -5
- cloudbeds_fiscal_document/models/transaction_for_allocation_response.py +4 -1
- cloudbeds_fiscal_document/models/transaction_status.py +37 -0
- cloudbeds_fiscal_document/test/test_configs_api.py +28 -0
- cloudbeds_fiscal_document/test/test_configs_response.py +9 -1
- cloudbeds_fiscal_document/test/test_configs_update_request.py +12 -4
- cloudbeds_fiscal_document/test/test_create_credit_note_request.py +13 -6
- cloudbeds_fiscal_document/test/test_create_invoice_request.py +22 -8
- cloudbeds_fiscal_document/test/test_fiscal_document_detailed_response.py +32 -5
- cloudbeds_fiscal_document/test/test_fiscal_document_paginated.py +29 -7
- cloudbeds_fiscal_document/test/test_fiscal_document_patch_request.py +3 -1
- cloudbeds_fiscal_document/test/test_fiscal_document_recipient.py +25 -3
- cloudbeds_fiscal_document/test/test_fiscal_document_summary_response.py +2 -1
- cloudbeds_fiscal_document/test/test_fiscal_document_transaction_response.py +7 -1
- cloudbeds_fiscal_document/test/test_fiscal_document_transactions_for_allocation_paginated.py +1 -0
- cloudbeds_fiscal_document/test/test_fiscal_document_transactions_paginated.py +7 -1
- cloudbeds_fiscal_document/test/test_fiscal_documents_api.py +113 -1
- cloudbeds_fiscal_document/test/test_get_invoice_preview_request.py +2 -1
- cloudbeds_fiscal_document/test/test_government_integration.py +2 -1
- cloudbeds_fiscal_document/test/test_recipient_details.py +4 -2
- cloudbeds_fiscal_document/test/test_recipient_tax_info.py +2 -1
- cloudbeds_fiscal_document/test/test_rectify_invoice_note_request.py +9 -0
- cloudbeds_fiscal_document/test/test_transaction_for_allocation_response.py +3 -1
- cloudbeds_fiscal_document/test/test_transaction_status.py +33 -0
- {cloudbeds_fiscal_document-1.10.0.dist-info → cloudbeds_fiscal_document-1.12.0.dist-info}/METADATA +3 -3
- {cloudbeds_fiscal_document-1.10.0.dist-info → cloudbeds_fiscal_document-1.12.0.dist-info}/RECORD +39 -37
- {cloudbeds_fiscal_document-1.10.0.dist-info → cloudbeds_fiscal_document-1.12.0.dist-info}/WHEEL +0 -0
- {cloudbeds_fiscal_document-1.10.0.dist-info → cloudbeds_fiscal_document-1.12.0.dist-info}/licenses/LICENSE +0 -0
- {cloudbeds_fiscal_document-1.10.0.dist-info → cloudbeds_fiscal_document-1.12.0.dist-info}/top_level.txt +0 -0
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field,
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from cloudbeds_fiscal_document.models.receipt_transaction_allocation import ReceiptTransactionAllocation
|
|
@@ -38,8 +38,7 @@ class CreateReceiptRequest(BaseModel):
|
|
|
38
38
|
source_id: Annotated[int, Field(strict=True, ge=1)] = Field(alias="sourceId")
|
|
39
39
|
source_kind: SourceKind = Field(alias="sourceKind")
|
|
40
40
|
recipient: RecipientRequest
|
|
41
|
-
|
|
42
|
-
__properties: ClassVar[List[str]] = ["allocations", "transactionId", "paymentId", "sequenceId", "userId", "sourceId", "sourceKind", "recipient", "generateReceipt"]
|
|
41
|
+
__properties: ClassVar[List[str]] = ["allocations", "transactionId", "paymentId", "sequenceId", "userId", "sourceId", "sourceKind", "recipient"]
|
|
43
42
|
|
|
44
43
|
model_config = ConfigDict(
|
|
45
44
|
populate_by_name=True,
|
|
@@ -129,8 +128,7 @@ class CreateReceiptRequest(BaseModel):
|
|
|
129
128
|
"userId": obj.get("userId"),
|
|
130
129
|
"sourceId": obj.get("sourceId"),
|
|
131
130
|
"sourceKind": obj.get("sourceKind"),
|
|
132
|
-
"recipient": RecipientRequest.from_dict(obj["recipient"]) if obj.get("recipient") is not None else None
|
|
133
|
-
"generateReceipt": obj.get("generateReceipt") if obj.get("generateReceipt") is not None else True
|
|
131
|
+
"recipient": RecipientRequest.from_dict(obj["recipient"]) if obj.get("recipient") is not None else None
|
|
134
132
|
})
|
|
135
133
|
return _obj
|
|
136
134
|
|
|
@@ -30,6 +30,7 @@ class DocumentTriggerEvent(str, Enum):
|
|
|
30
30
|
AT_CHECK_OUT = 'at_check_out'
|
|
31
31
|
ON_RESERVATION_CREATED = 'on_reservation_created'
|
|
32
32
|
ON_PAYMENT_CREATION = 'on_payment_creation'
|
|
33
|
+
ON_ALLOCATION_CREATION = 'on_allocation_creation'
|
|
33
34
|
|
|
34
35
|
@classmethod
|
|
35
36
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -29,10 +29,10 @@ class FiscalDocumentKind(str, Enum):
|
|
|
29
29
|
INVOICE = 'INVOICE'
|
|
30
30
|
CREDIT_NOTE = 'CREDIT_NOTE'
|
|
31
31
|
RECEIPT = 'RECEIPT'
|
|
32
|
-
FISCALIZED_RECEIPT = 'FISCALIZED_RECEIPT'
|
|
33
32
|
RECTIFY_INVOICE = 'RECTIFY_INVOICE'
|
|
34
33
|
PRO_FORMA_INVOICE = 'PRO_FORMA_INVOICE'
|
|
35
34
|
REFUND_RECEIPT = 'REFUND_RECEIPT'
|
|
35
|
+
INVOICE_RECEIPT = 'INVOICE_RECEIPT'
|
|
36
36
|
|
|
37
37
|
@classmethod
|
|
38
38
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field,
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from cloudbeds_fiscal_document.models.fiscal_document_status import FiscalDocumentStatus
|
|
23
23
|
from cloudbeds_fiscal_document.models.government_integration_qr import GovernmentIntegrationQr
|
|
@@ -37,8 +37,7 @@ class GovernmentIntegration(BaseModel):
|
|
|
37
37
|
external_id: Optional[StrictStr] = Field(default=None, alias="externalId")
|
|
38
38
|
rectifying_invoice_type: Optional[StrictStr] = Field(default=None, alias="rectifyingInvoiceType")
|
|
39
39
|
cancellation_failed_fallback_status: Optional[FiscalDocumentStatus] = Field(default=None, alias="cancellationFailedFallbackStatus")
|
|
40
|
-
|
|
41
|
-
__properties: ClassVar[List[str]] = ["number", "series", "status", "qr", "url", "officialId", "externalId", "rectifyingInvoiceType", "cancellationFailedFallbackStatus", "generateReceipt"]
|
|
40
|
+
__properties: ClassVar[List[str]] = ["number", "series", "status", "qr", "url", "officialId", "externalId", "rectifyingInvoiceType", "cancellationFailedFallbackStatus"]
|
|
42
41
|
|
|
43
42
|
model_config = ConfigDict(
|
|
44
43
|
populate_by_name=True,
|
|
@@ -102,8 +101,7 @@ class GovernmentIntegration(BaseModel):
|
|
|
102
101
|
"officialId": obj.get("officialId"),
|
|
103
102
|
"externalId": obj.get("externalId"),
|
|
104
103
|
"rectifyingInvoiceType": obj.get("rectifyingInvoiceType"),
|
|
105
|
-
"cancellationFailedFallbackStatus": obj.get("cancellationFailedFallbackStatus")
|
|
106
|
-
"generateReceipt": obj.get("generateReceipt")
|
|
104
|
+
"cancellationFailedFallbackStatus": obj.get("cancellationFailedFallbackStatus")
|
|
107
105
|
})
|
|
108
106
|
return _obj
|
|
109
107
|
|
|
@@ -21,6 +21,7 @@ from datetime import datetime
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
23
|
from cloudbeds_fiscal_document.models.source_kind import SourceKind
|
|
24
|
+
from cloudbeds_fiscal_document.models.transaction_status import TransactionStatus
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
26
27
|
|
|
@@ -37,8 +38,9 @@ class TransactionForAllocationResponse(BaseModel):
|
|
|
37
38
|
internal_code: Optional[StrictStr] = Field(default=None, alias="internalCode")
|
|
38
39
|
amount: Optional[Union[StrictFloat, StrictInt]] = None
|
|
39
40
|
allocated_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="allocatedAmount")
|
|
41
|
+
status: Optional[TransactionStatus] = None
|
|
40
42
|
taxes: Optional[List[TransactionForAllocationResponse]] = None
|
|
41
|
-
__properties: ClassVar[List[str]] = ["id", "propertyId", "sourceId", "sourceKind", "transactionDate", "description", "internalCode", "amount", "allocatedAmount", "taxes"]
|
|
43
|
+
__properties: ClassVar[List[str]] = ["id", "propertyId", "sourceId", "sourceKind", "transactionDate", "description", "internalCode", "amount", "allocatedAmount", "status", "taxes"]
|
|
42
44
|
|
|
43
45
|
model_config = ConfigDict(
|
|
44
46
|
populate_by_name=True,
|
|
@@ -107,6 +109,7 @@ class TransactionForAllocationResponse(BaseModel):
|
|
|
107
109
|
"internalCode": obj.get("internalCode"),
|
|
108
110
|
"amount": obj.get("amount"),
|
|
109
111
|
"allocatedAmount": obj.get("allocatedAmount"),
|
|
112
|
+
"status": obj.get("status"),
|
|
110
113
|
"taxes": [TransactionForAllocationResponse.from_dict(_item) for _item in obj["taxes"]] if obj.get("taxes") is not None else None
|
|
111
114
|
})
|
|
112
115
|
return _obj
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Fiscal document service API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class TransactionStatus(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
Status for transactions
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
POSTED = 'POSTED'
|
|
30
|
+
PENDING = 'PENDING'
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_json(cls, json_str: str) -> Self:
|
|
34
|
+
"""Create an instance of TransactionStatus from a JSON string"""
|
|
35
|
+
return cls(json.loads(json_str))
|
|
36
|
+
|
|
37
|
+
|
|
@@ -26,6 +26,13 @@ class TestConfigsApi(unittest.TestCase):
|
|
|
26
26
|
def tearDown(self) -> None:
|
|
27
27
|
pass
|
|
28
28
|
|
|
29
|
+
def test_delete_logo(self) -> None:
|
|
30
|
+
"""Test case for delete_logo
|
|
31
|
+
|
|
32
|
+
Delete logo image for fiscal documents
|
|
33
|
+
"""
|
|
34
|
+
pass
|
|
35
|
+
|
|
29
36
|
def test_get_configs(self) -> None:
|
|
30
37
|
"""Test case for get_configs
|
|
31
38
|
|
|
@@ -33,6 +40,20 @@ class TestConfigsApi(unittest.TestCase):
|
|
|
33
40
|
"""
|
|
34
41
|
pass
|
|
35
42
|
|
|
43
|
+
def test_get_logo(self) -> None:
|
|
44
|
+
"""Test case for get_logo
|
|
45
|
+
|
|
46
|
+
Get logo image for fiscal documents
|
|
47
|
+
"""
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
def test_get_pdf_preview(self) -> None:
|
|
51
|
+
"""Test case for get_pdf_preview
|
|
52
|
+
|
|
53
|
+
Get PDF document preview
|
|
54
|
+
"""
|
|
55
|
+
pass
|
|
56
|
+
|
|
36
57
|
def test_update_configs(self) -> None:
|
|
37
58
|
"""Test case for update_configs
|
|
38
59
|
|
|
@@ -40,6 +61,13 @@ class TestConfigsApi(unittest.TestCase):
|
|
|
40
61
|
"""
|
|
41
62
|
pass
|
|
42
63
|
|
|
64
|
+
def test_upload_logo(self) -> None:
|
|
65
|
+
"""Test case for upload_logo
|
|
66
|
+
|
|
67
|
+
Upload logo image for fiscal documents
|
|
68
|
+
"""
|
|
69
|
+
pass
|
|
70
|
+
|
|
43
71
|
|
|
44
72
|
if __name__ == '__main__':
|
|
45
73
|
unittest.main()
|
|
@@ -38,6 +38,7 @@ class TestConfigsResponse(unittest.TestCase):
|
|
|
38
38
|
property_id = '',
|
|
39
39
|
document_kind = 'INVOICE',
|
|
40
40
|
show_detailed_tax_fee = True,
|
|
41
|
+
show_credit_notes_and_receipts = True,
|
|
41
42
|
charge_breakdown = True,
|
|
42
43
|
use_guest_lang = True,
|
|
43
44
|
due_days = 56,
|
|
@@ -57,7 +58,14 @@ class TestConfigsResponse(unittest.TestCase):
|
|
|
57
58
|
cpf = '',
|
|
58
59
|
custom_text = {
|
|
59
60
|
'key' : ''
|
|
60
|
-
}
|
|
61
|
+
},
|
|
62
|
+
create_invoice_on_allocation = True,
|
|
63
|
+
trigger_events = [
|
|
64
|
+
'manual'
|
|
65
|
+
],
|
|
66
|
+
update_invoice_on_link_document = True,
|
|
67
|
+
use_invoice_document_settings = True,
|
|
68
|
+
use_invoice_title_and_numbering = True
|
|
61
69
|
)
|
|
62
70
|
else:
|
|
63
71
|
return ConfigsResponse(
|
|
@@ -35,27 +35,35 @@ class TestConfigsUpdateRequest(unittest.TestCase):
|
|
|
35
35
|
model = ConfigsUpdateRequest()
|
|
36
36
|
if include_optional:
|
|
37
37
|
return ConfigsUpdateRequest(
|
|
38
|
+
trigger_events = [
|
|
39
|
+
'manual'
|
|
40
|
+
],
|
|
38
41
|
show_detailed_tax_fee = True,
|
|
39
42
|
charge_breakdown = True,
|
|
40
43
|
use_guest_lang = True,
|
|
41
44
|
due_days = 56,
|
|
45
|
+
sequence_start_number = 1,
|
|
42
46
|
lang = '',
|
|
43
47
|
prefix = '',
|
|
44
48
|
suffix = '',
|
|
45
49
|
legal_company_name = '',
|
|
46
|
-
title = {
|
|
47
|
-
'key' : ''
|
|
48
|
-
},
|
|
50
|
+
title = {"en":"Invoice","es":"Factura"},
|
|
49
51
|
show_legal_company_name = True,
|
|
50
52
|
include_room_number = True,
|
|
51
53
|
use_document_number = True,
|
|
54
|
+
create_invoice_on_allocation = True,
|
|
55
|
+
update_invoice_on_link_document = True,
|
|
52
56
|
is_compact = True,
|
|
57
|
+
use_invoice_title_and_numbering = True,
|
|
58
|
+
use_invoice_document_settings = True,
|
|
59
|
+
show_credit_notes_and_receipts = True,
|
|
53
60
|
tax_id1 = '',
|
|
54
61
|
tax_id2 = '',
|
|
55
62
|
cpf = '',
|
|
56
63
|
custom_text = {
|
|
57
64
|
'key' : ''
|
|
58
|
-
}
|
|
65
|
+
},
|
|
66
|
+
logo_id = 56
|
|
59
67
|
)
|
|
60
68
|
else:
|
|
61
69
|
return ConfigsUpdateRequest(
|
|
@@ -35,21 +35,28 @@ class TestCreateCreditNoteRequest(unittest.TestCase):
|
|
|
35
35
|
model = CreateCreditNoteRequest()
|
|
36
36
|
if include_optional:
|
|
37
37
|
return CreateCreditNoteRequest(
|
|
38
|
-
sequence_id =
|
|
39
|
-
invoice_id =
|
|
38
|
+
sequence_id = 1,
|
|
39
|
+
invoice_id = 1,
|
|
40
40
|
reason = '',
|
|
41
|
-
user_id =
|
|
41
|
+
user_id = 0,
|
|
42
42
|
method = 'VOID',
|
|
43
43
|
transaction_ids = [
|
|
44
44
|
56
|
|
45
45
|
],
|
|
46
|
-
|
|
46
|
+
folio_ids = [
|
|
47
|
+
56
|
|
48
|
+
],
|
|
49
|
+
exclude_transaction_ids = [
|
|
50
|
+
56
|
|
51
|
+
],
|
|
52
|
+
include_transaction_ids = [
|
|
53
|
+
56
|
|
54
|
+
]
|
|
47
55
|
)
|
|
48
56
|
else:
|
|
49
57
|
return CreateCreditNoteRequest(
|
|
50
|
-
invoice_id =
|
|
58
|
+
invoice_id = 1,
|
|
51
59
|
method = 'VOID',
|
|
52
|
-
guest_id = 56,
|
|
53
60
|
)
|
|
54
61
|
"""
|
|
55
62
|
|
|
@@ -36,22 +36,36 @@ class TestCreateInvoiceRequest(unittest.TestCase):
|
|
|
36
36
|
if include_optional:
|
|
37
37
|
return CreateInvoiceRequest(
|
|
38
38
|
transaction_ids = [
|
|
39
|
-
|
|
39
|
+
1
|
|
40
40
|
],
|
|
41
|
-
source_id =
|
|
42
|
-
sequence_id =
|
|
41
|
+
source_id = 1,
|
|
42
|
+
sequence_id = 1,
|
|
43
43
|
source_kind = 'GROUP_PROFILE',
|
|
44
|
-
user_id =
|
|
45
|
-
|
|
44
|
+
user_id = 0,
|
|
45
|
+
recipient = cloudbeds_fiscal_document.models.recipient_request.RecipientRequest(
|
|
46
|
+
type = 'GUEST',
|
|
47
|
+
id = 1, ),
|
|
48
|
+
folio_ids = [
|
|
49
|
+
1
|
|
50
|
+
],
|
|
51
|
+
exclude_transaction_ids = [
|
|
52
|
+
1
|
|
53
|
+
],
|
|
54
|
+
include_transaction_ids = [
|
|
55
|
+
1
|
|
56
|
+
],
|
|
57
|
+
simplified = True
|
|
46
58
|
)
|
|
47
59
|
else:
|
|
48
60
|
return CreateInvoiceRequest(
|
|
49
61
|
transaction_ids = [
|
|
50
|
-
|
|
62
|
+
1
|
|
51
63
|
],
|
|
52
|
-
source_id =
|
|
64
|
+
source_id = 1,
|
|
53
65
|
source_kind = 'GROUP_PROFILE',
|
|
54
|
-
|
|
66
|
+
recipient = cloudbeds_fiscal_document.models.recipient_request.RecipientRequest(
|
|
67
|
+
type = 'GUEST',
|
|
68
|
+
id = 1, ),
|
|
55
69
|
)
|
|
56
70
|
"""
|
|
57
71
|
|
|
@@ -40,25 +40,33 @@ class TestFiscalDocumentDetailedResponse(unittest.TestCase):
|
|
|
40
40
|
property_id = '',
|
|
41
41
|
user_id = '',
|
|
42
42
|
user_full_name = '',
|
|
43
|
+
source_name = '',
|
|
43
44
|
source_id = '',
|
|
44
45
|
source_kind = 'GROUP_PROFILE',
|
|
45
46
|
kind = 'INVOICE',
|
|
46
47
|
invoice_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
|
48
|
+
invoice_date_property_timezone = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
|
47
49
|
file_name = '',
|
|
48
50
|
amount = 1.337,
|
|
49
51
|
balance = 1.337,
|
|
50
52
|
due_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
|
53
|
+
due_date_property_timezone = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
|
51
54
|
recipients = [
|
|
52
55
|
cloudbeds_fiscal_document.models.recipient_details.RecipientDetails(
|
|
53
|
-
id = '',
|
|
56
|
+
id = '0',
|
|
54
57
|
first_name = '',
|
|
55
58
|
last_name = '',
|
|
56
|
-
email = '',
|
|
59
|
+
email = '',
|
|
60
|
+
type = 'COMPANY',
|
|
61
|
+
company_name = '', )
|
|
57
62
|
],
|
|
58
63
|
status = 'COMPLETED',
|
|
59
|
-
|
|
64
|
+
origin = '',
|
|
60
65
|
external_id = '',
|
|
66
|
+
fail_reason = '',
|
|
67
|
+
method = 'VOID',
|
|
61
68
|
created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
|
69
|
+
parent_id = '',
|
|
62
70
|
updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
|
63
71
|
government_integration = cloudbeds_fiscal_document.models.government_integration.GovernmentIntegration(
|
|
64
72
|
number = '',
|
|
@@ -70,11 +78,30 @@ class TestFiscalDocumentDetailedResponse(unittest.TestCase):
|
|
|
70
78
|
url = '',
|
|
71
79
|
official_id = '',
|
|
72
80
|
external_id = '',
|
|
73
|
-
rectifying_invoice_type = '',
|
|
81
|
+
rectifying_invoice_type = '',
|
|
82
|
+
cancellation_failed_fallback_status = 'COMPLETED', ),
|
|
83
|
+
latest_linked_document = cloudbeds_fiscal_document.models.latest_linked_document.LatestLinkedDocument(
|
|
84
|
+
id = '',
|
|
85
|
+
number = '',
|
|
86
|
+
created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
|
87
|
+
kind = 'INVOICE',
|
|
88
|
+
status = 'COMPLETED', ),
|
|
89
|
+
linked_documents = [
|
|
90
|
+
cloudbeds_fiscal_document.models.linked_document.LinkedDocument(
|
|
91
|
+
id = '',
|
|
92
|
+
number = '',
|
|
93
|
+
created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
|
94
|
+
kind = 'INVOICE',
|
|
95
|
+
status = 'COMPLETED',
|
|
96
|
+
is_latest = True,
|
|
97
|
+
relationship_type = 'PARENT', )
|
|
98
|
+
],
|
|
74
99
|
actions = [
|
|
75
100
|
cloudbeds_fiscal_document.models.action.Action(
|
|
76
101
|
type = 'CANCEL', )
|
|
77
|
-
]
|
|
102
|
+
],
|
|
103
|
+
source_identifier = '',
|
|
104
|
+
simplified = True
|
|
78
105
|
)
|
|
79
106
|
else:
|
|
80
107
|
return FiscalDocumentDetailedResponse(
|
|
@@ -42,25 +42,33 @@ class TestFiscalDocumentPaginated(unittest.TestCase):
|
|
|
42
42
|
property_id = '',
|
|
43
43
|
user_id = '',
|
|
44
44
|
user_full_name = '',
|
|
45
|
+
source_name = '',
|
|
45
46
|
source_id = '',
|
|
46
47
|
source_kind = 'GROUP_PROFILE',
|
|
47
48
|
kind = 'INVOICE',
|
|
48
49
|
invoice_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
|
50
|
+
invoice_date_property_timezone = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
|
49
51
|
file_name = '',
|
|
50
52
|
amount = 1.337,
|
|
51
53
|
balance = 1.337,
|
|
52
54
|
due_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
|
55
|
+
due_date_property_timezone = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
|
53
56
|
recipients = [
|
|
54
57
|
cloudbeds_fiscal_document.models.recipient_details.RecipientDetails(
|
|
55
|
-
id = '',
|
|
58
|
+
id = '0',
|
|
56
59
|
first_name = '',
|
|
57
60
|
last_name = '',
|
|
58
|
-
email = '',
|
|
61
|
+
email = '',
|
|
62
|
+
type = 'COMPANY',
|
|
63
|
+
company_name = '', )
|
|
59
64
|
],
|
|
60
65
|
status = 'COMPLETED',
|
|
61
|
-
|
|
66
|
+
origin = '',
|
|
62
67
|
external_id = '',
|
|
68
|
+
fail_reason = '',
|
|
69
|
+
method = 'VOID',
|
|
63
70
|
created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
|
71
|
+
parent_id = '',
|
|
64
72
|
updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
|
65
73
|
government_integration = cloudbeds_fiscal_document.models.government_integration.GovernmentIntegration(
|
|
66
74
|
number = '',
|
|
@@ -71,11 +79,25 @@ class TestFiscalDocumentPaginated(unittest.TestCase):
|
|
|
71
79
|
url = '',
|
|
72
80
|
official_id = '',
|
|
73
81
|
external_id = '',
|
|
74
|
-
rectifying_invoice_type = '',
|
|
82
|
+
rectifying_invoice_type = '',
|
|
83
|
+
cancellation_failed_fallback_status = 'COMPLETED', ),
|
|
84
|
+
latest_linked_document = cloudbeds_fiscal_document.models.latest_linked_document.LatestLinkedDocument(
|
|
85
|
+
id = '',
|
|
86
|
+
number = '',
|
|
87
|
+
created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ),
|
|
88
|
+
linked_documents = [
|
|
89
|
+
cloudbeds_fiscal_document.models.linked_document.LinkedDocument(
|
|
90
|
+
id = '',
|
|
91
|
+
number = '',
|
|
92
|
+
created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
|
93
|
+
is_latest = True,
|
|
94
|
+
relationship_type = 'PARENT', )
|
|
95
|
+
],
|
|
75
96
|
actions = [
|
|
76
|
-
cloudbeds_fiscal_document.models.action.Action(
|
|
77
|
-
|
|
78
|
-
|
|
97
|
+
cloudbeds_fiscal_document.models.action.Action()
|
|
98
|
+
],
|
|
99
|
+
source_identifier = '',
|
|
100
|
+
simplified = True, )
|
|
79
101
|
],
|
|
80
102
|
next_page_token = ''
|
|
81
103
|
)
|
|
@@ -36,6 +36,7 @@ class TestFiscalDocumentPatchRequest(unittest.TestCase):
|
|
|
36
36
|
if include_optional:
|
|
37
37
|
return FiscalDocumentPatchRequest(
|
|
38
38
|
status = 'COMPLETED',
|
|
39
|
+
fail_reason = '',
|
|
39
40
|
government_integration = cloudbeds_fiscal_document.models.government_integration.GovernmentIntegration(
|
|
40
41
|
number = '',
|
|
41
42
|
series = '',
|
|
@@ -46,7 +47,8 @@ class TestFiscalDocumentPatchRequest(unittest.TestCase):
|
|
|
46
47
|
url = '',
|
|
47
48
|
official_id = '',
|
|
48
49
|
external_id = '',
|
|
49
|
-
rectifying_invoice_type = '',
|
|
50
|
+
rectifying_invoice_type = '',
|
|
51
|
+
cancellation_failed_fallback_status = 'COMPLETED', )
|
|
50
52
|
)
|
|
51
53
|
else:
|
|
52
54
|
return FiscalDocumentPatchRequest(
|
|
@@ -35,7 +35,7 @@ class TestFiscalDocumentRecipient(unittest.TestCase):
|
|
|
35
35
|
model = FiscalDocumentRecipient()
|
|
36
36
|
if include_optional:
|
|
37
37
|
return FiscalDocumentRecipient(
|
|
38
|
-
id = '',
|
|
38
|
+
id = '0',
|
|
39
39
|
first_name = '',
|
|
40
40
|
last_name = '',
|
|
41
41
|
email = '',
|
|
@@ -47,10 +47,32 @@ class TestFiscalDocumentRecipient(unittest.TestCase):
|
|
|
47
47
|
state = '',
|
|
48
48
|
zip_code = '',
|
|
49
49
|
country = '', ),
|
|
50
|
+
company = cloudbeds_fiscal_document.models.recipient_company.RecipientCompany(
|
|
51
|
+
name = '',
|
|
52
|
+
tax_id = '',
|
|
53
|
+
tax_id_type = '',
|
|
54
|
+
address1 = '',
|
|
55
|
+
address2 = '',
|
|
56
|
+
city = '',
|
|
57
|
+
state = '',
|
|
58
|
+
zip_code = '',
|
|
59
|
+
country = '', ),
|
|
50
60
|
tax = cloudbeds_fiscal_document.models.recipient_tax_info.RecipientTaxInfo(
|
|
51
|
-
id = '',
|
|
61
|
+
id = '',
|
|
62
|
+
company_name = '', ),
|
|
63
|
+
contact_details = cloudbeds_fiscal_document.models.recipient_contact_details.RecipientContactDetails(
|
|
64
|
+
phone = '',
|
|
65
|
+
gender = '',
|
|
66
|
+
cell_phone = '',
|
|
67
|
+
birthday = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ),
|
|
68
|
+
document = cloudbeds_fiscal_document.models.recipient_document.RecipientDocument(
|
|
69
|
+
type = '',
|
|
70
|
+
number = '',
|
|
71
|
+
issuing_country = '',
|
|
72
|
+
issue_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
|
73
|
+
expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ),
|
|
52
74
|
country_data = {
|
|
53
|
-
'key' :
|
|
75
|
+
'key' : null
|
|
54
76
|
}
|
|
55
77
|
)
|
|
56
78
|
else:
|
|
@@ -48,7 +48,8 @@ class TestFiscalDocumentSummaryResponse(unittest.TestCase):
|
|
|
48
48
|
url = '',
|
|
49
49
|
official_id = '',
|
|
50
50
|
external_id = '',
|
|
51
|
-
rectifying_invoice_type = '',
|
|
51
|
+
rectifying_invoice_type = '',
|
|
52
|
+
cancellation_failed_fallback_status = 'COMPLETED', ),
|
|
52
53
|
linked_to = ''
|
|
53
54
|
)
|
|
54
55
|
else:
|
|
@@ -44,7 +44,13 @@ class TestFiscalDocumentTransactionResponse(unittest.TestCase):
|
|
|
44
44
|
description = '',
|
|
45
45
|
internal_code = '',
|
|
46
46
|
amount = 1.337,
|
|
47
|
-
folio_id = ''
|
|
47
|
+
folio_id = '',
|
|
48
|
+
status = 'PENDING',
|
|
49
|
+
paid_amount = 1.337,
|
|
50
|
+
allocations = [
|
|
51
|
+
cloudbeds_fiscal_document.models.fiscal_document_transaction_allocation.FiscalDocumentTransactionAllocation(
|
|
52
|
+
receipt_number = '', )
|
|
53
|
+
]
|
|
48
54
|
)
|
|
49
55
|
else:
|
|
50
56
|
return FiscalDocumentTransactionResponse(
|
cloudbeds_fiscal_document/test/test_fiscal_document_transactions_for_allocation_paginated.py
CHANGED
|
@@ -46,6 +46,7 @@ class TestFiscalDocumentTransactionsForAllocationPaginated(unittest.TestCase):
|
|
|
46
46
|
internal_code = '',
|
|
47
47
|
amount = 1.337,
|
|
48
48
|
allocated_amount = 1.337,
|
|
49
|
+
status = 'POSTED',
|
|
49
50
|
taxes = [
|
|
50
51
|
cloudbeds_fiscal_document.models.transaction_for_allocation_response.TransactionForAllocationResponse(
|
|
51
52
|
id = '',
|
|
@@ -46,7 +46,13 @@ class TestFiscalDocumentTransactionsPaginated(unittest.TestCase):
|
|
|
46
46
|
description = '',
|
|
47
47
|
internal_code = '',
|
|
48
48
|
amount = 1.337,
|
|
49
|
-
folio_id = '',
|
|
49
|
+
folio_id = '',
|
|
50
|
+
status = 'PENDING',
|
|
51
|
+
paid_amount = 1.337,
|
|
52
|
+
allocations = [
|
|
53
|
+
cloudbeds_fiscal_document.models.fiscal_document_transaction_allocation.FiscalDocumentTransactionAllocation(
|
|
54
|
+
receipt_number = '', )
|
|
55
|
+
], )
|
|
50
56
|
],
|
|
51
57
|
next_page_token = ''
|
|
52
58
|
)
|