wflow-api 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.
@@ -0,0 +1,51 @@
1
+ """Organization: the current workspace's own identity and settings."""
2
+
3
+ from wflow_api.client import WflowClient
4
+ from wflow_api.models import Organization, OrganizationSettings, OrgSlug
5
+ from wflow_api.operation import operation
6
+
7
+
8
+ @operation
9
+ async def get_organization(client: WflowClient, organization: OrgSlug) -> Organization:
10
+ """The workspace's own identity — who this organization is, not who the caller is.
11
+
12
+ Use `get_me` for the signed-in user's rights within the workspace, and this for the
13
+ workspace itself.
14
+
15
+ Fields:
16
+
17
+ - `name`, `id`, `created` — display name and identity
18
+ - `organizationUrlPart`, `customerUrlPart` — the slugs in the workspace's URLs
19
+ - `vatCountry`, `vatNonPayer` — which VAT regime documents are processed under
20
+ - `seriesOnDocument`, `acceptDateAsCreatedDate` — document numbering and dating behaviour
21
+ - `allowSupportAccess` — whether wflow support may enter this workspace
22
+ - `trialExpiration` — trial end date, or null when not on a trial
23
+ - `authenticationPolicy`, `biDashboardStatus`, `biDashboardTrialExpires`
24
+ """
25
+ return Organization.model_validate(await client.request("GET", f"/api/{organization}/organization") or {})
26
+
27
+
28
+ @operation
29
+ async def get_organization_settings(client: WflowClient, organization: OrgSlug) -> OrganizationSettings:
30
+ """How this workspace processes documents — the toggles behind its automatic behaviour.
31
+
32
+ Read this before explaining why a document was linked, posted or numbered the way it
33
+ was: most of that behaviour is a setting here rather than a rule in the document.
34
+
35
+ Fields:
36
+
37
+ - `vatCountry`, `vatNonPayer`, `fiscalYearStart` — the accounting regime
38
+ - `defaultLanguage`, `name` — workspace defaults
39
+ - `processIsdoc`, `processIsdocLines`, `processIsdocDescription`,
40
+ `autoGenerateMissingPDFForISDOC` — how ISDOC e-invoices are ingested
41
+ - `processEKasa`, `processEKasaLines` — how eKasa receipts are ingested
42
+ - `autoLinkIISD`, `autoLinkIISDToleranceRate`, `autoLinkTakeLinesIISD`,
43
+ `autoLinkTakeAccountingIISD`, `numberOnlyIISD`, `shareApproveIISD`,
44
+ `shareApproveIISDTolerance` — automatic linking of invoices to delivery notes
45
+ - `autoLinkPartner`, `sortDocumentsByIc` — partner matching
46
+ - `enableLinesApproval`, `autoCloneLastDocumentAccounting`, `vatInclusiveBudgets`
47
+ - `allowSupportAccess`, `trialExpiration`
48
+ """
49
+ return OrganizationSettings.model_validate(
50
+ await client.request("GET", f"/api/{organization}/organization/settings") or {}
51
+ )