From 9af48e34ef33a20913087ac9c510814a22a2a70e Mon Sep 17 00:00:00 2001 From: Kasper Nowak <54978466+kaspernowak@users.noreply.github.com> Date: Sat, 14 Jun 2025 00:44:50 +0200 Subject: [PATCH 1/2] feat: Add structured address fields to DTOs and deprecate legacy address for bexio API compliance --- .phpunit.cache/test-results | 1 - README.md | 201 ++++++++++-------- .../AdditionalAddressDTO.php | 14 +- .../CreateEditAdditionalAddressDTO.php | 41 +++- .../ContactAdditionalAddressDTO.php | 14 +- .../CreateEditContactAdditionalAddressDTO.php | 47 +++- src/Dto/Contacts/ContactDTO.php | 6 + src/Dto/Contacts/CreateEditContactDTO.php | 41 +++- .../create-an-additional-address.json | 27 ++- .../edit-an-additional-address.json | 27 ++- .../create-contact-additional-address.json | 27 ++- .../edit-contact-additional-address.json | 27 ++- .../Saloon/Contacts/create-contact.json | 2 +- .../Saloon/Contacts/fetch-a-contact.json | 2 +- .../Contacts/fetch-a-list-of-contacts.json | 2 +- .../CreateAnAdditionalAddressRequestTest.php | 4 +- .../EditAnAdditionalAddressRequestTest.php | 12 +- ...ateContactAdditionalAddressRequestTest.php | 4 +- ...itAContactAdditionalAddressRequestTest.php | 6 +- 19 files changed, 378 insertions(+), 127 deletions(-) delete mode 100644 .phpunit.cache/test-results diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results deleted file mode 100644 index 42e148f..0000000 --- a/.phpunit.cache/test-results +++ /dev/null @@ -1 +0,0 @@ -{"version":"pest_3.7.4","defects":{"P\\Tests\\Requests\\ManualEntries\\AddFileToAccountingEntryLineRequestTest::__pest_evaluable_it_can_perform_the_request":1,"P\\Tests\\Requests\\IbanPayments\\UpdateIbanPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":1,"P\\Tests\\Requests\\Invoices\\CreateAnInvoiceRequestTest::__pest_evaluable_it_can_perform_the_request":8,"P\\Tests\\Requests\\Contacts\\BuilkCreateContactsRequestTest::__pest_evaluable_it_can_perform_the_request":1,"P\\Tests\\Requests\\QrPayments\\UpdateQrPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":1,"P\\Tests\\Requests\\Invoices\\EditAnInvoiceRequestTest::__pest_evaluable_it_can_perform_the_request":8,"P\\Tests\\Requests\\Files\\ShowFileUsageRequestTest::__pest_evaluable_it_can_perform_the_request":1,"P\\Tests\\Requests\\ManualEntries\\CreateManualEntryRequestTest::__pest_evaluable_it_can_perform_the_request":8},"times":{"P\\Tests\\Requests\\Files\\GetAFilePreviewRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\BusinessYears\\FetchAListOfBusinessYearsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Reports\\JournalRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Payments\\CancelAPaymentTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Titles\\DeleteAnAdditonalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\SearchContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CalendarYears\\CreateCalendarYearRequestTest::__pest_evaluable_it_can_perform_the_request":0.003,"P\\Tests\\Requests\\Salutations\\SearchSalutationsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\FetchAContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\IbanPayments\\GetIbanPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Invoices\\DeleteAnInvoiceRequestTest::__pest_evaluable_it_can_perform_the_request":0.022,"P\\Tests\\Requests\\CalendarYears\\SearchCalendarYearsRequestTest::__pest_evaluable_it_can_perform_the_request":0.002,"P\\Tests\\Requests\\Currencies\\EditACurrencyRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ContactsGroups\\EditAContactGroupRequestTest::__pest_evaluable_it_can_perform_the_request":0.006,"P\\Tests\\Requests\\ContactsGroups\\CreateContactGroupRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Salutations\\FetchASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\CreateAFileRequestTest::__pest_evaluable_it_can_perform_the_request":0.002,"P\\Tests\\Requests\\Units\\FetchAListOfUnitsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Payments\\FetchAListOfPaymentsTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Currencies\\CreateCurrencyRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\FetchAListOfNotesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsSectors\\SearchContactSectorsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\EditAContactRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ContactsGroups\\SearchContactGroupsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\QrPayments\\CreateQrPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ContactAdditionalAddresses\\CreateContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\EditAContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\BusinessYears\\FetchABusinessYearRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsSectors\\FetchAListOfContactSectorsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\AddFileToAccountingEntryLineRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\DeleteFileOfAccountingEntryLineRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\IbanPayments\\UpdateIbanPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Currencies\\FetchExchangeRatesForCurrenciesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\DocumentSettings\\FetchAListOfDocumentSettingsRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Titles\\EditAnAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\AdditionalAddresses\\FetchAListOfAdditionalAddressesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\CreateANoteRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CalendarYears\\FetchACalendarYearRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Invoices\\CreateAnInvoiceRequestTest::__pest_evaluable_it_can_perform_the_request":0.004,"P\\Tests\\Requests\\ContactsRelations\\DeleteAContactRelationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\PaymentTypes\\FetchAListOfPaymentTypesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\FetchAListOfManualEntriesRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Contacts\\BuilkCreateContactsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\AccountGroups\\FetchAListOfAccountGroupsRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":0.204,"P\\Tests\\Requests\\ContactsRelations\\EditAContactRelationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Currencies\\DeleteACurrencyRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\QrPayments\\UpdateQrPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsRelations\\FetchAContactRelationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsGroups\\FetchAListOfContactGroupsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Invoices\\SubPositions\\CreateASubPositionRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Taxes\\FetchAListOfTaxesRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\BankAccounts\\FetchASingleBankAccountRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\DeleteAContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\BankAccounts\\FetchAListOfBankAccountsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Invoices\\EditAnInvoiceRequestTest::__pest_evaluable_it_can_perform_the_request":0.006,"P\\Tests\\Requests\\Contacts\\RestoreAContactRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\AdditionalAddresses\\DeleteAnAdditonalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\ShowFileUsageRequestTest::__pest_evaluable_it_can_perform_the_request":0.003,"P\\Tests\\Requests\\Invoices\\DefaultPositions\\CreateADefaultPositionRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\CompanyProfiles\\FetchAListOfCompanyProfilesRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Titles\\SearchTitlesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\FetchAContactRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\SearchFilesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\AdditionalAddresses\\CreateAnAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\FetchANoteRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Invoices\\FetchAListOfInvoicesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Titles\\FetchAListOfTitlesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\CreateManualEntryRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Salutations\\EditASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Users\\FetchAListOfUsersRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Accounts\\SearchAccountsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Invoices\\ShowPdfRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Files\\FetchAListOfFilesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Salutations\\FetchAListOfSalutationsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Currencies\\FetchAllPossibleCurrencyCodesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\DeleteAFileRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Invoices\\FetchAnInvoiceRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Payments\\DeleteAPaymentTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\EditAFileRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Taxes\\FetchATaxRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\AdditionalAddresses\\FetchAnAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Invoices\\CancelAnInvoiceRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Projects\\FetchAListOfPaymentTypesRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Titles\\FetchATitleRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\GetASingleFileRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsGroups\\FetchAContactGroupRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\FetchAListOfContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\CreateContactRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsRelations\\SearchContactRelationsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CalendarYears\\FetchAListOfCalendarYearsRequestTest::__pest_evaluable_it_can_perform_the_request":0.002,"P\\Tests\\Requests\\Notes\\DeleteANoteRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\QrPayments\\GetQrPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\IbanPayments\\CreateIbanPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\AdditionalAddresses\\SearchAdditionalAddressesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsGroups\\DeleteAContactGroupRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\DownloadFIleRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Accounts\\FetchAListOfAccountsRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Contacts\\SearchContactsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\FetchFileOfAccountingEntryLineRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\FetchFilesOfAccountingEntryRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\AdditionalAddresses\\EditAnAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Taxes\\DeleteATaxRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\SearchNotesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\EditANoteRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Currencies\\FetchACurrencyRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsRelations\\FetchAListOfContactRelationsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Currencies\\FetchAListOfCurrenciesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Salutations\\CreateASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\BusinessActivities\\FetchAListOfBusinessActivitesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Languages\\FetchAListOfLanguagesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Titles\\CreateASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\FetchAListOfContactsRequestTest::__pest_evaluable_it_can_perform_the_request":0.005,"P\\Tests\\Requests\\Salutations\\DeleteASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CompanyProfiles\\FetchACompanyProfileRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Contacts\\DeleteAContactRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\GetNextReferenceNumberRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Users\\FetchAuthenticatedUserRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsRelations\\CreateContactRelationRequestTest::__pest_evaluable_it_can_perform_the_request":0}} \ No newline at end of file diff --git a/README.md b/README.md index 081a1f9..1d6ab58 100644 --- a/README.md +++ b/README.md @@ -15,20 +15,20 @@ Bexio is a cloud-based simple business software for the self-employed, small bus ## πŸ›  Requirements -| Package | PHP | Laravel | -|-----------|-------------|-----------| -| v12.0.0 | ^8.2 - ^8.4 | 12.x | -| v11.0.0 | ^8.2 - ^8.3 | 11.x | -| v1.0.0 | ^8.2 | 10.x | +| Package | PHP | Laravel | +| ------- | ----------- | ------- | +| v12.0.0 | ^8.2 - ^8.4 | 12.x | +| v11.0.0 | ^8.2 - ^8.3 | 11.x | +| v1.0.0 | ^8.2 | 10.x | ## Authentication The currently supported authentication methods are: -| Method | Supported | -|-----------|:-----------:| -| API token | βœ… | -| OAuth | ❌ | +| Method | Supported | +| --------- | :-------: | +| API token | βœ… | +| OAuth | ❌ | ## βš™οΈ Installation @@ -62,19 +62,19 @@ use CodebarAg\Bexio\BexioConnector; ... $connector = new BexioConnector(); -```` +``` ### Responses The following responses are currently supported for retrieving the response body: -| Response Methods | Description | Supported | -|-------------------|------------------------------------------------------------------------------------------------------------------------------------|:-----------:| -| body | Returns the HTTP body as a string | βœ… | -| json | Retrieves a JSON response body and json_decodes it into an array. | βœ… | -| object | Retrieves a JSON response body and json_decodes it into an object. | βœ… | -| collect | Retrieves a JSON response body and json_decodes it into a Laravel collection. **Requires illuminate/collections to be installed.** | βœ… | -| dto | Converts the response into a data-transfer object. You must define your DTO first | βœ… | +| Response Methods | Description | Supported | +| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- | :-------: | +| body | Returns the HTTP body as a string | βœ… | +| json | Retrieves a JSON response body and json_decodes it into an array. | βœ… | +| object | Retrieves a JSON response body and json_decodes it into an object. | βœ… | +| collect | Retrieves a JSON response body and json_decodes it into a Laravel collection. **Requires illuminate/collections to be installed.** | βœ… | +| dto | Converts the response into a data-transfer object. You must define your DTO first | βœ… | See https://docs.saloon.dev/the-basics/responses for more information. @@ -82,8 +82,8 @@ See https://docs.saloon.dev/the-basics/responses for more information. We provide enums for the following values: -| Enum | Values | -|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Enum | Values | +| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Accounts: SearchFieldEnum | ACCOUNT_NO(), self FIBU_ACCOUNT_GROUP_ID(), NAME(), ACCOUNT_TYPE() | | Accounts: AccountTypeEnum | EARNINGS(), EXPENDITURES(), ACTIVE_ACCOUNTS(), PASSIVE_ACCOUNTS(), COMPLETE_ACCOUNTS() | | AdditionalAddresses: AddSearchTypeEnum | ID(), ID_ASC(), ID_DESC(), NAME(), NAME_ASC(), NAME_DESC() | @@ -103,65 +103,62 @@ We provide enums for the following values: | Titles: OrderByEnum | ID(), ID_ASC(), ID_DESC(), NAME(), NAME_ASC(), NAME_DESC() | | SearchCriteriaEnum | EQUALS(), DOUBLE_EQUALS(), EQUAL(), NOT_EQUALS(), GREATER_THAN_SYMBOL(), GREATER_THAN(), GREATER_EQUAL_SYMBOL(), GREATER_EQUAL(), LESS_THAN_SYMBOL(), LESS_THAN(), LESS_EQUAL_SYMBOL(), LESS_EQUAL(), LIKE(), NOT_LIKE(), IS_NULL(), NOT_NULL(), IN(), NOT_IN() | - - - `Note: When using the dto method on a response, the enum values will be converted to their respective enum class.` ### DTOs We provide DTOs for the following: -| DTO | -|---------------------------------------| -| AccountGroupDTO | -| AccountDTO | -| BankAccountDTO | -| AdditionalAddressDTO | -| BankAccountDTO | -| BusinessActivityDTO | -| BusinessYearDTO | -| CalendarYearDTO | -| CompanyProfileDTO | -| ContactAdditionalAddressDTO | -| ContactGroupDTO | -| ContactRelationDTO | -| ContactDTO | -| CreateEditContactDTO | -| ContactSectorDTO | -| CurrencyDTO | -| CreateCurrencyDTO | -| EditCurrencyDTO | -| ExchangeCurrencyDTO | -| DocumentSettingDTO | -| FileDTO | -| EditFileDTO | -| FileUsageDTO | -| InvoiceDTO | -| InvoicePositionDTO | -| InvoiceTaxDTO | -| PdfDTO | -| LanguageDTO | -| AddFileDTO | -| EntryDTO | -| FileDTO | -| ManualEntryDTO | -| NoteDTO | -| PaymentDTO | -| PaymentTypeDTO | -| ProjectDTO | -| JournalDTO | -| SalutationDTO | -| TaxDTO | -| TitleDTO | -| UnitDTO | -| UserDTO | -| VatPeriodDTO | +| DTO | +| --------------------------- | +| AccountGroupDTO | +| AccountDTO | +| BankAccountDTO | +| AdditionalAddressDTO | +| BankAccountDTO | +| BusinessActivityDTO | +| BusinessYearDTO | +| CalendarYearDTO | +| CompanyProfileDTO | +| ContactAdditionalAddressDTO | +| ContactGroupDTO | +| ContactRelationDTO | +| ContactDTO | +| CreateEditContactDTO | +| ContactSectorDTO | +| CurrencyDTO | +| CreateCurrencyDTO | +| EditCurrencyDTO | +| ExchangeCurrencyDTO | +| DocumentSettingDTO | +| FileDTO | +| EditFileDTO | +| FileUsageDTO | +| InvoiceDTO | +| InvoicePositionDTO | +| InvoiceTaxDTO | +| PdfDTO | +| LanguageDTO | +| AddFileDTO | +| EntryDTO | +| FileDTO | +| ManualEntryDTO | +| NoteDTO | +| PaymentDTO | +| PaymentTypeDTO | +| ProjectDTO | +| JournalDTO | +| SalutationDTO | +| TaxDTO | +| TitleDTO | +| UnitDTO | +| UserDTO | +| VatPeriodDTO | In addition to the above, we also provide DTOs to be used for create and edit request for the following: -| DTO | -|---------------------------------------| +| DTO | +| ------------------------------------- | | CreateCalendarYearDTO | | CreateEditAdditionalAddressDTO | | CreateEditContactAdditionalAddressDTO | @@ -191,14 +188,15 @@ use CodebarAg\bexio\BexioConnector; // PROVIDE TOKEN IN CONSTRUCTOR $connector = new BexioConnector(token: 'your-token'); - + // OR - + // PROVIDE TOKEN IN .ENV FILE $connector = new BexioConnector(); ``` ### Accounts + ```php /** * Fetch A List Of Account Groups @@ -224,6 +222,7 @@ $accounts = $connector->send(new SearchAccountsRequest( ``` ### Addresses + ```php /** * Fetch A List Of Addresses @@ -262,7 +261,7 @@ $address = $connector->send(new CreateAddressRequest( address: 'Test Address', postcode: '1234', city: 'Test City', - ) + ) )); ``` @@ -279,7 +278,7 @@ $address = $connector->send(new EditAnAddressRequest( address: 'Test Address Edit', postcode: '4567', city: 'Test City Edit', - ) + ) )); ``` @@ -292,8 +291,8 @@ $address = $connector->send(new DeleteAnAddressRequest( )); ``` - ### Bank Accounts + ```php /** * Fetch A List Of Bank Accounts @@ -310,8 +309,8 @@ $bankAccount = $connector->send(new FetchASingleBankAccountRequest( ))->dto(); ``` - ### Business Years + ```php /** * Fetch A List Of Business Years @@ -329,6 +328,7 @@ $businessYear = $connector->send(new FetchABusinessYearRequest( ``` ### Calendar Years + ```php /** * Fetch A List Of Calendar Years @@ -346,6 +346,7 @@ $calendarYear = $connector->send(new FetchACalendarYearRequest( ``` ### Company Profiles + ```php /** * Fetch A List Of Company Profiles @@ -363,6 +364,7 @@ $companyProfile = $connector->send(new FetchACompanyProfileRequest( ``` ### Additional Addresses + ```php /** * Fetch A List Of Contact Additional Addresses @@ -403,7 +405,9 @@ $contactAdditionalAddress = $connector->send(new CreateContactAdditionalAddressR name: 'Test', subject: 'Test Subject', description: 'This is a test', - address: 'Test Address', + street_name: 'Test Street', + house_number: '42', + address_addition: 'c/o Test', postcode: '1234', city: 'Test City', ) @@ -421,7 +425,9 @@ $contactAdditionalAddress = $connector->send(new EditAContactAdditionalAddressRe name: 'Test Edit', subject: 'Test Subject Edit', description: 'This is a test edit', - address: 'Test Address Edit', + street_name: 'Test Street Edit', + house_number: '42B', + address_addition: 'c/o Test Edit', postcode: '4567', city: 'Test City Edit', ) @@ -439,6 +445,7 @@ $contactAdditionalAddress = $connector->send(new DeleteAContactAdditionalAddress ``` ### Contact Groups + ```php /** * Fetch A List Of Contact Groups @@ -498,6 +505,7 @@ $contactGroup = $connector->send(new DeleteAContactGroupRequest( ``` ### Contact Relations + ```php /** * Fetch A List Of Contact Relations @@ -561,6 +569,7 @@ $contactRelation = $connector->send(new DeleteAContactRelationRequest( ``` ### Contacts + ```php /** * Fetch A List Of Contacts @@ -657,6 +666,7 @@ $contact = $connector->send(new RestoreAContactRequest( ``` ### Contact Sectors + ```php /** * Fetch A List Of Contact Sectors @@ -676,6 +686,7 @@ $contactSectors = $connector->send(new SearchContactSectorsRequest( ``` ### Currencies + ```php /** * Fetch A List Of Currencies @@ -742,6 +753,7 @@ $exchangeRates = $connector->send(new FetchExchangeRatesForCurrenciesRequest( ``` ### Files + ```php /** * Fetch A List Of Files @@ -823,6 +835,7 @@ $file = $connector->send(new DeleteAFileRequest( ``` ### Iban Payments + ```php /** * Fetch An Iban Payment @@ -865,7 +878,7 @@ $payment = $connector->send(new CreateIbanPaymentRequest( ```php /** * Update Iban Payment - * + * * NOTE: THE PAYMENT MUST HAVE A STATUS OF OPEN TO BE UPDATED */ $payment = $connector->send(new EditIbanPaymentRequest( @@ -897,6 +910,7 @@ $payment = $connector->send(new EditIbanPaymentRequest( ``` ### Invoices + ```php /** * Fetch A List Of Invoices @@ -1058,9 +1072,8 @@ return response(base64_decode($pdf->content)) ->header('Content-Length', $pdf->size); ``` - - ### Languages + ```php /** * Fetch A List Of Languages @@ -1069,6 +1082,7 @@ $languages = $connector->send(new FetchAListOfLanguagesRequest())->dto(); ``` ### Manual Entries + ```php /** * Fetch A List Of Manual Entries @@ -1145,6 +1159,7 @@ $referenceNumber = $connector->send(new GetNextReferenceNumberRequest())->dto(); ``` ### Notes + ```php /** * Fetch A List Of Notes @@ -1208,6 +1223,7 @@ $note = $connector->send(new DeleteANoteRequest( ``` ### Payments + ```php /** * Fetch A List Of Payments @@ -1233,8 +1249,8 @@ $payment = $connector->send(new DeleteAPaymentRequest( ))->json(); ``` - ### Qr Payments + ```php /** * Fetch A Qr Payment @@ -1276,7 +1292,7 @@ $connector->send(new CreateQrPaymentRequest( ```php /** * Update A Qr Payment - * + * * NOTE: THE PAYMENT MUST HAVE A STATUS OF OPEN TO BE UPDATED */ $payment = $connector->send(new EditQrPaymentRequest( @@ -1304,6 +1320,7 @@ $payment = $connector->send(new EditQrPaymentRequest( ``` ### Reports + ```php /** * Journal @@ -1312,6 +1329,7 @@ $journals = $connector->send(new JournalRequest())->dto(); ``` ### Salutations + ```php /** * Fetch A List Of Salutations @@ -1373,6 +1391,7 @@ $salutation = $connector->send(new DeleteASalutationRequest( ``` ### Taxes + ```php /** * Fetch A List Of Taxes @@ -1399,14 +1418,15 @@ $tax = $connector->send(new DeleteATaxRequest( ``` ### Titles + ```php /** * Fetch A List Of Titles */ $titles = $connector->send(new FetchAListOfTitlesRequest())->dto(); - ``` +``` -```php +```php /** * Fetch A Title */ @@ -1460,6 +1480,7 @@ $title = $connector->send(new DeleteATitleRequest( ``` ### VAT Periods + ```php /** * Fetch A List Of VAT Periods @@ -1516,12 +1537,12 @@ Please review [our security policy](.github/SECURITY.md) on reporting security v ## πŸ™ Credits -- [Rhys Lees](https://github.com/RhysLees) -- [Sebastian Fix](https://github.com/StanBarrows) -- [All Contributors](../../contributors) -- [Skeleton Repository from Spatie](https://github.com/spatie/package-skeleton-laravel) -- [Laravel Package Training from Spatie](https://spatie.be/videos/laravel-package-training) -- [Laravel Saloon by Sam CarrΓ©](https://github.com/Sammyjo20/Saloon) +- [Rhys Lees](https://github.com/RhysLees) +- [Sebastian Fix](https://github.com/StanBarrows) +- [All Contributors](../../contributors) +- [Skeleton Repository from Spatie](https://github.com/spatie/package-skeleton-laravel) +- [Laravel Package Training from Spatie](https://spatie.be/videos/laravel-package-training) +- [Laravel Saloon by Sam CarrΓ©](https://github.com/Sammyjo20/Saloon) ## 🎭 License diff --git a/src/Dto/AdditionalAddresses/AdditionalAddressDTO.php b/src/Dto/AdditionalAddresses/AdditionalAddressDTO.php index ec3912b..de91099 100644 --- a/src/Dto/AdditionalAddresses/AdditionalAddressDTO.php +++ b/src/Dto/AdditionalAddresses/AdditionalAddressDTO.php @@ -15,7 +15,10 @@ public function __construct( public string $subject, public string $description, public ?string $address = null, - public ?int $postcode = null, + public ?string $street_name = null, + public ?string $house_number = null, + public ?string $address_addition = null, + public ?string $postcode = null, public ?string $city = null, public ?string $country_id = null, ) {} @@ -23,7 +26,7 @@ public function __construct( public static function fromResponse(Response $response): self { if ($response->failed()) { - throw new \Exception('Failed to create DTO from Response'); + throw new Exception('Failed to create DTO from Response'); } $data = $response->json(); @@ -40,12 +43,15 @@ public static function fromArray(array $data): self return new self( id: Arr::get($data, 'id'), name: Arr::get($data, 'name'), + subject: Arr::get($data, 'subject'), + description: Arr::get($data, 'description'), address: Arr::get($data, 'address'), + street_name: Arr::get($data, 'street_name'), + house_number: Arr::get($data, 'house_number'), + address_addition: Arr::get($data, 'address_addition'), postcode: Arr::get($data, 'postcode'), city: Arr::get($data, 'city'), country_id: Arr::get($data, 'country_id'), - subject: Arr::get($data, 'subject'), - description: Arr::get($data, 'description'), ); } } diff --git a/src/Dto/AdditionalAddresses/CreateEditAdditionalAddressDTO.php b/src/Dto/AdditionalAddresses/CreateEditAdditionalAddressDTO.php index 30fca39..7f7c860 100644 --- a/src/Dto/AdditionalAddresses/CreateEditAdditionalAddressDTO.php +++ b/src/Dto/AdditionalAddresses/CreateEditAdditionalAddressDTO.php @@ -9,20 +9,38 @@ class CreateEditAdditionalAddressDTO extends Data { + /** + * DTO for creating/editing additional addresses. As of June 2025, use street_name, house_number, address_addition instead of address. + */ public function __construct( public string $name, public string $subject, public string $description, + /** @deprecated Use street_name, house_number, address_addition instead. Will be removed after 2025-12-07. */ public ?string $address = null, - public ?int $postcode = null, + public ?string $street_name = null, + public ?string $house_number = null, + public ?string $address_addition = null, + public ?string $postcode = null, public ?string $city = null, public ?string $country_id = null, - ) {} + ) { + if ($this->address !== null) { + $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; + logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + trigger_error($msg, E_USER_DEPRECATED); + } + + if (!$this->street_name && $this->address) { + $this->street_name = $this->address; + $this->address = null; + } + } public static function fromResponse(Response $response): self { if ($response->failed()) { - throw new \Exception('Failed to create DTO from Response'); + throw new Exception('Failed to create DTO from Response'); } $data = $response->json(); @@ -36,11 +54,26 @@ public static function fromArray(array $data): self throw new Exception('Unable to create DTO. Data missing from response.'); } + $street_name = Arr::get($data, 'street_name'); + $address = Arr::get($data, 'address'); + + if ($address !== null) { + $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; + logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + trigger_error($msg, E_USER_DEPRECATED); + } + + if (!$street_name && $address) { + $street_name = $address; + $address = null; + } + return new self( name: Arr::get($data, 'name'), subject: Arr::get($data, 'subject'), description: Arr::get($data, 'description'), - address: Arr::get($data, 'address'), + address: $address, + street_name: $street_name, postcode: Arr::get($data, 'postcode'), city: Arr::get($data, 'city'), country_id: Arr::get($data, 'country_id'), diff --git a/src/Dto/ContactAdditionalAddresses/ContactAdditionalAddressDTO.php b/src/Dto/ContactAdditionalAddresses/ContactAdditionalAddressDTO.php index 73a42a3..fbc0370 100644 --- a/src/Dto/ContactAdditionalAddresses/ContactAdditionalAddressDTO.php +++ b/src/Dto/ContactAdditionalAddresses/ContactAdditionalAddressDTO.php @@ -14,16 +14,19 @@ public function __construct( public string $name, public string $subject, public string $description, - public string $address, - public string $postcode, - public string $city, + public ?string $address = null, + public ?string $street_name = null, + public ?string $house_number = null, + public ?string $address_addition = null, + public ?string $postcode = null, + public ?string $city = null, public ?int $country_id = null, ) {} public static function fromResponse(Response $response): self { if ($response->failed()) { - throw new \Exception('Failed to create DTO from Response'); + throw new Exception('Failed to create DTO from Response'); } $data = $response->json(); @@ -43,6 +46,9 @@ public static function fromArray(array $data): self subject: Arr::get($data, 'subject'), description: Arr::get($data, 'description'), address: Arr::get($data, 'address'), + street_name: Arr::get($data, 'street_name'), + house_number: Arr::get($data, 'house_number'), + address_addition: Arr::get($data, 'address_addition'), postcode: Arr::get($data, 'postcode'), city: Arr::get($data, 'city'), country_id: Arr::get($data, 'country_id') diff --git a/src/Dto/ContactAdditionalAddresses/CreateEditContactAdditionalAddressDTO.php b/src/Dto/ContactAdditionalAddresses/CreateEditContactAdditionalAddressDTO.php index f8d9c6d..7d6f165 100644 --- a/src/Dto/ContactAdditionalAddresses/CreateEditContactAdditionalAddressDTO.php +++ b/src/Dto/ContactAdditionalAddresses/CreateEditContactAdditionalAddressDTO.php @@ -9,20 +9,38 @@ class CreateEditContactAdditionalAddressDTO extends Data { + /** + * DTO for creating/editing contact additional addresses. As of June 2025, use street_name, house_number, address_addition instead of address. + */ public function __construct( public string $name, public string $subject, public string $description, - public string $address, - public string $postcode, - public string $city, + /** @deprecated Use street_name, house_number, address_addition instead. Will be removed after 2025-12-07. */ + public ?string $address = null, + public ?string $street_name = null, + public ?string $house_number = null, + public ?string $address_addition = null, + public ?string $postcode = null, + public ?string $city = null, public ?int $country_id = null, - ) {} + ) { + if ($this->address !== null) { + $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; + logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + trigger_error($msg, E_USER_DEPRECATED); + } + + if (!$this->street_name && $this->address) { + $this->street_name = $this->address; + $this->address = null; + } + } public static function fromResponse(Response $response): self { if ($response->failed()) { - throw new \Exception('Failed to create DTO from Response'); + throw new Exception('Failed to create DTO from Response'); } $data = $response->json(); @@ -36,11 +54,28 @@ public static function fromArray(array $data): self throw new Exception('Unable to create DTO. Data missing from response.'); } + $street_name = Arr::get($data, 'street_name'); + $address = Arr::get($data, 'address'); + + if ($address !== null) { + $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; + logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + trigger_error($msg, E_USER_DEPRECATED); + } + + if (!$street_name && $address) { + $street_name = $address; + $address = null; + } + return new self( name: Arr::get($data, 'name'), subject: Arr::get($data, 'subject'), description: Arr::get($data, 'description'), - address: Arr::get($data, 'address'), + address: $address, + street_name: $street_name, + house_number: Arr::get($data, 'house_number'), + address_addition: Arr::get($data, 'address_addition'), postcode: Arr::get($data, 'postcode'), city: Arr::get($data, 'city'), country_id: Arr::get($data, 'country_id') diff --git a/src/Dto/Contacts/ContactDTO.php b/src/Dto/Contacts/ContactDTO.php index 2e07a23..7e7003c 100644 --- a/src/Dto/Contacts/ContactDTO.php +++ b/src/Dto/Contacts/ContactDTO.php @@ -22,6 +22,9 @@ public function __construct( public ?int $title_id, // ref to title public ?string $birthday, public ?string $address, + public ?string $street_name, + public ?string $house_number, + public ?string $address_addition, public ?string $postcode, public ?string $city, public ?int $country_id, // ref to country @@ -69,6 +72,9 @@ public static function fromArray(array $data): self title_id: Arr::get($data, 'title_id'), birthday: Arr::get($data, 'birthday'), address: Arr::get($data, 'address'), + street_name: Arr::get($data, 'street_name'), + house_number: Arr::get($data, 'house_number'), + address_addition: Arr::get($data, 'address_addition'), postcode: Arr::get($data, 'postcode'), city: Arr::get($data, 'city'), country_id: Arr::get($data, 'country_id'), diff --git a/src/Dto/Contacts/CreateEditContactDTO.php b/src/Dto/Contacts/CreateEditContactDTO.php index e0a9ed2..64a2c1a 100644 --- a/src/Dto/Contacts/CreateEditContactDTO.php +++ b/src/Dto/Contacts/CreateEditContactDTO.php @@ -10,6 +10,9 @@ class CreateEditContactDTO extends Data { + /** + * DTO for creating/editing contacts. As of June 2025, use street_name, house_number, address_addition instead of address. + */ public function __construct( public int $user_id, // ref to user public int $owner_id, @@ -20,7 +23,11 @@ public function __construct( public ?int $salutation_form = null, public ?int $titel_id = null, // ref to title public ?Carbon $birthday = null, + /** @deprecated Use street_name, house_number, address_addition instead. Will be removed after 2025-12-07. */ public ?string $address = null, + public ?string $street_name = null, + public ?string $house_number = null, + public ?string $address_addition = null, public ?string $postcode = null, public ?string $city = null, public ?int $country_id = null, // ref to country @@ -36,12 +43,23 @@ public function __construct( public ?int $language_id = null, // ref to language public ?string $contact_group_ids = null, public ?string $contact_branch_ids = null, - ) {} + ) { + if ($this->address !== null) { + $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; + logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + trigger_error($msg, E_USER_DEPRECATED); + } + + if (!$this->street_name && $this->address) { + $this->street_name = $this->address; + $this->address = null; + } + } public static function fromResponse(Response $response): self { if ($response->failed()) { - throw new \Exception('Failed to create DTO from Response'); + throw new Exception('Failed to create DTO from Response'); } $data = $response->json(); @@ -55,6 +73,20 @@ public static function fromArray(array $data): self throw new Exception('Unable to create DTO. Data missing from response.'); } + $street_name = Arr::get($data, 'street_name'); + $address = Arr::get($data, 'address'); + + if ($address !== null) { + $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; + logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + trigger_error($msg, E_USER_DEPRECATED); + } + + if (!$street_name && $address) { + $street_name = $address; + $address = null; + } + return new self( user_id: Arr::get($data, 'user_id'), owner_id: Arr::get($data, 'owner_id'), @@ -65,7 +97,10 @@ public static function fromArray(array $data): self salutation_form: Arr::get($data, 'salutation_form'), titel_id: Arr::get($data, 'title_id'), birthday: Arr::get($data, 'birthday'), - address: Arr::get($data, 'address'), + address: $address, + street_name: $street_name, + house_number: Arr::get($data, 'house_number'), + address_addition: Arr::get($data, 'address_addition'), postcode: Arr::get($data, 'postcode'), city: Arr::get($data, 'city'), country_id: Arr::get($data, 'country_id'), diff --git a/tests/Fixtures/Saloon/AdditionalAddresses/create-an-additional-address.json b/tests/Fixtures/Saloon/AdditionalAddresses/create-an-additional-address.json index f608f5a..54bef92 100644 --- a/tests/Fixtures/Saloon/AdditionalAddresses/create-an-additional-address.json +++ b/tests/Fixtures/Saloon/AdditionalAddresses/create-an-additional-address.json @@ -1 +1,26 @@ -{"statusCode":201,"headers":{"Date":"Tue, 02 Jan 2024 11:49:34 GMT","Content-Type":"application\/json","Content-Length":"163","Connection":"keep-alive","ratelimit-reset":"26","x-ratelimit-remaining-minute":"938","x-ratelimit-limit-minute":"1000","ratelimit-remaining":"938","ratelimit-limit":"1000","etag":"e3765efbd9edc6ff9c02f8a9d8a79786","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c78acc32dc87-LHR"},"data":"{\"id\":4,\"name\":\"Test name\",\"address\":\"Test address\",\"postcode\":\"12345\",\"city\":\"Test city\",\"country_id\":1,\"subject\":\"Test subject\",\"description\":\"Test description\"}"} \ No newline at end of file +{ + "statusCode": 201, + "headers": { + "Date": "Thu, 19 Jun 2025 23:29:17 GMT", + "Content-Type": "application\/json", + "Content-Length": "258", + "Connection": "keep-alive", + "x-ratelimit-remaining-minute": "999", + "x-ratelimit-limit-minute": "1000", + "ratelimit-remaining": "999", + "ratelimit-reset": "43", + "ratelimit-limit": "1000", + "etag": "692fb7fc8a68c97841a569337d2c0065", + "Cache-Control": "no-store", + "pragma": "no-cache", + "vary": "Origin", + "access-control-allow-origin": "https:\/\/office.bexio.com", + "via": "1.1 google", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "Server": "cloudflare", + "CF-RAY": "9526cec36a3aeb4e-CPH" + }, + "data": "{\"id\":48,\"name\":\"Test name\",\"address\":\"Test Street 42A\\nc\\\/o Test\",\"street_name\":\"Test Street\",\"house_number\":\"42A\",\"address_addition\":\"c\\\/o Test\",\"postcode\":\"12345\",\"city\":\"Test city\",\"country_id\":1,\"subject\":\"Test subject\",\"description\":\"Test description\"}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/AdditionalAddresses/edit-an-additional-address.json b/tests/Fixtures/Saloon/AdditionalAddresses/edit-an-additional-address.json index 34051eb..fb7f175 100644 --- a/tests/Fixtures/Saloon/AdditionalAddresses/edit-an-additional-address.json +++ b/tests/Fixtures/Saloon/AdditionalAddresses/edit-an-additional-address.json @@ -1 +1,26 @@ -{"statusCode":404,"headers":{"Date":"Tue, 02 Jan 2024 11:49:31 GMT","Content-Type":"application\/json","Transfer-Encoding":"chunked","Connection":"keep-alive","ratelimit-reset":"29","x-ratelimit-remaining-minute":"947","x-ratelimit-limit-minute":"1000","ratelimit-remaining":"947","ratelimit-limit":"1000","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c779ac78dd60-LHR"},"data":"{\"error_code\":404,\"message\":\"Page not found\"}"} \ No newline at end of file +{ + "statusCode": 200, + "headers": { + "Date": "Thu, 19 Jun 2025 23:29:18 GMT", + "Content-Type": "application\/json", + "Content-Length": "314", + "Connection": "keep-alive", + "x-ratelimit-remaining-minute": "997", + "x-ratelimit-limit-minute": "1000", + "ratelimit-remaining": "997", + "ratelimit-reset": "42", + "ratelimit-limit": "1000", + "etag": "822b4318da4d28aae733008cbdd48297", + "Cache-Control": "no-store", + "pragma": "no-cache", + "vary": "Origin", + "access-control-allow-origin": "https:\/\/office.bexio.com", + "via": "1.1 google", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "Server": "cloudflare", + "CF-RAY": "9526cec8ee2192c7-CPH" + }, + "data": "{\"id\":37,\"name\":\"Test name edited\",\"address\":\"Test Street edited 42B\\nc\\\/o Test edited\",\"street_name\":\"Test Street edited\",\"house_number\":\"42B\",\"address_addition\":\"c\\\/o Test edited\",\"postcode\":\"12345\",\"city\":\"Test city edited\",\"country_id\":1,\"subject\":\"Test subject edited\",\"description\":\"Test description edited\"}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/ContactAdditionalAddresses/create-contact-additional-address.json b/tests/Fixtures/Saloon/ContactAdditionalAddresses/create-contact-additional-address.json index f49ba8f..52130db 100644 --- a/tests/Fixtures/Saloon/ContactAdditionalAddresses/create-contact-additional-address.json +++ b/tests/Fixtures/Saloon/ContactAdditionalAddresses/create-contact-additional-address.json @@ -1 +1,26 @@ -{"statusCode":201,"headers":{"Date":"Tue, 02 Jan 2024 11:49:30 GMT","Content-Type":"application\/json","Content-Length":"158","Connection":"keep-alive","x-ratelimit-remaining-minute":"954","ratelimit-limit":"1000","ratelimit-remaining":"954","ratelimit-reset":"31","x-ratelimit-limit-minute":"1000","etag":"278dd39bdcac4f690049a16e5a8e4d18","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c76ddd6a730e-LHR"},"data":"{\"id\":3,\"name\":\"Test\",\"address\":\"Test Address\",\"postcode\":\"1234\",\"city\":\"Test City\",\"country_id\":null,\"subject\":\"Test Subject\",\"description\":\"This is a test\"}"} \ No newline at end of file +{ + "statusCode": 201, + "headers": { + "Date": "Thu, 19 Jun 2025 23:29:18 GMT", + "Content-Type": "application\/json", + "Content-Length": "253", + "Connection": "keep-alive", + "ratelimit-remaining": "998", + "ratelimit-reset": "42", + "x-ratelimit-limit-minute": "1000", + "x-ratelimit-remaining-minute": "998", + "ratelimit-limit": "1000", + "etag": "822b4318da4d28aae733008cbdd48297", + "Cache-Control": "no-store", + "pragma": "no-cache", + "vary": "Origin", + "access-control-allow-origin": "https:\/\/office.bexio.com", + "via": "1.1 google", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "Server": "cloudflare", + "CF-RAY": "9526cec70c79929a-CPH" + }, + "data": "{\"id\":49,\"name\":\"Test\",\"address\":\"Test Street 42A\\nc\\\/o Test\",\"street_name\":\"Test Street\",\"house_number\":\"42A\",\"address_addition\":\"c\\\/o Test\",\"postcode\":\"1234\",\"city\":\"Test City\",\"country_id\":null,\"subject\":\"Test Subject\",\"description\":\"This is a test\"}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/ContactAdditionalAddresses/edit-contact-additional-address.json b/tests/Fixtures/Saloon/ContactAdditionalAddresses/edit-contact-additional-address.json index d9c4e92..9b58b44 100644 --- a/tests/Fixtures/Saloon/ContactAdditionalAddresses/edit-contact-additional-address.json +++ b/tests/Fixtures/Saloon/ContactAdditionalAddresses/edit-contact-additional-address.json @@ -1 +1,26 @@ -{"statusCode":404,"headers":{"Date":"Tue, 02 Jan 2024 11:49:37 GMT","Content-Type":"application\/json","Transfer-Encoding":"chunked","Connection":"keep-alive","ratelimit-reset":"23","x-ratelimit-remaining-minute":"929","x-ratelimit-limit-minute":"1000","ratelimit-remaining":"929","ratelimit-limit":"1000","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c79a09a32408-LHR"},"data":"{\"error_code\":404,\"message\":\"Page not found\"}"} \ No newline at end of file +{ + "statusCode": 200, + "headers": { + "Date": "Thu, 19 Jun 2025 23:29:18 GMT", + "Content-Type": "application\/json", + "Content-Length": "293", + "Connection": "keep-alive", + "ratelimit-reset": "42", + "x-ratelimit-remaining-minute": "996", + "x-ratelimit-limit-minute": "1000", + "ratelimit-remaining": "996", + "ratelimit-limit": "1000", + "etag": "822b4318da4d28aae733008cbdd48297", + "Cache-Control": "no-store", + "pragma": "no-cache", + "vary": "Origin", + "access-control-allow-origin": "https:\/\/office.bexio.com", + "via": "1.1 google", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "Server": "cloudflare", + "CF-RAY": "9526cecb4aeaebcc-CPH" + }, + "data": "{\"id\":38,\"name\":\"Test Edit\",\"address\":\"Test Street Edit 42B\\nc\\\/o Test Edit\",\"street_name\":\"Test Street Edit\",\"house_number\":\"42B\",\"address_addition\":\"c\\\/o Test Edit\",\"postcode\":\"4567\",\"city\":\"Test City Edit\",\"country_id\":null,\"subject\":\"Test Subject Edit\",\"description\":\"This is a test edit\"}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/Contacts/create-contact.json b/tests/Fixtures/Saloon/Contacts/create-contact.json index 509dda2..ed023a9 100644 --- a/tests/Fixtures/Saloon/Contacts/create-contact.json +++ b/tests/Fixtures/Saloon/Contacts/create-contact.json @@ -1 +1 @@ -{"statusCode":201,"headers":{"Date":"Tue, 02 Jan 2024 11:49:15 GMT","Content-Type":"application\/json","Content-Length":"4304","Connection":"keep-alive","x-ratelimit-remaining-minute":"995","x-ratelimit-limit-minute":"1000","ratelimit-remaining":"995","ratelimit-limit":"1000","ratelimit-reset":"45","etag":"bb727c1b45f71280b8bd667bfafd4235","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c712fb5076ab-LHR"},"data":"{\"id\":2,\"nr\":\"000002\",\"contact_type_id\":1,\"name_1\":\"John\",\"name_2\":\"\",\"salutation_id\":null,\"salutation_form\":null,\"title_id\":null,\"birthday\":null,\"address\":\"\",\"postcode\":\"\",\"city\":\"\",\"country_id\":null,\"mail\":\"\",\"mail_second\":\"\",\"phone_fixed\":\"\",\"phone_fixed_second\":\"\",\"phone_mobile\":\"\",\"fax\":\"\",\"url\":\"\",\"skype_name\":\"\",\"remarks\":\"\",\"language_id\":null,\"is_lead\":false,\"contact_group_ids\":null,\"contact_branch_ids\":null,\"user_id\":1,\"owner_id\":1,\"profile_image\":\"iVBORw0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2OM6QQViaAkSotoCvTh\\\/MW49gkhVuBnGVB9GIBeUJEIMcjI8+gsFcIDsczBD174MIzj3tnOTVpZo15EZ1muA2VEOiWOw3jSh5NzaowQT9LQPQeGQ0akbVgbh2XM1qfwOsP8XP84KfKeCquIfjfnAzrKgGfM2+gsGazOmXGqQrtzXJyq0IgHLjoL8MbHYoRTHwYFD2R0llsfixFufBheIycEuvWxiHDjw\\\/AaOSGQogiqClXq02nTC+SEwOhN9WLVzsciguzDILTpBXKjQBc+FhFUHwalTS\\\/geYClHTZ+\\\/RTOfDhu+Uz3zC476zHH+kcX4dTbGx33VQc5m4WDLStsn+naGVUqlLXlNXKmQADY\\\/ORpnOr7JOuekxPjAHsVbly7GCfe2uC6r1Tc94x1I4IW45JTK7edCq3a0IFuxrqtAu3yh6mHxdrhK988jRPn7qrQqfo4RBVuXrcYf\\\/uzM\\\/XZ5Q\\\/bJVpzmBSoUpxbRRrHJ7dndokqdDL2qRSneu55xjoFW791Bv2DcVfq4+AqrF1VjN4315M\\\/51nG+of\\\/iLGfHhjyJGP9Z7tWKP21ANB7+gaOn7kp9S\\\/roPWVCLas\\\/yy2bihVlu0+HsXeA0OeZKz\\\/fNcK\\\/A+fbwenvaUJAAAAAABJRU5ErkJggg==\",\"updated_at\":\"2024-01-02 12:49:15\"}"} \ No newline at end of file +{"statusCode":201,"headers":{"Date":"Tue, 02 Jan 2024 11:49:15 GMT","Content-Type":"application\/json","Content-Length":"4304","Connection":"keep-alive","x-ratelimit-remaining-minute":"995","x-ratelimit-limit-minute":"1000","ratelimit-remaining":"995","ratelimit-limit":"1000","ratelimit-reset":"45","etag":"bb727c1b45f71280b8bd667bfafd4235","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c712fb5076ab-LHR"},"data":"{\"id\":2,\"nr\":\"000002\",\"contact_type_id\":1,\"name_1\":\"John\",\"name_2\":\"\",\"salutation_id\":null,\"salutation_form\":null,\"title_id\":null,\"birthday\":null,\"address\":\"\",\"street_name\":\"\",\"house_number\":\"\",\"address_addition\":\"\",\"postcode\":\"\",\"city\":\"\",\"country_id\":null,\"mail\":\"\",\"mail_second\":\"\",\"phone_fixed\":\"\",\"phone_fixed_second\":\"\",\"phone_mobile\":\"\",\"fax\":\"\",\"url\":\"\",\"skype_name\":\"\",\"remarks\":\"\",\"language_id\":null,\"is_lead\":false,\"contact_group_ids\":null,\"contact_branch_ids\":null,\"user_id\":1,\"owner_id\":1,\"profile_image\":\"iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKq0lEQVR4nNVcbWwUxxl+znYNGLChlq22MbExHArQYivFmC8V4j+NjKsmbaOqrcRJaaISJ6qEFVS1UDi3\\\/EhD5UgtH+mPNLbUNhVNm0ayL7EiHFPxfU5qU2KEr3ZNoSX4BPGdD8PZ55v+IHPsze7OvLO7XPEjWfLuzs3MPffsfLwfg0Pto8wrnOsf96yu+wUv+3iofZRhSd0xdic540mF27aHPannfsKrPt5JzrAldcdY3tVrd\\\/DaG1fgFuGBGEI9Y67rud8I9YwhPBBzXc9rb1zB1Wt3kAcALx0aRnIq7arC1raI607lCm77mpxK46VDwwBwl0C3Kpwt6uNwq0KuPuBTAgF3KtT5RcMDMTQF+lDfdNIT0kM9Y6hvOommQJ8WKU5VaFQfYCDQqQqp6hOJc0ukSJwukU5VaFQfAPh8FV2MX1R8fi4iJ7ZiTmGe5Yet0BToyyIgfaUx63l4IIbWtoiSpLqaEuxr8aOxoVxaLtQzhta2iPLLNzaUY1+LH3U1JVn385aEssp0dqyV1mNEcioN\\\/+beLAKzmNJVoUx9ugpTlXeiMFV5XRWK6gMEBQJ6KhTVBwBnOzeRFKcCVyQAkuJU4Iqsbzppuk9RoZX6AKBALBhPpJBMpkkERm8kTfcGhyZw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/tests/Fixtures/Saloon/Contacts/fetch-a-contact.json b/tests/Fixtures/Saloon/Contacts/fetch-a-contact.json index fe30e43..d4b8579 100644 --- a/tests/Fixtures/Saloon/Contacts/fetch-a-contact.json +++ b/tests/Fixtures/Saloon/Contacts/fetch-a-contact.json @@ -1 +1 @@ -{"statusCode":200,"headers":{"Date":"Tue, 02 Jan 2024 11:49:32 GMT","Content-Type":"application\/json","Content-Length":"4408","Connection":"keep-alive","x-ratelimit-remaining-minute":"946","x-ratelimit-limit-minute":"1000","ratelimit-remaining":"946","ratelimit-limit":"1000","ratelimit-reset":"28","etag":"afbd41a73ac4b6db063793ef7aceb4d2","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c77b5e9060db-LHR"},"data":"{\"id\":1,\"nr\":\"000001\",\"contact_type_id\":1,\"name_1\":\"bexio AG\",\"name_2\":\"\",\"salutation_id\":0,\"salutation_form\":null,\"title_id\":null,\"birthday\":null,\"address\":\"Alte Jonastrasse 24\",\"postcode\":\"8640\",\"city\":\"Rapperswil\",\"country_id\":1,\"mail\":\"support@bexio.com\",\"mail_second\":null,\"phone_fixed\":\"+41 (0) 71 552 00 60\",\"phone_fixed_second\":null,\"phone_mobile\":\"\",\"fax\":\"\",\"url\":\"https:\\\/\\\/www.bexio.com\",\"skype_name\":\"\",\"remarks\":\"\",\"language_id\":null,\"is_lead\":false,\"contact_group_ids\":\"1\",\"contact_branch_ids\":null,\"user_id\":1,\"owner_id\":1,\"profile_image\":\"iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKvUlEQVR4nO1cbWxT1xl+cm1QGGkxBAcoH3G+Y99QaGi+qtVIKaWtzY+maMkKTbdkErTQShPqUqBVFRXQKpjYpgGGSm3ohMYSYOm2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ZAdXGi3OlKPxVRsgoFOE8xjoNNgKjYp8jDErhVCxqMZyH2cqz5ApI60XBUKkQdE57HwjTN855TUzoqURDEuBAnMWZGDjGWZooHFyIvWYzEWGpHOsxJI55sBFdTOkktixrJM5KzIETwvWsncWi1cJ0aMPEBh7ayf8dTO4mkDlNXOkkOiGAeAROWi7PwcZC7LxLf\\\/+jasXYo8pbWzyBh89d9XAfCPQWrVziIkHtp6EK4vXWHnMpdlhvYkhSBYO4tgzvxkXDh9IXQsRZ5atbOS588J5a3cVonkR+YCuDe1sygNhfzSfLhdbvQx9gxf2l6J5AXJYvRIF+LOzs9G1vIsdPyzQ5I8QN3aWZnLg2Nw9oqce147i63ErOVZyM7Plswjq3ZWx9cdaDryN0nyAHVrZ5HBu\\\/1y+32rnRWYCODQ1oNY\\\/dIzyHosSzLu\\\/wB9hHkIfDBOugAAAABJRU5ErkJggg==\",\"updated_at\":\"2009-06-09 08:37:17\"}"} \ No newline at end of file +{"statusCode":200,"headers":{"Date":"Tue, 02 Jan 2024 11:49:32 GMT","Content-Type":"application\/json","Content-Length":"4408","Connection":"keep-alive","x-ratelimit-remaining-minute":"946","x-ratelimit-limit-minute":"1000","ratelimit-remaining":"946","ratelimit-limit":"1000","ratelimit-reset":"28","etag":"afbd41a73ac4b6db063793ef7aceb4d2","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c77b5e9060db-LHR"},"data":"{\"id\":1,\"nr\":\"000001\",\"contact_type_id\":1,\"name_1\":\"bexio AG\",\"name_2\":\"\",\"salutation_id\":0,\"salutation_form\":null,\"title_id\":null,\"birthday\":null,\"address\":\"Alte Jonastrasse 24\",\"street_name\":\"Alte Jonastrasse\",\"house_number\":\"24\",\"address_addition\":\"\",\"postcode\":\"8640\",\"city\":\"Rapperswil\",\"country_id\":1,\"mail\":\"support@bexio.com\",\"mail_second\":null,\"phone_fixed\":\"+41 (0) 71 552 00 60\",\"phone_fixed_second\":null,\"phone_mobile\":\"\",\"fax\":\"\",\"url\":\"https:\\\/\\\/www.bexio.com\",\"skype_name\":\"\",\"remarks\":\"\",\"language_id\":null,\"is_lead\":false,\"contact_group_ids\":\"1\",\"contact_branch_ids\":null,\"user_id\":1,\"owner_id\":1,\"profile_image\":\"iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKvUlEQVR4nO1cbWxT1xl+cm1QGGkxBAcoH3G+Y99QaGi+qtVIKaWtzY+maMkKTbdkErTQShPqUqBVFRXQKpjYpgGGSm3ohMYSYOm2YlhgaZsyHAq02xTjZiklRglJ7YQ4y5dJDNkPc5zr+23fCzOSn1+55577vvc+fnzOueeJ34TJyclJqAC3y43mhmb8t38QPo8P3m6vonhJuiRk5+cAAP7zVTuGfcOK4ukX6qFL0eHh5FkoLS9FqjFVUTwCSmkAt8sNW40Nezbsxrwl8+Dt7sO2w9tRub0S+oX6iOMl6ZLw\\\/KYyvHtsB26N3cKtsVt499gOPL+pDEm6pIjj6RfqUbm9EtsOb4e3uw\\\/zlszDng27Yauxwe1yRxyPDW20F7pdbtjr7HA62gAAiTMTUVpeCvuHJ9F6qhXmMjMKVhfiYtOXOP3RaUlFJumSsGrd0zCXmTE9cTrcLncods+1Hqx6cRXMZWa0NLbg7B\\\/OSCpSv1CPZ3\\\/yLApWF4LSUGhpbIHPM4DS8lI01\\\/8dTkcbnI420CV5sFRZolZkQqRfYTZxBJZqKyxVFrz25GboUmaj9o+10E4Lfj53bt8RJJJNHIGtxhbKQZfk4dXdr4bOjfvHBYlkEwcAgYkAan9cC59nAPu+2A97nR32D0+GXRctkbIVKEQcMKU+Ap9nAOc\\\/OQ9zmRkAQGkoFD1XHKbIsZExXuJILmYep6MNbpc79HDTE6dzFDlj5gwOcQTnPzkPn2cgdExU6B\\\/xh+W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F7pFPz1ZCS4Fx6Lmh5GtGCPmQaTAXQxHfyt3JULV3DgjfBd42iJfBBqZ0UCoclm0682w1RkCi6kTUUmGGgDOp2doQ58s6xcxHrtLDkQm6UNtAGmIhMAxpuItcqK\\\/W9wP51oiYzl2llikLO8sTLfockfxiIT0ug0XHNe470oUiJjvXYWN768dWEanQbjXfUBrN0YsV9zExAi5czasVw7i4A5q8pZG7I5CiPQWGhEWl66ZBBAHpFqeyxqeBhTsSIjDgDS8tI5e4acLX1rtRX7tvxOVkCA+9VmI9ZqZ0X6CseElecbytnSzy3IRfpSeSpkwu1y47Pjn3LaY6121mfHP42KvPSl6cgtyOW081bxlTMWskE2XNmIxGOxVq+RzGOtXqPIw5C6VghCnPASmPt4LjIezZAdXGi3OlKPxVRsgoFOE8xjoNNgKjYp8jDErhVCxqMZyH2cqz5ApI60XBUKkQdE57HwjTN855TUzoqURDEuBAnMWZGDjGWZooHFyIvWYzEWGpHOsxJI55sBFdTOkktixrJM5KzIETwvWsncWi1cJ0aMPEBh7ayf8dTO4mkDlNXOkkOiGAeAROWi7PwcZC7LxLf\\\/+jasXYo8pbWzyBh89d9XAfCPQWrVziIkHtp6EK4vXWHnMpdlhvYkhSBYO4tgzvxkXDh9IXQsRZ5atbOS588J5a3cVonkR+YCuDe1sygNhfzSfLhdbvQx9gxf2l6J5AXJYvRIF+LOzs9G1vIsdPyzQ5I8QN3aWZnLg2Nw9oqce147i63ErOVZyM7Plswjq3ZWx9cdaDryN0nyAHVrZ5HBu\\\/1y+32rnRWYCODQ1oNY\\\/dIzyHosSzLu\\\/wB9hHkIfDBOugAAAABJRU5ErkJggg==\",\"updated_at\":\"2009-06-09 08:37:17\"}"} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/Contacts/fetch-a-list-of-contacts.json b/tests/Fixtures/Saloon/Contacts/fetch-a-list-of-contacts.json index 9d65f10..091b3d4 100644 --- a/tests/Fixtures/Saloon/Contacts/fetch-a-list-of-contacts.json +++ b/tests/Fixtures/Saloon/Contacts/fetch-a-list-of-contacts.json @@ -1 +1 @@ -{"statusCode":200,"headers":{"Date":"Tue, 02 Jan 2024 11:49:36 GMT","Content-Type":"application\/json","Content-Length":"1054","Connection":"keep-alive","x-ratelimit-remaining-minute":"931","ratelimit-limit":"1000","ratelimit-remaining":"931","ratelimit-reset":"24","x-ratelimit-limit-minute":"1000","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c796a9260672-LHR"},"data":"[{\"id\":1,\"nr\":\"000001\",\"contact_type_id\":1,\"name_1\":\"bexio AG\",\"name_2\":\"\",\"salutation_id\":0,\"salutation_form\":null,\"title_id\":null,\"birthday\":null,\"address\":\"Alte Jonastrasse 24\",\"postcode\":\"8640\",\"city\":\"Rapperswil\",\"country_id\":1,\"mail\":\"support@bexio.com\",\"mail_second\":null,\"phone_fixed\":\"+41 (0) 71 552 00 60\",\"phone_fixed_second\":null,\"phone_mobile\":\"\",\"fax\":\"\",\"url\":\"https:\\\/\\\/www.bexio.com\",\"skype_name\":\"\",\"remarks\":\"\",\"language_id\":null,\"is_lead\":false,\"contact_group_ids\":\"1\",\"contact_branch_ids\":null,\"user_id\":1,\"owner_id\":1,\"updated_at\":\"2009-06-09 08:37:17\"},{\"id\":2,\"nr\":\"000002\",\"contact_type_id\":1,\"name_1\":\"John\",\"name_2\":\"\",\"salutation_id\":0,\"salutation_form\":null,\"title_id\":null,\"birthday\":null,\"address\":\"\",\"postcode\":\"\",\"city\":\"\",\"country_id\":null,\"mail\":\"\",\"mail_second\":\"\",\"phone_fixed\":\"\",\"phone_fixed_second\":\"\",\"phone_mobile\":\"\",\"fax\":\"\",\"url\":\"\",\"skype_name\":\"\",\"remarks\":\"\",\"language_id\":null,\"is_lead\":false,\"contact_group_ids\":null,\"contact_branch_ids\":null,\"user_id\":1,\"owner_id\":1,\"updated_at\":\"2024-01-02 12:49:15\"}]"} \ No newline at end of file +{"statusCode":200,"headers":{"Date":"Tue, 02 Jan 2024 11:49:36 GMT","Content-Type":"application\/json","Content-Length":"1054","Connection":"keep-alive","x-ratelimit-remaining-minute":"931","ratelimit-limit":"1000","ratelimit-remaining":"931","ratelimit-reset":"24","x-ratelimit-limit-minute":"1000","Cache-Control":"no-store","pragma":"no-cache","vary":"Origin","access-control-allow-origin":"https:\/\/office.bexio.com","via":"1.1 google","alt-svc":"h3=\":443\"; ma=86400","CF-Cache-Status":"DYNAMIC","Server":"cloudflare","CF-RAY":"83f2c796a9260672-LHR"},"data":"[{\"id\":1,\"nr\":\"000001\",\"contact_type_id\":1,\"name_1\":\"bexio AG\",\"name_2\":\"\",\"salutation_id\":0,\"salutation_form\":null,\"title_id\":null,\"birthday\":null,\"address\":\"Alte Jonastrasse 24\",\"street_name\":\"Alte Jonastrasse\",\"house_number\":\"24\",\"address_addition\":\"\",\"postcode\":\"8640\",\"city\":\"Rapperswil\",\"country_id\":1,\"mail\":\"support@bexio.com\",\"mail_second\":null,\"phone_fixed\":\"+41 (0) 71 552 00 60\",\"phone_fixed_second\":null,\"phone_mobile\":\"\",\"fax\":\"\",\"url\":\"https:\\\/\\\/www.bexio.com\",\"skype_name\":\"\",\"remarks\":\"\",\"language_id\":null,\"is_lead\":false,\"contact_group_ids\":\"1\",\"contact_branch_ids\":null,\"user_id\":1,\"owner_id\":1,\"updated_at\":\"2009-06-09 08:37:17\"},{\"id\":2,\"nr\":\"000002\",\"contact_type_id\":1,\"name_1\":\"John\",\"name_2\":\"\",\"salutation_id\":0,\"salutation_form\":null,\"title_id\":null,\"birthday\":null,\"address\":\"\",\"postcode\":\"\",\"city\":\"\",\"country_id\":null,\"mail\":\"\",\"mail_second\":\"\",\"phone_fixed\":\"\",\"phone_fixed_second\":\"\",\"phone_mobile\":\"\",\"fax\":\"\",\"url\":\"\",\"skype_name\":\"\",\"remarks\":\"\",\"language_id\":null,\"is_lead\":false,\"contact_group_ids\":null,\"contact_branch_ids\":null,\"user_id\":1,\"owner_id\":1,\"updated_at\":\"2024-01-02 12:49:15\"}]"} \ No newline at end of file diff --git a/tests/Requests/AdditionalAddresses/CreateAnAdditionalAddressRequestTest.php b/tests/Requests/AdditionalAddresses/CreateAnAdditionalAddressRequestTest.php index 4413f8d..754ac14 100644 --- a/tests/Requests/AdditionalAddresses/CreateAnAdditionalAddressRequestTest.php +++ b/tests/Requests/AdditionalAddresses/CreateAnAdditionalAddressRequestTest.php @@ -20,7 +20,9 @@ name: 'Test name', subject: 'Test subject', description: 'Test description', - address: 'Test address', + street_name: 'Test Street', + house_number: '42A', + address_addition: 'c/o Test', postcode: '12345', city: 'Test city', country_id: 1, diff --git a/tests/Requests/AdditionalAddresses/EditAnAdditionalAddressRequestTest.php b/tests/Requests/AdditionalAddresses/EditAnAdditionalAddressRequestTest.php index 0ac53ae..8d47e53 100644 --- a/tests/Requests/AdditionalAddresses/EditAnAdditionalAddressRequestTest.php +++ b/tests/Requests/AdditionalAddresses/EditAnAdditionalAddressRequestTest.php @@ -14,18 +14,22 @@ $connector = new BexioConnector; $connector->withMockClient($mockClient); - $response = $connector->send(new EditAnAdditionalAddressRequest( + $request = new EditAnAdditionalAddressRequest( contactId: 1, - id: 13, + id: 37, data: new CreateEditAdditionalAddressDTO( name: 'Test name edited', subject: 'Test subject edited', description: 'Test description edited', - address: 'Test address edited', + street_name: 'Test Street edited', + house_number: '42B', + address_addition: 'c/o Test edited', postcode: '12345', city: 'Test city edited', country_id: 1, ) - )); + ); + + $response = $connector->send($request); $mockClient->assertSent(EditAnAdditionalAddressRequest::class); }); diff --git a/tests/Requests/ContactAdditionalAddresses/CreateContactAdditionalAddressRequestTest.php b/tests/Requests/ContactAdditionalAddresses/CreateContactAdditionalAddressRequestTest.php index 872b8c4..c337052 100644 --- a/tests/Requests/ContactAdditionalAddresses/CreateContactAdditionalAddressRequestTest.php +++ b/tests/Requests/ContactAdditionalAddresses/CreateContactAdditionalAddressRequestTest.php @@ -20,7 +20,9 @@ name: 'Test', subject: 'Test Subject', description: 'This is a test', - address: 'Test Address', + street_name: 'Test Street', + house_number: '42A', + address_addition: 'c/o Test', postcode: '1234', city: 'Test City', ) diff --git a/tests/Requests/ContactAdditionalAddresses/EditAContactAdditionalAddressRequestTest.php b/tests/Requests/ContactAdditionalAddresses/EditAContactAdditionalAddressRequestTest.php index dc26cee..44f7113 100644 --- a/tests/Requests/ContactAdditionalAddresses/EditAContactAdditionalAddressRequestTest.php +++ b/tests/Requests/ContactAdditionalAddresses/EditAContactAdditionalAddressRequestTest.php @@ -16,12 +16,14 @@ $response = $connector->send(new EditAContactAdditionalAddressRequest( 1, - 9, + 38, new CreateEditContactAdditionalAddressDTO( name: 'Test Edit', subject: 'Test Subject Edit', description: 'This is a test edit', - address: 'Test Address Edit', + street_name: 'Test Street Edit', + house_number: '42B', + address_addition: 'c/o Test Edit', postcode: '4567', city: 'Test City Edit', ) From 57dcfa4c489e5427fc484508d7a959f943a4205b Mon Sep 17 00:00:00 2001 From: kaspernowak <54978466+kaspernowak@users.noreply.github.com> Date: Fri, 20 Jun 2025 10:09:33 +0000 Subject: [PATCH 2/2] Fix styling --- .../CreateEditAdditionalAddressDTO.php | 8 ++++---- .../CreateEditContactAdditionalAddressDTO.php | 8 ++++---- src/Dto/Contacts/CreateEditContactDTO.php | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Dto/AdditionalAddresses/CreateEditAdditionalAddressDTO.php b/src/Dto/AdditionalAddresses/CreateEditAdditionalAddressDTO.php index 7f7c860..e884b63 100644 --- a/src/Dto/AdditionalAddresses/CreateEditAdditionalAddressDTO.php +++ b/src/Dto/AdditionalAddresses/CreateEditAdditionalAddressDTO.php @@ -27,11 +27,11 @@ public function __construct( ) { if ($this->address !== null) { $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; - logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + logger()->warning($msg.' in '.__FILE__.' on line '.__LINE__); trigger_error($msg, E_USER_DEPRECATED); } - if (!$this->street_name && $this->address) { + if (! $this->street_name && $this->address) { $this->street_name = $this->address; $this->address = null; } @@ -59,11 +59,11 @@ public static function fromArray(array $data): self if ($address !== null) { $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; - logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + logger()->warning($msg.' in '.__FILE__.' on line '.__LINE__); trigger_error($msg, E_USER_DEPRECATED); } - if (!$street_name && $address) { + if (! $street_name && $address) { $street_name = $address; $address = null; } diff --git a/src/Dto/ContactAdditionalAddresses/CreateEditContactAdditionalAddressDTO.php b/src/Dto/ContactAdditionalAddresses/CreateEditContactAdditionalAddressDTO.php index 7d6f165..ae44c8c 100644 --- a/src/Dto/ContactAdditionalAddresses/CreateEditContactAdditionalAddressDTO.php +++ b/src/Dto/ContactAdditionalAddresses/CreateEditContactAdditionalAddressDTO.php @@ -27,11 +27,11 @@ public function __construct( ) { if ($this->address !== null) { $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; - logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + logger()->warning($msg.' in '.__FILE__.' on line '.__LINE__); trigger_error($msg, E_USER_DEPRECATED); } - if (!$this->street_name && $this->address) { + if (! $this->street_name && $this->address) { $this->street_name = $this->address; $this->address = null; } @@ -59,11 +59,11 @@ public static function fromArray(array $data): self if ($address !== null) { $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; - logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + logger()->warning($msg.' in '.__FILE__.' on line '.__LINE__); trigger_error($msg, E_USER_DEPRECATED); } - if (!$street_name && $address) { + if (! $street_name && $address) { $street_name = $address; $address = null; } diff --git a/src/Dto/Contacts/CreateEditContactDTO.php b/src/Dto/Contacts/CreateEditContactDTO.php index 64a2c1a..84c7c53 100644 --- a/src/Dto/Contacts/CreateEditContactDTO.php +++ b/src/Dto/Contacts/CreateEditContactDTO.php @@ -46,11 +46,11 @@ public function __construct( ) { if ($this->address !== null) { $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; - logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + logger()->warning($msg.' in '.__FILE__.' on line '.__LINE__); trigger_error($msg, E_USER_DEPRECATED); } - if (!$this->street_name && $this->address) { + if (! $this->street_name && $this->address) { $this->street_name = $this->address; $this->address = null; } @@ -78,11 +78,11 @@ public static function fromArray(array $data): self if ($address !== null) { $msg = 'The "address" property is deprecated and will be removed after 2025-12-07. Use street_name, house_number, address_addition instead.'; - logger()->warning($msg . " in " . __FILE__ . " on line " . __LINE__); + logger()->warning($msg.' in '.__FILE__.' on line '.__LINE__); trigger_error($msg, E_USER_DEPRECATED); } - if (!$street_name && $address) { + if (! $street_name && $address) { $street_name = $address; $address = null; }