diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ad0059..ab7d2f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.4.2 - 2025-12-05 +- sync: add mapping hidden_source_ids field + ## 0.4.1 - 2025-11-04 - accounting: add bank related endpoints diff --git a/chift/openapi/openapi.json b/chift/openapi/openapi.json index 7657354..4c901bd 100644 --- a/chift/openapi/openapi.json +++ b/chift/openapi/openapi.json @@ -892,6 +892,23 @@ ], "title": "Status" } + }, + { + "name": "include_coverage", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/BoolParam" + }, + { + "type": "null" + } + ], + "default": "false", + "title": "Include Coverage" + } } ], "responses": { @@ -6469,11 +6486,19 @@ { "name": "journal_id", "in": "query", - "required": true, + "required": false, "schema": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Journal Id" - } + }, + "description": "Journal ID used to filter journal entries to only retrieve entries for a specific journal. This is an optional filter parameter." }, { "name": "date_from", @@ -6659,11 +6684,19 @@ { "name": "journal_id", "in": "query", - "required": true, + "required": false, "schema": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Journal Id" - } + }, + "description": "Journal ID used to filter journal entries to only retrieve entries for a specific journal. This is an optional filter parameter." }, { "name": "date_from", @@ -18501,11 +18534,13 @@ }, "bank_account_id": { "type": "string", + "minLength": 1, "title": "Bank Account Id", "description": "Unique ID of the bank account in the accounting system" }, "external_bank_statement_id": { "type": "string", + "minLength": 1, "title": "External Bank Statement Id", "description": "External bank statement ID" }, @@ -18561,6 +18596,7 @@ }, "bank_account_id": { "type": "string", + "minLength": 1, "title": "Bank Account Id", "description": "Unique ID of the bank account in the accounting system" }, @@ -18605,18 +18641,27 @@ ], "title": "BankStatementItemOut" }, + "BankTransactionItemAccountType": { + "type": "string", + "enum": [ + "customer_account", + "supplier_account", + "employee_account", + "general_account" + ], + "title": "BankTransactionItemAccountType" + }, "BankTransactionItemIn": { "properties": { "account_type": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/BankTransactionItemAccountType" }, { "type": "null" } ], - "title": "Account Type", "description": "Account type; mandatory if account is provided" }, "account": { @@ -18632,7 +18677,14 @@ "description": "Account identifier" }, "description": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Description", "description": "Transaction description" }, @@ -18687,6 +18739,7 @@ }, "currency": { "type": "string", + "minLength": 1, "title": "Currency", "description": "Transaction currency" }, @@ -18717,13 +18770,12 @@ "account_type": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/BankTransactionItemAccountType" }, { "type": "null" } ], - "title": "Account Type", "description": "Account type; mandatory if account is provided" }, "account": { @@ -18739,7 +18791,14 @@ "description": "Account identifier" }, "description": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Description", "description": "Transaction description" }, @@ -18794,6 +18853,7 @@ }, "currency": { "type": "string", + "minLength": 1, "title": "Currency", "description": "Transaction currency" }, @@ -23798,6 +23858,32 @@ ], "title": "CountryItem" }, + "CoverageItem": { + "properties": { + "operation": { + "type": "string", + "title": "Operation" + }, + "status": { + "$ref": "#/components/schemas/CoverageStatus" + } + }, + "type": "object", + "required": [ + "operation", + "status" + ], + "title": "CoverageItem" + }, + "CoverageStatus": { + "type": "string", + "enum": [ + "SUPPORTED", + "NOT_IMPLEMENTED", + "NOT_SUPPORTED" + ], + "title": "CoverageStatus" + }, "CreateConsumerSyncItem": { "properties": { "syncid": { @@ -26022,7 +26108,8 @@ "type": "null" } ], - "title": "Country" + "title": "Country", + "description": "Format: ISO 3166-1 codes." } }, "type": "object", @@ -26081,7 +26168,8 @@ "type": "null" } ], - "title": "Main Currency" + "title": "Main Currency", + "description": "Format: ISO 3166-1 codes." }, "addresses": { "anyOf": [ @@ -26333,6 +26421,17 @@ "title": "Tax Code", "description": "Indicates the Tax Code used for the entry item. This is the Id of the Tax Code instance in the accounting software." }, + "tax_info": { + "anyOf": [ + { + "$ref": "#/components/schemas/TaxInfo" + }, + { + "type": "null" + } + ], + "description": "Tax information related to the journal item. The provided tax amount is added to the amount (debit or credit) of the journal item. This is only supported for general accounts." + }, "account_info": { "anyOf": [ { @@ -26473,6 +26572,22 @@ "description": "List of post-connections that can be activated for this integration.", "default": [] }, + "operations_coverage": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/CoverageItem" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Operations Coverage", + "description": "List of operations coverage for this integration.", + "default": [] + }, "credentials": { "anyOf": [ { @@ -27706,7 +27821,14 @@ "description": "Last Due date of the invoice. The invoice date is used when this information is not given by the software." }, "partner_id": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Partner Id" }, "journal_id": { @@ -27911,7 +28033,14 @@ "description": "Last Due date of the invoice. The invoice date is used when this information is not given by the software." }, "partner_id": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Partner Id" }, "journal_id": { @@ -35855,8 +35984,15 @@ "properties": { "consumers": { "items": { - "type": "string", - "format": "uuid" + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "string" + } + ] }, "type": "array", "title": "Consumers" @@ -36905,6 +37041,13 @@ "type": "array", "title": "Values" }, + "hidden_source_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Hidden Source Ids" + }, "sub_mapping_name": { "type": "string", "title": "Sub Mapping Name" @@ -36925,6 +37068,7 @@ "required": [ "name", "values", + "hidden_source_ids", "sub_mapping_name" ], "title": "ReadSyncMappingItem" @@ -38305,6 +38449,62 @@ ], "title": "SyncConsumerStatus" }, + "TaxInfo": { + "properties": { + "tax_code": { + "type": "string", + "title": "Tax Code", + "description": "VAT code of the tax line. This is the Id of the Tax code instance in the accounting software." + }, + "tax_amount": { + "type": "number", + "title": "Tax Amount", + "description": "Amount of the tax line. The amount must be positive and is required even with reversed VAT." + }, + "vat_account": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Vat Account", + "description": "VAT account of the tax line. This is the account number used to book the tax amount. The account is mandatory if tax amount is different from 0 and will be used when we need to pass this information to the accounting software." + }, + "reversed_vat_account": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Reversed Vat Account", + "description": "Reversed VAT account of the tax line. This is the account number used to book the reversed tax amount. The account is mandatory if you are using a reversed VAT code." + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "Optional extra description of the tax line." + } + }, + "type": "object", + "required": [ + "tax_code", + "tax_amount" + ], + "title": "TaxInfo" + }, "TaxRateItem": { "properties": { "id": { diff --git a/chift/openapi/openapi.py b/chift/openapi/openapi.py index 03445ad..22d1db5 100644 --- a/chift/openapi/openapi.py +++ b/chift/openapi/openapi.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.json -# timestamp: 2025-11-06T08:30:08+00:00 +# timestamp: 2025-12-05T10:38:46+00:00 from __future__ import annotations @@ -481,11 +481,16 @@ class BankAccountItemOut(BaseModel): ) +class BankTransactionItemAccountType(Enum): + customer_account = "customer_account" + supplier_account = "supplier_account" + employee_account = "employee_account" + general_account = "general_account" + + class BankTransactionItemIn(BaseModel): - account_type: Optional[str] = Field( - None, - description="Account type; mandatory if account is provided", - title="Account Type", + account_type: Optional[BankTransactionItemAccountType] = Field( + None, description="Account type; mandatory if account is provided" ) account: Optional[str] = Field( None, description="Account identifier", title="Account" @@ -502,7 +507,9 @@ class BankTransactionItemIn(BaseModel): ) fee_amount: Optional[float] = Field(0, description="Fee amount", title="Fee Amount") tax_amount: Optional[float] = Field(0, description="Tax amount", title="Tax Amount") - currency: str = Field(..., description="Transaction currency", title="Currency") + currency: constr(min_length=1) = Field( + ..., description="Transaction currency", title="Currency" + ) currency_exchange_rate: Optional[float] = Field( 1, description="Exchange rate applicable at the transaction date", @@ -511,10 +518,8 @@ class BankTransactionItemIn(BaseModel): class BankTransactionItemOut(BaseModel): - account_type: Optional[str] = Field( - None, - description="Account type; mandatory if account is provided", - title="Account Type", + account_type: Optional[BankTransactionItemAccountType] = Field( + None, description="Account type; mandatory if account is provided" ) account: Optional[str] = Field( None, description="Account identifier", title="Account" @@ -531,7 +536,9 @@ class BankTransactionItemOut(BaseModel): ) fee_amount: Optional[float] = Field(0, description="Fee amount", title="Fee Amount") tax_amount: Optional[float] = Field(0, description="Tax amount", title="Tax Amount") - currency: str = Field(..., description="Transaction currency", title="Currency") + currency: constr(min_length=1) = Field( + ..., description="Transaction currency", title="Currency" + ) currency_exchange_rate: Optional[float] = Field( 1, description="Exchange rate applicable at the transaction date", @@ -877,6 +884,12 @@ class CountryItem(BaseModel): name: str = Field(..., title="Name") +class CoverageStatus(Enum): + SUPPORTED = "SUPPORTED" + NOT_IMPLEMENTED = "NOT_IMPLEMENTED" + NOT_SUPPORTED = "NOT_SUPPORTED" + + class CreateConsumerSyncItem(BaseModel): syncid: UUID = Field(..., title="Syncid") integrationids: Optional[List[str]] = Field( @@ -1158,7 +1171,9 @@ class FolderAddressItem(BaseModel): box: Optional[str] = Field(None, title="Box") postal_code: Optional[str] = Field(None, title="Postal Code") city: Optional[str] = Field(None, title="City") - country: Optional[str] = Field(None, title="Country") + country: Optional[str] = Field( + None, description="Format: ISO 3166-1 codes.", title="Country" + ) class FolderItem(BaseModel): @@ -1167,7 +1182,9 @@ class FolderItem(BaseModel): selected: Optional[bool] = Field(True, title="Selected") vat: Optional[str] = Field(None, title="Vat") company_number: Optional[str] = Field(None, title="Company Number") - main_currency: Optional[str] = Field(None, title="Main Currency") + main_currency: Optional[str] = Field( + None, description="Format: ISO 3166-1 codes.", title="Main Currency" + ) addresses: Optional[List[FolderAddressItem]] = Field(None, title="Addresses") @@ -2340,6 +2357,7 @@ class ReadSyncMappingItem(BaseModel): challenge_question: Optional[str] = Field(None, title="Challenge Question") conditions: Optional[Dict[str, Dict[str, Any]]] = Field(None, title="Conditions") values: List[ReadMappingItem] = Field(..., title="Values") + hidden_source_ids: List[str] = Field(..., title="Hidden Source Ids") sub_mapping_name: str = Field(..., title="Sub Mapping Name") sub_mapping_description: Optional[str] = Field( None, title="Sub Mapping Description" @@ -2425,6 +2443,34 @@ class SyncConsumerStatus(Enum): inactive = "inactive" +class TaxInfo(BaseModel): + tax_code: str = Field( + ..., + description="VAT code of the tax line. This is the Id of the Tax code instance in the accounting software.", + title="Tax Code", + ) + tax_amount: float = Field( + ..., + description="Amount of the tax line. The amount must be positive and is required even with reversed VAT.", + title="Tax Amount", + ) + vat_account: Optional[str] = Field( + None, + description="VAT account of the tax line. This is the account number used to book the tax amount. The account is mandatory if tax amount is different from 0 and will be used when we need to pass this information to the accounting software.", + title="Vat Account", + ) + reversed_vat_account: Optional[str] = Field( + None, + description="Reversed VAT account of the tax line. This is the account number used to book the reversed tax amount. The account is mandatory if you are using a reversed VAT code.", + title="Reversed Vat Account", + ) + description: Optional[str] = Field( + None, + description="Optional extra description of the tax line.", + title="Description", + ) + + class TaxRateItem(BaseModel): id: str = Field(..., description="Technical id in Chift", title="Id") source_ref: Ref = Field(..., description="Technical id in the target software") @@ -3107,12 +3153,12 @@ class BankStatementItemIn(BaseModel): bank_statement_date: Date = Field( ..., description="Date of the bank statement", title="Bank Statement Date" ) - bank_account_id: str = Field( + bank_account_id: constr(min_length=1) = Field( ..., description="Unique ID of the bank account in the accounting system", title="Bank Account Id", ) - external_bank_statement_id: str = Field( + external_bank_statement_id: constr(min_length=1) = Field( ..., description="External bank statement ID", title="External Bank Statement Id", @@ -3134,7 +3180,7 @@ class BankStatementItemOut(BaseModel): bank_statement_date: Date = Field( ..., description="Date of the bank statement", title="Bank Statement Date" ) - bank_account_id: str = Field( + bank_account_id: constr(min_length=1) = Field( ..., description="Unique ID of the bank account in the accounting system", title="Bank Account Id", @@ -3711,6 +3757,11 @@ class ContactItemOut(BaseModel): ) +class CoverageItem(BaseModel): + operation: str = Field(..., title="Operation") + status: CoverageStatus + + class DataStoreItem(BaseModel): id: str = Field(..., title="Id") name: str = Field(..., title="Name") @@ -4005,6 +4056,10 @@ class GenericJournalItem(BaseModel): description="Indicates the Tax Code used for the entry item. This is the Id of the Tax Code instance in the accounting software.", title="Tax Code", ) + tax_info: Optional[TaxInfo] = Field( + None, + description="Tax information related to the journal item. The provided tax amount is added to the amount (debit or credit) of the journal item. This is only supported for general accounts.", + ) account_info: Optional[AccountToCreate] = Field( None, description="(For certain specific connectors only) Details of the third-party account (client/supplier) to be created if it does not already exist in the accounting system. Some softwares do not support creating third-party accounts via API; in such cases, this information must be provided to allow the accounting software to automatically create the missing account (e.g., for Tiime).", @@ -4029,6 +4084,11 @@ class IntegrationItem(BaseModel): description="List of post-connections that can be activated for this integration.", title="Post Connections", ) + operations_coverage: Optional[List[CoverageItem]] = Field( + [], + description="List of operations coverage for this integration.", + title="Operations Coverage", + ) credentials: Optional[List[CredentialItemOutput]] = Field( [], description="List of credentials that must be specified to create a connection. Can be used if you want to pass credentials on connection creation. Not compatible with oAuth2 routes.", @@ -5187,7 +5247,7 @@ class PaymentReporting(BaseModel): class PostSyncFlowEvent(BaseModel): - consumers: Optional[List[UUID]] = Field(None, title="Consumers") + consumers: Optional[List[Union[UUID, str]]] = Field(None, title="Consumers") data: Optional[PostSyncFlowEventData] = None @@ -6405,7 +6465,7 @@ class InvoiceItemOutMonoAnalyticPlan(BaseModel): description="Last Due date of the invoice. The invoice date is used when this information is not given by the software.", title="Due Date", ) - partner_id: str = Field(..., title="Partner Id") + partner_id: Optional[str] = Field(..., title="Partner Id") journal_id: Optional[str] = Field( None, description="Indicates the journal used in for the invoice. If the journal is not given, the journal will be automatically set if only one journal exists otherwise an error will be thrown.", @@ -6487,7 +6547,7 @@ class InvoiceItemOutMultiAnalyticPlans(BaseModel): description="Last Due date of the invoice. The invoice date is used when this information is not given by the software.", title="Due Date", ) - partner_id: str = Field(..., title="Partner Id") + partner_id: Optional[str] = Field(..., title="Partner Id") journal_id: Optional[str] = Field( None, description="Indicates the journal used in for the invoice. If the journal is not given, the journal will be automatically set if only one journal exists otherwise an error will be thrown.", diff --git a/pyproject.toml b/pyproject.toml index 5b80f9f..a340ed0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "chift" -version = "0.4.1" +version = "0.4.2" description = "Chift API client" authors = ["Henry Hertoghe "] readme = "README.md"