sevdesk 0.1.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.
- sevdesk/__init__.py +3 -0
- sevdesk/base/basecontroller.py +102 -0
- sevdesk/client.py +81 -0
- sevdesk/controllers/accountingcontact_controller.py +33 -0
- sevdesk/controllers/basics_controller.py +9 -0
- sevdesk/controllers/checkaccount_controller.py +45 -0
- sevdesk/controllers/checkaccounttransaction_controller.py +38 -0
- sevdesk/controllers/communicationway_controller.py +38 -0
- sevdesk/controllers/contact_controller.py +53 -0
- sevdesk/controllers/contactaddress_controller.py +32 -0
- sevdesk/controllers/contactfield_controller.py +72 -0
- sevdesk/controllers/creditnote_controller.py +86 -0
- sevdesk/controllers/creditnotepos_controller.py +11 -0
- sevdesk/controllers/export_controller.py +77 -0
- sevdesk/controllers/invoice_controller.py +96 -0
- sevdesk/controllers/invoicepos_controller.py +11 -0
- sevdesk/controllers/layout_controller.py +32 -0
- sevdesk/controllers/order_controller.py +78 -0
- sevdesk/controllers/orderpos_controller.py +27 -0
- sevdesk/controllers/part_controller.py +32 -0
- sevdesk/controllers/report_controller.py +25 -0
- sevdesk/controllers/tag_controller.py +37 -0
- sevdesk/controllers/voucher_controller.py +80 -0
- sevdesk/controllers/voucherpos_controller.py +11 -0
- sevdesk/converters/accountdatev.py +7 -0
- sevdesk/converters/accountingtype.py +7 -0
- sevdesk/converters/addresscountry.py +7 -0
- sevdesk/converters/category.py +7 -0
- sevdesk/converters/checkaccount.py +7 -0
- sevdesk/converters/contact.py +7 -0
- sevdesk/converters/contactcustomfieldsetting.py +7 -0
- sevdesk/converters/contactperson.py +7 -0
- sevdesk/converters/costcentre.py +7 -0
- sevdesk/converters/country.py +7 -0
- sevdesk/converters/createuser.py +7 -0
- sevdesk/converters/creditnote.py +7 -0
- sevdesk/converters/discountdelete.py +8 -0
- sevdesk/converters/document.py +7 -0
- sevdesk/converters/error.py +8 -0
- sevdesk/converters/estimatedaccountingtype.py +7 -0
- sevdesk/converters/invoice.py +7 -0
- sevdesk/converters/key.py +7 -0
- sevdesk/converters/metadaten.py +9 -0
- sevdesk/converters/object.py +6 -0
- sevdesk/converters/object_.py +7 -0
- sevdesk/converters/order.py +7 -0
- sevdesk/converters/origin.py +7 -0
- sevdesk/converters/parent.py +7 -0
- sevdesk/converters/part.py +7 -0
- sevdesk/converters/paymentmethod.py +7 -0
- sevdesk/converters/sevclient.py +7 -0
- sevdesk/converters/sourcetransaction.py +7 -0
- sevdesk/converters/supplier.py +7 -0
- sevdesk/converters/tag.py +7 -0
- sevdesk/converters/targettransaction.py +7 -0
- sevdesk/converters/taxrule.py +7 -0
- sevdesk/converters/taxset.py +7 -0
- sevdesk/converters/unity.py +7 -0
- sevdesk/converters/voucher.py +7 -0
- sevdesk/models/accountingcontact.py +11 -0
- sevdesk/models/accountingcontactresponse.py +17 -0
- sevdesk/models/accountingcontactupdate.py +11 -0
- sevdesk/models/changelayout.py +8 -0
- sevdesk/models/changelayoutresponse.py +10 -0
- sevdesk/models/checkaccountresponse.py +28 -0
- sevdesk/models/checkaccounttransaction.py +27 -0
- sevdesk/models/checkaccounttransactionresponse.py +31 -0
- sevdesk/models/checkaccounttransactionupdate.py +19 -0
- sevdesk/models/checkaccountupdate.py +15 -0
- sevdesk/models/communicationway.py +20 -0
- sevdesk/models/communicationwayresponse.py +20 -0
- sevdesk/models/communicationwayupdate.py +14 -0
- sevdesk/models/contact.py +35 -0
- sevdesk/models/contactaddress.py +26 -0
- sevdesk/models/contactaddressresponse.py +26 -0
- sevdesk/models/contactaddressupdate.py +20 -0
- sevdesk/models/contactcustomfield.py +12 -0
- sevdesk/models/contactcustomfieldresponse.py +17 -0
- sevdesk/models/contactcustomfieldsetting.py +10 -0
- sevdesk/models/contactcustomfieldsettingresponse.py +16 -0
- sevdesk/models/contactcustomfieldsettingupdate.py +10 -0
- sevdesk/models/contactcustomfieldupdate.py +13 -0
- sevdesk/models/contactresponse.py +42 -0
- sevdesk/models/contactupdate.py +35 -0
- sevdesk/models/createclearingaccount.py +9 -0
- sevdesk/models/createclearingaccountresponse.py +19 -0
- sevdesk/models/createfileimportaccount.py +11 -0
- sevdesk/models/createfileimportaccountresponse.py +22 -0
- sevdesk/models/createinvoicefromorder.py +12 -0
- sevdesk/models/createpackinglistfromorder.py +8 -0
- sevdesk/models/creditnote.py +51 -0
- sevdesk/models/creditnote_mailresponse.py +18 -0
- sevdesk/models/creditnote_sendbywithrender.py +11 -0
- sevdesk/models/creditnotepos.py +32 -0
- sevdesk/models/creditnoteposresponse.py +31 -0
- sevdesk/models/creditnoteresponse.py +50 -0
- sevdesk/models/creditnoteupdate.py +50 -0
- sevdesk/models/discount.py +18 -0
- sevdesk/models/email.py +21 -0
- sevdesk/models/emailorder.py +21 -0
- sevdesk/models/export_job_download_info.py +10 -0
- sevdesk/models/export_progress_data.py +9 -0
- sevdesk/models/invoice.py +69 -0
- sevdesk/models/invoicepos.py +34 -0
- sevdesk/models/invoiceposresponse.py +33 -0
- sevdesk/models/invoiceresponse.py +76 -0
- sevdesk/models/iscountsresponse.py +17 -0
- sevdesk/models/order.py +44 -0
- sevdesk/models/orderpos.py +31 -0
- sevdesk/models/orderposresponse.py +31 -0
- sevdesk/models/orderposupdate.py +31 -0
- sevdesk/models/orderresponse.py +55 -0
- sevdesk/models/orderupdate.py +55 -0
- sevdesk/models/part.py +29 -0
- sevdesk/models/partupdate.py +29 -0
- sevdesk/models/receiptguidedto.py +13 -0
- sevdesk/models/savecreditnote.py +12 -0
- sevdesk/models/savecreditnoteresponse.py +9 -0
- sevdesk/models/saveinvoice.py +14 -0
- sevdesk/models/saveinvoiceresponse.py +10 -0
- sevdesk/models/saveorder.py +10 -0
- sevdesk/models/saveorderresponse.py +9 -0
- sevdesk/models/savevoucher.py +11 -0
- sevdesk/models/savevoucherresponse.py +10 -0
- sevdesk/models/tagcreateresponse.py +17 -0
- sevdesk/models/tagresponse.py +14 -0
- sevdesk/models/textparser_fetchdictionaryentriesbytype_response.py +9 -0
- sevdesk/models/validationerror.py +9 -0
- sevdesk/models/voucher.py +55 -0
- sevdesk/models/voucherpos.py +32 -0
- sevdesk/models/voucherposresponse.py +31 -0
- sevdesk/models/voucherresponse.py +55 -0
- sevdesk/models/voucherupdate.py +32 -0
- sevdesk-0.1.0.dist-info/METADATA +189 -0
- sevdesk-0.1.0.dist-info/RECORD +138 -0
- sevdesk-0.1.0.dist-info/WHEEL +5 -0
- sevdesk-0.1.0.dist-info/licenses/LICENSE +33 -0
- sevdesk-0.1.0.dist-info/top_level.txt +1 -0
sevdesk/__init__.py
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import inspect
|
|
2
|
+
from typing import get_type_hints, get_origin, get_args
|
|
3
|
+
|
|
4
|
+
class BaseController:
|
|
5
|
+
def __init__(self, client):
|
|
6
|
+
self.client = client
|
|
7
|
+
|
|
8
|
+
@staticmethod
|
|
9
|
+
def parse_response(response, return_type):
|
|
10
|
+
"""Wandelt die Response in das entsprechende Model um"""
|
|
11
|
+
if return_type is None:
|
|
12
|
+
return response
|
|
13
|
+
|
|
14
|
+
# Hole den ursprünglichen Typ (ohne list[] wrapper)
|
|
15
|
+
origin = get_origin(return_type)
|
|
16
|
+
|
|
17
|
+
# Wenn es eine Liste ist
|
|
18
|
+
if origin is list:
|
|
19
|
+
args = get_args(return_type)
|
|
20
|
+
if args:
|
|
21
|
+
model_class = args[0]
|
|
22
|
+
# Response sollte eine Liste von Dicts sein
|
|
23
|
+
if isinstance(response, dict) and 'objects' in response:
|
|
24
|
+
# sevDesk API struktur: {"objects": [...]}
|
|
25
|
+
return [model_class(**item) if isinstance(item, dict) else item
|
|
26
|
+
for item in response['objects']]
|
|
27
|
+
elif isinstance(response, list):
|
|
28
|
+
return [model_class(**item) if isinstance(item, dict) else item
|
|
29
|
+
for item in response]
|
|
30
|
+
|
|
31
|
+
# Einzelnes Model
|
|
32
|
+
elif hasattr(return_type, '__bases__'): # Check if it's a class
|
|
33
|
+
if isinstance(response, dict):
|
|
34
|
+
# sevDesk API struktur kann auch {"objects": {...}} sein
|
|
35
|
+
if 'objects' in response and isinstance(response['objects'], dict):
|
|
36
|
+
return return_type(**response['objects'])
|
|
37
|
+
else:
|
|
38
|
+
return return_type(**response)
|
|
39
|
+
|
|
40
|
+
return response
|
|
41
|
+
|
|
42
|
+
@staticmethod
|
|
43
|
+
def request(method, path):
|
|
44
|
+
def decorator(func):
|
|
45
|
+
def wrapper(self, *args, **kwargs):
|
|
46
|
+
# Args in kwargs umwandeln
|
|
47
|
+
sig = inspect.signature(func)
|
|
48
|
+
bound_args = sig.bind(self, *args, **kwargs)
|
|
49
|
+
bound_args.apply_defaults()
|
|
50
|
+
|
|
51
|
+
# Entferne 'self' aus den arguments
|
|
52
|
+
all_kwargs = dict(bound_args.arguments)
|
|
53
|
+
all_kwargs.pop('self', None)
|
|
54
|
+
|
|
55
|
+
gen = func(self, **all_kwargs)
|
|
56
|
+
|
|
57
|
+
try:
|
|
58
|
+
# Pre-request: bis zum yield ausführen
|
|
59
|
+
next(gen)
|
|
60
|
+
# veränderte parameter übernehmen
|
|
61
|
+
for arg in all_kwargs.copy():
|
|
62
|
+
# gi_frame HACK
|
|
63
|
+
if gen.gi_frame:
|
|
64
|
+
all_kwargs[arg] = gen.gi_frame.f_locals[arg]
|
|
65
|
+
|
|
66
|
+
response = self.client.request(method, path, all_kwargs)
|
|
67
|
+
|
|
68
|
+
# Return Type aus der Funktion auslesen
|
|
69
|
+
try:
|
|
70
|
+
type_hints = get_type_hints(func)
|
|
71
|
+
return_type = type_hints.get('return', None)
|
|
72
|
+
except Exception:
|
|
73
|
+
return_type = None
|
|
74
|
+
|
|
75
|
+
# Response in Model umwandeln
|
|
76
|
+
parsed_response = BaseController.parse_response(response, return_type)
|
|
77
|
+
|
|
78
|
+
# Gebe das Ergebnis direkt zurück
|
|
79
|
+
return parsed_response
|
|
80
|
+
|
|
81
|
+
except StopIteration:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
wrapper.__name__ = func.__name__
|
|
85
|
+
return wrapper
|
|
86
|
+
return decorator
|
|
87
|
+
|
|
88
|
+
@staticmethod
|
|
89
|
+
def get(path):
|
|
90
|
+
return BaseController.request('get', path)
|
|
91
|
+
|
|
92
|
+
@staticmethod
|
|
93
|
+
def post(path):
|
|
94
|
+
return BaseController.request('post', path)
|
|
95
|
+
|
|
96
|
+
@staticmethod
|
|
97
|
+
def put(path):
|
|
98
|
+
return BaseController.request('put', path)
|
|
99
|
+
|
|
100
|
+
@staticmethod
|
|
101
|
+
def delete(path):
|
|
102
|
+
return BaseController.request('delete', path)
|
sevdesk/client.py
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
import re
|
|
3
|
+
import importlib
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
class Client:
|
|
7
|
+
|
|
8
|
+
def __init__(self, api_token, api_base='https://my.sevdesk.de/api/v1', session=None):
|
|
9
|
+
self.api_token = api_token
|
|
10
|
+
self.api_base = api_base
|
|
11
|
+
self.session = session
|
|
12
|
+
if not self.session:
|
|
13
|
+
self.session = requests.Session()
|
|
14
|
+
|
|
15
|
+
# Automatisch alle Controller laden
|
|
16
|
+
self._load_controllers()
|
|
17
|
+
|
|
18
|
+
def _load_controllers(self):
|
|
19
|
+
"""Lädt automatisch alle Controller aus dem controllers Verzeichnis"""
|
|
20
|
+
controllers_dir = Path(__file__).parent / "controllers"
|
|
21
|
+
|
|
22
|
+
if not controllers_dir.exists():
|
|
23
|
+
return
|
|
24
|
+
|
|
25
|
+
for controller_file in controllers_dir.glob("*_controller.py"):
|
|
26
|
+
# z.B. "contact_controller.py" -> "contact"
|
|
27
|
+
controller_name = controller_file.stem.replace("_controller", "")
|
|
28
|
+
|
|
29
|
+
try:
|
|
30
|
+
# Dynamisch importieren
|
|
31
|
+
module = importlib.import_module(f"sevdesk.controllers.{controller_file.stem}")
|
|
32
|
+
|
|
33
|
+
# Finde die Controller-Klasse im Modul (endet mit "Controller")
|
|
34
|
+
controller_class = None
|
|
35
|
+
for attr_name in dir(module):
|
|
36
|
+
attr = getattr(module, attr_name)
|
|
37
|
+
if (isinstance(attr, type) and
|
|
38
|
+
attr_name.endswith("Controller") and
|
|
39
|
+
attr_name != "BaseController"):
|
|
40
|
+
controller_class = attr
|
|
41
|
+
break
|
|
42
|
+
|
|
43
|
+
if controller_class:
|
|
44
|
+
# Als Attribut setzen: self.contact = ContactController(self)
|
|
45
|
+
setattr(self, controller_name, controller_class(self))
|
|
46
|
+
else:
|
|
47
|
+
print(f"Warning: No controller class found in {controller_file.stem}")
|
|
48
|
+
|
|
49
|
+
except (ImportError, AttributeError) as e:
|
|
50
|
+
print(f"Warning: Could not load controller {controller_name}: {e}")
|
|
51
|
+
|
|
52
|
+
def request(self, method, path, params):
|
|
53
|
+
url_params = re.findall(r"{(\w+)}", path)
|
|
54
|
+
request_path = path.format(**params)
|
|
55
|
+
|
|
56
|
+
request_params = {
|
|
57
|
+
k: v for k, v in params.items()
|
|
58
|
+
if k not in url_params and
|
|
59
|
+
k != 'body' and
|
|
60
|
+
v} # v not None
|
|
61
|
+
request_url = f'{self.api_base}{request_path}'
|
|
62
|
+
request_body = params.get('body', None)
|
|
63
|
+
if request_body:
|
|
64
|
+
request_body = request_body.model_dump(by_alias=True, exclude_none=True)
|
|
65
|
+
|
|
66
|
+
# print('request_params', request_params)
|
|
67
|
+
# print('request_url', request_url)
|
|
68
|
+
# print('request_body', request_body)
|
|
69
|
+
|
|
70
|
+
response = self.session.request(
|
|
71
|
+
method=method,
|
|
72
|
+
url=request_url,
|
|
73
|
+
params=request_params,
|
|
74
|
+
json=request_body,
|
|
75
|
+
headers={
|
|
76
|
+
'Authorization': self.api_token
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
# print(response.status_code)
|
|
80
|
+
# print(response.text)
|
|
81
|
+
return response.json()
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from sevdesk.models.accountingcontact import AccountingContact
|
|
4
|
+
from sevdesk.models.accountingcontactresponse import AccountingContactResponse
|
|
5
|
+
from sevdesk.models.accountingcontactupdate import AccountingContactUpdate
|
|
6
|
+
|
|
7
|
+
class AccountingContactController(BaseController):
|
|
8
|
+
|
|
9
|
+
@BaseController.get("/AccountingContact")
|
|
10
|
+
def getAccountingContact(self, contact_id: Optional[str] = None, contact_objectName: Optional[str] = None) -> list[AccountingContactResponse]:
|
|
11
|
+
"""Retrieve accounting contact"""
|
|
12
|
+
return (yield)
|
|
13
|
+
|
|
14
|
+
@BaseController.post("/AccountingContact")
|
|
15
|
+
def createAccountingContact(self, body: AccountingContact) -> AccountingContactResponse:
|
|
16
|
+
"""Create a new accounting contact"""
|
|
17
|
+
return (yield)
|
|
18
|
+
|
|
19
|
+
@BaseController.get("/AccountingContact/{accountingContactId}")
|
|
20
|
+
def getAccountingContactById(self, accountingContactId: int) -> list[AccountingContactResponse]:
|
|
21
|
+
"""Find accounting contact by ID"""
|
|
22
|
+
return (yield)
|
|
23
|
+
|
|
24
|
+
@BaseController.put("/AccountingContact/{accountingContactId}")
|
|
25
|
+
def updateAccountingContact(self, accountingContactId: int, body: AccountingContactUpdate) -> AccountingContactResponse:
|
|
26
|
+
"""Update an existing accounting contact"""
|
|
27
|
+
return (yield)
|
|
28
|
+
|
|
29
|
+
@BaseController.delete("/AccountingContact/{accountingContactId}")
|
|
30
|
+
def deleteAccountingContact(self, accountingContactId: int):
|
|
31
|
+
"""Deletes an accounting contact"""
|
|
32
|
+
return (yield)
|
|
33
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from sevdesk.models.checkaccountresponse import CheckAccountResponse
|
|
3
|
+
from sevdesk.models.checkaccountupdate import CheckAccountUpdate
|
|
4
|
+
from sevdesk.models.createclearingaccount import CreateClearingAccount
|
|
5
|
+
from sevdesk.models.createclearingaccountresponse import CreateClearingAccountResponse
|
|
6
|
+
from sevdesk.models.createfileimportaccount import CreateFileImportAccount
|
|
7
|
+
from sevdesk.models.createfileimportaccountresponse import CreateFileImportAccountResponse
|
|
8
|
+
|
|
9
|
+
class CheckAccountController(BaseController):
|
|
10
|
+
|
|
11
|
+
@BaseController.get("/CheckAccount")
|
|
12
|
+
def getCheckAccounts(self) -> list[CheckAccountResponse]:
|
|
13
|
+
"""Retrieve check accounts"""
|
|
14
|
+
return (yield)
|
|
15
|
+
|
|
16
|
+
@BaseController.post("/CheckAccount/Factory/fileImportAccount")
|
|
17
|
+
def createFileImportAccount(self, body: CreateFileImportAccount) -> CreateFileImportAccountResponse:
|
|
18
|
+
"""Create a new file import account"""
|
|
19
|
+
return (yield)
|
|
20
|
+
|
|
21
|
+
@BaseController.post("/CheckAccount/Factory/clearingAccount")
|
|
22
|
+
def createClearingAccount(self, body: CreateClearingAccount) -> CreateClearingAccountResponse:
|
|
23
|
+
"""Create a new clearing account"""
|
|
24
|
+
return (yield)
|
|
25
|
+
|
|
26
|
+
@BaseController.get("/CheckAccount/{checkAccountId}")
|
|
27
|
+
def getCheckAccountById(self, checkAccountId: int) -> list[CheckAccountResponse]:
|
|
28
|
+
"""Find check account by ID"""
|
|
29
|
+
return (yield)
|
|
30
|
+
|
|
31
|
+
@BaseController.put("/CheckAccount/{checkAccountId}")
|
|
32
|
+
def updateCheckAccount(self, checkAccountId: int, body: CheckAccountUpdate) -> CheckAccountResponse:
|
|
33
|
+
"""Update an existing check account"""
|
|
34
|
+
return (yield)
|
|
35
|
+
|
|
36
|
+
@BaseController.delete("/CheckAccount/{checkAccountId}")
|
|
37
|
+
def deleteCheckAccount(self, checkAccountId: int):
|
|
38
|
+
"""Deletes a check account"""
|
|
39
|
+
return (yield)
|
|
40
|
+
|
|
41
|
+
@BaseController.get("/CheckAccount/{checkAccountId}/getBalanceAtDate")
|
|
42
|
+
def getBalanceAtDate(self, checkAccountId: int, date: str):
|
|
43
|
+
"""Get the balance at a given date"""
|
|
44
|
+
return (yield)
|
|
45
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from sevdesk.models.checkaccounttransaction import CheckAccountTransaction
|
|
4
|
+
from sevdesk.models.checkaccounttransactionresponse import CheckAccountTransactionResponse
|
|
5
|
+
from sevdesk.models.checkaccounttransactionupdate import CheckAccountTransactionUpdate
|
|
6
|
+
|
|
7
|
+
class CheckAccountTransactionController(BaseController):
|
|
8
|
+
|
|
9
|
+
@BaseController.get("/CheckAccountTransaction")
|
|
10
|
+
def getTransactions(self, checkAccount_id: Optional[int] = None, checkAccount_objectName: Optional[str] = None, endDate: Optional[str] = None, isBooked: Optional[bool] = None, onlyCredit: Optional[bool] = None, onlyDebit: Optional[bool] = None, payeePayerName: Optional[str] = None, paymtPurpose: Optional[str] = None, startDate: Optional[str] = None) -> list[CheckAccountTransactionResponse]:
|
|
11
|
+
"""Retrieve transactions"""
|
|
12
|
+
return (yield)
|
|
13
|
+
|
|
14
|
+
@BaseController.post("/CheckAccountTransaction")
|
|
15
|
+
def createTransaction(self, body: CheckAccountTransaction) -> CheckAccountTransactionResponse:
|
|
16
|
+
"""Create a new transaction"""
|
|
17
|
+
return (yield)
|
|
18
|
+
|
|
19
|
+
@BaseController.get("/CheckAccountTransaction/{checkAccountTransactionId}")
|
|
20
|
+
def getCheckAccountTransactionById(self, checkAccountTransactionId: int) -> list[CheckAccountTransactionResponse]:
|
|
21
|
+
"""Find check account transaction by ID"""
|
|
22
|
+
return (yield)
|
|
23
|
+
|
|
24
|
+
@BaseController.put("/CheckAccountTransaction/{checkAccountTransactionId}")
|
|
25
|
+
def updateCheckAccountTransaction(self, checkAccountTransactionId: int, body: CheckAccountTransactionUpdate) -> CheckAccountTransactionResponse:
|
|
26
|
+
"""Update an existing check account transaction"""
|
|
27
|
+
return (yield)
|
|
28
|
+
|
|
29
|
+
@BaseController.delete("/CheckAccountTransaction/{checkAccountTransactionId}")
|
|
30
|
+
def deleteCheckAccountTransaction(self, checkAccountTransactionId: int):
|
|
31
|
+
"""Deletes a check account transaction"""
|
|
32
|
+
return (yield)
|
|
33
|
+
|
|
34
|
+
@BaseController.put("/CheckAccountTransaction/{checkAccountTransactionId}/enshrine")
|
|
35
|
+
def checkAccountTransactionEnshrine(self, checkAccountTransactionId: int):
|
|
36
|
+
"""Enshrine"""
|
|
37
|
+
return (yield)
|
|
38
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from sevdesk.models.communicationway import CommunicationWay
|
|
4
|
+
from sevdesk.models.communicationwayresponse import CommunicationWayResponse
|
|
5
|
+
from sevdesk.models.communicationwayupdate import CommunicationWayUpdate
|
|
6
|
+
|
|
7
|
+
class CommunicationWayController(BaseController):
|
|
8
|
+
|
|
9
|
+
@BaseController.get("/CommunicationWay")
|
|
10
|
+
def getCommunicationWays(self, contact_id: Optional[str] = None, contact_objectName: Optional[str] = None, main: Optional[str] = None, type_: Optional[str] = None) -> list[CommunicationWayResponse]:
|
|
11
|
+
"""Retrieve communication ways"""
|
|
12
|
+
return (yield)
|
|
13
|
+
|
|
14
|
+
@BaseController.post("/CommunicationWay")
|
|
15
|
+
def createCommunicationWay(self, body: CommunicationWay) -> CommunicationWayResponse:
|
|
16
|
+
"""Create a new contact communication way"""
|
|
17
|
+
return (yield)
|
|
18
|
+
|
|
19
|
+
@BaseController.get("/CommunicationWay/{communicationWayId}")
|
|
20
|
+
def getCommunicationWayById(self, communicationWayId: int) -> list[CommunicationWayResponse]:
|
|
21
|
+
"""Find communication way by ID"""
|
|
22
|
+
return (yield)
|
|
23
|
+
|
|
24
|
+
@BaseController.delete("/CommunicationWay/{communicationWayId}")
|
|
25
|
+
def deleteCommunicationWay(self, communicationWayId: int):
|
|
26
|
+
"""Deletes a communication way"""
|
|
27
|
+
return (yield)
|
|
28
|
+
|
|
29
|
+
@BaseController.put("/CommunicationWay/{communicationWayId}")
|
|
30
|
+
def UpdateCommunicationWay(self, communicationWayId: int, body: CommunicationWayUpdate) -> CommunicationWayResponse:
|
|
31
|
+
"""Update a existing communication way"""
|
|
32
|
+
return (yield)
|
|
33
|
+
|
|
34
|
+
@BaseController.get("/CommunicationWayKey")
|
|
35
|
+
def getCommunicationWayKeys(self):
|
|
36
|
+
"""Retrieve communication way keys"""
|
|
37
|
+
return (yield)
|
|
38
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from sevdesk.models.contact import Contact
|
|
4
|
+
from sevdesk.models.contactresponse import ContactResponse
|
|
5
|
+
from sevdesk.models.contactupdate import ContactUpdate
|
|
6
|
+
|
|
7
|
+
class ContactController(BaseController):
|
|
8
|
+
|
|
9
|
+
@BaseController.get("/Contact/Factory/getNextCustomerNumber")
|
|
10
|
+
def getNextCustomerNumber(self):
|
|
11
|
+
"""Get next free customer number"""
|
|
12
|
+
return (yield)
|
|
13
|
+
|
|
14
|
+
@BaseController.get("/Contact/Factory/findContactsByCustomFieldValue")
|
|
15
|
+
def findContactsByCustomFieldValue(self, customFieldName: str, value: str, customFieldSetting_id: Optional[str] = None, customFieldSetting_objectName: Optional[str] = None) -> list[ContactResponse]:
|
|
16
|
+
"""Find contacts by custom field value"""
|
|
17
|
+
return (yield)
|
|
18
|
+
|
|
19
|
+
@BaseController.get("/Contact/Mapper/checkCustomerNumberAvailability")
|
|
20
|
+
def contactCustomerNumberAvailabilityCheck(self, customerNumber: Optional[str] = None):
|
|
21
|
+
"""Check if a customer number is available"""
|
|
22
|
+
return (yield)
|
|
23
|
+
|
|
24
|
+
@BaseController.get("/Contact")
|
|
25
|
+
def getContacts(self, customerNumber: Optional[str] = None, depth: Optional[str] = None) -> list[ContactResponse]:
|
|
26
|
+
"""Retrieve contacts"""
|
|
27
|
+
return (yield)
|
|
28
|
+
|
|
29
|
+
@BaseController.post("/Contact")
|
|
30
|
+
def createContact(self, body: Contact) -> ContactResponse:
|
|
31
|
+
"""Create a new contact"""
|
|
32
|
+
return (yield)
|
|
33
|
+
|
|
34
|
+
@BaseController.get("/Contact/{contactId}")
|
|
35
|
+
def getContactById(self, contactId: int) -> list[ContactResponse]:
|
|
36
|
+
"""Find contact by ID"""
|
|
37
|
+
return (yield)
|
|
38
|
+
|
|
39
|
+
@BaseController.put("/Contact/{contactId}")
|
|
40
|
+
def updateContact(self, contactId: int, body: ContactUpdate) -> ContactResponse:
|
|
41
|
+
"""Update a existing contact"""
|
|
42
|
+
return (yield)
|
|
43
|
+
|
|
44
|
+
@BaseController.delete("/Contact/{contactId}")
|
|
45
|
+
def deleteContact(self, contactId: int):
|
|
46
|
+
"""Deletes a contact"""
|
|
47
|
+
return (yield)
|
|
48
|
+
|
|
49
|
+
@BaseController.get("/Contact/{contactId}/getTabsItemCount")
|
|
50
|
+
def getContactTabsItemCountById(self, contactId: int):
|
|
51
|
+
"""Get number of all items"""
|
|
52
|
+
return (yield)
|
|
53
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from sevdesk.models.contactaddress import ContactAddress
|
|
3
|
+
from sevdesk.models.contactaddressresponse import ContactAddressResponse
|
|
4
|
+
from sevdesk.models.contactaddressupdate import ContactAddressUpdate
|
|
5
|
+
|
|
6
|
+
class ContactAddressController(BaseController):
|
|
7
|
+
|
|
8
|
+
@BaseController.post("/ContactAddress")
|
|
9
|
+
def createContactAddress(self, body: ContactAddress) -> ContactAddressResponse:
|
|
10
|
+
"""Create a new contact address"""
|
|
11
|
+
return (yield)
|
|
12
|
+
|
|
13
|
+
@BaseController.get("/ContactAddress")
|
|
14
|
+
def getContactAddresses(self) -> list[ContactAddressResponse]:
|
|
15
|
+
"""Retrieve contact addresses"""
|
|
16
|
+
return (yield)
|
|
17
|
+
|
|
18
|
+
@BaseController.get("/ContactAddress/{contactAddressId}")
|
|
19
|
+
def contactAddressId(self, contactAddressId: int) -> list[ContactAddressResponse]:
|
|
20
|
+
"""Find contact address by ID"""
|
|
21
|
+
return (yield)
|
|
22
|
+
|
|
23
|
+
@BaseController.put("/ContactAddress/{contactAddressId}")
|
|
24
|
+
def updateContactAddress(self, contactAddressId: int, body: ContactAddressUpdate) -> ContactAddressResponse:
|
|
25
|
+
"""update a existing contact address"""
|
|
26
|
+
return (yield)
|
|
27
|
+
|
|
28
|
+
@BaseController.delete("/ContactAddress/{contactAddressId}")
|
|
29
|
+
def deleteContactAddress(self, contactAddressId: int):
|
|
30
|
+
"""Deletes a contact address"""
|
|
31
|
+
return (yield)
|
|
32
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from sevdesk.models.contactcustomfield import ContactCustomField
|
|
4
|
+
from sevdesk.models.contactcustomfieldresponse import ContactCustomFieldResponse
|
|
5
|
+
from sevdesk.models.contactcustomfieldsetting import ContactCustomFieldSetting
|
|
6
|
+
from sevdesk.models.contactcustomfieldsettingresponse import ContactCustomFieldSettingResponse
|
|
7
|
+
from sevdesk.models.contactcustomfieldsettingupdate import ContactCustomFieldSettingUpdate
|
|
8
|
+
from sevdesk.models.contactcustomfieldupdate import ContactCustomFieldUpdate
|
|
9
|
+
from sevdesk.models.textparser_fetchdictionaryentriesbytype_response import Textparser_fetchDictionaryEntriesByType_response
|
|
10
|
+
|
|
11
|
+
class ContactFieldController(BaseController):
|
|
12
|
+
|
|
13
|
+
@BaseController.get("/Textparser/fetchDictionaryEntriesByType")
|
|
14
|
+
def getPlaceholder(self, objectName: str, subObjectName: Optional[str] = None) -> list[Textparser_fetchDictionaryEntriesByType_response]:
|
|
15
|
+
"""Retrieve Placeholders"""
|
|
16
|
+
return (yield)
|
|
17
|
+
|
|
18
|
+
@BaseController.get("/ContactCustomField")
|
|
19
|
+
def getContactFields(self) -> list[ContactCustomFieldResponse]:
|
|
20
|
+
"""Retrieve contact fields"""
|
|
21
|
+
return (yield)
|
|
22
|
+
|
|
23
|
+
@BaseController.post("/ContactCustomField")
|
|
24
|
+
def createContactField(self, body: ContactCustomField) -> ContactCustomFieldResponse:
|
|
25
|
+
"""Create contact field"""
|
|
26
|
+
return (yield)
|
|
27
|
+
|
|
28
|
+
@BaseController.get("/ContactCustomField/{contactCustomFieldId}")
|
|
29
|
+
def getContactFieldsById(self, contactCustomFieldId: float) -> list[ContactCustomFieldResponse]:
|
|
30
|
+
"""Retrieve contact fields"""
|
|
31
|
+
return (yield)
|
|
32
|
+
|
|
33
|
+
@BaseController.put("/ContactCustomField/{contactCustomFieldId}")
|
|
34
|
+
def updateContactfield(self, contactCustomFieldId: float, body: ContactCustomFieldUpdate) -> ContactCustomFieldResponse:
|
|
35
|
+
"""Update a contact field"""
|
|
36
|
+
return (yield)
|
|
37
|
+
|
|
38
|
+
@BaseController.delete("/ContactCustomField/{contactCustomFieldId}")
|
|
39
|
+
def deleteContactCustomFieldId(self, contactCustomFieldId: int):
|
|
40
|
+
"""delete a contact field"""
|
|
41
|
+
return (yield)
|
|
42
|
+
|
|
43
|
+
@BaseController.get("/ContactCustomFieldSetting")
|
|
44
|
+
def getContactFieldSettings(self) -> list[ContactCustomFieldSettingResponse]:
|
|
45
|
+
"""Retrieve contact field settings"""
|
|
46
|
+
return (yield)
|
|
47
|
+
|
|
48
|
+
@BaseController.post("/ContactCustomFieldSetting")
|
|
49
|
+
def createContactFieldSetting(self, body: ContactCustomFieldSetting) -> list[ContactCustomFieldSettingResponse]:
|
|
50
|
+
"""Create contact field setting"""
|
|
51
|
+
return (yield)
|
|
52
|
+
|
|
53
|
+
@BaseController.get("/ContactCustomFieldSetting/{contactCustomFieldSettingId}")
|
|
54
|
+
def getContactFieldSettingById(self, contactCustomFieldSettingId: int) -> list[ContactCustomFieldSettingResponse]:
|
|
55
|
+
"""Find contact field setting by ID"""
|
|
56
|
+
return (yield)
|
|
57
|
+
|
|
58
|
+
@BaseController.put("/ContactCustomFieldSetting/{contactCustomFieldSettingId}")
|
|
59
|
+
def updateContactFieldSetting(self, contactCustomFieldSettingId: int, body: ContactCustomFieldSettingUpdate) -> ContactCustomFieldSettingResponse:
|
|
60
|
+
"""Update contact field setting"""
|
|
61
|
+
return (yield)
|
|
62
|
+
|
|
63
|
+
@BaseController.delete("/ContactCustomFieldSetting/{contactCustomFieldSettingId}")
|
|
64
|
+
def deleteContactFieldSetting(self, contactCustomFieldSettingId: int):
|
|
65
|
+
"""Deletes a contact field setting"""
|
|
66
|
+
return (yield)
|
|
67
|
+
|
|
68
|
+
@BaseController.get("/ContactCustomFieldSetting/{contactCustomFieldSettingId}/getReferenceCount")
|
|
69
|
+
def getReferenceCount(self, contactCustomFieldSettingId: int):
|
|
70
|
+
"""Receive count reference"""
|
|
71
|
+
return (yield)
|
|
72
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from sevdesk.models.creditnoteresponse import CreditNoteResponse
|
|
4
|
+
from sevdesk.models.creditnoteupdate import CreditNoteUpdate
|
|
5
|
+
from sevdesk.models.creditnote_mailresponse import CreditNote_mailResponse
|
|
6
|
+
from sevdesk.models.creditnote_sendbywithrender import CreditNote_sendByWithRender
|
|
7
|
+
from sevdesk.models.savecreditnote import SaveCreditNote
|
|
8
|
+
from sevdesk.models.savecreditnoteresponse import SaveCreditNoteResponse
|
|
9
|
+
|
|
10
|
+
class CreditNoteController(BaseController):
|
|
11
|
+
|
|
12
|
+
@BaseController.get("/CreditNote")
|
|
13
|
+
def getCreditNotes(self, contact_id: Optional[int] = None, contact_objectName: Optional[str] = None, creditNoteNumber: Optional[str] = None, endDate: Optional[int] = None, startDate: Optional[int] = None, status: Optional[str] = None) -> list[CreditNoteResponse]:
|
|
14
|
+
"""Retrieve CreditNote"""
|
|
15
|
+
return (yield)
|
|
16
|
+
|
|
17
|
+
@BaseController.post("/CreditNote/Factory/saveCreditNote")
|
|
18
|
+
def createcreditNote(self, body: SaveCreditNote) -> SaveCreditNoteResponse:
|
|
19
|
+
"""Create a new creditNote"""
|
|
20
|
+
return (yield)
|
|
21
|
+
|
|
22
|
+
@BaseController.post("/CreditNote/Factory/createFromInvoice")
|
|
23
|
+
def createCreditNoteFromInvoice(self):
|
|
24
|
+
"""Creates a new creditNote from an invoice"""
|
|
25
|
+
return (yield)
|
|
26
|
+
|
|
27
|
+
@BaseController.post("/CreditNote/Factory/createFromVoucher")
|
|
28
|
+
def createCreditNoteFromVoucher(self):
|
|
29
|
+
"""Creates a new creditNote from a voucher"""
|
|
30
|
+
return (yield)
|
|
31
|
+
|
|
32
|
+
@BaseController.get("/CreditNote/{creditNoteId}")
|
|
33
|
+
def getcreditNoteById(self, creditNoteId: int) -> list[CreditNoteResponse]:
|
|
34
|
+
"""Find creditNote by ID"""
|
|
35
|
+
return (yield)
|
|
36
|
+
|
|
37
|
+
@BaseController.put("/CreditNote/{creditNoteId}")
|
|
38
|
+
def updatecreditNote(self, creditNoteId: int, body: CreditNoteUpdate) -> CreditNoteResponse:
|
|
39
|
+
"""Update an existing creditNote"""
|
|
40
|
+
return (yield)
|
|
41
|
+
|
|
42
|
+
@BaseController.delete("/CreditNote/{creditNoteId}")
|
|
43
|
+
def deletecreditNote(self, creditNoteId: int):
|
|
44
|
+
"""Deletes an creditNote"""
|
|
45
|
+
return (yield)
|
|
46
|
+
|
|
47
|
+
@BaseController.get("/CreditNote/{creditNoteId}/sendByWithRender")
|
|
48
|
+
def sendCreditNoteByPrinting(self, creditNoteId: int, sendType: str) -> CreditNote_sendByWithRender:
|
|
49
|
+
"""Send credit note by printing"""
|
|
50
|
+
return (yield)
|
|
51
|
+
|
|
52
|
+
@BaseController.put("/CreditNote/{creditNoteId}/sendBy")
|
|
53
|
+
def creditNoteSendBy(self, creditNoteId: int) -> CreditNoteResponse:
|
|
54
|
+
"""Mark credit note as sent"""
|
|
55
|
+
return (yield)
|
|
56
|
+
|
|
57
|
+
@BaseController.put("/CreditNote/{creditNoteId}/enshrine")
|
|
58
|
+
def creditNoteEnshrine(self, creditNoteId: int):
|
|
59
|
+
"""Enshrine"""
|
|
60
|
+
return (yield)
|
|
61
|
+
|
|
62
|
+
@BaseController.get("/CreditNote/{creditNoteId}/getPdf")
|
|
63
|
+
def creditNoteGetPdf(self, creditNoteId: int, download: Optional[bool] = None, preventSendBy: Optional[bool] = None):
|
|
64
|
+
"""Retrieve pdf document of a credit note"""
|
|
65
|
+
return (yield)
|
|
66
|
+
|
|
67
|
+
@BaseController.post("/CreditNote/{creditNoteId}/sendViaEmail")
|
|
68
|
+
def sendCreditNoteViaEMail(self, creditNoteId: int) -> list[CreditNote_mailResponse]:
|
|
69
|
+
"""Send credit note via email"""
|
|
70
|
+
return (yield)
|
|
71
|
+
|
|
72
|
+
@BaseController.put("/CreditNote/{creditNoteId}/bookAmount")
|
|
73
|
+
def bookCreditNote(self, creditNoteId: int):
|
|
74
|
+
"""Book a credit note"""
|
|
75
|
+
return (yield)
|
|
76
|
+
|
|
77
|
+
@BaseController.put("/CreditNote/{creditNoteId}/resetToOpen")
|
|
78
|
+
def creditNoteResetToOpen(self, creditNoteId: int):
|
|
79
|
+
"""Reset status to open"""
|
|
80
|
+
return (yield)
|
|
81
|
+
|
|
82
|
+
@BaseController.put("/CreditNote/{creditNoteId}/resetToDraft")
|
|
83
|
+
def creditNoteResetToDraft(self, creditNoteId: int):
|
|
84
|
+
"""Reset status to draft"""
|
|
85
|
+
return (yield)
|
|
86
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from sevdesk.base.basecontroller import BaseController
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from sevdesk.models.creditnoteposresponse import CreditNotePosResponse
|
|
4
|
+
|
|
5
|
+
class CreditNotePosController(BaseController):
|
|
6
|
+
|
|
7
|
+
@BaseController.get("/CreditNotePos")
|
|
8
|
+
def getcreditNotePositions(self, creditNote_id: Optional[int] = None, creditNote_objectName: Optional[str] = None) -> list[CreditNotePosResponse]:
|
|
9
|
+
"""Retrieve creditNote positions"""
|
|
10
|
+
return (yield)
|
|
11
|
+
|