From 772139bf6599216d68b01a6b66ad7f1d3448ec9c Mon Sep 17 00:00:00 2001 From: Jeroen Stapelkamp Date: Tue, 16 Jun 2026 10:39:12 +0200 Subject: [PATCH 1/3] Generate v3 API namespace without regenerating v1/v2 Enable v3 generation and update the generator to handle the OpenAPI 3.1 constructs the v3 spec introduced: void 200 responses (now emit void methods), union type arrays such as ["integer","string"] (normalized via primaryType), and array responses with inline scalar items (now typed as array). Only the new V30 namespace is added; the existing V10-V20 namespaces are left untouched. --- .php-cs-fixer.dist.php | 1 + generator/ComponentClassGenerator.php | 10 +- generator/Generator.php | 14 +- generator/Helpers.php | 40 +- generator/RequestClassGenerator.php | 27 +- src/Data/V30/AddressType.php | 23 + src/Data/V30/BarcodeWithAmount.php | 23 + src/Data/V30/BasicProductData.php | 37 + src/Data/V30/BundleGroup.php | 28 + src/Data/V30/BuyOrderDeliveryRowRead.php | 45 + src/Data/V30/CRMActivityStatus.php | 27 + src/Data/V30/CRMActivityType.php | 23 + src/Data/V30/CRMProjectStatus.php | 27 + src/Data/V30/CRMProjectType.php | 23 + src/Data/V30/Child.php | 23 + src/Data/V30/ContactTypeEnum.php | 19 + src/Data/V30/CreditorTypeDto.php | 23 + src/Data/V30/CustomerAddress.php | 65 + src/Data/V30/DatabankViewOption.php | 19 + src/Data/V30/DebtorCostCentre.php | 25 + src/Data/V30/DebtorWebsiteDomains.php | 24 + src/Data/V30/EmailAddress.php | 23 + src/Data/V30/EmailMessageStatus.php | 25 + src/Data/V30/EmailUserEmailAddress.php | 33 + src/Data/V30/ExplodedViewHighlight.php | 26 + src/Data/V30/ExplodedViewHighlightProduct.php | 26 + src/Data/V30/ExplodedViewProductGroup.php | 26 + src/Data/V30/ExternalValue.php | 23 + src/Data/V30/FinancialBookBookingMutation.php | 34 + .../FinancialBookBookingMutationMatching.php | 39 + src/Data/V30/FreeValue.php | 23 + src/Data/V30/Gender.php | 23 + src/Data/V30/GetProductImage.php | 27 + src/Data/V30/ITSIssueFreeType.php | 23 + src/Data/V30/ITSIssueGroup.php | 23 + src/Data/V30/ITSIssueLevel.php | 23 + src/Data/V30/ITSIssueStatus.php | 23 + src/Data/V30/ITSIssueType.php | 23 + src/Data/V30/ITSPriority.php | 23 + src/Data/V30/ITSProject.php | 23 + src/Data/V30/KeyValuePairOfintAnddecimal.php | 23 + src/Data/V30/OrderRow.php | 104 ++ src/Data/V30/OrderShipment.php | 35 + src/Data/V30/OrderShipmentFreeValue.php | 31 + src/Data/V30/OrderShippingMethod.php | 25 + src/Data/V30/OrderStatus.php | 23 + src/Data/V30/OrderTotalsRead.php | 33 + src/Data/V30/Payment.php | 35 + src/Data/V30/PaymentConditionDto.php | 21 + src/Data/V30/PaymentMethod.php | 27 + src/Data/V30/ProductExtraBarcode.php | 23 + src/Data/V30/ProductGroup.php | 44 + src/Data/V30/ProductGroupTranslation.php | 43 + src/Data/V30/ProductOffer.php | 31 + .../V30/ProductPricelistContractPrice.php | 29 + src/Data/V30/ProductResource.php | 29 + src/Data/V30/ProductShiftPrice.php | 33 + src/Data/V30/ProductShiftPriceV14.php | 35 + src/Data/V30/ProductStockControlRow.php | 50 + ...ductStockInformationStockLocationStock.php | 25 + ...nformationWarehouseDefaultPickLocation.php | 27 + .../ProductStockInformationWarehouseStock.php | 30 + src/Data/V30/ProductStockWarehouse.php | 29 + ...ProductTemplatePropertyWithTranslation.php | 26 + .../ProductTemplateValuesWithTranslation.php | 24 + ...eValuesWithTranslationTemplateProperty.php | 24 + ...esWithTranslationTemplatePropertyValue.php | 24 + src/Data/V30/ProductType.php | 23 + src/Data/V30/ProductV12.php | 192 +++ src/Data/V30/ProductVariant.php | 32 + ...ntBalkChildrenGroupChildVariantOptions.php | 23 + ...roductVariantBalkChildrenGroupChildren.php | 24 + .../V30/ProductVariantBalkTranslation.php | 27 + src/Data/V30/Province.php | 23 + src/Data/V30/RelatedProductV3.php | 27 + src/Data/V30/RelationStatus.php | 23 + src/Data/V30/RelationType.php | 23 + src/Data/V30/Representative.php | 23 + src/Data/V30/ReturnProblem.php | 25 + src/Data/V30/ReturnSolution.php | 25 + src/Data/V30/SalesOrderDeliveryDetailRow.php | 39 + src/Data/V30/StockLocationForProductItem.php | 37 + src/Data/V30/Translation.php | 25 + .../V30/VariantBalkCategoryTranslation.php | 29 + src/Data/V30/VatCode.php | 25 + src/Data/V30/WarehouseMinimalStockNumber.php | 23 + src/Data/V30/WebsiteDomain.php | 27 + src/Data/V30/WebsiteProductListType.php | 19 + src/Requests/V30/AppointmentsRequest.php | 64 + src/Requests/V30/BackOfficeRequest.php | 41 + src/Requests/V30/BundlesRequest.php | 77 ++ src/Requests/V30/BuyOrderDeliveryRequest.php | 150 +++ src/Requests/V30/BuyOrderRequest.php | 217 ++++ src/Requests/V30/CRMRequest.php | 174 +++ src/Requests/V30/CompanyRequest.php | 107 ++ src/Requests/V30/DeliveryRequest.php | 65 + src/Requests/V30/EmailRequest.php | 312 +++++ src/Requests/V30/ExplodedViewsRequest.php | 39 + src/Requests/V30/FinancialRequest.php | 391 ++++++ src/Requests/V30/ITSRequest.php | 193 +++ src/Requests/V30/ManagementRequest.php | 368 ++++++ src/Requests/V30/MarketingRequest.php | 34 + src/Requests/V30/OrderRequest.php | 960 +++++++++++++++ src/Requests/V30/PickbonsRequest.php | 158 +++ src/Requests/V30/PriceListsRequest.php | 52 + src/Requests/V30/ProductGroupsRequest.php | 96 ++ src/Requests/V30/ProductRequest.php | 1084 +++++++++++++++++ src/Requests/V30/ProductTemplateRequest.php | 117 ++ src/Requests/V30/RelationsRequest.php | 805 ++++++++++++ src/Requests/V30/RoundRequest.php | 237 ++++ src/Requests/V30/ShipmentRequest.php | 81 ++ src/Requests/V30/ShipperRequest.php | 71 ++ src/Requests/V30/StockRequest.php | 538 ++++++++ src/Requests/V30/TypeRequest.php | 110 ++ src/Requests/V30/UserRequest.php | 51 + src/Requests/V30/WebshopRequest.php | 370 ++++++ src/Requests/V30/WebsiteDomainRequest.php | 76 ++ src/Responses/V30/AddressType.php | 23 + src/Responses/V30/Administration.php | 23 + src/Responses/V30/Agenda.php | 33 + src/Responses/V30/ApiUser.php | 27 + src/Responses/V30/Appointment.php | 51 + src/Responses/V30/AssemblyAction.php | 39 + src/Responses/V30/BasicProductData.php | 37 + src/Responses/V30/Branch.php | 23 + src/Responses/V30/Brand.php | 25 + src/Responses/V30/BundleDiscount.php | 23 + src/Responses/V30/BundleGroupForChild.php | 23 + src/Responses/V30/BundleGroupsForParent.php | 24 + src/Responses/V30/BuyOrderBaseInfo.php | 45 + .../V30/BuyOrderDeliveryAndOrderMovement.php | 23 + src/Responses/V30/BuyOrderDeliveryRead.php | 44 + .../V30/BuyOrderDeliveryStatusValue.php | 23 + .../V30/BuyOrderDeliveryTypeValue.php | 23 + src/Responses/V30/BuyOrderGetInfo.php | 47 + src/Responses/V30/BuyOrderRow.php | 59 + src/Responses/V30/CRMActivity.php | 53 + src/Responses/V30/CRMActivityStatus.php | 27 + src/Responses/V30/CRMActivityType.php | 23 + src/Responses/V30/CRMProject.php | 43 + src/Responses/V30/CRMProjectStatus.php | 27 + src/Responses/V30/CRMProjectType.php | 23 + src/Responses/V30/CompanyInformation.php | 43 + src/Responses/V30/CompanyValues.php | 25 + src/Responses/V30/ContactCharacteristic.php | 27 + src/Responses/V30/ContactType.php | 25 + src/Responses/V30/Country.php | 28 + src/Responses/V30/Creditor.php | 61 + src/Responses/V30/CreditorDiscount.php | 37 + src/Responses/V30/CreditorDiscountType.php | 23 + .../CreditorThirdPartyExternalIdentifer.php | 25 + src/Responses/V30/Customer.php | 118 ++ src/Responses/V30/CustomerAddress.php | 65 + src/Responses/V30/CustomerContact.php | 71 ++ .../CustomerThirdPartyExternalIdentifer.php | 25 + src/Responses/V30/DatabaseConfiguration.php | 21 + src/Responses/V30/DebtorCharacteristic.php | 25 + .../V30/DebtorWebsiteDomainsList.php | 22 + src/Responses/V30/DeliveryOption.php | 31 + src/Responses/V30/EmailAddress.php | 23 + src/Responses/V30/EmailAttachment.php | 29 + src/Responses/V30/EmailBox.php | 35 + src/Responses/V30/EmailMessage.php | 60 + src/Responses/V30/EmailMessageStatus.php | 25 + src/Responses/V30/EmailUser.php | 32 + src/Responses/V30/ExplodedView.php | 38 + src/Responses/V30/FinancialBook.php | 29 + src/Responses/V30/FinancialBookBooking.php | 48 + src/Responses/V30/FinancialJournal.php | 61 + src/Responses/V30/FinancialJournalStatus.php | 25 + src/Responses/V30/Gender.php | 23 + src/Responses/V30/GetRound.php | 51 + src/Responses/V30/GetRoundOrder.php | 35 + src/Responses/V30/GlobalizationType.php | 25 + src/Responses/V30/ITSFreeValue.php | 23 + src/Responses/V30/ITSIssue.php | 77 ++ src/Responses/V30/ITSIssueGroup.php | 23 + src/Responses/V30/ITSIssueLevel.php | 23 + src/Responses/V30/ITSIssueStatus.php | 23 + src/Responses/V30/ITSIssueType.php | 23 + src/Responses/V30/ITSProject.php | 23 + src/Responses/V30/ITSTaskPriority.php | 23 + src/Responses/V30/InvoiceOpenPayment.php | 37 + src/Responses/V30/Ledger.php | 25 + src/Responses/V30/OperatingSystemType.php | 23 + src/Responses/V30/Order.php | 114 ++ src/Responses/V30/OrderAction.php | 33 + src/Responses/V30/OrderActionType.php | 23 + src/Responses/V30/OrderHeadPickbon.php | 61 + src/Responses/V30/OrderHeadPickbonRow.php | 35 + src/Responses/V30/OrderOpenPayment.php | 29 + src/Responses/V30/OrderRowV11.php | 108 ++ src/Responses/V30/OrderShipment.php | 35 + src/Responses/V30/OrderStatus.php | 23 + .../V30/PackingMaterialDepositType.php | 33 + src/Responses/V30/PaymentMethod.php | 27 + src/Responses/V30/PickbonSoftBlocked.php | 27 + .../V30/ProductAssemblyRecipeItem.php | 29 + src/Responses/V30/ProductBarcode.php | 24 + .../V30/ProductCodeWithSupplierCode.php | 23 + src/Responses/V30/ProductCompositionItem.php | 29 + src/Responses/V30/ProductDimensions.php | 59 + src/Responses/V30/ProductExtraBarcodeType.php | 23 + src/Responses/V30/ProductGroup.php | 44 + src/Responses/V30/ProductGroupType.php | 23 + src/Responses/V30/ProductImageV2.php | 24 + src/Responses/V30/ProductMediaFileDto.php | 24 + .../V30/ProductMinimalStockNumber.php | 28 + ...oductPickLocationBasedOnSystemSettings.php | 23 + src/Responses/V30/ProductPriceInformation.php | 24 + src/Responses/V30/ProductPricelist.php | 33 + src/Responses/V30/ProductRelationType.php | 23 + src/Responses/V30/ProductReview.php | 38 + src/Responses/V30/ProductSEOInformation.php | 35 + src/Responses/V30/ProductSalesInformation.php | 31 + src/Responses/V30/ProductShiftPrice.php | 33 + .../V30/ProductShippingInformation.php | 39 + src/Responses/V30/ProductStatus.php | 23 + src/Responses/V30/ProductStock.php | 31 + src/Responses/V30/ProductStockControlHead.php | 40 + src/Responses/V30/ProductStockControlRow.php | 50 + .../V30/ProductStockInformationV2.php | 35 + src/Responses/V30/ProductStockLocations.php | 31 + src/Responses/V30/ProductStockMutation.php | 43 + .../V30/ProductStockMutationTypeV11.php | 25 + .../V30/ProductStockSupplierWithActive.php | 29 + src/Responses/V30/ProductStockSuppliers.php | 27 + ...tStockWarehouseWithDefaultPickLocation.php | 31 + src/Responses/V30/ProductSupplier.php | 32 + .../V30/ProductSupplierNextDelivery.php | 25 + src/Responses/V30/ProductTemplate.php | 23 + .../V30/ProductTemplateProductValue.php | 28 + src/Responses/V30/ProductTemplateProperty.php | 41 + .../V30/ProductTemplatesWithTranslation.php | 27 + src/Responses/V30/ProductUnit.php | 23 + src/Responses/V30/ProductV14.php | 194 +++ src/Responses/V30/ProductVariantBalk.php | 31 + .../V30/ProductVariantBalkChildrenGroup.php | 24 + .../V30/ProductWithRelatedProductsV3.php | 24 + src/Responses/V30/Province.php | 23 + src/Responses/V30/RelationStatus.php | 23 + src/Responses/V30/RelationType.php | 23 + src/Responses/V30/Representative.php | 23 + src/Responses/V30/ReturnCategory.php | 23 + src/Responses/V30/ReturnOrderV2.php | 126 ++ src/Responses/V30/ReturnProblemV11.php | 28 + src/Responses/V30/ReturnSolution.php | 25 + src/Responses/V30/SalesOrderDelivery.php | 38 + src/Responses/V30/SalesOrderDeliveryRow.php | 23 + src/Responses/V30/SecondTypeContactGroup.php | 23 + src/Responses/V30/ShipperType.php | 23 + src/Responses/V30/ShippingMethod.php | 47 + src/Responses/V30/StockLocationForProduct.php | 26 + src/Responses/V30/Subscriber.php | 25 + .../V30/ThirdPartyExternalIdentifierType.php | 23 + src/Responses/V30/Top10Item.php | 25 + src/Responses/V30/TypeContactGroup.php | 23 + src/Responses/V30/TypeCostCenter.php | 23 + src/Responses/V30/TypeEntityCode.php | 23 + .../V30/TypeFinancialBookingStatus.php | 23 + src/Responses/V30/TypeLedgerColumn.php | 25 + src/Responses/V30/TypeRoundOrderStatus.php | 27 + src/Responses/V30/TypeRoundStatus.php | 25 + src/Responses/V30/TypeTransactionCode.php | 23 + src/Responses/V30/Userstatus.php | 39 + src/Responses/V30/ValuevsBudget.php | 31 + src/Responses/V30/VariantBalkCategory.php | 26 + src/Responses/V30/VatCode.php | 25 + src/Responses/V30/Vehicle.php | 41 + src/Responses/V30/WareHouse.php | 33 + src/Responses/V30/WarehouseStockLocation.php | 61 + src/Responses/V30/WarehouseZone.php | 27 + src/Responses/V30/WebshopOrderlistProduct.php | 25 + src/Responses/V30/WebshopSearchWord.php | 31 + src/Responses/V30/WebshopUser.php | 112 ++ .../V30/WebshopUserProductOfProductV12.php | 47 + src/Responses/V30/WebshopUserProductType.php | 25 + src/Responses/V30/WebshopUserType.php | 23 + src/Responses/V30/WebshopVisitorBehaviour.php | 39 + src/Responses/V30/WebsiteAlias.php | 34 + src/Responses/V30/WebsiteDomain.php | 27 + .../V30/WebsiteDomainsForProduct.php | 24 + 282 files changed, 15402 insertions(+), 16 deletions(-) create mode 100644 src/Data/V30/AddressType.php create mode 100644 src/Data/V30/BarcodeWithAmount.php create mode 100644 src/Data/V30/BasicProductData.php create mode 100644 src/Data/V30/BundleGroup.php create mode 100644 src/Data/V30/BuyOrderDeliveryRowRead.php create mode 100644 src/Data/V30/CRMActivityStatus.php create mode 100644 src/Data/V30/CRMActivityType.php create mode 100644 src/Data/V30/CRMProjectStatus.php create mode 100644 src/Data/V30/CRMProjectType.php create mode 100644 src/Data/V30/Child.php create mode 100644 src/Data/V30/ContactTypeEnum.php create mode 100644 src/Data/V30/CreditorTypeDto.php create mode 100644 src/Data/V30/CustomerAddress.php create mode 100644 src/Data/V30/DatabankViewOption.php create mode 100644 src/Data/V30/DebtorCostCentre.php create mode 100644 src/Data/V30/DebtorWebsiteDomains.php create mode 100644 src/Data/V30/EmailAddress.php create mode 100644 src/Data/V30/EmailMessageStatus.php create mode 100644 src/Data/V30/EmailUserEmailAddress.php create mode 100644 src/Data/V30/ExplodedViewHighlight.php create mode 100644 src/Data/V30/ExplodedViewHighlightProduct.php create mode 100644 src/Data/V30/ExplodedViewProductGroup.php create mode 100644 src/Data/V30/ExternalValue.php create mode 100644 src/Data/V30/FinancialBookBookingMutation.php create mode 100644 src/Data/V30/FinancialBookBookingMutationMatching.php create mode 100644 src/Data/V30/FreeValue.php create mode 100644 src/Data/V30/Gender.php create mode 100644 src/Data/V30/GetProductImage.php create mode 100644 src/Data/V30/ITSIssueFreeType.php create mode 100644 src/Data/V30/ITSIssueGroup.php create mode 100644 src/Data/V30/ITSIssueLevel.php create mode 100644 src/Data/V30/ITSIssueStatus.php create mode 100644 src/Data/V30/ITSIssueType.php create mode 100644 src/Data/V30/ITSPriority.php create mode 100644 src/Data/V30/ITSProject.php create mode 100644 src/Data/V30/KeyValuePairOfintAnddecimal.php create mode 100644 src/Data/V30/OrderRow.php create mode 100644 src/Data/V30/OrderShipment.php create mode 100644 src/Data/V30/OrderShipmentFreeValue.php create mode 100644 src/Data/V30/OrderShippingMethod.php create mode 100644 src/Data/V30/OrderStatus.php create mode 100644 src/Data/V30/OrderTotalsRead.php create mode 100644 src/Data/V30/Payment.php create mode 100644 src/Data/V30/PaymentConditionDto.php create mode 100644 src/Data/V30/PaymentMethod.php create mode 100644 src/Data/V30/ProductExtraBarcode.php create mode 100644 src/Data/V30/ProductGroup.php create mode 100644 src/Data/V30/ProductGroupTranslation.php create mode 100644 src/Data/V30/ProductOffer.php create mode 100644 src/Data/V30/ProductPricelistContractPrice.php create mode 100644 src/Data/V30/ProductResource.php create mode 100644 src/Data/V30/ProductShiftPrice.php create mode 100644 src/Data/V30/ProductShiftPriceV14.php create mode 100644 src/Data/V30/ProductStockControlRow.php create mode 100644 src/Data/V30/ProductStockInformationStockLocationStock.php create mode 100644 src/Data/V30/ProductStockInformationWarehouseDefaultPickLocation.php create mode 100644 src/Data/V30/ProductStockInformationWarehouseStock.php create mode 100644 src/Data/V30/ProductStockWarehouse.php create mode 100644 src/Data/V30/ProductTemplatePropertyWithTranslation.php create mode 100644 src/Data/V30/ProductTemplateValuesWithTranslation.php create mode 100644 src/Data/V30/ProductTemplateValuesWithTranslationTemplateProperty.php create mode 100644 src/Data/V30/ProductTemplateValuesWithTranslationTemplatePropertyValue.php create mode 100644 src/Data/V30/ProductType.php create mode 100644 src/Data/V30/ProductV12.php create mode 100644 src/Data/V30/ProductVariant.php create mode 100644 src/Data/V30/ProductVariantBalkChildrenGroupChildVariantOptions.php create mode 100644 src/Data/V30/ProductVariantBalkChildrenGroupChildren.php create mode 100644 src/Data/V30/ProductVariantBalkTranslation.php create mode 100644 src/Data/V30/Province.php create mode 100644 src/Data/V30/RelatedProductV3.php create mode 100644 src/Data/V30/RelationStatus.php create mode 100644 src/Data/V30/RelationType.php create mode 100644 src/Data/V30/Representative.php create mode 100644 src/Data/V30/ReturnProblem.php create mode 100644 src/Data/V30/ReturnSolution.php create mode 100644 src/Data/V30/SalesOrderDeliveryDetailRow.php create mode 100644 src/Data/V30/StockLocationForProductItem.php create mode 100644 src/Data/V30/Translation.php create mode 100644 src/Data/V30/VariantBalkCategoryTranslation.php create mode 100644 src/Data/V30/VatCode.php create mode 100644 src/Data/V30/WarehouseMinimalStockNumber.php create mode 100644 src/Data/V30/WebsiteDomain.php create mode 100644 src/Data/V30/WebsiteProductListType.php create mode 100644 src/Requests/V30/AppointmentsRequest.php create mode 100644 src/Requests/V30/BackOfficeRequest.php create mode 100644 src/Requests/V30/BundlesRequest.php create mode 100644 src/Requests/V30/BuyOrderDeliveryRequest.php create mode 100644 src/Requests/V30/BuyOrderRequest.php create mode 100644 src/Requests/V30/CRMRequest.php create mode 100644 src/Requests/V30/CompanyRequest.php create mode 100644 src/Requests/V30/DeliveryRequest.php create mode 100644 src/Requests/V30/EmailRequest.php create mode 100644 src/Requests/V30/ExplodedViewsRequest.php create mode 100644 src/Requests/V30/FinancialRequest.php create mode 100644 src/Requests/V30/ITSRequest.php create mode 100644 src/Requests/V30/ManagementRequest.php create mode 100644 src/Requests/V30/MarketingRequest.php create mode 100644 src/Requests/V30/OrderRequest.php create mode 100644 src/Requests/V30/PickbonsRequest.php create mode 100644 src/Requests/V30/PriceListsRequest.php create mode 100644 src/Requests/V30/ProductGroupsRequest.php create mode 100644 src/Requests/V30/ProductRequest.php create mode 100644 src/Requests/V30/ProductTemplateRequest.php create mode 100644 src/Requests/V30/RelationsRequest.php create mode 100644 src/Requests/V30/RoundRequest.php create mode 100644 src/Requests/V30/ShipmentRequest.php create mode 100644 src/Requests/V30/ShipperRequest.php create mode 100644 src/Requests/V30/StockRequest.php create mode 100644 src/Requests/V30/TypeRequest.php create mode 100644 src/Requests/V30/UserRequest.php create mode 100644 src/Requests/V30/WebshopRequest.php create mode 100644 src/Requests/V30/WebsiteDomainRequest.php create mode 100644 src/Responses/V30/AddressType.php create mode 100644 src/Responses/V30/Administration.php create mode 100644 src/Responses/V30/Agenda.php create mode 100644 src/Responses/V30/ApiUser.php create mode 100644 src/Responses/V30/Appointment.php create mode 100644 src/Responses/V30/AssemblyAction.php create mode 100644 src/Responses/V30/BasicProductData.php create mode 100644 src/Responses/V30/Branch.php create mode 100644 src/Responses/V30/Brand.php create mode 100644 src/Responses/V30/BundleDiscount.php create mode 100644 src/Responses/V30/BundleGroupForChild.php create mode 100644 src/Responses/V30/BundleGroupsForParent.php create mode 100644 src/Responses/V30/BuyOrderBaseInfo.php create mode 100644 src/Responses/V30/BuyOrderDeliveryAndOrderMovement.php create mode 100644 src/Responses/V30/BuyOrderDeliveryRead.php create mode 100644 src/Responses/V30/BuyOrderDeliveryStatusValue.php create mode 100644 src/Responses/V30/BuyOrderDeliveryTypeValue.php create mode 100644 src/Responses/V30/BuyOrderGetInfo.php create mode 100644 src/Responses/V30/BuyOrderRow.php create mode 100644 src/Responses/V30/CRMActivity.php create mode 100644 src/Responses/V30/CRMActivityStatus.php create mode 100644 src/Responses/V30/CRMActivityType.php create mode 100644 src/Responses/V30/CRMProject.php create mode 100644 src/Responses/V30/CRMProjectStatus.php create mode 100644 src/Responses/V30/CRMProjectType.php create mode 100644 src/Responses/V30/CompanyInformation.php create mode 100644 src/Responses/V30/CompanyValues.php create mode 100644 src/Responses/V30/ContactCharacteristic.php create mode 100644 src/Responses/V30/ContactType.php create mode 100644 src/Responses/V30/Country.php create mode 100644 src/Responses/V30/Creditor.php create mode 100644 src/Responses/V30/CreditorDiscount.php create mode 100644 src/Responses/V30/CreditorDiscountType.php create mode 100644 src/Responses/V30/CreditorThirdPartyExternalIdentifer.php create mode 100644 src/Responses/V30/Customer.php create mode 100644 src/Responses/V30/CustomerAddress.php create mode 100644 src/Responses/V30/CustomerContact.php create mode 100644 src/Responses/V30/CustomerThirdPartyExternalIdentifer.php create mode 100644 src/Responses/V30/DatabaseConfiguration.php create mode 100644 src/Responses/V30/DebtorCharacteristic.php create mode 100644 src/Responses/V30/DebtorWebsiteDomainsList.php create mode 100644 src/Responses/V30/DeliveryOption.php create mode 100644 src/Responses/V30/EmailAddress.php create mode 100644 src/Responses/V30/EmailAttachment.php create mode 100644 src/Responses/V30/EmailBox.php create mode 100644 src/Responses/V30/EmailMessage.php create mode 100644 src/Responses/V30/EmailMessageStatus.php create mode 100644 src/Responses/V30/EmailUser.php create mode 100644 src/Responses/V30/ExplodedView.php create mode 100644 src/Responses/V30/FinancialBook.php create mode 100644 src/Responses/V30/FinancialBookBooking.php create mode 100644 src/Responses/V30/FinancialJournal.php create mode 100644 src/Responses/V30/FinancialJournalStatus.php create mode 100644 src/Responses/V30/Gender.php create mode 100644 src/Responses/V30/GetRound.php create mode 100644 src/Responses/V30/GetRoundOrder.php create mode 100644 src/Responses/V30/GlobalizationType.php create mode 100644 src/Responses/V30/ITSFreeValue.php create mode 100644 src/Responses/V30/ITSIssue.php create mode 100644 src/Responses/V30/ITSIssueGroup.php create mode 100644 src/Responses/V30/ITSIssueLevel.php create mode 100644 src/Responses/V30/ITSIssueStatus.php create mode 100644 src/Responses/V30/ITSIssueType.php create mode 100644 src/Responses/V30/ITSProject.php create mode 100644 src/Responses/V30/ITSTaskPriority.php create mode 100644 src/Responses/V30/InvoiceOpenPayment.php create mode 100644 src/Responses/V30/Ledger.php create mode 100644 src/Responses/V30/OperatingSystemType.php create mode 100644 src/Responses/V30/Order.php create mode 100644 src/Responses/V30/OrderAction.php create mode 100644 src/Responses/V30/OrderActionType.php create mode 100644 src/Responses/V30/OrderHeadPickbon.php create mode 100644 src/Responses/V30/OrderHeadPickbonRow.php create mode 100644 src/Responses/V30/OrderOpenPayment.php create mode 100644 src/Responses/V30/OrderRowV11.php create mode 100644 src/Responses/V30/OrderShipment.php create mode 100644 src/Responses/V30/OrderStatus.php create mode 100644 src/Responses/V30/PackingMaterialDepositType.php create mode 100644 src/Responses/V30/PaymentMethod.php create mode 100644 src/Responses/V30/PickbonSoftBlocked.php create mode 100644 src/Responses/V30/ProductAssemblyRecipeItem.php create mode 100644 src/Responses/V30/ProductBarcode.php create mode 100644 src/Responses/V30/ProductCodeWithSupplierCode.php create mode 100644 src/Responses/V30/ProductCompositionItem.php create mode 100644 src/Responses/V30/ProductDimensions.php create mode 100644 src/Responses/V30/ProductExtraBarcodeType.php create mode 100644 src/Responses/V30/ProductGroup.php create mode 100644 src/Responses/V30/ProductGroupType.php create mode 100644 src/Responses/V30/ProductImageV2.php create mode 100644 src/Responses/V30/ProductMediaFileDto.php create mode 100644 src/Responses/V30/ProductMinimalStockNumber.php create mode 100644 src/Responses/V30/ProductPickLocationBasedOnSystemSettings.php create mode 100644 src/Responses/V30/ProductPriceInformation.php create mode 100644 src/Responses/V30/ProductPricelist.php create mode 100644 src/Responses/V30/ProductRelationType.php create mode 100644 src/Responses/V30/ProductReview.php create mode 100644 src/Responses/V30/ProductSEOInformation.php create mode 100644 src/Responses/V30/ProductSalesInformation.php create mode 100644 src/Responses/V30/ProductShiftPrice.php create mode 100644 src/Responses/V30/ProductShippingInformation.php create mode 100644 src/Responses/V30/ProductStatus.php create mode 100644 src/Responses/V30/ProductStock.php create mode 100644 src/Responses/V30/ProductStockControlHead.php create mode 100644 src/Responses/V30/ProductStockControlRow.php create mode 100644 src/Responses/V30/ProductStockInformationV2.php create mode 100644 src/Responses/V30/ProductStockLocations.php create mode 100644 src/Responses/V30/ProductStockMutation.php create mode 100644 src/Responses/V30/ProductStockMutationTypeV11.php create mode 100644 src/Responses/V30/ProductStockSupplierWithActive.php create mode 100644 src/Responses/V30/ProductStockSuppliers.php create mode 100644 src/Responses/V30/ProductStockWarehouseWithDefaultPickLocation.php create mode 100644 src/Responses/V30/ProductSupplier.php create mode 100644 src/Responses/V30/ProductSupplierNextDelivery.php create mode 100644 src/Responses/V30/ProductTemplate.php create mode 100644 src/Responses/V30/ProductTemplateProductValue.php create mode 100644 src/Responses/V30/ProductTemplateProperty.php create mode 100644 src/Responses/V30/ProductTemplatesWithTranslation.php create mode 100644 src/Responses/V30/ProductUnit.php create mode 100644 src/Responses/V30/ProductV14.php create mode 100644 src/Responses/V30/ProductVariantBalk.php create mode 100644 src/Responses/V30/ProductVariantBalkChildrenGroup.php create mode 100644 src/Responses/V30/ProductWithRelatedProductsV3.php create mode 100644 src/Responses/V30/Province.php create mode 100644 src/Responses/V30/RelationStatus.php create mode 100644 src/Responses/V30/RelationType.php create mode 100644 src/Responses/V30/Representative.php create mode 100644 src/Responses/V30/ReturnCategory.php create mode 100644 src/Responses/V30/ReturnOrderV2.php create mode 100644 src/Responses/V30/ReturnProblemV11.php create mode 100644 src/Responses/V30/ReturnSolution.php create mode 100644 src/Responses/V30/SalesOrderDelivery.php create mode 100644 src/Responses/V30/SalesOrderDeliveryRow.php create mode 100644 src/Responses/V30/SecondTypeContactGroup.php create mode 100644 src/Responses/V30/ShipperType.php create mode 100644 src/Responses/V30/ShippingMethod.php create mode 100644 src/Responses/V30/StockLocationForProduct.php create mode 100644 src/Responses/V30/Subscriber.php create mode 100644 src/Responses/V30/ThirdPartyExternalIdentifierType.php create mode 100644 src/Responses/V30/Top10Item.php create mode 100644 src/Responses/V30/TypeContactGroup.php create mode 100644 src/Responses/V30/TypeCostCenter.php create mode 100644 src/Responses/V30/TypeEntityCode.php create mode 100644 src/Responses/V30/TypeFinancialBookingStatus.php create mode 100644 src/Responses/V30/TypeLedgerColumn.php create mode 100644 src/Responses/V30/TypeRoundOrderStatus.php create mode 100644 src/Responses/V30/TypeRoundStatus.php create mode 100644 src/Responses/V30/TypeTransactionCode.php create mode 100644 src/Responses/V30/Userstatus.php create mode 100644 src/Responses/V30/ValuevsBudget.php create mode 100644 src/Responses/V30/VariantBalkCategory.php create mode 100644 src/Responses/V30/VatCode.php create mode 100644 src/Responses/V30/Vehicle.php create mode 100644 src/Responses/V30/WareHouse.php create mode 100644 src/Responses/V30/WarehouseStockLocation.php create mode 100644 src/Responses/V30/WarehouseZone.php create mode 100644 src/Responses/V30/WebshopOrderlistProduct.php create mode 100644 src/Responses/V30/WebshopSearchWord.php create mode 100644 src/Responses/V30/WebshopUser.php create mode 100644 src/Responses/V30/WebshopUserProductOfProductV12.php create mode 100644 src/Responses/V30/WebshopUserProductType.php create mode 100644 src/Responses/V30/WebshopUserType.php create mode 100644 src/Responses/V30/WebshopVisitorBehaviour.php create mode 100644 src/Responses/V30/WebsiteAlias.php create mode 100644 src/Responses/V30/WebsiteDomain.php create mode 100644 src/Responses/V30/WebsiteDomainsForProduct.php diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 38389d3..915d2e2 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -12,6 +12,7 @@ '@PHPUnit84Migration:risky' => true, 'ordered_imports' => true, 'phpdoc_line_span' => [ + 'class' => 'single', 'const' => 'single', 'method' => 'single', 'property' => 'single', diff --git a/generator/ComponentClassGenerator.php b/generator/ComponentClassGenerator.php index 7e678f1..2a3b747 100644 --- a/generator/ComponentClassGenerator.php +++ b/generator/ComponentClassGenerator.php @@ -57,9 +57,10 @@ public function resolve(string $name, string $namespace, string $version): strin $type = $this->resolve($parameter->getReference(), 'Data', $version); $typedParameters[$parameterName] = $type; } else { - $type = Helpers::phpType($parameter->type, $parameter->type); + $primaryType = Helpers::primaryType($parameter->type); + $type = Helpers::phpType($parameter->type, $primaryType ?? 'mixed'); - if ('string' === $parameter->type && 'date-time' === $parameter->format) { + if ('string' === $primaryType && 'date-time' === $parameter->format) { $type = Carbon::class; $dateParameters[] = $parameterName; @@ -71,14 +72,15 @@ public function resolve(string $name, string $namespace, string $version): strin $arrayParameters[$parameterName] = $commentType; $commentType = '\\'.$commentType; } else { - $commentType = $parameter->items?->type ?? 'mixed'; + $commentType = $parameter->items ? Helpers::primaryType($parameter->items->type) : null; + $commentType ??= 'mixed'; } $constructor->addComment('@param array<'.$commentType.'> $'.$this->propertyName($parameterName)); } } - $nullable = !\in_array($parameterName, ['Records', 'ValidationMessages'], true) && (($parameter->nullable ?? false) || class_exists($type)); + $nullable = !\in_array($parameterName, ['Records', 'ValidationMessages'], true) && (Helpers::isNullable($parameter) || class_exists($type)); $constructor ->addPromotedParameter($this->propertyName($parameterName)) diff --git a/generator/Generator.php b/generator/Generator.php index 9bfc4d5..51b45b9 100644 --- a/generator/Generator.php +++ b/generator/Generator.php @@ -54,7 +54,6 @@ public static function resolveVersions(): array $versions = []; foreach ($config['sources'] as $source) { if (preg_match('/Version v(\d+\.\d+)/', $source['title'], $versionMatch) - && !str_starts_with($versionMatch[1], '3.') ) { $versions[$versionMatch[1]] = self::$baseUrl.$source['url']; } @@ -135,21 +134,22 @@ className: $namespace.'Request', $responseReference = $operation->responses['200']->content['application/json']->schema ?? null; if ($responseReference instanceof Schema) { - $returnType = $responseReference->type; + $returnType = Helpers::primaryType($responseReference->type); $arrayType = null; - if ('array' === $returnType) { + if ('array' === $returnType && $responseReference->items instanceof Reference) { $arrayType = $this->componentClassGenerator->resolve( $responseReference->items->getReference(), 'Responses', $this->getVersion($version) ); + } elseif ('array' === $returnType && $responseReference->items instanceof Schema) { + $itemType = Helpers::primaryType($responseReference->items->type); + $arrayType = Helpers::phpType($itemType, $itemType ?? 'mixed'); } $classMethod = $requestGenerator->addMethod($method, $uri, $operation, $returnType, arrayType: $arrayType); - } else { - Assert::isInstanceOf($responseReference, Reference::class); - + } elseif ($responseReference instanceof Reference) { $requestSchema = $requestProperties instanceof Reference ? $this->resolveReference($requestProperties->getReference())->properties : []; @@ -179,6 +179,8 @@ className: $namespace.'Request', } $classMethod = $requestGenerator->addMethod($method, $uri, $operation, returnType: $returnType, paginated: $paginatedResponse ?: null); + } else { + $classMethod = $requestGenerator->addMethod($method, $uri, $operation, void: true); } if ($operation->description) { diff --git a/generator/Helpers.php b/generator/Helpers.php index bb317c5..f975504 100644 --- a/generator/Helpers.php +++ b/generator/Helpers.php @@ -48,7 +48,9 @@ public static function resolveParameterType(Schema|Reference $property): string $property = $property->resolve(); } - if ('array' === $property->type) { + $primary = self::primaryType($property->type); + + if ('array' === $primary) { if ($property->items instanceof Reference) { $property = clone $property; @@ -60,7 +62,7 @@ public static function resolveParameterType(Schema|Reference $property): string } else { $type = 'array'; } - } elseif ('object' === $property->type) { + } elseif ('object' === $primary) { $properties = []; foreach ($property->properties as $parameterName => $propertyValue) { $properties[] = \sprintf('%s?: %s', $parameterName, self::resolveParameterType($propertyValue)); @@ -68,7 +70,7 @@ public static function resolveParameterType(Schema|Reference $property): string $type = \sprintf('array{%s}', implode(', ', $properties)); } else { - $type = $property->type.($property->nullable ? '|null' : ''); + $type = ($primary ?? 'mixed').(self::isNullable($property) ? '|null' : ''); } return $type; @@ -97,6 +99,10 @@ public static function makePhpDoc(array $properties, string $format): array public static function phpType(mixed $type, string $default = 'mixed'): string { + if (\is_array($type)) { + $type = self::primaryType($type); + } + return match ($type) { 'integer' => 'int', 'number' => 'float', @@ -104,4 +110,32 @@ public static function phpType(mixed $type, string $default = 'mixed'): string default => $default, }; } + + public static function primaryType(mixed $type): ?string + { + if (\is_array($type)) { + foreach ($type as $candidate) { + if (\is_string($candidate) && 'null' !== $candidate) { + return $candidate; + } + } + + return null; + } + + return \is_string($type) ? $type : null; + } + + public static function isNullable(Schema|Reference $property): bool + { + if ($property instanceof Reference) { + return false; + } + + if (\is_array($property->type) && \in_array('null', $property->type, true)) { + return true; + } + + return (bool) ($property->nullable ?? false); + } } diff --git a/generator/RequestClassGenerator.php b/generator/RequestClassGenerator.php index 8564e22..7b994a6 100644 --- a/generator/RequestClassGenerator.php +++ b/generator/RequestClassGenerator.php @@ -28,7 +28,7 @@ public function __construct( $this->class->setExtends(Request::class); } - public function addMethod(string $httpMethod, string $uri, Operation $operation, ?string $returnType = null, ?PaginateType $paginated = null, ?string $arrayType = null): Method + public function addMethod(string $httpMethod, string $uri, Operation $operation, ?string $returnType = null, ?PaginateType $paginated = null, ?string $arrayType = null, bool $void = false): Method { $action = last(explode('/', ltrim($uri, '/'))); $requestSchema = $operation->requestBody?->content['application/json']?->schema; @@ -44,7 +44,7 @@ public function addMethod(string $httpMethod, string $uri, Operation $operation, continue; } - $parameterType = Helpers::phpType($parameter->schema->type, $parameter->schema->type); + $parameterType = Helpers::phpType($parameter->schema->type, Helpers::primaryType($parameter->schema->type) ?? 'mixed'); $method ->addParameter($parameter->name) @@ -61,7 +61,8 @@ public function addMethod(string $httpMethod, string $uri, Operation $operation, $parameterDoc = "array{\n".implode("\n", Helpers::makePhpDoc($requestProperties, ' %s,'))."\n}"; } else { if ($requestSchema->items instanceof Schema) { - $parameterDoc = "array<{$requestSchema->items->type}>"; + $itemType = Helpers::primaryType($requestSchema->items->type) ?? 'mixed'; + $parameterDoc = "array<{$itemType}>"; } else { $requestProperties = $requestSchema->items->resolve()->properties; @@ -92,6 +93,17 @@ public function addMethod(string $httpMethod, string $uri, Operation $operation, ? ', '.preg_replace('/\'\{\$(.*)\}\'/', '\$$1', var_export($requestParameters, true)) : ''; + if ($void) { + $method->setReturnType('void'); + $method->setBody( + <<getClient()->{$httpMethod}('{$uri}'{$parametersPhp}); + PHP + ); + + return $method; + } + $returnType = Helpers::phpType($returnType, $returnType ?? 'mixed'); if ($paginated && class_exists($returnType)) { @@ -115,6 +127,15 @@ public function addMethod(string $httpMethod, string $uri, Operation $operation, PHP ); + } elseif ('array' === $returnType && $arrayType) { + $method->addComment("\n@return array"); + $method->setBody( + <<buildResponse( + \$this->getClient()->{$httpMethod}('{$uri}'{$parametersPhp}), + ); + PHP + ); } elseif (class_exists($returnType)) { if ($paginated) { $paginateMethod = match ($paginated) { diff --git a/src/Data/V30/AddressType.php b/src/Data/V30/AddressType.php new file mode 100644 index 0000000..61ed48b --- /dev/null +++ b/src/Data/V30/AddressType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/BarcodeWithAmount.php b/src/Data/V30/BarcodeWithAmount.php new file mode 100644 index 0000000..3264f3c --- /dev/null +++ b/src/Data/V30/BarcodeWithAmount.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + qty: $data['Qty'] ?? 0, + barcode: $data['Barcode'] ?? null, + ); + } +} diff --git a/src/Data/V30/BasicProductData.php b/src/Data/V30/BasicProductData.php new file mode 100644 index 0000000..aeffee3 --- /dev/null +++ b/src/Data/V30/BasicProductData.php @@ -0,0 +1,37 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + vendorCode: $data['VendorCode'] ?? null, + productCode: $data['ProductCode'] ?? null, + description1: $data['Description1'] ?? null, + description2: $data['Description2'] ?? null, + pictureName: $data['PictureName'] ?? null, + domain: $data['Domain'] ?? null, + defaultPickStockLocationId: $data['DefaultPickStockLocationId'] ?? null, + statusName: $data['StatusName'] ?? null, + ); + } +} diff --git a/src/Data/V30/BundleGroup.php b/src/Data/V30/BundleGroup.php new file mode 100644 index 0000000..6cb1cdb --- /dev/null +++ b/src/Data/V30/BundleGroup.php @@ -0,0 +1,28 @@ + $children */ + public function __construct( + public int $id, + public int $sortId, + public ?string $description, + public ?array $children, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + sortId: $data['SortId'] ?? 0, + description: $data['Description'] ?? null, + children: array_map(static fn (array $item) => Child::make($item), $data['Children'] ?? []), + ); + } +} diff --git a/src/Data/V30/BuyOrderDeliveryRowRead.php b/src/Data/V30/BuyOrderDeliveryRowRead.php new file mode 100644 index 0000000..23d6946 --- /dev/null +++ b/src/Data/V30/BuyOrderDeliveryRowRead.php @@ -0,0 +1,45 @@ + $data */ + public static function make(array $data): self + { + return new self( + buyPrice: $data['BuyPrice'] ?? null, + id: $data['Id'] ?? 0, + productCode: $data['ProductCode'] ?? null, + vendorCode: $data['VendorCode'] ?? null, + productCodeSupplier: $data['ProductCodeSupplier'] ?? null, + buyOrderRowId: $data['BuyOrderRowId'] ?? null, + debtorName: $data['DebtorName'] ?? null, + orderId: $data['OrderId'] ?? null, + productId: $data['ProductId'] ?? 0, + qtyDelivered: $data['Qty_Delivered'] ?? 0.0, + remarks: $data['Remarks'] ?? null, + stockLocationId: $data['StockLocationId'] ?? null, + amountOfLabelsToPrint: $data['AmountOfLabelsToPrint'] ?? null, + ); + } +} diff --git a/src/Data/V30/CRMActivityStatus.php b/src/Data/V30/CRMActivityStatus.php new file mode 100644 index 0000000..4b8d6dc --- /dev/null +++ b/src/Data/V30/CRMActivityStatus.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + sorting: $data['Sorting'] ?? 0, + isCompleted: $data['IsCompleted'] ?? false, + ); + } +} diff --git a/src/Data/V30/CRMActivityType.php b/src/Data/V30/CRMActivityType.php new file mode 100644 index 0000000..1fe4977 --- /dev/null +++ b/src/Data/V30/CRMActivityType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Data/V30/CRMProjectStatus.php b/src/Data/V30/CRMProjectStatus.php new file mode 100644 index 0000000..e45c3fb --- /dev/null +++ b/src/Data/V30/CRMProjectStatus.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + sorting: $data['Sorting'] ?? 0, + isCompleted: $data['IsCompleted'] ?? false, + ); + } +} diff --git a/src/Data/V30/CRMProjectType.php b/src/Data/V30/CRMProjectType.php new file mode 100644 index 0000000..18d3fa4 --- /dev/null +++ b/src/Data/V30/CRMProjectType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Data/V30/Child.php b/src/Data/V30/Child.php new file mode 100644 index 0000000..78454a9 --- /dev/null +++ b/src/Data/V30/Child.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + sortId: $data['SortId'] ?? 0, + ); + } +} diff --git a/src/Data/V30/ContactTypeEnum.php b/src/Data/V30/ContactTypeEnum.php new file mode 100644 index 0000000..eb09c2d --- /dev/null +++ b/src/Data/V30/ContactTypeEnum.php @@ -0,0 +1,19 @@ + $data */ + public static function make(array $data): self + { + return new self( + ); + } +} diff --git a/src/Data/V30/CreditorTypeDto.php b/src/Data/V30/CreditorTypeDto.php new file mode 100644 index 0000000..5bc35ee --- /dev/null +++ b/src/Data/V30/CreditorTypeDto.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? null, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Data/V30/CustomerAddress.php b/src/Data/V30/CustomerAddress.php new file mode 100644 index 0000000..e4faeb8 --- /dev/null +++ b/src/Data/V30/CustomerAddress.php @@ -0,0 +1,65 @@ + $data */ + public static function make(array $data): self + { + return new self( + type: isset($data['Type']) ? AddressType::make($data['Type']) : null, + province: isset($data['Province']) ? Province::make($data['Province']) : null, + email: $data['Email'] ?? null, + contactName: $data['ContactName'] ?? null, + companyName: $data['CompanyName'] ?? null, + address1: $data['Address1'] ?? null, + address2: $data['Address2'] ?? null, + id: $data['Id'] ?? null, + debtorId: $data['DebtorId'] ?? null, + creditorId: $data['CreditorId'] ?? null, + isMainContact: $data['IsMainContact'] ?? false, + isHidden: $data['IsHidden'] ?? null, + ownContactNumber: $data['OwnContactNumber'] ?? null, + countryCode: $data['CountryCode'] ?? null, + isoCode: $data['IsoCode'] ?? null, + city: $data['City'] ?? null, + zipcode: $data['Zipcode'] ?? null, + street: $data['Street'] ?? null, + houseNumber: $data['HouseNumber'] ?? null, + houseNumberAddition: $data['HouseNumberAddition'] ?? null, + telephoneNumber: $data['TelephoneNumber'] ?? null, + countryId: $data['CountryId'] ?? 0, + zoneId: $data['ZoneId'] ?? 0, + ); + } +} diff --git a/src/Data/V30/DatabankViewOption.php b/src/Data/V30/DatabankViewOption.php new file mode 100644 index 0000000..84b4ce1 --- /dev/null +++ b/src/Data/V30/DatabankViewOption.php @@ -0,0 +1,19 @@ + $data */ + public static function make(array $data): self + { + return new self( + ); + } +} diff --git a/src/Data/V30/DebtorCostCentre.php b/src/Data/V30/DebtorCostCentre.php new file mode 100644 index 0000000..abf72b7 --- /dev/null +++ b/src/Data/V30/DebtorCostCentre.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + code: $data['Code'] ?? null, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Data/V30/DebtorWebsiteDomains.php b/src/Data/V30/DebtorWebsiteDomains.php new file mode 100644 index 0000000..4fb9fb2 --- /dev/null +++ b/src/Data/V30/DebtorWebsiteDomains.php @@ -0,0 +1,24 @@ + $websiteDomainIds */ + public function __construct( + public int $debtorId, + public ?array $websiteDomainIds, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + debtorId: $data['DebtorId'] ?? 0, + websiteDomainIds: $data['WebsiteDomainIds'] ?? null, + ); + } +} diff --git a/src/Data/V30/EmailAddress.php b/src/Data/V30/EmailAddress.php new file mode 100644 index 0000000..9a35769 --- /dev/null +++ b/src/Data/V30/EmailAddress.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + name: $data['Name'] ?? null, + email: $data['Email'] ?? null, + ); + } +} diff --git a/src/Data/V30/EmailMessageStatus.php b/src/Data/V30/EmailMessageStatus.php new file mode 100644 index 0000000..57e9d20 --- /dev/null +++ b/src/Data/V30/EmailMessageStatus.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + color: $data['Color'] ?? 0, + ); + } +} diff --git a/src/Data/V30/EmailUserEmailAddress.php b/src/Data/V30/EmailUserEmailAddress.php new file mode 100644 index 0000000..3e8b3d8 --- /dev/null +++ b/src/Data/V30/EmailUserEmailAddress.php @@ -0,0 +1,33 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + fullAddress: $data['FullAddress'] ?? null, + emailAddress: $data['EmailAddress'] ?? null, + isDefaultEmailAddress: $data['IsDefaultEmailAddress'] ?? false, + emailHtmlSignature: $data['EmailHtmlSignature'] ?? null, + emailTextSignature: $data['EmailTextSignature'] ?? null, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/ExplodedViewHighlight.php b/src/Data/V30/ExplodedViewHighlight.php new file mode 100644 index 0000000..ea7794c --- /dev/null +++ b/src/Data/V30/ExplodedViewHighlight.php @@ -0,0 +1,26 @@ + $products */ + public function __construct( + public int $id, + public ?string $name, + public ?array $products, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + products: array_map(static fn (array $item) => ExplodedViewHighlightProduct::make($item), $data['Products'] ?? []), + ); + } +} diff --git a/src/Data/V30/ExplodedViewHighlightProduct.php b/src/Data/V30/ExplodedViewHighlightProduct.php new file mode 100644 index 0000000..d4fe8e6 --- /dev/null +++ b/src/Data/V30/ExplodedViewHighlightProduct.php @@ -0,0 +1,26 @@ + $productNameTranslations */ + public function __construct( + public int $productId, + public ?string $productName1, + public ?array $productNameTranslations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + productName1: $data['ProductName1'] ?? null, + productNameTranslations: array_map(static fn (array $item) => Translation::make($item), $data['ProductNameTranslations'] ?? []), + ); + } +} diff --git a/src/Data/V30/ExplodedViewProductGroup.php b/src/Data/V30/ExplodedViewProductGroup.php new file mode 100644 index 0000000..2c5f763 --- /dev/null +++ b/src/Data/V30/ExplodedViewProductGroup.php @@ -0,0 +1,26 @@ + $productGroupNameTranslations */ + public function __construct( + public int $productGroupId, + public ?string $productGroupName, + public ?array $productGroupNameTranslations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productGroupId: $data['ProductGroupId'] ?? 0, + productGroupName: $data['ProductGroupName'] ?? null, + productGroupNameTranslations: array_map(static fn (array $item) => Translation::make($item), $data['ProductGroupNameTranslations'] ?? []), + ); + } +} diff --git a/src/Data/V30/ExternalValue.php b/src/Data/V30/ExternalValue.php new file mode 100644 index 0000000..7673080 --- /dev/null +++ b/src/Data/V30/ExternalValue.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + typeId: $data['TypeId'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Data/V30/FinancialBookBookingMutation.php b/src/Data/V30/FinancialBookBookingMutation.php new file mode 100644 index 0000000..924c01c --- /dev/null +++ b/src/Data/V30/FinancialBookBookingMutation.php @@ -0,0 +1,34 @@ + $matchings */ + public function __construct( + public ?\Carbon\Carbon $bookingDateTime, + public float $amountIncl, + public ?int $creditorId, + public ?int $debtorId, + public ?int $paymentMethodId, + public ?\Carbon\Carbon $dateTimeCreated, + public ?array $matchings, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + bookingDateTime: isset($data['BookingDateTime']) ? \Carbon\Carbon::parse($data['BookingDateTime']) : null, + amountIncl: $data['AmountIncl'] ?? 0.0, + creditorId: $data['CreditorId'] ?? null, + debtorId: $data['DebtorId'] ?? null, + paymentMethodId: $data['PaymentMethodId'] ?? null, + dateTimeCreated: isset($data['DateTimeCreated']) ? \Carbon\Carbon::parse($data['DateTimeCreated']) : null, + matchings: array_map(static fn (array $item) => FinancialBookBookingMutationMatching::make($item), $data['Matchings'] ?? []), + ); + } +} diff --git a/src/Data/V30/FinancialBookBookingMutationMatching.php b/src/Data/V30/FinancialBookBookingMutationMatching.php new file mode 100644 index 0000000..eb2ee49 --- /dev/null +++ b/src/Data/V30/FinancialBookBookingMutationMatching.php @@ -0,0 +1,39 @@ + $data */ + public static function make(array $data): self + { + return new self( + amount: $data['Amount'] ?? 0.0, + orderId: $data['OrderId'] ?? null, + ledgerId: $data['LedgerId'] ?? 0, + vatCode: $data['VatCode'] ?? 0, + description: $data['Description'] ?? null, + vatAmount: $data['VatAmount'] ?? 0.0, + exclVatAmount: $data['ExclVatAmount'] ?? 0.0, + inclVatAmount: $data['InclVatAmount'] ?? 0.0, + financialCostCenterId: $data['FinancialCostCenterId'] ?? null, + productId: $data['ProductId'] ?? null, + ); + } +} diff --git a/src/Data/V30/FreeValue.php b/src/Data/V30/FreeValue.php new file mode 100644 index 0000000..3af3f02 --- /dev/null +++ b/src/Data/V30/FreeValue.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + key: $data['Key'] ?? null, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Data/V30/Gender.php b/src/Data/V30/Gender.php new file mode 100644 index 0000000..20393b0 --- /dev/null +++ b/src/Data/V30/Gender.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/GetProductImage.php b/src/Data/V30/GetProductImage.php new file mode 100644 index 0000000..2fe17fa --- /dev/null +++ b/src/Data/V30/GetProductImage.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + imageName: $data['ImageName'] ?? null, + imageId: $data['ImageId'] ?? 0, + sortId: $data['SortId'] ?? null, + ); + } +} diff --git a/src/Data/V30/ITSIssueFreeType.php b/src/Data/V30/ITSIssueFreeType.php new file mode 100644 index 0000000..cbecbba --- /dev/null +++ b/src/Data/V30/ITSIssueFreeType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/ITSIssueGroup.php b/src/Data/V30/ITSIssueGroup.php new file mode 100644 index 0000000..9058c5a --- /dev/null +++ b/src/Data/V30/ITSIssueGroup.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/ITSIssueLevel.php b/src/Data/V30/ITSIssueLevel.php new file mode 100644 index 0000000..1398776 --- /dev/null +++ b/src/Data/V30/ITSIssueLevel.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/ITSIssueStatus.php b/src/Data/V30/ITSIssueStatus.php new file mode 100644 index 0000000..f66ca86 --- /dev/null +++ b/src/Data/V30/ITSIssueStatus.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/ITSIssueType.php b/src/Data/V30/ITSIssueType.php new file mode 100644 index 0000000..8d086fb --- /dev/null +++ b/src/Data/V30/ITSIssueType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/ITSPriority.php b/src/Data/V30/ITSPriority.php new file mode 100644 index 0000000..41f2728 --- /dev/null +++ b/src/Data/V30/ITSPriority.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/ITSProject.php b/src/Data/V30/ITSProject.php new file mode 100644 index 0000000..ef5dd5b --- /dev/null +++ b/src/Data/V30/ITSProject.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/KeyValuePairOfintAnddecimal.php b/src/Data/V30/KeyValuePairOfintAnddecimal.php new file mode 100644 index 0000000..e447b03 --- /dev/null +++ b/src/Data/V30/KeyValuePairOfintAnddecimal.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + key: $data['Key'] ?? 0, + value: $data['Value'] ?? 0.0, + ); + } +} diff --git a/src/Data/V30/OrderRow.php b/src/Data/V30/OrderRow.php new file mode 100644 index 0000000..ff4f7aa --- /dev/null +++ b/src/Data/V30/OrderRow.php @@ -0,0 +1,104 @@ + $serialNumbers */ + public function __construct( + public ?array $serialNumbers, + public ?float $expectedNextQtyOnDelivery, + public ?float $discountPercent, + public float $qtyReserved, + public float $inclPrice, + public ?string $internalNotes, + public bool $isAssemblyChild, + public ?int $packingMaterialDepositId, + public ?int $id, + public ?string $description, + public ?string $description2, + public ?int $productId, + public float $qty, + public ?float $buyPrice, + public ?float $grossPrice, + public ?float $nettPrice, + public float $qtyDeliverd, + public float $qtyDeliverdNotInvoiced, + public ?string $productCode, + public ?string $productBarcode1, + public ?float $VATPercentage, + public ?string $notes, + public int $debtorId, + public ?int $orderId, + public ?int $warehouseId, + public ?string $commission, + public ?int $deliveryOptionId, + public ?int $vatCodeId, + public ?int $vatCodeIdOverrule, + public ?string $freeValue1, + public ?string $freeValue2, + public ?string $freeValue3, + public ?string $freeValue4, + public ?string $freeValue5, + public ?\Carbon\Carbon $expectedNextDelivery, + public ?ExternalValue $externalValue, + public ?\Carbon\Carbon $agreedDeliveryDate, + public ?int $type1Id, + public ?int $type2Id, + public ?int $type3Id, + public ?int $type4Id, + public ?int $type5Id, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + serialNumbers: $data['SerialNumbers'] ?? null, + expectedNextQtyOnDelivery: $data['ExpectedNextQtyOnDelivery'] ?? null, + discountPercent: $data['DiscountPercent'] ?? null, + qtyReserved: $data['QtyReserved'] ?? 0.0, + inclPrice: $data['InclPrice'] ?? 0.0, + internalNotes: $data['InternalNotes'] ?? null, + isAssemblyChild: $data['IsAssemblyChild'] ?? false, + packingMaterialDepositId: $data['PackingMaterialDepositId'] ?? null, + id: $data['Id'] ?? null, + description: $data['Description'] ?? null, + description2: $data['Description2'] ?? null, + productId: $data['ProductId'] ?? null, + qty: $data['Qty'] ?? 0.0, + buyPrice: $data['BuyPrice'] ?? null, + grossPrice: $data['GrossPrice'] ?? null, + nettPrice: $data['NettPrice'] ?? null, + qtyDeliverd: $data['QtyDeliverd'] ?? 0.0, + qtyDeliverdNotInvoiced: $data['QtyDeliverd_NotInvoiced'] ?? 0.0, + productCode: $data['ProductCode'] ?? null, + productBarcode1: $data['ProductBarcode1'] ?? null, + VATPercentage: $data['VATPercentage'] ?? null, + notes: $data['Notes'] ?? null, + debtorId: $data['DebtorId'] ?? 0, + orderId: $data['OrderId'] ?? null, + warehouseId: $data['WarehouseId'] ?? null, + commission: $data['Commission'] ?? null, + deliveryOptionId: $data['DeliveryOptionId'] ?? null, + vatCodeId: $data['VatCodeId'] ?? null, + vatCodeIdOverrule: $data['VatCodeIdOverrule'] ?? null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + freeValue3: $data['FreeValue3'] ?? null, + freeValue4: $data['FreeValue4'] ?? null, + freeValue5: $data['FreeValue5'] ?? null, + expectedNextDelivery: isset($data['ExpectedNextDelivery']) ? \Carbon\Carbon::parse($data['ExpectedNextDelivery']) : null, + externalValue: isset($data['ExternalValue']) ? ExternalValue::make($data['ExternalValue']) : null, + agreedDeliveryDate: isset($data['AgreedDeliveryDate']) ? \Carbon\Carbon::parse($data['AgreedDeliveryDate']) : null, + type1Id: $data['Type1Id'] ?? null, + type2Id: $data['Type2Id'] ?? null, + type3Id: $data['Type3Id'] ?? null, + type4Id: $data['Type4Id'] ?? null, + type5Id: $data['Type5Id'] ?? null, + ); + } +} diff --git a/src/Data/V30/OrderShipment.php b/src/Data/V30/OrderShipment.php new file mode 100644 index 0000000..1763d71 --- /dev/null +++ b/src/Data/V30/OrderShipment.php @@ -0,0 +1,35 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + deliveryId: $data['DeliveryId'] ?? null, + dateTimeAdded: isset($data['DateTimeAdded']) ? \Carbon\Carbon::parse($data['DateTimeAdded']) : null, + sendEmail: $data['SendEmail'] ?? null, + orderId: $data['OrderId'] ?? 0, + shipperId: $data['ShipperId'] ?? 0, + barcode: $data['Barcode'] ?? null, + trackTraceUrl: $data['TrackTraceUrl'] ?? null, + ); + } +} diff --git a/src/Data/V30/OrderShipmentFreeValue.php b/src/Data/V30/OrderShipmentFreeValue.php new file mode 100644 index 0000000..40bb811 --- /dev/null +++ b/src/Data/V30/OrderShipmentFreeValue.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + shipperTypeId: $data['ShipperTypeId'] ?? 0, + freevalue1: $data['Freevalue1'] ?? null, + freevalue2: $data['Freevalue2'] ?? null, + freevalue3: $data['Freevalue3'] ?? null, + freevalue4: $data['Freevalue4'] ?? null, + freevalue5: $data['Freevalue5'] ?? null, + ); + } +} diff --git a/src/Data/V30/OrderShippingMethod.php b/src/Data/V30/OrderShippingMethod.php new file mode 100644 index 0000000..86a4864 --- /dev/null +++ b/src/Data/V30/OrderShippingMethod.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + exportCode: $data['ExportCode'] ?? null, + ); + } +} diff --git a/src/Data/V30/OrderStatus.php b/src/Data/V30/OrderStatus.php new file mode 100644 index 0000000..82c75f9 --- /dev/null +++ b/src/Data/V30/OrderStatus.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Data/V30/OrderTotalsRead.php b/src/Data/V30/OrderTotalsRead.php new file mode 100644 index 0000000..07cafdb --- /dev/null +++ b/src/Data/V30/OrderTotalsRead.php @@ -0,0 +1,33 @@ + $data */ + public static function make(array $data): self + { + return new self( + amountEx: $data['AmountEx'] ?? 0.0, + VATPercentage: $data['VATPercentage'] ?? 0.0, + calcTotalPayed: $data['Calc_TotalPayed'] ?? null, + amountIncl: $data['AmountIncl'] ?? 0.0, + isPaid: $data['IsPaid'] ?? false, + shippingCost: $data['ShippingCost'] ?? 0.0, + shippingCostIncl: $data['ShippingCostIncl'] ?? null, + ); + } +} diff --git a/src/Data/V30/Payment.php b/src/Data/V30/Payment.php new file mode 100644 index 0000000..0240901 --- /dev/null +++ b/src/Data/V30/Payment.php @@ -0,0 +1,35 @@ + $data */ + public static function make(array $data): self + { + return new self( + orderId: $data['OrderId'] ?? null, + invoiceId: $data['InvoiceId'] ?? null, + amountIncl: $data['AmountIncl'] ?? 0.0, + description: $data['Description'] ?? null, + bookingId: $data['BookingId'] ?? 0, + matchingLedgerId: $data['MatchingLedgerId'] ?? 0, + dateTime: isset($data['DateTime']) ? \Carbon\Carbon::parse($data['DateTime']) : null, + ledgerCode: $data['LedgerCode'] ?? null, + ); + } +} diff --git a/src/Data/V30/PaymentConditionDto.php b/src/Data/V30/PaymentConditionDto.php new file mode 100644 index 0000000..fa9bba9 --- /dev/null +++ b/src/Data/V30/PaymentConditionDto.php @@ -0,0 +1,21 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? null, + ); + } +} diff --git a/src/Data/V30/PaymentMethod.php b/src/Data/V30/PaymentMethod.php new file mode 100644 index 0000000..a3ea0aa --- /dev/null +++ b/src/Data/V30/PaymentMethod.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + maxAmount: $data['MaxAmount'] ?? null, + selectKey: $data['SelectKey'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductExtraBarcode.php b/src/Data/V30/ProductExtraBarcode.php new file mode 100644 index 0000000..1aa3ede --- /dev/null +++ b/src/Data/V30/ProductExtraBarcode.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + barcode: $data['Barcode'] ?? null, + qty: $data['Qty'] ?? 0, + ); + } +} diff --git a/src/Data/V30/ProductGroup.php b/src/Data/V30/ProductGroup.php new file mode 100644 index 0000000..17ff326 --- /dev/null +++ b/src/Data/V30/ProductGroup.php @@ -0,0 +1,44 @@ + $translations */ + public function __construct( + public int $id, + public ?string $name, + public ?int $parentProductGroupId, + public ?string $shortname, + public ?string $pictureUrl, + public int $sortValue, + public ?string $pictureName, + public int $productGroupTypeId, + public bool $isVisibleOnWebshop, + public int $depthLevel, + public bool $showUnitOnWebsite, + public ?array $translations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + parentProductGroupId: $data['ParentProductGroupId'] ?? null, + shortname: $data['Shortname'] ?? null, + pictureUrl: $data['PictureUrl'] ?? null, + sortValue: $data['SortValue'] ?? 0, + pictureName: $data['PictureName'] ?? null, + productGroupTypeId: $data['ProductGroupTypeId'] ?? 0, + isVisibleOnWebshop: $data['IsVisibleOnWebshop'] ?? false, + depthLevel: $data['DepthLevel'] ?? 0, + showUnitOnWebsite: $data['ShowUnitOnWebsite'] ?? false, + translations: array_map(static fn (array $item) => ProductGroupTranslation::make($item), $data['Translations'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductGroupTranslation.php b/src/Data/V30/ProductGroupTranslation.php new file mode 100644 index 0000000..7451db7 --- /dev/null +++ b/src/Data/V30/ProductGroupTranslation.php @@ -0,0 +1,43 @@ + $data */ + public static function make(array $data): self + { + return new self( + productGroupId: $data['Product_GroupId'] ?? 0, + globalisationId: $data['GlobalisationId'] ?? 0, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + h1Tag: $data['H1Tag'] ?? null, + keywords: $data['Keywords'] ?? null, + name: $data['Name'] ?? null, + productGroupInfo: $data['ProductGroupInfo'] ?? null, + value: $data['Value'] ?? null, + metaDescription: $data['MetaDescription'] ?? null, + shortName: $data['ShortName'] ?? null, + USPDescription: $data['USPDescription'] ?? null, + globalisationCode: $data['GlobalisationCode'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductOffer.php b/src/Data/V30/ProductOffer.php new file mode 100644 index 0000000..67c544b --- /dev/null +++ b/src/Data/V30/ProductOffer.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + startDate: isset($data['StartDate']) ? \Carbon\Carbon::parse($data['StartDate']) : null, + endDate: isset($data['EndDate']) ? \Carbon\Carbon::parse($data['EndDate']) : null, + fromPrice: $data['FromPrice'] ?? null, + toPrice: $data['ToPrice'] ?? null, + offerGroupId: $data['OfferGroupId'] ?? null, + productId: $data['ProductId'] ?? 0, + ); + } +} diff --git a/src/Data/V30/ProductPricelistContractPrice.php b/src/Data/V30/ProductPricelistContractPrice.php new file mode 100644 index 0000000..be6b682 --- /dev/null +++ b/src/Data/V30/ProductPricelistContractPrice.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + priceEx: $data['PriceEx'] ?? 0.0, + qty: $data['Qty'] ?? 0, + fromDate: isset($data['FromDate']) ? \Carbon\Carbon::parse($data['FromDate']) : null, + toDate: isset($data['ToDate']) ? \Carbon\Carbon::parse($data['ToDate']) : null, + productId: $data['ProductId'] ?? 0, + ); + } +} diff --git a/src/Data/V30/ProductResource.php b/src/Data/V30/ProductResource.php new file mode 100644 index 0000000..45eaea5 --- /dev/null +++ b/src/Data/V30/ProductResource.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + fileName: $data['FileName'] ?? null, + type: isset($data['Type']) ? DatabankViewOption::make($data['Type']) : null, + description: $data['Description'] ?? null, + sorting: $data['Sorting'] ?? null, + url: $data['Url'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductShiftPrice.php b/src/Data/V30/ProductShiftPrice.php new file mode 100644 index 0000000..23eee2d --- /dev/null +++ b/src/Data/V30/ProductShiftPrice.php @@ -0,0 +1,33 @@ + $data */ + public static function make(array $data): self + { + return new self( + qty: $data['Qty'] ?? 0, + buyPrice: $data['BuyPrice'] ?? 0.0, + margin: $data['Margin'] ?? 0.0, + sellPriceExcl: $data['SellPriceExcl'] ?? 0.0, + sellPriceGrossExcl: $data['SellPriceGrossExcl'] ?? 0.0, + description: $data['Description'] ?? null, + discountType: $data['DiscountType'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductShiftPriceV14.php b/src/Data/V30/ProductShiftPriceV14.php new file mode 100644 index 0000000..6bc7b90 --- /dev/null +++ b/src/Data/V30/ProductShiftPriceV14.php @@ -0,0 +1,35 @@ + $data */ + public static function make(array $data): self + { + return new self( + costPrice: $data['CostPrice'] ?? 0.0, + qty: $data['Qty'] ?? 0, + buyPrice: $data['BuyPrice'] ?? 0.0, + margin: $data['Margin'] ?? 0.0, + sellPriceExcl: $data['SellPriceExcl'] ?? 0.0, + sellPriceGrossExcl: $data['SellPriceGrossExcl'] ?? 0.0, + description: $data['Description'] ?? null, + discountType: $data['DiscountType'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductStockControlRow.php b/src/Data/V30/ProductStockControlRow.php new file mode 100644 index 0000000..e7f4268 --- /dev/null +++ b/src/Data/V30/ProductStockControlRow.php @@ -0,0 +1,50 @@ + $barcodeExtraList */ + public function __construct( + public ?int $id, + public ?int $productStockHeadId, + public int $productId, + public ?string $productDescription, + public ?string $productDescription2, + public ?string $vendorcode, + public float $stockTotal, + public float $stockOnCurrentLocation, + public ?float $stockCountedByUser, + public ?\Carbon\Carbon $stockLevelDate, + public ?string $barcode, + public ?string $productCode, + public ?string $barcode2, + public ?string $systemBarcode, + public ?array $barcodeExtraList, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? null, + productStockHeadId: $data['ProductStockHeadId'] ?? null, + productId: $data['ProductId'] ?? 0, + productDescription: $data['ProductDescription'] ?? null, + productDescription2: $data['ProductDescription2'] ?? null, + vendorcode: $data['Vendorcode'] ?? null, + stockTotal: $data['StockTotal'] ?? 0.0, + stockOnCurrentLocation: $data['StockOnCurrentLocation'] ?? 0.0, + stockCountedByUser: $data['StockCountedByUser'] ?? null, + stockLevelDate: isset($data['StockLevelDate']) ? \Carbon\Carbon::parse($data['StockLevelDate']) : null, + barcode: $data['Barcode'] ?? null, + productCode: $data['ProductCode'] ?? null, + barcode2: $data['Barcode2'] ?? null, + systemBarcode: $data['SystemBarcode'] ?? null, + barcodeExtraList: array_map(static fn (array $item) => ProductExtraBarcode::make($item), $data['BarcodeExtraList'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductStockInformationStockLocationStock.php b/src/Data/V30/ProductStockInformationStockLocationStock.php new file mode 100644 index 0000000..25b189a --- /dev/null +++ b/src/Data/V30/ProductStockInformationStockLocationStock.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + locationId: $data['LocationId'] ?? 0, + actualStock: $data['ActualStock'] ?? 0.0, + zoneId: $data['ZoneId'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductStockInformationWarehouseDefaultPickLocation.php b/src/Data/V30/ProductStockInformationWarehouseDefaultPickLocation.php new file mode 100644 index 0000000..b2c26eb --- /dev/null +++ b/src/Data/V30/ProductStockInformationWarehouseDefaultPickLocation.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + warehouseId: $data['WarehouseId'] ?? 0, + minimalStock: $data['MinimalStock'] ?? 0.0, + maximumStock: $data['MaximumStock'] ?? null, + defaultPickLocationId: $data['DefaultPickLocationId'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductStockInformationWarehouseStock.php b/src/Data/V30/ProductStockInformationWarehouseStock.php new file mode 100644 index 0000000..948d28a --- /dev/null +++ b/src/Data/V30/ProductStockInformationWarehouseStock.php @@ -0,0 +1,30 @@ + $locations */ + public function __construct( + public int $warehouseId, + public ?string $warehouseName, + public float $actualStock, + public float $freeStock, + public ?array $locations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + warehouseId: $data['WarehouseId'] ?? 0, + warehouseName: $data['WarehouseName'] ?? null, + actualStock: $data['ActualStock'] ?? 0.0, + freeStock: $data['FreeStock'] ?? 0.0, + locations: array_map(static fn (array $item) => ProductStockInformationStockLocationStock::make($item), $data['Locations'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductStockWarehouse.php b/src/Data/V30/ProductStockWarehouse.php new file mode 100644 index 0000000..f58b814 --- /dev/null +++ b/src/Data/V30/ProductStockWarehouse.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + warehouseId: $data['WarehouseId'] ?? 0, + warehouseName: $data['WarehouseName'] ?? null, + minimalStock: $data['MinimalStock'] ?? 0.0, + maxStock: $data['MaxStock'] ?? null, + defaultStockLocationId: $data['DefaultStockLocationId'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductTemplatePropertyWithTranslation.php b/src/Data/V30/ProductTemplatePropertyWithTranslation.php new file mode 100644 index 0000000..824a981 --- /dev/null +++ b/src/Data/V30/ProductTemplatePropertyWithTranslation.php @@ -0,0 +1,26 @@ + $translations */ + public function __construct( + public int $templatePropertyId, + public ?string $templatePropertyName, + public ?array $translations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + templatePropertyId: $data['TemplatePropertyId'] ?? 0, + templatePropertyName: $data['TemplatePropertyName'] ?? null, + translations: array_map(static fn (array $item) => Translation::make($item), $data['Translations'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductTemplateValuesWithTranslation.php b/src/Data/V30/ProductTemplateValuesWithTranslation.php new file mode 100644 index 0000000..4ac483a --- /dev/null +++ b/src/Data/V30/ProductTemplateValuesWithTranslation.php @@ -0,0 +1,24 @@ + $templates */ + public function __construct( + public int $productId, + public ?array $templates, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + templates: array_map(static fn (array $item) => ProductTemplateValuesWithTranslationTemplateProperty::make($item), $data['Templates'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductTemplateValuesWithTranslationTemplateProperty.php b/src/Data/V30/ProductTemplateValuesWithTranslationTemplateProperty.php new file mode 100644 index 0000000..7146d33 --- /dev/null +++ b/src/Data/V30/ProductTemplateValuesWithTranslationTemplateProperty.php @@ -0,0 +1,24 @@ + $values */ + public function __construct( + public int $templatePropertyId, + public ?array $values, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + templatePropertyId: $data['TemplatePropertyId'] ?? 0, + values: array_map(static fn (array $item) => ProductTemplateValuesWithTranslationTemplatePropertyValue::make($item), $data['Values'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductTemplateValuesWithTranslationTemplatePropertyValue.php b/src/Data/V30/ProductTemplateValuesWithTranslationTemplatePropertyValue.php new file mode 100644 index 0000000..d99c525 --- /dev/null +++ b/src/Data/V30/ProductTemplateValuesWithTranslationTemplatePropertyValue.php @@ -0,0 +1,24 @@ + $translations */ + public function __construct( + public ?string $value, + public ?array $translations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + value: $data['Value'] ?? null, + translations: array_map(static fn (array $item) => Translation::make($item), $data['Translations'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductType.php b/src/Data/V30/ProductType.php new file mode 100644 index 0000000..7515d04 --- /dev/null +++ b/src/Data/V30/ProductType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Data/V30/ProductV12.php b/src/Data/V30/ProductV12.php new file mode 100644 index 0000000..dc57a98 --- /dev/null +++ b/src/Data/V30/ProductV12.php @@ -0,0 +1,192 @@ + $freeValues + * @param array $descriptions + * @param array $shiftPrices + * @param array $productGroups + * @param array $barcodeExtraList + * @param array $wareHouses + * @param array $tags + */ + public function __construct( + public int $productId, + public ?string $productCode, + public ?string $productName1, + public ?string $productName2, + public ?string $productInfo, + public int $statusId, + public ?string $statusname, + public int $brandId, + public ?string $brandname, + public ?string $imagename1, + public ?string $imageUrl1, + public ?string $imagename2, + public ?string $imageUrl2, + public ?string $imagename3, + public ?string $imageUrl3, + public ?string $unit, + public int $unitId, + public int $minSaleAmount, + public ?int $minSaleAmountWebshop, + public ?int $minSaleBuyAmountDropShipment, + public ?int $saleCountIncrement, + public ?int $saleCountIncrementWebshop, + public ?int $saleCountIncrementDropShipment, + public ?int $minBuyAmount, + public float $vatPercent, + public ?int $vatCodeId, + public float $sellPriceGross, + public float $weight, + public float $volume, + public ?ProductOffer $offer, + public ?float $sellPriceAdvice, + public float $buyPrice, + public int $productGroupId1, + public ?int $productGroupId2, + public ?int $productGroupId3, + public ?int $productGroupId4, + public ?int $buyCountIncrement, + public ?float $sellPriceLowestForWebshop, + public bool $excludePriceFromPricelistCalculations, + public ?float $additionalBuyPriceAmount, + public ?float $additionalBuyPricePercentage, + public ?bool $isComposedProduct, + public bool $isAssemblyProduct, + public bool $composedProductSetChildSellPricesToZero, + public ?bool $composedProductSetSellPriceToZero, + public float $freeStock, + public ?int $externalStockActiveSupplier, + public ?int $creditorDiscountGroupId, + public ?\Carbon\Carbon $dateTimeLastChanged, + public ?\Carbon\Carbon $dateTimeAdded, + public ?string $barCode1, + public ?array $freeValues, + public ?int $sorting, + public ?\Carbon\Carbon $nextDelivery, + public ?array $descriptions, + public ?array $shiftPrices, + public ?array $productGroups, + public ?string $barcode2, + public ?array $barcodeExtraList, + public ?string $systemBarcode, + public int $productGroup1ProductGroupTypeId, + public ?array $wareHouses, + public ?int $minimalStock, + public int $PCSinInsidePackage, + public int $PCSinOutsidePackage, + public ?ProductType $productType1, + public ?ProductType $productType2, + public ?ProductType $productType3, + public ?ProductType $productType4, + public ?ProductType $productType5, + public ?float $standardAmount, + public ?string $vendorCode, + public ?int $productTemplateId, + public ?string $productTemplateName, + public bool $hasVariants, + public ?int $variantParentProductId, + public ?array $tags, + public ?int $defaultPickLocation, + public ?int $defaultBulkLocation, + public bool $hidePricesOnWebsite, + public bool $showOfferButtonOnWebsite, + public bool $hideStartingPricesOnWebsite, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + productCode: $data['ProductCode'] ?? null, + productName1: $data['ProductName1'] ?? null, + productName2: $data['ProductName2'] ?? null, + productInfo: $data['ProductInfo'] ?? null, + statusId: $data['StatusId'] ?? 0, + statusname: $data['Statusname'] ?? null, + brandId: $data['BrandId'] ?? 0, + brandname: $data['Brandname'] ?? null, + imagename1: $data['Imagename1'] ?? null, + imageUrl1: $data['ImageUrl1'] ?? null, + imagename2: $data['Imagename2'] ?? null, + imageUrl2: $data['ImageUrl2'] ?? null, + imagename3: $data['Imagename3'] ?? null, + imageUrl3: $data['ImageUrl3'] ?? null, + unit: $data['Unit'] ?? null, + unitId: $data['UnitId'] ?? 0, + minSaleAmount: $data['MinSaleAmount'] ?? 0, + minSaleAmountWebshop: $data['MinSaleAmountWebshop'] ?? null, + minSaleBuyAmountDropShipment: $data['MinSaleBuyAmountDropShipment'] ?? null, + saleCountIncrement: $data['SaleCountIncrement'] ?? null, + saleCountIncrementWebshop: $data['SaleCountIncrementWebshop'] ?? null, + saleCountIncrementDropShipment: $data['SaleCountIncrementDropShipment'] ?? null, + minBuyAmount: $data['MinBuyAmount'] ?? null, + vatPercent: $data['VatPercent'] ?? 0.0, + vatCodeId: $data['VatCodeId'] ?? null, + sellPriceGross: $data['SellPriceGross'] ?? 0.0, + weight: $data['Weight'] ?? 0.0, + volume: $data['Volume'] ?? 0.0, + offer: isset($data['Offer']) ? ProductOffer::make($data['Offer']) : null, + sellPriceAdvice: $data['SellPriceAdvice'] ?? null, + buyPrice: $data['BuyPrice'] ?? 0.0, + productGroupId1: $data['ProductGroupId1'] ?? 0, + productGroupId2: $data['ProductGroupId2'] ?? null, + productGroupId3: $data['ProductGroupId3'] ?? null, + productGroupId4: $data['ProductGroupId4'] ?? null, + buyCountIncrement: $data['BuyCountIncrement'] ?? null, + sellPriceLowestForWebshop: $data['SellPriceLowestForWebshop'] ?? null, + excludePriceFromPricelistCalculations: $data['ExcludePriceFromPricelistCalculations'] ?? false, + additionalBuyPriceAmount: $data['AdditionalBuyPriceAmount'] ?? null, + additionalBuyPricePercentage: $data['AdditionalBuyPricePercentage'] ?? null, + isComposedProduct: $data['IsComposedProduct'] ?? null, + isAssemblyProduct: $data['IsAssemblyProduct'] ?? false, + composedProductSetChildSellPricesToZero: $data['ComposedProductSetChildSellPricesToZero'] ?? false, + composedProductSetSellPriceToZero: $data['ComposedProductSetSellPriceToZero'] ?? null, + freeStock: $data['FreeStock'] ?? 0.0, + externalStockActiveSupplier: $data['ExternalStockActiveSupplier'] ?? null, + creditorDiscountGroupId: $data['CreditorDiscountGroupId'] ?? null, + dateTimeLastChanged: isset($data['DateTimeLastChanged']) ? \Carbon\Carbon::parse($data['DateTimeLastChanged']) : null, + dateTimeAdded: isset($data['DateTimeAdded']) ? \Carbon\Carbon::parse($data['DateTimeAdded']) : null, + barCode1: $data['BarCode1'] ?? null, + freeValues: array_map(static fn (array $item) => FreeValue::make($item), $data['FreeValues'] ?? []), + sorting: $data['Sorting'] ?? null, + nextDelivery: isset($data['NextDelivery']) ? \Carbon\Carbon::parse($data['NextDelivery']) : null, + descriptions: array_map(static fn (array $item) => Translation::make($item), $data['Descriptions'] ?? []), + shiftPrices: array_map(static fn (array $item) => ProductShiftPrice::make($item), $data['ShiftPrices'] ?? []), + productGroups: array_map(static fn (array $item) => ProductGroup::make($item), $data['ProductGroups'] ?? []), + barcode2: $data['Barcode2'] ?? null, + barcodeExtraList: array_map(static fn (array $item) => ProductExtraBarcode::make($item), $data['BarcodeExtraList'] ?? []), + systemBarcode: $data['SystemBarcode'] ?? null, + productGroup1ProductGroupTypeId: $data['ProductGroup1ProductGroupTypeId'] ?? 0, + wareHouses: array_map(static fn (array $item) => ProductStockWarehouse::make($item), $data['WareHouses'] ?? []), + minimalStock: $data['MinimalStock'] ?? null, + PCSinInsidePackage: $data['PCSinInsidePackage'] ?? 0, + PCSinOutsidePackage: $data['PCSinOutsidePackage'] ?? 0, + productType1: isset($data['ProductType1']) ? ProductType::make($data['ProductType1']) : null, + productType2: isset($data['ProductType2']) ? ProductType::make($data['ProductType2']) : null, + productType3: isset($data['ProductType3']) ? ProductType::make($data['ProductType3']) : null, + productType4: isset($data['ProductType4']) ? ProductType::make($data['ProductType4']) : null, + productType5: isset($data['ProductType5']) ? ProductType::make($data['ProductType5']) : null, + standardAmount: $data['StandardAmount'] ?? null, + vendorCode: $data['VendorCode'] ?? null, + productTemplateId: $data['ProductTemplateId'] ?? null, + productTemplateName: $data['ProductTemplateName'] ?? null, + hasVariants: $data['HasVariants'] ?? false, + variantParentProductId: $data['VariantParentProductId'] ?? null, + tags: $data['Tags'] ?? null, + defaultPickLocation: $data['DefaultPickLocation'] ?? null, + defaultBulkLocation: $data['DefaultBulkLocation'] ?? null, + hidePricesOnWebsite: $data['HidePricesOnWebsite'] ?? false, + showOfferButtonOnWebsite: $data['ShowOfferButtonOnWebsite'] ?? false, + hideStartingPricesOnWebsite: $data['HideStartingPricesOnWebsite'] ?? false, + ); + } +} diff --git a/src/Data/V30/ProductVariant.php b/src/Data/V30/ProductVariant.php new file mode 100644 index 0000000..a57edd8 --- /dev/null +++ b/src/Data/V30/ProductVariant.php @@ -0,0 +1,32 @@ + $translations */ + public function __construct( + public ?string $name, + public int $id, + public int $sort, + public ?int $categoryId, + public ?string $shortCode, + public ?array $translations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + name: $data['Name'] ?? null, + id: $data['Id'] ?? 0, + sort: $data['Sort'] ?? 0, + categoryId: $data['CategoryId'] ?? null, + shortCode: $data['ShortCode'] ?? null, + translations: array_map(static fn (array $item) => Translation::make($item), $data['Translations'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductVariantBalkChildrenGroupChildVariantOptions.php b/src/Data/V30/ProductVariantBalkChildrenGroupChildVariantOptions.php new file mode 100644 index 0000000..29ee304 --- /dev/null +++ b/src/Data/V30/ProductVariantBalkChildrenGroupChildVariantOptions.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + variantBalkId: $data['VariantBalkId'] ?? 0, + variantOptionid: $data['VariantOptionid'] ?? 0, + ); + } +} diff --git a/src/Data/V30/ProductVariantBalkChildrenGroupChildren.php b/src/Data/V30/ProductVariantBalkChildrenGroupChildren.php new file mode 100644 index 0000000..3a1c9cd --- /dev/null +++ b/src/Data/V30/ProductVariantBalkChildrenGroupChildren.php @@ -0,0 +1,24 @@ + $variantOptions */ + public function __construct( + public int $productId, + public ?array $variantOptions, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + variantOptions: array_map(static fn (array $item) => ProductVariantBalkChildrenGroupChildVariantOptions::make($item), $data['VariantOptions'] ?? []), + ); + } +} diff --git a/src/Data/V30/ProductVariantBalkTranslation.php b/src/Data/V30/ProductVariantBalkTranslation.php new file mode 100644 index 0000000..11e9ba5 --- /dev/null +++ b/src/Data/V30/ProductVariantBalkTranslation.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + value: $data['Value'] ?? null, + globalisationCode: $data['GlobalisationCode'] ?? null, + globalisationId: $data['GlobalisationId'] ?? 0, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + ); + } +} diff --git a/src/Data/V30/Province.php b/src/Data/V30/Province.php new file mode 100644 index 0000000..bc99c61 --- /dev/null +++ b/src/Data/V30/Province.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/RelatedProductV3.php b/src/Data/V30/RelatedProductV3.php new file mode 100644 index 0000000..73f2d0a --- /dev/null +++ b/src/Data/V30/RelatedProductV3.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + relatedProductId: $data['RelatedProductId'] ?? 0, + relatedTypeId: $data['RelatedTypeId'] ?? 0, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + ); + } +} diff --git a/src/Data/V30/RelationStatus.php b/src/Data/V30/RelationStatus.php new file mode 100644 index 0000000..292fc35 --- /dev/null +++ b/src/Data/V30/RelationStatus.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Data/V30/RelationType.php b/src/Data/V30/RelationType.php new file mode 100644 index 0000000..7eb5f17 --- /dev/null +++ b/src/Data/V30/RelationType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Data/V30/Representative.php b/src/Data/V30/Representative.php new file mode 100644 index 0000000..a5d5fe0 --- /dev/null +++ b/src/Data/V30/Representative.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/ReturnProblem.php b/src/Data/V30/ReturnProblem.php new file mode 100644 index 0000000..de9cae3 --- /dev/null +++ b/src/Data/V30/ReturnProblem.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Data/V30/ReturnSolution.php b/src/Data/V30/ReturnSolution.php new file mode 100644 index 0000000..5244b2c --- /dev/null +++ b/src/Data/V30/ReturnSolution.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Data/V30/SalesOrderDeliveryDetailRow.php b/src/Data/V30/SalesOrderDeliveryDetailRow.php new file mode 100644 index 0000000..ba17ec7 --- /dev/null +++ b/src/Data/V30/SalesOrderDeliveryDetailRow.php @@ -0,0 +1,39 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + productCode: $data['ProductCode'] ?? null, + buyPrice: $data['BuyPrice'] ?? 0.0, + sellPrice: $data['SellPrice'] ?? 0.0, + description: $data['Description'] ?? null, + useWarehouseIdForReservation: $data['UseWarehouseIdForReservation'] ?? null, + supplierProductCode: $data['Supplier_ProductCode'] ?? null, + commission: $data['Commission'] ?? null, + rowId: $data['RowId'] ?? 0, + amountDelivered: $data['AmountDelivered'] ?? 0.0, + ); + } +} diff --git a/src/Data/V30/StockLocationForProductItem.php b/src/Data/V30/StockLocationForProductItem.php new file mode 100644 index 0000000..21f29cd --- /dev/null +++ b/src/Data/V30/StockLocationForProductItem.php @@ -0,0 +1,37 @@ + $data */ + public static function make(array $data): self + { + return new self( + isDefault: $data['IsDefault'] ?? false, + location: $data['Location'] ?? null, + locationId: $data['LocationId'] ?? 0, + qty: $data['Qty'] ?? 0.0, + warehouseSortId: $data['WarehouseSortId'] ?? 0, + rowSortId: $data['RowSortId'] ?? 0, + columnSortId: $data['ColumnSortId'] ?? 0, + locationSortId: $data['LocationSortId'] ?? 0, + productId: $data['ProductId'] ?? 0, + ); + } +} diff --git a/src/Data/V30/Translation.php b/src/Data/V30/Translation.php new file mode 100644 index 0000000..e2e828d --- /dev/null +++ b/src/Data/V30/Translation.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + globalisationCode: $data['GlobalisationCode'] ?? null, + globalisationId: $data['GlobalisationId'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Data/V30/VariantBalkCategoryTranslation.php b/src/Data/V30/VariantBalkCategoryTranslation.php new file mode 100644 index 0000000..54f3cce --- /dev/null +++ b/src/Data/V30/VariantBalkCategoryTranslation.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + title: $data['Title'] ?? null, + information: $data['Information'] ?? null, + shortDescription: $data['ShortDescription'] ?? null, + globalisationId: $data['GlobalisationId'] ?? 0, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + ); + } +} diff --git a/src/Data/V30/VatCode.php b/src/Data/V30/VatCode.php new file mode 100644 index 0000000..ee14e60 --- /dev/null +++ b/src/Data/V30/VatCode.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + percent: $data['Percent'] ?? 0.0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Data/V30/WarehouseMinimalStockNumber.php b/src/Data/V30/WarehouseMinimalStockNumber.php new file mode 100644 index 0000000..e1f9583 --- /dev/null +++ b/src/Data/V30/WarehouseMinimalStockNumber.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + warehouseId: $data['WarehouseId'] ?? 0, + minimalStock: $data['MinimalStock'] ?? null, + ); + } +} diff --git a/src/Data/V30/WebsiteDomain.php b/src/Data/V30/WebsiteDomain.php new file mode 100644 index 0000000..be651b2 --- /dev/null +++ b/src/Data/V30/WebsiteDomain.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + url: $data['Url'] ?? null, + title: $data['Title'] ?? null, + isMainDomain: $data['IsMainDomain'] ?? false, + ); + } +} diff --git a/src/Data/V30/WebsiteProductListType.php b/src/Data/V30/WebsiteProductListType.php new file mode 100644 index 0000000..4e96424 --- /dev/null +++ b/src/Data/V30/WebsiteProductListType.php @@ -0,0 +1,19 @@ + $data */ + public static function make(array $data): self + { + return new self( + ); + } +} diff --git a/src/Requests/V30/AppointmentsRequest.php b/src/Requests/V30/AppointmentsRequest.php new file mode 100644 index 0000000..1bcbb8d --- /dev/null +++ b/src/Requests/V30/AppointmentsRequest.php @@ -0,0 +1,64 @@ + + * + * @throws Logic4ApiException + */ + public function getAgendas(array $parameters = []): array + { + return array_map( + static fn (array $data) => Agenda::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Appointments/GetAgendas', ['json' => $parameters]), + ), + ); + } + + /** + * @param array{ + * Subject?: string|null, + * AppointmentIds?: array, + * HasITS?: bool|null, + * ITS_Id?: int|null, + * DebtorId?: int|null, + * CreditorId?: int|null, + * ContactId?: int|null, + * AgendaId?: int|null, + * TaskForUserId?: int|null, + * StartDateTimeFrom?: string|null, + * StartDateTimeUntil?: string|null, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getAppointments(array $parameters = []): array + { + return array_map( + static fn (array $data) => Appointment::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Appointments/GetAppointments', ['json' => $parameters]), + ), + ); + } +} diff --git a/src/Requests/V30/BackOfficeRequest.php b/src/Requests/V30/BackOfficeRequest.php new file mode 100644 index 0000000..bc5eb0d --- /dev/null +++ b/src/Requests/V30/BackOfficeRequest.php @@ -0,0 +1,41 @@ +buildResponse( + $this->getClient()->get('/v3/Backoffice/GetDatabaseConfiguration'), + ) + ); + } + + /** + * Maak een nieuwe taak aan. + * + * @param array{ + * Type?: mixed, + * SerializedJson?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function postCreateBackofficeAction(array $parameters = []): void + { + $this->getClient()->post('/v3/Backoffice/PostCreateBackofficeAction', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/BundlesRequest.php b/src/Requests/V30/BundlesRequest.php new file mode 100644 index 0000000..e7dde24 --- /dev/null +++ b/src/Requests/V30/BundlesRequest.php @@ -0,0 +1,77 @@ + + * + * @throws Logic4ApiException + */ + public function getBundleDiscounts(): array + { + return array_map( + static fn (array $data) => BundleDiscount::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Bundles/GetBundleDiscounts'), + ), + ); + } + + /** + * Het is verplicht gebruik te maken van ParentProductIds en/of TakeRecords in het filter. + * + * @param array{ + * ParentProductIds?: array, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBundles(array $parameters = []): array + { + return array_map( + static fn (array $data) => BundleGroupsForParent::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Bundles/GetBundles', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg bundles waarvan een product een kind is. + * + * @param array{ + * ChildProductId?: int, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBundlesForChild(array $parameters = []): array + { + return array_map( + static fn (array $data) => BundleGroupForChild::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Bundles/GetBundlesForChild', ['json' => $parameters]), + ), + ); + } +} diff --git a/src/Requests/V30/BuyOrderDeliveryRequest.php b/src/Requests/V30/BuyOrderDeliveryRequest.php new file mode 100644 index 0000000..ea51de4 --- /dev/null +++ b/src/Requests/V30/BuyOrderDeliveryRequest.php @@ -0,0 +1,150 @@ +, + * PickingListNumber?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function createBuyOrderDelivery(array $parameters = []): string + { + return $this->buildResponse( + $this->getClient()->post('/v3/BuyOrderDeliveries/CreateBuyOrderDelivery', ['json' => $parameters]), + ); + } + + /** + * Maak een nieuwe inkooplevering aan, o.b.v. deze inkooplevering wordt automatisch een uitlevering aangemaakt. + * Let op: de verkooporder kan enkel uitgeleverd worden als de betreffende inkooporderregel een OrderRowId heeft. + * + * @param array{ + * OrderId?: int|null, + * ProcessMutationButDoNotCreatePickbon?: bool, + * Status?: mixed, + * SupplierId?: int|null, + * BuyOrderId?: int|null, + * Remarks?: string|null, + * Description?: string|null, + * BranchId?: int|null, + * Rows?: array, + * PickingListNumber?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function createBuyOrderDeliveryAndOrderMovement( + array $parameters = [], + ): BuyOrderDeliveryAndOrderMovement { + return BuyOrderDeliveryAndOrderMovement::make( + $this->buildResponse( + $this->getClient()->post('/v3/BuyOrderDeliveries/CreateBuyOrderDeliveryAndOrderMovement', ['json' => $parameters]), + ) + ); + } + + /** + * Verkrijg alle beschikbare inkoopleveringen, het aantal op te vragen inkoopleveringen is gelimiteerd tot 1000. + * + * @param array{ + * CreationDateFrom?: string|null, + * BuyOrderDeliveryId?: int|null, + * BuyOrderId?: int|null, + * BranchId?: int|null, + * SupplierId?: int|null, + * StatusId?: int|null, + * TypeId?: int|null, + * Skip?: int|null, + * Take?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBuyOrderDeliveries(array $parameters = []): array + { + return array_map( + static fn (array $data) => BuyOrderDeliveryRead::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/BuyOrderDeliveries/GetBuyOrderDeliveries', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle beschikbare inkooplevering statussen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBuyOrderDeliveryStatusses(): array + { + return array_map( + static fn (array $data) => BuyOrderDeliveryStatusValue::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/BuyOrderDeliveries/GetBuyOrderDeliveryStatusses'), + ), + ); + } + + /** + * Verkrijg alle beschikbare inkooplevering types. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBuyOrderDeliveryTypes(): array + { + return array_map( + static fn (array $data) => BuyOrderDeliveryTypeValue::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/BuyOrderDeliveries/GetBuyOrderDeliveryTypes'), + ), + ); + } + + /** + * Wijzig de inkooplevering. + * Enkel statusId 3 of 5 zijn toegestaan. + * + * @param array{ + * Id?: int, + * Description?: string|null, + * PickingListNr?: string|null, + * Remarks?: string|null, + * StatusId?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateBuyOrderDelivery(array $parameters = []): void + { + $this->getClient()->patch('/v3/BuyOrderDeliveries/UpdateBuyOrderDelivery', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/BuyOrderRequest.php b/src/Requests/V30/BuyOrderRequest.php new file mode 100644 index 0000000..dd23b3a --- /dev/null +++ b/src/Requests/V30/BuyOrderRequest.php @@ -0,0 +1,217 @@ +getClient()->post('/v3/BuyOrders/AddBuyOrderRow', ['json' => $parameters]); + } + + /** + * Maak een nieuwe inkooporder. + * + * @param array{ + * CreditorId?: int, + * DatabaseAdministrationId?: int, + * CreatedAt?: string, + * BuyOrderRows?: array, + * Remarks?: string|null, + * BranchId?: int|null, + * OrderId?: int|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function createBuyOrder(array $parameters = []): BuyOrderBaseInfo + { + return BuyOrderBaseInfo::make( + $this->buildResponse( + $this->getClient()->post('/v3/BuyOrders/CreateBuyOrder', ['json' => $parameters]), + ) + ); + } + + /** + * Verkrijg de inkooporder regels voor een bepaalde inkooporder die al besteld zijn bij de leverancier. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBuyOrderRows(int $value): array + { + return array_map( + static fn (array $data) => BuyOrderRow::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/BuyOrders/GetBuyOrderRows', ['json' => $value]), + ), + ); + } + + /** + * Haal inkoopordersregels op o.b.v. het meegestuurde filter. + * Let op: het kan zijn dat niet alle inkoopregels van een bepaalde order worden opgehaald, doordat de uitvoer wordt gelimiteerd via de Skip- en TakeRecords. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ProductId?: int|null, + * ProductCode?: string|null, + * BuyOrderStatusId?: int|null, + * IsDropShipment?: bool|null, + * OrderId?: int|null, + * BuyOrderId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBuyOrderRowsByFilter(array $parameters = []): array + { + return array_map( + static fn (array $data) => BuyOrderRow::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/BuyOrders/GetBuyOrderRowsByFilter', ['json' => $parameters]), + ), + ); + } + + /** + * Haal per artikel openstaande inkoopordersregels op o.b.v. het meegestuurde filter. + * + * @param array{ + * ProductIds?: array, + * Dropshipment?: bool|null, + * MinimumDeliveryDate?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getBuyOrderRowsPerProduct(array $parameters = []): object + { + return $this->buildResponse( + $this->getClient()->post('/v3/BuyOrders/GetBuyOrderRowsPerProduct', ['json' => $parameters]), + ); + } + + /** + * Haal inkooporders op o.b.v. het meegestuurde filter. De hoeveelheid inkooporders wordt gelimiteerd aan de hand van opgegeven SkipRecords en TakeRecords. + * TakeRecords wordt gelimiteerd op 10.000. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * DateTimeChangedFrom?: string|null, + * DateTimeChangedTo?: string|null, + * BranchId?: int|null, + * BuyOrderIsClosed?: bool|null, + * SupplierId?: int|null, + * BuyOrderId?: int|null, + * BuyOrderIdFrom?: int|null, + * Remarks?: string|null, + * BuyOrderDateFrom?: string|null, + * BuyOrderDateTo?: string|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBuyOrders(array $parameters = []): array + { + return array_map( + static fn (array $data) => BuyOrderGetInfo::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/BuyOrders/GetBuyOrders', ['json' => $parameters]), + ), + ); + } + + /** + * Wijzig een bestaande inkooporder. + * + * @param array{ + * Id?: int|null, + * CreditorId?: int, + * Remarks?: string|null, + * BranchId?: int|null, + * BuyOrderClosed?: bool, + * CreatedAt?: string, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function updateBuyOrder(array $parameters = []): array + { + return array_map( + static fn (array $data) => BuyOrderBaseInfo::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/BuyOrders/UpdateBuyOrder', ['json' => $parameters]), + ), + ); + } + + /** + * Update een bestaande inkooporderregel. + * + * @param array{ + * BuyOrderRowId?: int, + * OrderId?: int|null, + * ProductCode?: string|null, + * ProductId?: int|null, + * Price?: number, + * Description?: string|null, + * ProductDesc2?: string|null, + * ExpectedDeliveryDate?: string|null, + * QtyToOrder?: number, + * OrderedOnDateByDistributor?: string|null, + * OrderRowId?: int|null, + * InternalNote?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateBuyOrderRow(array $parameters = []): void + { + $this->getClient()->patch('/v3/BuyOrders/UpdateBuyOrderRow', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/CRMRequest.php b/src/Requests/V30/CRMRequest.php new file mode 100644 index 0000000..ed76348 --- /dev/null +++ b/src/Requests/V30/CRMRequest.php @@ -0,0 +1,174 @@ +, + * CreatedByUserIds?: array, + * CarriedOutByUserId?: int|null, + * StartDateFrom?: string|null, + * StartDateTo?: string|null, + * Name?: string|null, + * TypeId?: int|null, + * CrmProjectStatusId?: int|null, + * CrmProjectTypeId?: int|null, + * CrmProjectName?: string|null, + * ShowOnlyOpenActivities?: bool|null, + * UserIdForRights?: int|null, + * CarriedOutByUserIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCRMActivities(array $parameters = []): array + { + return array_map( + static fn (array $data) => CRMActivity::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/CRM/GetCRMActivities', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle beschikbare CRM activiteit statussen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCRMActivityStatusses(): array + { + return array_map( + static fn (array $data) => CRMActivityStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/CRM/GetCRMActivityStatusses'), + ), + ); + } + + /** + * Verkrijg alle beschikbare CRM activiteit types. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCRMActivityTypes(): array + { + return array_map( + static fn (array $data) => CRMActivityType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/CRM/GetCRMActivityTypes'), + ), + ); + } + + /** + * Verkrijg CRM projecten o.b.v. het meegestuurde filter en de opgegeven gebruiker. + *
+ * Let op: Vanaf V3 is het verplicht TakeRecords mee te sturen, met een maximum van 10.000. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * CrmProjectId?: int|null, + * StartDate?: string|null, + * EndDate?: string|null, + * StatusIds?: array, + * ResponsibleUserIds?: array, + * Name?: string|null, + * TypeId?: int|null, + * UserIdForRights?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCRMProjects(array $parameters = []): array + { + return array_map( + static fn (array $data) => CRMProject::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/CRM/GetCRMProjects', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle beschikbare CRM projectstatussen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCRMProjectStatusses(): array + { + return array_map( + static fn (array $data) => CRMProjectStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/CRM/GetCRMProjectStatusses'), + ), + ); + } + + /** + * Verkrijg alle beschikbare CRM projecttypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCRMProjectTypes(): array + { + return array_map( + static fn (array $data) => CRMProjectType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/CRM/GetCRMProjectTypes'), + ), + ); + } + + /** + * Verkrijg alle beschikbare CRM projecttypes 2. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCRMProjectTypes2(): array + { + return array_map( + static fn (array $data) => CRMProjectType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/CRM/GetCRMProjectTypes2'), + ), + ); + } +} diff --git a/src/Requests/V30/CompanyRequest.php b/src/Requests/V30/CompanyRequest.php new file mode 100644 index 0000000..fd350cf --- /dev/null +++ b/src/Requests/V30/CompanyRequest.php @@ -0,0 +1,107 @@ + + * + * @throws Logic4ApiException + */ + public function getAdministrationsForUser(): array + { + return array_map( + static fn (array $data) => Administration::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Company/GetAdministrationsForUser'), + ), + ); + } + + /** + * Verkrijg alle filialen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBranches(): array + { + return array_map( + static fn (array $data) => Branch::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Company/GetBranches'), + ), + ); + } + + /** + * Verkrijg bedrijfsgegevens voor de opgegeven administratie. + * + * @throws Logic4ApiException + */ + public function getCompanyInformation(): CompanyInformation + { + return CompanyInformation::make( + $this->buildResponse( + $this->getClient()->get('/v3/Company/GetCompanyInformation'), + ) + ); + } + + /** + * Verkrijg algemene bedrijfsgegevens. + * + * @throws Logic4ApiException + */ + public function getCompanyValues(): CompanyValues + { + return CompanyValues::make( + $this->buildResponse( + $this->getClient()->get('/v3/Company/GetCompanyValues'), + ) + ); + } + + /** + * Haal de algemene notitie van het bedrijf op. + * + * @throws Logic4ApiException + */ + public function getNotice(): string + { + return $this->buildResponse( + $this->getClient()->get('/v3/Company/GetNotice'), + ); + } + + /** + * Haal alle statussen van de gekoppelde gebruikers op. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getUserStatuses(): array + { + return array_map( + static fn (array $data) => Userstatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Company/GetUserStatuses'), + ), + ); + } +} diff --git a/src/Requests/V30/DeliveryRequest.php b/src/Requests/V30/DeliveryRequest.php new file mode 100644 index 0000000..ad541f0 --- /dev/null +++ b/src/Requests/V30/DeliveryRequest.php @@ -0,0 +1,65 @@ +, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function createDeliveryForOrderRows(array $parameters = []): array + { + return array_map( + static fn (array $data) => SalesOrderDeliveryRow::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Delivery/CreateDeliveryForOrderRows', ['json' => $parameters]), + ), + ); + } + + /** + * Zoeken op verkooporder uitleveringen. + * + * @param array{ + * DateTimeFrom?: string|null, + * DateTimeTo?: string|null, + * OrderId?: int|null, + * DebtorId?: int|null, + * ShippingMethodId?: int|null, + * OrderStatusId?: int|null, + * BranchId?: int|null, + * WebsiteDomainId?: int|null, + * SkipRecords?: int, + * TakeRecords?: int, + * ShowAPIMovements?: bool, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getDeliveries(array $parameters = []): array + { + return array_map( + static fn (array $data) => SalesOrderDelivery::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Delivery/GetDeliveries', ['json' => $parameters]), + ), + ); + } +} diff --git a/src/Requests/V30/EmailRequest.php b/src/Requests/V30/EmailRequest.php new file mode 100644 index 0000000..878e2c4 --- /dev/null +++ b/src/Requests/V30/EmailRequest.php @@ -0,0 +1,312 @@ + $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function addEmailAttachments(array $parameters = []): array + { + return array_map( + static fn (array $data) => EmailAttachment::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Email/AddEmailAttachments', ['json' => $parameters]), + ), + ); + } + + /** + * Maak een nieuwe emailbox aan, bij een onderliggende emailbox worden de rechten overgenomen van de bovenliggende emailbox. + * Als het om een submap van de inbox gaat worden deze rechten overgenomen. + * + * @param array{ + * Id?: int, + * Name?: string|null, + * ParentId?: int|null, + * UserCanRead?: bool, + * UserCanDelete?: bool, + * SortId?: int, + * NewMessages?: int, + * HasEmails?: bool, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addEmailBox(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Email/AddEmailBox', ['json' => $parameters]), + ); + } + + /** + * Voeg een nieuwe email toe in de conceptenmap van de gebruiker. + * + * @param array{ + * Id?: int, + * Subject?: string|null, + * EmailBody?: string|null, + * IsHTMLBody?: bool, + * BoxId?: int, + * DateTimeSend?: string, + * IsInbound?: bool, + * IsRead?: bool, + * IsReplyedOn?: string|null, + * IsForwardedOn?: string|null, + * Status?: array{Id?: int, Name?: string|null, Color?: int}, + * ToEmailAddresses?: array, + * FromEmailAddress?: array{Name?: string|null, Email?: string|null}, + * CCEmailAddresses?: array, + * BCCEmailAddresses?: array, + * HasAttachment?: bool, + * PreviousEmailId?: int|null, + * CanDelete?: bool|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addEmailMessage(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Email/AddEmailMessage', ['json' => $parameters]), + ); + } + + /** + * Verwijder een emailbijlage o.b.v. email-attachment Id. + * + * @throws Logic4ApiException + */ + public function deleteEmailAttachment(int $id): void + { + $this->getClient()->delete('/v3/Email/DeleteEmailAttachment', ['query' => ['id' => $id]]); + } + + /** + * Verwijder een emailbox, let op dit kan alleen als er geen emails of onderliggende emailboxen aan gekoppeld zijn. + * + * @throws Logic4ApiException + */ + public function deleteEmailBox(int $id): void + { + $this->getClient()->delete('/v3/Email/DeleteEmailBox', ['query' => ['id' => $id]]); + } + + /** + * Verwijder een email. + * + * @throws Logic4ApiException + */ + public function deleteEmailMessage(int $id): void + { + $this->getClient()->delete('/v3/Email/DeleteEmailMessage', ['query' => ['id' => $id]]); + } + + /** + * Update minimale gegevens van een email. + * + * @param array{ + * EmailIds?: array, + * EmailBoxId?: int|null, + * EmailStatusId?: int|null, + * IsRead?: bool|null, + * Action?: mixed, + * } $parameters + * + * @throws Logic4ApiException + */ + public function emailMessagesAction(array $parameters = []): void + { + $this->getClient()->post('/v3/Email/EmailMessagesAction', ['json' => $parameters]); + } + + /** + * Verkrijg emailbijlagen van een emailmessage. + * + * @param array{ + * EmailMessageId?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getEmailAttachments(array $parameters = []): array + { + return array_map( + static fn (array $data) => EmailAttachment::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Email/GetEmailAttachments', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg emailboxen o.b.v. meegestuurde user Id. + * + * @param array{ + * ParentId?: int|null, + * ShowOnlyTopLevelEmailboxes?: bool|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getEmailBoxes(array $parameters = []): array + { + return array_map( + static fn (array $data) => EmailBox::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Email/GetEmailBoxes', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg emailmessages o.b.v. het meegestuurde filter. + * + * @param array{ + * EmailId?: int|null, + * EmailboxId?: int|null, + * IncludedSubEmailboxes?: bool|null, + * StartDate?: string|null, + * EndDate?: string|null, + * OnlyWithAttachment?: bool|null, + * StatusId?: int|null, + * IsInbound?: bool|null, + * SearchText1?: string|null, + * SearchText1Type?: string|null, + * SearchText2?: string|null, + * SearchText2Type?: string|null, + * SearchText2Switch?: string|null, + * SearchText3?: string|null, + * SearchText3Type?: string|null, + * SearchText3Switch?: string|null, + * GetEmailMessageBody?: bool|null, + * SkipRecords?: int|null, + * TakeRecords?: int|null, + * OrderByNewestFirst?: bool, + * LoadRights?: bool, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getEmailMessages(array $parameters = []): array + { + return array_map( + static fn (array $data) => EmailMessage::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Email/GetEmailMessages', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg emailberichten statussen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getEmailMessageStatuses(): array + { + return array_map( + static fn (array $data) => EmailMessageStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Email/GetEmailMessageStatuses'), + ), + ); + } + + /** + * Verkrijg een emailuser o.b.v. meegestuurde user Id. + * + * @throws Logic4ApiException + */ + public function getEmailUser(): EmailUser + { + return EmailUser::make( + $this->buildResponse( + $this->getClient()->get('/v3/Email/GetEmailUser'), + ) + ); + } + + /** + * Verkrijg email-snelkeuzes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getUsedEmailAddresses(): array + { + return array_map( + static fn (array $data) => EmailAddress::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Email/GetUsedEmailAddresses'), + ), + ); + } + + /** + * Update een bestaande email. + * + * @param array{ + * Id?: int, + * Subject?: string|null, + * EmailBody?: string|null, + * IsHTMLBody?: bool, + * BoxId?: int, + * DateTimeSend?: string, + * IsInbound?: bool, + * IsRead?: bool, + * IsReplyedOn?: string|null, + * IsForwardedOn?: string|null, + * Status?: array{Id?: int, Name?: string|null, Color?: int}, + * ToEmailAddresses?: array, + * FromEmailAddress?: array{Name?: string|null, Email?: string|null}, + * CCEmailAddresses?: array, + * BCCEmailAddresses?: array, + * HasAttachment?: bool, + * PreviousEmailId?: int|null, + * CanDelete?: bool|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateEmailMessage(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->put('/v3/Email/UpdateEmailMessage', ['json' => $parameters]), + ); + } +} diff --git a/src/Requests/V30/ExplodedViewsRequest.php b/src/Requests/V30/ExplodedViewsRequest.php new file mode 100644 index 0000000..e9626cb --- /dev/null +++ b/src/Requests/V30/ExplodedViewsRequest.php @@ -0,0 +1,39 @@ +, + * ProductGroupIds?: array, + * ProductIds?: array, + * GlobalisationIds?: array, + * WebsiteDomainId?: int|null, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getExplodedViews(array $parameters = []): array + { + return array_map( + static fn (array $data) => ExplodedView::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/ExplodedViews/GetExplodedViews', ['json' => $parameters]), + ), + ); + } +} diff --git a/src/Requests/V30/FinancialRequest.php b/src/Requests/V30/FinancialRequest.php new file mode 100644 index 0000000..ef38a76 --- /dev/null +++ b/src/Requests/V30/FinancialRequest.php @@ -0,0 +1,391 @@ +, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addFinancialBuyBookingWithMutations(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Financial/AddFinancialBuyBookingWithMutations', ['json' => $parameters]), + ); + } + + /** + * Maak een financiële memoriaal dagboekboeking met mutaties aan. + * Geeft terug het id van de aangemaakte boeking. + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * Reference?: string|null, + * BookingDateTime?: string, + * FinancialBookId?: int, + * JournalStatusId?: int|null, + * Mutations?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addFinancialGeneralBookingWithMutations(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Financial/AddFinancialGeneralBookingWithMutations', ['json' => $parameters]), + ); + } + + /** + * Maak een financiële verkoop dagboekboeking met mutaties aan. + * Geeft terug het id van de aangemaakte boeking. + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * Description?: string|null, + * FinancialCostCenterId?: int|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * Reference?: string|null, + * BookingDateTime?: string, + * FinancialBookId?: int, + * JournalStatusId?: int|null, + * Mutations?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addFinancialSaleBookingWithMutations(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Financial/AddFinancialSaleBookingWithMutations', ['json' => $parameters]), + ); + } + + /** + * Verkrijg boeking status types. + * Voor deze aanroep zijn extra rechten vereist. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBookingStatusTypes(): array + { + return array_map( + static fn (array $data) => TypeFinancialBookingStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetBookingStatusTypes'), + ), + ); + } + + /** + * Financieel dagboekboeking met mutaties verkrijgen o.b.v. het aangeleverde filter. + * Levert alleen boekingen uit verkoop, inkoop of memoriale dagboeken. + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * BookingId?: int|null, + * FinancialBookId?: int|null, + * BookingDateTimeFrom?: string|null, + * BookingDateTimeTo?: string|null, + * SkipRecords?: int, + * TakeRecords?: int, + * Reference?: string|null, + * UserId?: int|null, + * BookingNumberByUser?: int|null, + * Description?: string|null, + * DebtorId?: int|null, + * CreditorId?: int|null, + * StatusId?: int|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getFinancialBookingsWithMutations(array $parameters = []): array + { + return array_map( + static fn (array $data) => FinancialBookBooking::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Financial/GetFinancialBookingsWithMutations', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de beschikbare financiële dagboeken o.b.v. het aangeleverde filter. + * + * @param array{ + * LedgerId?: int|null, + * FinancialBookType?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getFinancialBooks(array $parameters = []): array + { + return array_map( + static fn (array $data) => FinancialBook::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Financial/GetFinancialBooks', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de financiële journalen o.b.v. het aangeleverde filter. + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * LedgerCode?: int|null, + * DateTimeFrom?: string|null, + * DateTimeTo?: string|null, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getFinancialJournals(array $parameters = []): array + { + return array_map( + static fn (array $data) => FinancialJournal::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Financial/GetFinancialJournals', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle mogelijke statussen van financiële journalen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getFinancialJournalStatuses(): array + { + return array_map( + static fn (array $data) => FinancialJournalStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetFinancialJournalStatuses'), + ), + ); + } + + /** + * Verkrijg de beschikbare grootboek categorieën. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getLedgerColumnTypes(): array + { + return array_map( + static fn (array $data) => TypeLedgerColumn::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetLedgerColumnTypes'), + ), + ); + } + + /** + * Verkrijg alle grootboeken. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getLedgers(): array + { + return array_map( + static fn (array $data) => Ledger::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetLedgers'), + ), + ); + } + + /** + * Verkrijg alle betaalmethodes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getPaymentMethods(): array + { + return array_map( + static fn (array $data) => PaymentMethod::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetPaymentMethods'), + ), + ); + } + + /** + * Verkrijg type Kosten Centra. + * Voor deze aanroep zijn extra rechten vereist. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTypeCostCenters(): array + { + return array_map( + static fn (array $data) => TypeCostCenter::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetTypeCostCenters'), + ), + ); + } + + /** + * Verkrijg type Entiteit Codes. + * Voor deze aanroep zijn extra rechten vereist. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTypeEntityCodes(): array + { + return array_map( + static fn (array $data) => TypeEntityCode::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetTypeEntityCodes'), + ), + ); + } + + /** + * Verkrijg type Transactie Codes. + * Voor deze aanroep zijn extra rechten vereist. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTypeTransactionCodes(): array + { + return array_map( + static fn (array $data) => TypeTransactionCode::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetTypeTransactionCodes'), + ), + ); + } + + /** + * Verkrijg alle BTW codes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getVatCodes(): array + { + return array_map( + static fn (array $data) => VatCode::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Financial/GetVatCodes'), + ), + ); + } + + /** + * Importeer UBL factuur naar het inkoopboek. + *
+ * Indien het veld CreditorID wordt meegegeven in de request, wordt de betreffende crediteur direct gekoppeld aan de nieuwe inkoopboeking. + * Wanneer het veld CreditorID leeg wordt gelaten, probeert het systeem automatisch een crediteur te matchen. Dit gebeurt op basis van een aantal regels. + *
+ * Eerst worden er crediteuren gematched op basis van het KvK-nummer en het btw-nummer. + * Alléén als dit geen resultaat levert, probeert het systeem te matchen op bedrijfsnaam, postcode en stadsnaam (alleen velden die in de UBL gevuld zijn worden gebruikt.) + * Nadat er gematched is wordt er een crediteur gekozen of gecreëerd afhankelijk van het volgende: + *
+ *
    . + * + * @param array{ + * Xml?: string|null, + * BookId?: int, + * StatusId?: int, + * UserId?: int|null, + * CreditorId?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function postUblInvoiceToBuyBooking(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Financial/PostUblInvoiceToBuyBooking', ['json' => $parameters]), + ); + } + + /** + * Wijzig de status van een financiële boeking. + * Geeft terug het id van de gewijzigde boeking. + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * BookingId?: int, + * StatusId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateFinancialBookingStatus(array $parameters = []): void + { + $this->getClient()->patch('/v3/Financial/UpdateFinancialBookingStatus', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/ITSRequest.php b/src/Requests/V30/ITSRequest.php new file mode 100644 index 0000000..1be61ea --- /dev/null +++ b/src/Requests/V30/ITSRequest.php @@ -0,0 +1,193 @@ + + * + * @throws Logic4ApiException + */ + public function getFreeValues1(): array + { + return array_map( + static fn (array $data) => ITSFreeValue::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetFreeValues1'), + ), + ); + } + + /** + * @return array + * + * @throws Logic4ApiException + */ + public function getFreeValues2(): array + { + return array_map( + static fn (array $data) => ITSFreeValue::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetFreeValues2'), + ), + ); + } + + /** + * @return array + * + * @throws Logic4ApiException + */ + public function getFreeValues3(): array + { + return array_map( + static fn (array $data) => ITSFreeValue::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetFreeValues3'), + ), + ); + } + + /** + * @return array + * + * @throws Logic4ApiException + */ + public function getIssueGroups(): array + { + return array_map( + static fn (array $data) => ITSIssueGroup::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetIssueGroups'), + ), + ); + } + + /** + * @return array + * + * @throws Logic4ApiException + */ + public function getIssueLevels(): array + { + return array_map( + static fn (array $data) => ITSIssueLevel::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetIssueLevels'), + ), + ); + } + + /** + * Verkrijg ITS issues o.b.v. het meegestuurde filter en de opgegeven gebruiker. + * + * @param array{ + * Id?: int|null, + * StartDate?: string|null, + * EndDate?: string|null, + * LastModifiedSince?: string|null, + * DebtorId?: int|null, + * CreditorId?: int|null, + * InvoiceId?: int|null, + * StatusId?: int|null, + * ResponsibleUserId?: int|null, + * IssueMustBeCompletedTo?: string|null, + * IssueMustBeCompletedFrom?: string|null, + * TypeId?: int|null, + * GroupId?: int|null, + * ProjectId?: int|null, + * OrderId?: int|null, + * SkipRecords?: int|null, + * TakeRecords?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getIssues(array $parameters = []): array + { + return array_map( + static fn (array $data) => ITSIssue::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/ITS/GetIssues', ['json' => $parameters]), + ), + ); + } + + /** + * @return array + * + * @throws Logic4ApiException + */ + public function getIssueStatusses(): array + { + return array_map( + static fn (array $data) => ITSIssueStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetIssueStatusses'), + ), + ); + } + + /** + * @return array + * + * @throws Logic4ApiException + */ + public function getIssueTypes(): array + { + return array_map( + static fn (array $data) => ITSIssueType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetIssueTypes'), + ), + ); + } + + /** + * Verkrijg ITS projecten o.b.v. het meegestuurde filter en de opgegeven gebruiker. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProjects(): array + { + return array_map( + static fn (array $data) => ITSProject::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetProjects'), + ), + ); + } + + /** + * @return array + * + * @throws Logic4ApiException + */ + public function getTaskPriorities(): array + { + return array_map( + static fn (array $data) => ITSTaskPriority::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ITS/GetTaskPriorities'), + ), + ); + } +} diff --git a/src/Requests/V30/ManagementRequest.php b/src/Requests/V30/ManagementRequest.php new file mode 100644 index 0000000..79d9e63 --- /dev/null +++ b/src/Requests/V30/ManagementRequest.php @@ -0,0 +1,368 @@ +, + * IncludingCurrentPeriod?: bool, + * ExcludeDebtorIds?: array, + * WebSiteDomainsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductCollectionSalesInformation(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductSalesInformation::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetProductCollectionSalesInformation', ['json' => $parameters]), + ), + ); + } + + /** + * Omzet van een bepaalde periode (Facturen/open orders/abonnementen). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * HistoryPoints?: int, + * IncludeOffers?: bool|null, + * IncludeOpenOrders?: bool|null, + * IncludeOrders?: bool|null, + * IncludeSubscriptions?: bool|null, + * IncludeInvoices?: bool|null, + * Year?: int|null, + * WebSiteDomainsIds?: array, + * TypeContactGroupsIds?: array, + * ExcludingDebtors?: array, + * OnlyForExcludingDebtors?: bool, + * NotLinkedToWebsiteDomain?: bool, + * EmployeeIds?: array, + * BranchIds?: array, + * ProductGroupsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getReportingGetSalesHistory(array $parameters = []): array + { + return array_map( + static fn (array $data) => ValuevsBudget::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetReportingGetSalesHistory', ['json' => $parameters]), + ), + ); + } + + /** + * Omzet o.b.v. order/factuur regels voor een bepaalde periode. + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * HistoryPoints?: int, + * IncludeOffers?: bool|null, + * IncludeOpenOrders?: bool|null, + * IncludeOrders?: bool|null, + * IncludeSubscriptions?: bool|null, + * IncludeInvoices?: bool|null, + * Year?: int|null, + * WebSiteDomainsIds?: array, + * TypeContactGroupsIds?: array, + * ExcludingDebtors?: array, + * OnlyForExcludingDebtors?: bool, + * NotLinkedToWebsiteDomain?: bool, + * EmployeeIds?: array, + * BranchIds?: array, + * ProductGroupsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getReportingGetSalesHistoryForOrderRows(array $parameters = []): array + { + return array_map( + static fn (array $data) => ValuevsBudget::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetReportingGetSalesHistoryForOrderRows', ['json' => $parameters]), + ), + ); + } + + /** + * Omzet van een bepaalde periode per type contact groep (Facturen/open orders/abonnementen). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * HistoryPoints?: int, + * IncludeOffers?: bool|null, + * IncludeOpenOrders?: bool|null, + * IncludeOrders?: bool|null, + * IncludeSubscriptions?: bool|null, + * IncludeInvoices?: bool|null, + * Year?: int|null, + * WebSiteDomainsIds?: array, + * TypeContactGroupsIds?: array, + * ExcludingDebtors?: array, + * OnlyForExcludingDebtors?: bool, + * NotLinkedToWebsiteDomain?: bool, + * EmployeeIds?: array, + * BranchIds?: array, + * ProductGroupsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getReportingGetSalesHistoryForTypeContactGroups(array $parameters = []): array + { + return array_map( + static fn (array $data) => ValuevsBudget::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetReportingGetSalesHistoryForTypeContactGroups', ['json' => $parameters]), + ), + ); + } + + /** + * Grootboek omzet en budgetten. + * + * @param array{ + * LedgerCodes?: array, + * GetOnlyMutationTotal?: bool, + * CreditCorrection?: bool, + * LedgerColumnTypeIds?: array, + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * HistoryPoints?: int, + * IncludeOffers?: bool|null, + * IncludeOpenOrders?: bool|null, + * IncludeOrders?: bool|null, + * IncludeSubscriptions?: bool|null, + * IncludeInvoices?: bool|null, + * Year?: int|null, + * WebSiteDomainsIds?: array, + * TypeContactGroupsIds?: array, + * ExcludingDebtors?: array, + * OnlyForExcludingDebtors?: bool, + * NotLinkedToWebsiteDomain?: bool, + * EmployeeIds?: array, + * BranchIds?: array, + * ProductGroupsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getReportingLedgerHistoryAndBudget(array $parameters = []): array + { + return array_map( + static fn (array $data) => ValuevsBudget::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetReportingLedgerHistoryAndBudget', ['json' => $parameters]), + ), + ); + } + + /** + * Omzet van huidige jaar o.b.v. facturen (Let op! er wordt geen rekening gehouden met de geschiedenispunten). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * HistoryPoints?: int, + * IncludeOffers?: bool|null, + * IncludeOpenOrders?: bool|null, + * IncludeOrders?: bool|null, + * IncludeSubscriptions?: bool|null, + * IncludeInvoices?: bool|null, + * Year?: int|null, + * WebSiteDomainsIds?: array, + * TypeContactGroupsIds?: array, + * ExcludingDebtors?: array, + * OnlyForExcludingDebtors?: bool, + * NotLinkedToWebsiteDomain?: bool, + * EmployeeIds?: array, + * BranchIds?: array, + * ProductGroupsIds?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getSalesTotalIncludingOrdersAndRepeating(array $parameters = []): float + { + return $this->buildResponse( + $this->getClient()->post('/v3/Management/GetSalesTotalIncludingOrdersAndRepeating', ['json' => $parameters]), + ); + } + + /** + * Top 10 filialen (dag/week/maand/kwartaal/jaar). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * ExcludeDebtorIds?: array, + * WebSiteDomainsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTop10Branches(array $parameters = []): array + { + return array_map( + static fn (array $data) => Top10Item::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetTop10Branches', ['json' => $parameters]), + ), + ); + } + + /** + * Top 10 klanten (dag/week/maand/kwartaal/jaar). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * ExcludeDebtorIds?: array, + * WebSiteDomainsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTop10Debtors(array $parameters = []): array + { + return array_map( + static fn (array $data) => Top10Item::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetTop10Debtors', ['json' => $parameters]), + ), + ); + } + + /** + * Top 10 productgroepen (dag/week/maand/kwartaal/jaar). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * ExcludeDebtorIds?: array, + * WebSiteDomainsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTop10Productgroups(array $parameters = []): array + { + return array_map( + static fn (array $data) => Top10Item::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetTop10Productgroups', ['json' => $parameters]), + ), + ); + } + + /** + * Top 10 artikelen (dag/week/maand/kwartaal/jaar). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * ExcludeDebtorIds?: array, + * WebSiteDomainsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTop10Products(array $parameters = []): array + { + return array_map( + static fn (array $data) => Top10Item::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetTop10Products', ['json' => $parameters]), + ), + ); + } + + /** + * Top 10 provincies (dag/week/maand/kwartaal/jaar). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * ExcludeDebtorIds?: array, + * WebSiteDomainsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTop10Provinces(array $parameters = []): array + { + return array_map( + static fn (array $data) => Top10Item::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetTop10Provinces', ['json' => $parameters]), + ), + ); + } + + /** + * Top 10 medewerkers (dag/week/maand/kwartaal/jaar). + * + * @param array{ + * TimeFrame?: mixed, + * IncludingCurrentPeriod?: bool, + * ExcludeDebtorIds?: array, + * WebSiteDomainsIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTop10Users(array $parameters = []): array + { + return array_map( + static fn (array $data) => Top10Item::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Management/GetTop10Users', ['json' => $parameters]), + ), + ); + } +} diff --git a/src/Requests/V30/MarketingRequest.php b/src/Requests/V30/MarketingRequest.php new file mode 100644 index 0000000..92bc927 --- /dev/null +++ b/src/Requests/V30/MarketingRequest.php @@ -0,0 +1,34 @@ + + * + * @throws Logic4ApiException + */ + public function getSubscribers(array $parameters = []): array + { + return array_map( + static fn (array $data) => Subscriber::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Marketing/GetSubscribers', ['json' => $parameters]), + ), + ); + } +} diff --git a/src/Requests/V30/OrderRequest.php b/src/Requests/V30/OrderRequest.php new file mode 100644 index 0000000..7815000 --- /dev/null +++ b/src/Requests/V30/OrderRequest.php @@ -0,0 +1,960 @@ + + * Vanaf versie 3 wordt een aanroep afgewezen als er een orderregel in zit dat niet bestaat. + *
    + * Geeft de hoeveelheid geupdate regels, exclusief regels die al het gegeven serienummer hadden. + * + * @param array{ + * SerialNumberTypeId?: int, + * OrderRowSerialNumbers?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addOrderRowSerialNumbers(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/AddOrderRowSerialNumbers', ['json' => $parameters]), + ); + } + + /** + * Voeg een betaling toe aan een order of factuur. + * + * @param array{ + * OrderId?: int|null, + * InvoiceId?: int|null, + * AmountIncl?: number, + * Description?: string|null, + * BookingId?: int, + * MatchingLedgerId?: int, + * DateTime?: string|null, + * LedgerCode?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addPayment(array $parameters = []): void + { + $this->getClient()->post('/v3/Orders/AddPayment', ['json' => $parameters]); + } + + /** + * Wijzig of maak een nieuwe factuur aan, het is alleen mogelijk om stamgegevens van een factuur te updaten (status, NAW, betaal/verzendmethode). + * Factuurregels kunnen slechts eenmalig bij het aanmaken van de factuur gevuld worden. + * Bij het succesvol aanmaken/updaten wordt het (nieuwe) factuurnummer in de response gevuld. + * + * @param array{ + * Totals?: array{ShippingCost?: number, ShippingCostIncl?: number|null}, + * DebtorId?: int|null, + * CustomerThirdPartyExternalIdentifer?: array{DebtorId?: int|null, TypeId?: int|null, Value?: string|null}, + * Id?: int|null, + * PaymentMethod?: array{Id?: int, Description?: string|null, MaxAmount?: number|null, SelectKey?: string|null}, + * ShippingMethod?: array{Id?: int, Name?: string|null, ExportCode?: string|null}, + * CheckForOrderCostAndPaymentRegulation?: bool, + * OrderStatus?: array{Id?: int, Value?: string|null}, + * OrderRows?: array, + * AcceptTermsAndConditions?: bool, + * DeliveryAddress?: array{TelephoneNumber?: string|null, Email?: string|null, Street2?: string|null, HouseNumber2?: string|null, HouseNumberAddition2?: string|null, Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * InvoiceAddress?: array{Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * CreationDate?: string, + * Description?: string|null, + * Reference?: string|null, + * BranchId?: int|null, + * UserId?: int|null, + * WebsiteDomainId?: int|null, + * DeliveryOptionId?: int|null, + * DeliveryDate?: string|null, + * OrderShipmentFreeValues?: array{ShipperTypeId?: int, Freevalue1?: string|null, Freevalue2?: string|null, Freevalue3?: string|null, Freevalue4?: string|null, Freevalue5?: string|null}, + * Notes?: string|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * FreeValue4?: string|null, + * FreeValue5?: string|null, + * FreeValue6?: string|null, + * FreeValue7?: string|null, + * FreeValue8?: string|null, + * OrderType1Id?: int|null, + * OrderType2Id?: int|null, + * OrderType3Id?: int|null, + * OrderType4Id?: int|null, + * OrderType5Id?: int|null, + * OrderType6Id?: int|null, + * OrderType7Id?: int|null, + * OrderType8Id?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addUpdateInvoice(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/AddUpdateInvoice', ['json' => $parameters]), + ); + } + + /** + * Wijzig of maak een nieuwe order aan, het is alleen mogelijk om stamgegevens van een order te updaten (status, NAW, betaal/verzendmethode). + * Orderregels kunnen slechts eenmalig bij het aanmaken van de order gevuld worden. + * Bij het succesvol aanmaken/updaten wordt het (nieuwe) ordernummer in de response gevuld. + * Met v1.2 of hoger kan het Id van het afleveradres gebruikt worden om het afleveradres te bepalen. + * Met v1.3 of hoger wordt emballage meegenomen met de order. + * + * @param array{ + * Totals?: array{ShippingCost?: number, ShippingCostIncl?: number|null}, + * DebtorId?: int|null, + * CustomerThirdPartyExternalIdentifer?: array{DebtorId?: int|null, TypeId?: int|null, Value?: string|null}, + * Id?: int|null, + * PaymentMethod?: array{Id?: int, Description?: string|null, MaxAmount?: number|null, SelectKey?: string|null}, + * ShippingMethod?: array{Id?: int, Name?: string|null, ExportCode?: string|null}, + * CheckForOrderCostAndPaymentRegulation?: bool, + * OrderStatus?: array{Id?: int, Value?: string|null}, + * OrderRows?: array, + * AcceptTermsAndConditions?: bool, + * DeliveryAddress?: array{TelephoneNumber?: string|null, Email?: string|null, Street2?: string|null, HouseNumber2?: string|null, HouseNumberAddition2?: string|null, Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * InvoiceAddress?: array{Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * CreationDate?: string, + * Description?: string|null, + * Reference?: string|null, + * BranchId?: int|null, + * UserId?: int|null, + * WebsiteDomainId?: int|null, + * DeliveryOptionId?: int|null, + * DeliveryDate?: string|null, + * OrderShipmentFreeValues?: array{ShipperTypeId?: int, Freevalue1?: string|null, Freevalue2?: string|null, Freevalue3?: string|null, Freevalue4?: string|null, Freevalue5?: string|null}, + * Notes?: string|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * FreeValue4?: string|null, + * FreeValue5?: string|null, + * FreeValue6?: string|null, + * FreeValue7?: string|null, + * FreeValue8?: string|null, + * OrderType1Id?: int|null, + * OrderType2Id?: int|null, + * OrderType3Id?: int|null, + * OrderType4Id?: int|null, + * OrderType5Id?: int|null, + * OrderType6Id?: int|null, + * OrderType7Id?: int|null, + * OrderType8Id?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addUpdateOrder(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/AddUpdateOrder', ['json' => $parameters]), + ); + } + + /** + * Voeg een nieuwe orderregel toe of update een bestaande. Om een bestaande te updaten dient het veld 'Id' gevuld te zijn met een bestaand orderregelnummer. + *
    + * De optie "OrderRowWithProductComposition": {"AddProductCompositionByParentProductToOrder": true} heeft het volgende gedrag. + * - Bij een nieuw product worden samenstellingen toegevoegd als het product een samengesteld product is. + * - Bij een bestaand product worden samenstellingen toegevoegd mits er nog geen samenstellingen aanwezig zijn, anders komt er een foutmelding terug. + * + * De optie "ForceAddProductComposition" zorgt ervoor dat samenstellingen altijd worden toegevoegd, ongeacht of er reeds samenstellingen bestaan voor deze orderregel. + * + * @param array{ + * OrderRowWithProductComposition?: array{AddProductCompositionByParentProductToOrder?: bool, ForceAddProductComposition?: bool, UseSystemPricesForProductCompositionProducts?: bool}, + * InclPrice?: number|null, + * GrossInclPrice?: number|null, + * Id?: int|null, + * Description?: string|null, + * Description2?: string|null, + * ProductId?: int|null, + * Qty?: number, + * BuyPrice?: number|null, + * GrossPrice?: number|null, + * NettPrice?: number|null, + * QtyDeliverd?: number, + * QtyDeliverd_NotInvoiced?: number, + * ProductCode?: string|null, + * ProductBarcode1?: string|null, + * VATPercentage?: number|null, + * Notes?: string|null, + * DebtorId?: int, + * OrderId?: int|null, + * WarehouseId?: int|null, + * Commission?: string|null, + * DeliveryOptionId?: int|null, + * VatCodeId?: int|null, + * VatCodeIdOverrule?: int|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * FreeValue4?: string|null, + * FreeValue5?: string|null, + * ExpectedNextDelivery?: string|null, + * ExternalValue?: array{TypeId?: int, Value?: string|null}, + * AgreedDeliveryDate?: string|null, + * Type1Id?: int|null, + * Type2Id?: int|null, + * Type3Id?: int|null, + * Type4Id?: int|null, + * Type5Id?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addUpdateOrderRow(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/AddUpdateOrderRow', ['json' => $parameters]), + ); + } + + /** + * Maak en verwerk een factuur o.b.v. te factureren regels op een order. + * Geef als argument de Id van de order. + * + * @throws Logic4ApiException + */ + public function createAndProcessInvoiceForOrder(int $value): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/CreateAndProcessInvoiceForOrder', ['json' => $value]), + ); + } + + /** + * Een nieuwe retouropdracht aanmaken, het is alleen mogelijk om een retouropdracht aan te maken voor een bestaande order. + * Alle details van de retouropdracht (OriginalOrderId, ProblemId, SolutionId, ReceivedReturnOrderDate) moeten geldig zijn. + * Specificeer een negatieve waarde voor Qty in elke orderregel. Bij het succesvol aanmaken bevat de response het nummer van de retourorder. + * + * @param array{ + * Totals?: array{ShippingCost?: number, ShippingCostIncl?: number|null}, + * OriginalOrderId?: int, + * OriginalOrderDate?: string, + * OriginalOrderZipCode?: string|null, + * ProblemId?: int, + * SolutionId?: int, + * ReceivedReturnOrderDate?: string|null, + * ApprovedReturnOrderDate?: string|null, + * DebtorId?: int|null, + * CustomerThirdPartyExternalIdentifer?: array{DebtorId?: int|null, TypeId?: int|null, Value?: string|null}, + * Id?: int|null, + * PaymentMethod?: array{Id?: int, Description?: string|null, MaxAmount?: number|null, SelectKey?: string|null}, + * ShippingMethod?: array{Id?: int, Name?: string|null, ExportCode?: string|null}, + * CheckForOrderCostAndPaymentRegulation?: bool, + * OrderStatus?: array{Id?: int, Value?: string|null}, + * OrderRows?: array, + * AcceptTermsAndConditions?: bool, + * DeliveryAddress?: array{TelephoneNumber?: string|null, Email?: string|null, Street2?: string|null, HouseNumber2?: string|null, HouseNumberAddition2?: string|null, Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * InvoiceAddress?: array{Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * CreationDate?: string, + * Description?: string|null, + * Reference?: string|null, + * BranchId?: int|null, + * UserId?: int|null, + * WebsiteDomainId?: int|null, + * DeliveryOptionId?: int|null, + * DeliveryDate?: string|null, + * OrderShipmentFreeValues?: array{ShipperTypeId?: int, Freevalue1?: string|null, Freevalue2?: string|null, Freevalue3?: string|null, Freevalue4?: string|null, Freevalue5?: string|null}, + * Notes?: string|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * FreeValue4?: string|null, + * FreeValue5?: string|null, + * FreeValue6?: string|null, + * FreeValue7?: string|null, + * FreeValue8?: string|null, + * OrderType1Id?: int|null, + * OrderType2Id?: int|null, + * OrderType3Id?: int|null, + * OrderType4Id?: int|null, + * OrderType5Id?: int|null, + * OrderType6Id?: int|null, + * OrderType7Id?: int|null, + * OrderType8Id?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function createReturnOrder(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/CreateReturnOrder', ['json' => $parameters]), + ); + } + + /** + * Verkrijg acties die hebben plaatsgevonden i.m.v. het assembleren van artikelen. + * + * @param array{ + * StartDateTime?: string|null, + * EndDateTime?: string|null, + * OrderId?: int|null, + * TypeId?: int|null, + * UserId?: int|null, + * Description?: string|null, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getAssemblyActions(array $parameters = []): array + { + return array_map( + static fn (array $data) => AssemblyAction::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetAssemblyActions', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle assemblage actietypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getAssemblyActionsTypes(): array + { + return array_map( + static fn (array $data) => OrderActionType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Orders/GetAssemblyActionsTypes'), + ), + ); + } + + /** + * Verkrijg factuurregels o.b.v. het meegestuurde filter. + *
    + * Levert maximaal 10.000 regels. + *
    + * Vanaf versie 3 is het veld TakeRecords verplicht. + * + * @param array{ + * OrderId?: int|null, + * BrandName?: string|null, + * LoadNextDeliveryDate?: bool, + * ChangedAfter?: string|null, + * TakeRecords?: int|null, + * FromId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getInvoiceRows(array $parameters = []): array + { + return array_map( + static fn (array $data) => OrderRowV11::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetInvoiceRows', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg facturen o.b.v. het meegestuurde filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ChangedAfter?: string|null, + * Id?: int|null, + * DebtorId?: int|null, + * CreationDateFrom?: string|null, + * CreationDateTo?: string|null, + * Barcode1?: string|null, + * ProductCode?: string|null, + * Delivery_Address?: string|null, + * Delivery_PostalCode?: string|null, + * Delivery_City?: string|null, + * Delivery_ContactName?: string|null, + * Delivery_CompanyName?: string|null, + * Delivery_Email?: string|null, + * Invoice_Address?: string|null, + * Invoice_PostalCode?: string|null, + * Invoice_City?: string|null, + * Invoice_ContactName?: string|null, + * Invoice_CompanyName?: string|null, + * Invoice_Email?: string|null, + * LastActionFrom?: string|null, + * LastActionTo?: string|null, + * Reference?: string|null, + * LoadPayments?: bool, + * StatusId?: int|null, + * Type1Id?: int|null, + * Type2Id?: int|null, + * Type3Id?: int|null, + * WebsiteDomainIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getInvoices(array $parameters = []): array + { + return array_map( + static fn (array $data) => Order::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetInvoices', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg offerteregels o.b.v. het meegestuurde filter. + *
    + * Levert maximaal 10.000 regels. + *
    + * Gebruik van het veld TakeRecords is verplicht. + * + * @param array{ + * OrderId?: int|null, + * BrandName?: string|null, + * LoadNextDeliveryDate?: bool, + * ChangedAfter?: string|null, + * TakeRecords?: int|null, + * FromId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOfferRows(array $parameters = []): array + { + return array_map( + static fn (array $data) => OrderRowV11::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetOfferRows', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg het nog te betalen bedrag van openstaande facturen. + * + * @param array{ + * DebtorId?: int|null, + * DateFrom?: string|null, + * DateTo?: string|null, + * DaysPastDueDate?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOpenPaymentInvoices(array $parameters = []): array + { + return array_map( + static fn (array $data) => InvoiceOpenPayment::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetOpenPaymentInvoices', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg het nog te betalen bedrag van nog niet uitgeleverde orders.
    + * Indien historypoints zijn aangegeven, moet timeframe een van de volgende waarden hebben: ['Day', 'Week', 'Month', 'Quarter', 'Year']. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * TimeFrame?: mixed, + * HistoryPoints?: int|null, + * OrderstatusIds?: array, + * WebsiteDomainIds?: array, + * NotLinkedToWebsiteDomain?: bool, + * EmployeeIds?: array, + * BranchIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOpenPaymentOrders(array $parameters = []): array + { + return array_map( + static fn (array $data) => OrderOpenPayment::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetOpenPaymentOrders', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg het nog te betalen bedrag van nog niet uitgeleverde orders in totalen. + * + * @param array{ + * TimeFrame?: mixed, + * HistoryPoints?: int|null, + * OrderstatusIds?: array, + * WebsiteDomainIds?: array, + * NotLinkedToWebsiteDomain?: bool, + * EmployeeIds?: array, + * BranchIds?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getOpenPaymentOrdersTotals( + array $parameters = [], + ): OrderOpenPayment { + return OrderOpenPayment::make( + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetOpenPaymentOrdersTotals', ['json' => $parameters]), + ) + ); + } + + /** + * Verkrijg acties die hebben plaatsgevonden op een order bv. het wijzigen van een betaalmethode. + * + * @param array{ + * StartDateTime?: string|null, + * EndDateTime?: string|null, + * OrderId?: int|null, + * TypeId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOrderActions(array $parameters = []): array + { + return array_map( + static fn (array $data) => OrderAction::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetOrderActions', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle order actietypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOrderActionsTypes(): array + { + return array_map( + static fn (array $data) => OrderActionType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Orders/GetOrderActionsTypes'), + ), + ); + } + + /** + * Verkrijg order Id's o.b.v. het meegestuurde filter. + * + * @param array{ + * OnlyCompleteForDelivery?: bool|null, + * OnlyWithCompletePayment?: bool|null, + * OrderStatus?: int|null, + * Warehouses?: array, + * MustHaveQtyToDeliverNowAboveZero?: bool|null, + * HasPickbon?: bool|null, + * OnlyGetOrderIdsToCreatePickbonNow?: bool, + * ChangedAfter?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOrderIds(array $parameters = []): array + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetOrderIds', ['json' => $parameters]), + ); + } + + /** + * Verkrijg ordersregels o.b.v. het meegestuurde filter. + *
    + * Levert maximaal 10.000 regels. + *
    + * Vanaf versie 3 is het veld TakeRecords verplicht. + * + * @param array{ + * OrderId?: int|null, + * BrandName?: string|null, + * LoadNextDeliveryDate?: bool, + * ChangedAfter?: string|null, + * TakeRecords?: int|null, + * FromId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOrderRows(array $parameters = []): array + { + return array_map( + static fn (array $data) => OrderRowV11::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetOrderRows', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg orders o.b.v. het meegestuurde filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ChangedAfter?: string|null, + * Id?: int|null, + * DebtorId?: int|null, + * CreationDateFrom?: string|null, + * CreationDateTo?: string|null, + * Barcode1?: string|null, + * ProductCode?: string|null, + * Delivery_Address?: string|null, + * Delivery_PostalCode?: string|null, + * Delivery_City?: string|null, + * Delivery_ContactName?: string|null, + * Delivery_CompanyName?: string|null, + * Delivery_Email?: string|null, + * Invoice_Address?: string|null, + * Invoice_PostalCode?: string|null, + * Invoice_City?: string|null, + * Invoice_ContactName?: string|null, + * Invoice_CompanyName?: string|null, + * Invoice_Email?: string|null, + * LastActionFrom?: string|null, + * LastActionTo?: string|null, + * Reference?: string|null, + * LoadPayments?: bool, + * StatusId?: int|null, + * Type1Id?: int|null, + * Type2Id?: int|null, + * Type3Id?: int|null, + * WebsiteDomainIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOrders(array $parameters = []): array + { + return array_map( + static fn (array $data) => Order::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetOrders', ['json' => $parameters]), + ), + ); + } + + /** + * Haal alle orderstatussen op. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOrderStatuses(): array + { + return array_map( + static fn (array $data) => OrderStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Orders/GetOrderStatuses'), + ), + ); + } + + /** + * Verkrijg alle order retourcategorieën. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getReturnCategories(): array + { + return array_map( + static fn (array $data) => ReturnCategory::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Orders/GetReturnCategories'), + ), + ); + } + + /** + * Verkrijg retourorders o.b.v. het meegestuurde filter. + * + * @param array{ + * ReceivedReturnOrderDateFrom?: string|null, + * ReceivedReturnOrderDateTo?: string|null, + * SkipRecords?: int, + * TakeRecords?: int, + * SolutionId?: int|null, + * ProblemId?: int|null, + * CategoryId?: int|null, + * BelongsToOrderId?: int|null, + * Id?: int|null, + * DebtorId?: int|null, + * CreationDateFrom?: string|null, + * CreationDateTo?: string|null, + * Barcode1?: string|null, + * ProductCode?: string|null, + * Delivery_Address?: string|null, + * Delivery_PostalCode?: string|null, + * Delivery_City?: string|null, + * Delivery_ContactName?: string|null, + * Delivery_CompanyName?: string|null, + * Delivery_Email?: string|null, + * Invoice_Address?: string|null, + * Invoice_PostalCode?: string|null, + * Invoice_City?: string|null, + * Invoice_ContactName?: string|null, + * Invoice_CompanyName?: string|null, + * Invoice_Email?: string|null, + * LastActionFrom?: string|null, + * LastActionTo?: string|null, + * Reference?: string|null, + * LoadPayments?: bool, + * StatusId?: int|null, + * Type1Id?: int|null, + * Type2Id?: int|null, + * Type3Id?: int|null, + * WebsiteDomainIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getReturnOrders(array $parameters = []): array + { + return array_map( + static fn (array $data) => ReturnOrderV2::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetReturnOrders', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg retourproblemen o.b.v. het filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getReturnProblems(array $parameters = []): array + { + return array_map( + static fn (array $data) => ReturnProblemV11::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetReturnProblems', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg order retouroplossingen o.b.v. het filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getReturnSolutions(array $parameters = []): array + { + return array_map( + static fn (array $data) => ReturnSolution::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Orders/GetReturnSolutions', ['json' => $parameters]), + ), + ); + } + + /** + * @return array + * + * @throws Logic4ApiException + */ + public function getSerialnumberTypes(): array + { + return array_map( + static fn (array $data) => Order::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Orders/GetSerialnumberTypes'), + ), + ); + } + + /** + * Maakt een factuur aan, werkt voorraadmutaties bij, maakt financiële boekingen voor kosten en omzet aan, + * zet het bedrag van de order naar de de factuur en zet de factuur op gesloten. + * Geef als argument de Id van de factuur. + * + * @return array + * + * @throws Logic4ApiException + */ + public function processInvoice(int $value): array + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/ProcessInvoice', ['json' => $value]), + ); + } + + /** + * Email wordt standaard niet verstuurd als de debiteur of de betaalmethode facturen via email uit heeft staan. + *
    + * Geeft het ID van de verzonden email, of 0 als er geen email is verzonden. + *
    + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * InvoiceId?: int, + * IgnoreDebtorElectronicInvoicePreference?: bool, + * IgnorePaymentTypeElectronicInvoicePreference?: bool, + * } $parameters + * + * @throws Logic4ApiException + */ + public function sendEmailForInvoice(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/SendEmailForInvoice', ['json' => $parameters]), + ); + } + + /** + * Voorzie orderregels met een afgesproken afleverdatum. + * + * @param array $parameters + * + * @throws Logic4ApiException + */ + public function updateAgreedDeliveryDatesForOrderRows(array $parameters = []): void + { + $this->getClient()->post('/v3/Orders/UpdateAgreedDeliveryDatesForOrderRows', ['json' => $parameters]); + } + + /** + * Wijzig het contactadres van een order of factuur o.b.v. de meegestuurde gegevens. + * + * @param array{ + * OrderId?: int|null, + * InvoiceId?: int|null, + * ContactAddress?: array{Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateContactAddressForOrderOrInvoice(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/UpdateContactAddressForOrderOrInvoice', ['json' => $parameters]), + ); + } + + /** + * Wijzig het afleveradres van een order of factuur o.b.v. de meegestuurde gegevens. + * + * @param array{ + * OrderId?: int|null, + * InvoiceId?: int|null, + * DeliveryAddress?: array{TelephoneNumber?: string|null, Email?: string|null, Street2?: string|null, HouseNumber2?: string|null, HouseNumberAddition2?: string|null, Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateDeliveryAddressForOrderOrInvoice(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/UpdateDeliveryAddressForOrderOrInvoice', ['json' => $parameters]), + ); + } + + /** + * Wijzig het factuuradres van een order of factuur o.b.v. de meegestuurde gegevens. + * + * @param array{ + * OrderId?: int|null, + * InvoiceId?: int|null, + * InvoiceAddress?: array{Id?: int|null, ProvinceId?: int|null, ContactName?: string|null, CompanyName?: string|null, PostalCode?: string|null, City?: string|null, CountryCode?: string|null, Street?: string|null, HouseNumber?: string|null, HouseNumberAddition?: string|null}, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateInvoiceAddressForOrderOrInvoice(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Orders/UpdateInvoiceAddressForOrderOrInvoice', ['json' => $parameters]), + ); + } + + /** + * Update de status van een order. + * + * @param array{ + * StatusId?: int, + * OrderId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateOrderStatus(array $parameters = []): void + { + $this->getClient()->post('/v3/Orders/UpdateOrderStatus', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/PickbonsRequest.php b/src/Requests/V30/PickbonsRequest.php new file mode 100644 index 0000000..c30432e --- /dev/null +++ b/src/Requests/V30/PickbonsRequest.php @@ -0,0 +1,158 @@ + + * + * @throws Logic4ApiException + */ + public function createCompletePickbonForOrder(array $parameters = []): array + { + return $this->buildResponse( + $this->getClient()->post('/v3/Pickbons/CreateCompletePickbonForOrder', ['json' => $parameters]), + ); + } + + /** + * Maak nieuwe pickbon(nen) aan voor de nu te picken leveren orderregels. + * + * @return array + * + * @throws Logic4ApiException + */ + public function createPickbonForOrder(int $value): array + { + return $this->buildResponse( + $this->getClient()->post('/v3/Pickbons/CreatePickbonForOrder', ['json' => $value]), + ); + } + + /** + * Controleer of de pickbon soft-blocked is en zo ja, door wie en wanneer? + * + * @throws Logic4ApiException + */ + public function getIsPickbonSoftBlocked(int $value): PickbonSoftBlocked + { + return PickbonSoftBlocked::make( + $this->buildResponse( + $this->getClient()->post('/v3/Pickbons/GetIsPickbonSoftBlocked', ['json' => $value]), + ) + ); + } + + /** + * Verkrijg simpele pickbon rijen op basis van pickbonnen. + * + * @param array $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOrderHeadPickbonRows(array $parameters = []): array + { + return array_map( + static fn (array $data) => OrderHeadPickbonRow::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Pickbons/GetOrderHeadPickbonRows', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg pickbonnen op basis van het meegegeven filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * OnlyUnprocessedItems?: bool, + * OrderCreatedFrom?: string|null, + * WarehouseZoneId?: int|null, + * WarehouseId?: int|null, + * PickBonId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOrderHeadPickbons(array $parameters = []): array + { + return array_map( + static fn (array $data) => OrderHeadPickbon::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Pickbons/GetOrderHeadPickbons', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle magazijnzones. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWarehouseZones(): array + { + return array_map( + static fn (array $data) => WarehouseZone::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Pickbons/GetWarehouseZones'), + ), + ); + } + + /** + * Soft-block pickbonnen. + * + * @param array $parameters + * + * @throws Logic4ApiException + */ + public function postSoftBlockPickbons(array $parameters = []): void + { + $this->getClient()->post('/v3/Pickbons/PostSoftBlockPickbons', ['json' => $parameters]); + } + + /** + * Verwerk pickbonnen. + * + * @param array, + * Mutations?: array, + * OrderHeadPickbonId?: int, + * InterimLocationId?: int|null, + * Remarks?: string|null, + * }> $parameters + * + * @throws Logic4ApiException + */ + public function processPickbons(array $parameters = []): string + { + return $this->buildResponse( + $this->getClient()->post('/v3/Pickbons/ProcessPickbons', ['json' => $parameters]), + ); + } +} diff --git a/src/Requests/V30/PriceListsRequest.php b/src/Requests/V30/PriceListsRequest.php new file mode 100644 index 0000000..145bfcb --- /dev/null +++ b/src/Requests/V30/PriceListsRequest.php @@ -0,0 +1,52 @@ + + * + * @throws Logic4ApiException + */ + public function getPricelists(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductPricelist::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/PriceLists/GetPricelists', ['json' => $parameters]), + ), + ); + } + + /** + * Contractprijzen bijwerken binnen de prijslijst. + * + * @param array{ + * PriceListId?: int, + * ProductStaggeredPrices?: array}>, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updatePriceListForProducts(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->put('/v3/PriceLists/UpdatePriceListForProducts', ['json' => $parameters]), + ); + } +} diff --git a/src/Requests/V30/ProductGroupsRequest.php b/src/Requests/V30/ProductGroupsRequest.php new file mode 100644 index 0000000..40b41a5 --- /dev/null +++ b/src/Requests/V30/ProductGroupsRequest.php @@ -0,0 +1,96 @@ + + * + * @throws Logic4ApiException + */ + public function getProductGroups(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductGroup::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/ProductGroups/GetProductGroups', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle artikelgroep types. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductGroupTypes(): array + { + return array_map( + static fn (array $data) => ProductGroupType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/ProductGroups/GetProductGroupTypes'), + ), + ); + } + + /** + * Wijzig artikelgroep SEO informatie. + * Een SEO informatie record word op basis van een combinatie van ProductGroupId, GlobalizationId en WebsiteDomainId geselecteerd. + * WebsiteDomainId mag null zijn, dan geldt de gegeven SEO informatie voor alle webhopdomeinen. + *
    + * Als een record niet bestaat wordt deze aangemaakt.Lege records worden automatisch verwijdert. + * Niet-lege records moeten ten minste een Title of Description hebben. + *
    + * Bij het meegeven van een lege string of 'null' voor informatie velden, wordt bestaande informatie leeg gehaald. + * Velden die niet in de request staan worden niet gewijzigd. + *
    + * Als een product geen SEO informatie heeft voor een bepaalde taal en webshopdomein + * vindt er een fallback plaats op de basis informatie van de artikelgroep. + * + * @param array{ + * Product_GroupId?: int, + * GlobalisationId?: int, + * WebsiteDomainId?: int|null, + * H1Tag?: string|null, + * Keywords?: string|null, + * Name?: string|null, + * ProductGroupInfo?: string|null, + * Value?: string|null, + * MetaDescription?: string|null, + * ShortName?: string|null, + * USPDescription?: string|null, + * GlobalisationCode?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductGroupSEOInformation(array $parameters = []): void + { + $this->getClient()->patch('/v3/ProductGroups/UpdateProductGroupSEOInformation', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/ProductRequest.php b/src/Requests/V30/ProductRequest.php new file mode 100644 index 0000000..9253eed --- /dev/null +++ b/src/Requests/V30/ProductRequest.php @@ -0,0 +1,1084 @@ +}>, + * Barcode1?: string|null, + * Barcode2?: string|null, + * ExtraBarcodes?: array, + * VendorCode?: string|null, + * StatusId?: int, + * VisibleOnWebshopFrom?: string|null, + * ExpirationDateOnWebshop?: string|null, + * WarrantyMonths?: int|null, + * SortId?: int|null, + * InternalNote?: string|null, + * ProductInfo?: string|null, + * Tags?: string|null, + * USPDescription?: string|null, + * MetaDescription?: string|null, + * SellPriceAdviceEx?: number|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * FreeValue4?: string|null, + * FreeValue5?: string|null, + * ProductPrices?: array, + * WeightSingleProduct?: number, + * HeightSingleProduct?: number, + * WidthSingleProduct?: number, + * DepthSingleProduct?: number, + * WeightInsidePackage?: number, + * HeightInsidePackage?: number, + * WidthInsidePackage?: number, + * DepthInsidePackage?: number, + * WeightOutsidePackage?: number, + * HeightOutsidePackage?: number, + * WidthOutsidePackage?: number, + * DepthOutsidePackage?: number, + * MinStockCount?: int|null, + * MaxStockCount?: int|null, + * HidePricesOnWebsite?: bool, + * ShowOfferButtonOnWebsite?: bool, + * HideStartingPricesOnWebsite?: bool, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addProduct(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Products/AddProduct', ['json' => $parameters]), + ); + } + + /** + * Voeg een afbeelding toe aan het artikel + * - Maximale grootte van het bericht is 5MB + * - Return waarde is een AfbeeldingId als de opdracht is geslaagd. + * + * @param array{ + * ImageBase64String?: string|null, + * ProductId?: int, + * ImageName?: string|null, + * ImageId?: int|null, + * SortId?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addProductImage(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Products/AddProductImage', ['json' => $parameters]), + ); + } + + /** + * Koppel gerelateerde artikelen aan artikelen. + * Als een product al gekoppeld is en opnieuw wordt gekoppeld, worden de vrije velden overschreven. + * Wanneer deze vrije velden niet worden meegegeven in een nieuw request, worden de bestaande waarden verwijderd. + * + * @param array $parameters + * + * @throws Logic4ApiException + */ + public function addRelatedProducts(array $parameters = []): void + { + $this->getClient()->post('/v3/Products/AddRelatedProducts', ['json' => $parameters]); + } + + /** + * Koppelen van een website aan een product, max 1000 producten per request. + * Als een webshopdomein al reeds gekoppeld is, dan wordt deze overgeslagen. + * + * @param array{ + * ProductIds?: array, + * WebsiteDomainId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addWebsiteDomainForProducts(array $parameters = []): void + { + $this->getClient()->post('/v3/Products/AddWebsiteDomainForProducts', ['json' => $parameters]); + } + + /** @throws Logic4ApiException */ + public function deleteProductImage(int $productid, int $imageid): void + { + $this->getClient()->delete('/v3/Products/DeleteProductImage', ['query' => ['productid' => $productid, 'imageid' => $imageid]]); + } + + /** + * Ontkoppel gerelateerde artikelen. + * Ontkoppelt een specifiek gerelateerd artikel. Geef hierbij het RelatedTypeId op om aan te geven welk type koppeling verwijderd moet worden, + * aangezien een artikel zowel als ‘Gerelateerd’ als ‘Accessoire’ gekoppeld kan zijn. + * Wanneer RelatedTypeId niet wordt meegegeven in het request, worden alle koppelingen(ongeacht het type) voor het betreffende gerelateerde artikel ontkoppeld. + * + * @param array $parameters + * + * @throws Logic4ApiException + */ + public function deleteRelatedProducts(array $parameters = []): void + { + $this->getClient()->delete('/v3/Products/DeleteRelatedProducts', ['json' => $parameters]); + } + + /** + * Verwijder een website dat gekoppeld zit aan een product, max 1000 producten per request. + * Enkel gevonden records worden verwijderd, er vindt geen controle plaats op ProductId en/of WebsiteDomainId. + * Id's die niet gevonden worden, worden overgeslagen. + * + * @param array{ + * ProductIds?: array, + * WebsiteDomainId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function deleteWebsiteDomainForProducts(array $parameters = []): void + { + $this->getClient()->delete('/v3/Products/DeleteWebsiteDomainForProducts', ['json' => $parameters]); + } + + /** + * Verkrijg barcodes met aantallen o.b.v. een filter met artikel Id's. + * + * @param array $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBarcodesForProductIds(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductBarcode::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetBarcodesForProductIds', ['json' => $parameters]), + ), + ); + } + + /** + * Haal artikel barcode types op. + * Deze types worden gebruikt in bijvoorbeeld de UpdateProductAddExtraBarcode functionaliteit. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBarcodeTypes(): array + { + return array_map( + static fn (array $data) => ProductExtraBarcodeType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Products/GetBarcodeTypes'), + ), + ); + } + + /** + * Verkrijg basisinformatie van artikelen op basis van artikel Id's. + * + * @param array $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBasicProductDataForProducts(array $parameters = []): array + { + return array_map( + static fn (array $data) => BasicProductData::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetBasicProductDataForProducts', ['json' => $parameters]), + ), + ); + } + + /** + * Haal merken op o.b.v. het filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getBrands(array $parameters = []): array + { + return array_map( + static fn (array $data) => Brand::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetBrands', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de inhoud van een samengesteld artikel. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getComposedProductComposition(int $value): array + { + return array_map( + static fn (array $data) => ProductCompositionItem::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetComposedProductComposition', ['json' => $value]), + ), + ); + } + + /** + * Haal emballagetypen op. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getPackageMaterialDepositTypes(): array + { + return array_map( + static fn (array $data) => PackingMaterialDepositType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Products/GetPackageMaterialDepositTypes'), + ), + ); + } + + /** + * Verkrijg actuele prijzen voor een specifieke debiteur. + * + * @param array{ + * ProductCode?: string|null, + * DebtorId?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getPriceInformationForProduct( + array $parameters = [], + ): ProductPriceInformation { + return ProductPriceInformation::make( + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetPriceInformationForProduct', ['json' => $parameters]), + ) + ); + } + + /** + * Verkrijg een standaard assemblagerecept voor een artikel. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductAssemblyRecipe(int $value): array + { + return array_map( + static fn (array $data) => ProductAssemblyRecipeItem::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductAssemblyRecipe', ['json' => $value]), + ), + ); + } + + /** + * Verkrijg productcodes o.b.v. leverancier productcodes (maximaal 10.000). + * + * @param array{ + * SupplierId?: int, + * SupplierCodes?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductCodesBySupplierProductCodes(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductCodeWithSupplierCode::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductCodesBySupplierProductCodes', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de afmetingen van meerdere artikelen. + * + * @param array{ + * ProductIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductDimensions(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductDimensions::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductDimensions', ['json' => $parameters]), + ), + ); + } + + /** + * Ontvang de afbeeldingsinformatie van maximaal 1000 artikelen. + * + * @param array{ + * ProductIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductImages(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductImageV2::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductImages', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg product afbeeldingen, videos en documenten. + * + * @param array{ + * ProductIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductMedia(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductMediaFileDto::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductMedia', ['json' => $parameters]), + ), + ); + } + + /** + * Haal ID's op van voorraadlocaties voor een bepaald product in een bepaald magazijn. + * + * @param array{ + * ProductIds?: array, + * WarehouseId?: int|null, + * SystemDefaultPickLocation?: bool, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductPickStockLocationIds(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductPickLocationBasedOnSystemSettings::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductPickStockLocationIds', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg geschreven reviews op basis van het opgestuurde filter. + * + * @param array{ + * WebsiteDomainId?: int|null, + * DateTimeCreatedFrom?: string|null, + * DateTimeCreatedTo?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductReviews(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductReview::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductReviews', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg artikelen o.b.v. het meegestuurde filter. Het aantal op te vragen artikelen is gelimiteerd tot 10000. + *
    + * Vanaf v1.4 is de werking van BuyPrice gewijzigd. Dit veld bevat nu de inkoopprijs exclusief toeslagen. + * In voorgaande versies was dit veld inclusief toeslagen. Deze waarde is nu verplaatst naar het nieuwe veld CostPrice. + * + * @param array{ + * DateTimeChangedFrom?: string|null, + * DateTimeChangedTo?: string|null, + * LoadFreeValuesTypes?: bool, + * BrandIds?: array, + * IsVisibleInLogic4?: bool|null, + * IsVisibleOnWebShop?: bool|null, + * AllShowOnWebsite?: bool|null, + * ProductGroupId?: int|null, + * UseChildProductGroups?: bool|null, + * ProductCode?: string|null, + * Barcode?: string|null, + * Barcodes?: array, + * DebtorId?: int|null, + * WebshopUserId?: int|null, + * WebshopPriceListId?: int|null, + * UseDropShipmentAmountsForWebshopPrices?: bool|null, + * ProductIds?: array, + * ProductFilterListChoice?: mixed, + * ProductHistoryBasedOnInvoices?: bool|null, + * WebshopUserOrderlistProductType?: int|null, + * ActiveOffers?: bool|null, + * OfferGroupId?: int|null, + * FastSearchText?: string|null, + * GetHighestShiftPrice?: bool|null, + * CountryIdForSellPrice?: int|null, + * BranchIdForSellPrice?: int|null, + * LoadExternalStockActiveSupplier?: bool|null, + * SkipRecords?: int|null, + * TakeRecords?: int|null, + * FromId?: int|null, + * LoadProductGroups?: bool|null, + * LoadExtraBarcodes?: bool, + * OnlyShowParentProducts?: bool|null, + * GlobalisationId?: int|null, + * WebsiteDomainId?: int|null, + * WareHouseId?: int|null, + * UseECommerceProductGroups?: bool, + * UseECommerceProductGroupsToLoadProductGroups?: bool, + * LoadStockForWarehouses?: bool, + * LoadAllWebshopGroupsLinkedToProduct?: bool, + * LoadProductTypes?: bool, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProducts(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductV14::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProducts', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg SEO informatie voor 1 of meerdere artikelen (maximaal 1.000). + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ProductIds?: array, + * WebsiteDomainId?: int|null, + * GlobalizationId?: int|null, + * ProductId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductsSEOInformation(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductSEOInformation::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductsSEOInformation', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de verzendinformatie van een product. + * + * @param array{ + * ProductId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getProductShippingInformation( + array $parameters = [], + ): ProductShippingInformation { + return ProductShippingInformation::make( + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductShippingInformation', ['json' => $parameters]), + ) + ); + } + + /** + * Verkrijg artikel Id's o.b.v. het meegestuurde filter. + * + * @param array{ + * IsVisibleInLogic4?: bool|null, + * IsVisibleOnWebShop?: bool|null, + * AllShowOnWebsite?: bool|null, + * ProductGroupId?: int|null, + * UseChildProductGroups?: bool|null, + * ProductCode?: string|null, + * Barcode?: string|null, + * Barcodes?: array, + * DebtorId?: int|null, + * WebshopUserId?: int|null, + * WebshopPriceListId?: int|null, + * UseDropShipmentAmountsForWebshopPrices?: bool|null, + * ProductIds?: array, + * ProductFilterListChoice?: mixed, + * ProductHistoryBasedOnInvoices?: bool|null, + * WebshopUserOrderlistProductType?: int|null, + * ActiveOffers?: bool|null, + * OfferGroupId?: int|null, + * FastSearchText?: string|null, + * GetHighestShiftPrice?: bool|null, + * CountryIdForSellPrice?: int|null, + * BranchIdForSellPrice?: int|null, + * LoadExternalStockActiveSupplier?: bool|null, + * SkipRecords?: int|null, + * TakeRecords?: int|null, + * FromId?: int|null, + * LoadProductGroups?: bool|null, + * LoadExtraBarcodes?: bool, + * OnlyShowParentProducts?: bool|null, + * GlobalisationId?: int|null, + * WebsiteDomainId?: int|null, + * WareHouseId?: int|null, + * UseECommerceProductGroups?: bool, + * UseECommerceProductGroupsToLoadProductGroups?: bool, + * LoadStockForWarehouses?: bool, + * LoadAllWebshopGroupsLinkedToProduct?: bool, + * LoadProductTypes?: bool, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductsIds(array $parameters = []): array + { + return $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductsIds', ['json' => $parameters]), + ); + } + + /** + * @param array{ + * ProductIds?: array, + * Skip?: int|null, + * Take?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductVariantBalkChildren(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductVariantBalkChildrenGroup::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetProductVariantBalkChildren', ['json' => $parameters]), + ), + ); + } + + /** + * Haal gerelateerde artikelen op. + * + * @param array{ + * ProductIds?: array, + * RelatedProductIds?: array, + * RelatedTypeId?: int|null, + * Skip?: int|null, + * Take?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getRelatedProducts(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductWithRelatedProductsV3::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetRelatedProducts', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle productstatussen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getStatuses(): array + { + return array_map( + static fn (array $data) => ProductStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Products/GetStatuses'), + ), + ); + } + + /** + * Verkrijg alle leveranciers van één product. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getSuppliersForProduct(int $value): array + { + return array_map( + static fn (array $data) => ProductSupplier::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetSuppliersForProduct', ['json' => $value]), + ), + ); + } + + /** + * Verkrijg alle leveranciers van één of meerdere producten op basis van ProductId's (max. 1000). Of gebruik 'TakeRecords' (max. 10.000). + * Vanaf v1.2 worden velden met de waarde null niet teruggegeven. + * + * @param array{ + * ProductIds?: array, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getSuppliersForProducts(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductSupplier::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetSuppliersForProducts', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle eenheden. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getUnits(): array + { + return array_map( + static fn (array $data) => ProductUnit::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Products/GetUnits'), + ), + ); + } + + /** + * Haal artikel variantbalk categorie gegevens op, waaronder de mogelijke waarden en vertalingen. + * + * @param array{ + * VariantBalkCategoryIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getVariantbalkCategories(array $parameters = []): array + { + return array_map( + static fn (array $data) => VariantBalkCategory::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetVariantbalkCategories', ['json' => $parameters]), + ), + ); + } + + /** + * Haal artikel variantbalk gegevens op, waaronder de mogelijke waarden, vertalingen en de categorieën. + * Voor nieuwe vertalingen kan het maximaal 10 minuten duren voordat deze terugkomen in de resultaten. + * + * @param array{ + * VariantBalkIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getVariantbalks(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductVariantBalk::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetVariantbalks', ['json' => $parameters]), + ), + ); + } + + /** + * Het ophalen van gekoppelde webshops per product, max. 1000 producten per request. + * + * @param array{ + * ProductIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebsiteDomainsForProducts(array $parameters = []): array + { + return array_map( + static fn (array $data) => WebsiteDomainsForProduct::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Products/GetWebsiteDomainsForProducts', ['json' => $parameters]), + ), + ); + } + + /** + * Verwijder een leverancier voor een artikel. + * Geeft een productId terug als resultaat indien het verwijderen goed is verlopen. + * + * @param array{ + * SupplierId?: int, + * ProductId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function removeProductSupplier(array $parameters = []): void + { + $this->getClient()->delete('/v3/Products/RemoveProductSupplier', ['json' => $parameters]); + } + + /** + * Maak een leverancier voor een artikel actief. + * Geeft een productId terug als resultaat indien het opslaan goed is verlopen. + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * SupplierId?: int, + * ProductId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function setActiveProductSupplier(array $parameters = []): void + { + $this->getClient()->post('/v3/Products/SetActiveProductSupplier', ['json' => $parameters]); + } + + /** + * Updaten van een product. + * Geeft een productId terug als resultaat indien het opslaan goed is verlopen. + * + * @param array{ + * ProductId?: int, + * ProductDescription1?: string|null, + * ProductDescription2?: string|null, + * ProductGroup2?: int|null, + * ProductGroup3?: int|null, + * ProductGroup4?: int|null, + * UnitId?: int|null, + * Barcode1?: string|null, + * Barcode2?: string|null, + * VendorCode?: string|null, + * StatusId?: int|null, + * VisibleOnWebshopFrom?: string|null, + * ExpirationDateOnWebshop?: string|null, + * WarrantyMonths?: int|null, + * SortId?: int|null, + * InternalNote?: string|null, + * ProductInfo?: string|null, + * Tags?: string|null, + * USPDescription?: string|null, + * MetaDescription?: string|null, + * SellPriceAdviceEx?: number|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * FreeValue4?: string|null, + * FreeValue5?: string|null, + * WeightSingleProduct?: number|null, + * HeightSingleProduct?: number|null, + * WidthSingleProduct?: number|null, + * DepthSingleProduct?: number|null, + * WeightInsidePackage?: number|null, + * HeightInsidePackage?: number|null, + * WidthInsidePackage?: number|null, + * DepthInsidePackage?: number|null, + * WeightOutsidePackage?: number|null, + * HeightOutsidePackage?: number|null, + * WidthOutsidePackage?: number|null, + * DepthOutsidePackage?: number|null, + * MinStockCount?: int|null, + * MaxStockCount?: int|null, + * TemplateId?: int|null, + * HidePricesOnWebsite?: bool, + * ShowOfferButtonOnWebsite?: bool, + * HideStartingPricesOnWebsite?: bool, + * OfferStartDate?: string|null, + * OfferEndDate?: string|null, + * OfferFromPrice?: number|null, + * OfferToPrice?: number|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProduct(array $parameters = []): void + { + $this->getClient()->patch('/v3/Products/UpdateProduct', ['json' => $parameters]); + } + + /** + * Voeg een barcode toe aan een artikel + * Geeft een productId terug als resultaat indien het opslaan goed is verlopen. + * + * @param array{ + * ProductId?: int, + * TypeId?: int|null, + * Barcode?: string|null, + * Quantity?: int, + * UnitId?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductAddExtraBarcode(array $parameters = []): void + { + $this->getClient()->post('/v3/Products/UpdateProductAddExtraBarcode', ['json' => $parameters]); + } + + /** + * Update een afbeelding van het artikel + * - Maximale grootte van het bericht is 5MB + * - Return waarde is een AfbeeldingId als de opdracht is geslaagd. + * + * @param array{ + * ImageBase64String?: string|null, + * ProductId?: int, + * ImageName?: string|null, + * ImageId?: int, + * SortId?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductImage(array $parameters = []): void + { + $this->getClient()->put('/v3/Products/UpdateProductImage', ['json' => $parameters]); + } + + /** + * Updaten van de artikel hoofdgroep en merk. + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * ProductGroup1Id?: int, + * BrandId?: int, + * ProductId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductMainGroupAndBrand(array $parameters = []): void + { + $this->getClient()->patch('/v3/Products/UpdateProductMainGroupAndBrand', ['json' => $parameters]); + } + + /** + * Updaten van de artikel staffel prijzen. + * Geeft een productId terug als resultaat indien het opslaan goed is verlopen. + * Niet aangeleverde staffels zullen automatisch worden verwijderd. + * Voor deze aanroep zijn extra rechten vereist. + * + * @param array{ + * ProductPrices?: array, + * ProductId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductPrices(array $parameters = []): void + { + $this->getClient()->post('/v3/Products/UpdateProductPrices', ['json' => $parameters]); + } + + /** + * Verwijder een barcode van een artikel + * Geeft een productId terug als resultaat indien het opslaan goed is verlopen. + * + * @param array{ + * ProductId?: int, + * Barcode?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductRemoveExtraBarcode(array $parameters = []): void + { + $this->getClient()->post('/v3/Products/UpdateProductRemoveExtraBarcode', ['json' => $parameters]); + } + + /** + * Verander de SEO informatie voor een product op basis van taal en webshopdomein. + * Een SEO informatie record wordt op basis van een combinatie van ProductId, GlobalizationId en WebsiteDomainId geselecteerd. + * WebsiteDomainId mag null zijn, dan geldt de gegeven SEO informatie voor alle webhopdomeinen. + *
    + * Als een record niet bestaat wordt deze aangemaakt. Lege records worden automatisch verwijderd. + * Niet-lege records moeten ten minste een Title of Description hebben. + *
    + * Bij het meegeven van een lege string of 'null' voor informatievelden, wordt bestaande informatie leeg gehaald. + * Velden die niet in de request staan worden niet gewijzigd. + *
    + * Als een product geen SEO informatie heeft voor een bepaalde taal en webshopdomein vindt er een fallback plaats op de basisinformatie van het artikel. + * + * @param array{ + * WebsiteDomainId?: int|null, + * GlobalizationId?: int, + * ProductId?: int, + * Title?: string|null, + * Description?: string|null, + * USP?: string|null, + * MetaName?: string|null, + * MetaDescription?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductSEOInformation(array $parameters = []): void + { + $this->getClient()->patch('/v3/Products/UpdateProductSEOInformation', ['json' => $parameters]); + } + + /** + * Updaten van de artikel leverancier. + * Geeft een productId terug als resultaat indien het opslaan goed is verlopen. + * + * @param array{ + * Supplier_ProductCode?: string|null, + * ProductName?: string|null, + * ProductCountIncrement?: int|null, + * ShippingTime?: int|null, + * MinOrderQuantity?: int|null, + * RepackagingQty?: int|null, + * RepackagingUnitId?: int|null, + * InternalNote?: string|null, + * SupplierId?: int, + * ProductId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductSupplier(array $parameters = []): void + { + $this->getClient()->post('/v3/Products/UpdateProductSupplier', ['json' => $parameters]); + } + + /** + * Update de prijzen van de leverancier. Geeft een productId terug als resultaat. + * + * @param array{ + * ProductId?: int, + * SupplierId?: int, + * ProductPrices?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateProductSupplierProductPrice(array $parameters = []): void + { + $this->getClient()->post('/v3/Products/UpdateProductSupplierProductPrice', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/ProductTemplateRequest.php b/src/Requests/V30/ProductTemplateRequest.php new file mode 100644 index 0000000..f36c491 --- /dev/null +++ b/src/Requests/V30/ProductTemplateRequest.php @@ -0,0 +1,117 @@ + + * + * @throws Logic4ApiException + */ + public function getProductTemplateProperties(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductTemplateProperty::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/ProductTemplates/GetProductTemplateProperties', ['json' => $parameters]), + ), + ); + } + + /** + * Haal meerdere artikel templates op. + * + * @param array{ + * TemplateId?: int|null, + * TemplatePropertyId?: int|null, + * Skip?: int|null, + * Take?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductTemplates(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductTemplate::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/ProductTemplates/GetProductTemplates', ['json' => $parameters]), + ), + ); + } + + /** + * @param array{ + * ProductIds?: array, + * VisibleOnWebsite?: bool|null, + * Skip?: int|null, + * Take?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductTemplateValuesPerProducts(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductTemplateProductValue::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/ProductTemplates/GetProductTemplateValuesPerProducts', ['json' => $parameters]), + ), + ); + } + + /** + * @param array{ + * ProductIds?: array, + * VisibleOnWebsite?: bool|null, + * Skip?: int|null, + * Take?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getProductTemplateValuesWithTranslations( + array $parameters = [], + ): ProductTemplatesWithTranslation { + return ProductTemplatesWithTranslation::make( + $this->buildResponse( + $this->getClient()->post('/v3/ProductTemplates/GetProductTemplateValuesWithTranslations', ['json' => $parameters]), + ) + ); + } + + /** + * @param array{ + * TemplatePropertyId?: int, + * PropertyValuesPerProduct?: array}>, + * } $parameters + * + * @throws Logic4ApiException + */ + public function setProductTemplatePropertyValues(array $parameters = []): void + { + $this->getClient()->post('/v3/ProductTemplates/SetProductTemplatePropertyValues', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/RelationsRequest.php b/src/Requests/V30/RelationsRequest.php new file mode 100644 index 0000000..797afc5 --- /dev/null +++ b/src/Requests/V30/RelationsRequest.php @@ -0,0 +1,805 @@ +buildResponse( + $this->getClient()->post('/v3/Relations/AddCreditorDiscount', ['json' => $parameters]), + ); + } + + /** + * Debiteur toevoegen. Mogelijke fouten (status en type): + * - 400 `tag:api.logic4.nl:2025-08-16:InvalidRequest` + * - Algemene validatiefout. + * - 400 `tag:api.logic4.nl:2026-02-03:InvalidVatFormat` + * - Het BTW-nummer heeft een ongeldig formaat en de VIES BTW-nummer validatieservice is niet aangeroepen. + * - 400 `tag:api.logic4.nl:2026-02-03:InvalidVatNumber` + * - De VIES BTW-nummer validatieservice geeft 'ongeldig BTW-nummer'. + * - 424 `tag:api.logic4.nl:2026-02-03:ViesNotAvailable` + * - De VIES BTW-nummer validatieservice is niet bereikbaar. + * + * @param array{ + * Id?: int|null, + * ValidateVat?: bool, + * IsoCode?: string|null, + * CountryCode?: string|null, + * CountryId?: int, + * CompanyName?: string|null, + * FirstName?: string|null, + * LastName?: string|null, + * EmailAddress?: string|null, + * LoginName?: string|null, + * PaymentMethodId?: int|null, + * PricelistIds?: array, + * TelephoneNumber?: string|null, + * MobileNumber?: string|null, + * Faxnumber?: string|null, + * ChamberOfCommerceCode?: string|null, + * Website?: string|null, + * Discount?: number|null, + * StandardReportIdForPickingList?: int|null, + * StandardReportIdForSalesOrderDelivery?: int|null, + * City?: string|null, + * Zipcode?: string|null, + * Street?: string|null, + * HouseNumber?: string|null, + * HouseNumberAddition?: string|null, + * VatNumber?: string|null, + * DontPrintPaperInvoiceForDebtor?: bool, + * ReceiveInvoiceElectronically?: bool, + * ElectronicInvoiceAttachmentType?: int|null, + * StandardInvoiceLayoutReportId?: int|null, + * Preposition?: string|null, + * CreditLimit?: number|null, + * ShippingMethodId?: int|null, + * GlobalisationId?: int|null, + * VatCodeId?: int|null, + * StatusId?: int|null, + * RepresentativeId?: int|null, + * RelationTypeId?: int|null, + * GenderId?: int|null, + * StandardPackagingSlipLayoutReportId?: int|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addCustomer(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Relations/AddCustomer', ['json' => $parameters]), + ); + } + + /** + * Adres toevoegen of updaten. + * + * @param array{ + * Type?: array{Id?: int, Name?: string|null}, + * Province?: array{Id?: int, Name?: string|null}, + * Email?: string|null, + * ContactName?: string|null, + * CompanyName?: string|null, + * Address1?: string|null, + * Address2?: string|null, + * Id?: int|null, + * DebtorId?: int|null, + * CreditorId?: int|null, + * IsMainContact?: bool, + * IsHidden?: bool|null, + * OwnContactNumber?: string|null, + * CountryCode?: string|null, + * IsoCode?: string|null, + * City?: string|null, + * Zipcode?: string|null, + * Street?: string|null, + * HouseNumber?: string|null, + * HouseNumberAddition?: string|null, + * TelephoneNumber?: string|null, + * CountryId?: int, + * ZoneId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addUpdateAddress(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Relations/AddUpdateAddress', ['json' => $parameters]), + ); + } + + /** + * Contactpersoon toevoegen of updaten. + * + * @param array{ + * EmailAddress?: string|null, + * FirstName?: string|null, + * Function?: string|null, + * Gender?: array{Id?: int, Name?: string|null}, + * Initials?: string|null, + * InsertionName?: string|null, + * LastName?: string|null, + * MobileNumber?: string|null, + * CreatedDateTime?: string|null, + * ChangedDateTime?: string|null, + * Id?: int|null, + * DebtorId?: int|null, + * CreditorId?: int|null, + * IsMainContact?: bool, + * IsHidden?: bool|null, + * OwnContactNumber?: string|null, + * CountryCode?: string|null, + * IsoCode?: string|null, + * City?: string|null, + * Zipcode?: string|null, + * Street?: string|null, + * HouseNumber?: string|null, + * HouseNumberAddition?: string|null, + * TelephoneNumber?: string|null, + * CountryId?: int, + * ZoneId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addUpdateContact(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Relations/AddUpdateContact', ['json' => $parameters]), + ); + } + + /** + * Crediteur externe identifier toevoegen of updaten. + * + * @param array{ + * CreditorId?: int, + * TypeId?: int, + * Value?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addUpdateCreditorThirdPartyExternalIdentifier(array $parameters = []): void + { + $this->getClient()->post('/v3/Relations/AddUpdateCreditorThirdPartyExternalIdentifier', ['json' => $parameters]); + } + + /** + * Debiteur externe identifier toevoegen of updaten. + * + * @param array{ + * DebtorId?: int, + * TypeId?: int, + * Value?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addUpdateCustomerThirdPartyExternalIdentifier(array $parameters = []): void + { + $this->getClient()->post('/v3/Relations/AddUpdateCustomerThirdPartyExternalIdentifier', ['json' => $parameters]); + } + + /** + * Voeg één of meer websitedomein Id's toe aan een debiteur. Geeft aantal toegevoegde Id's terug. + * + * @param array{ + * DebtorId?: int, + * WebsiteDomainIds?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addWebsiteDomains(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Relations/AddWebsiteDomains', ['json' => $parameters]), + ); + } + + /** + * Verwijder een crediteur derde partij externe identifier. + * + * @param array{ + * CreditorId?: int|null, + * TypeId?: int|null, + * Value?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function deleteCreditorThirdPartyExternalIdentifier(array $parameters = []): void + { + $this->getClient()->post('/v3/Relations/DeleteCreditorThirdPartyExternalIdentifier', ['json' => $parameters]); + } + + /** + * Verwijder een debiteur derde partij externe identifier. + * + * @param array{ + * DebtorId?: int|null, + * TypeId?: int|null, + * Value?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function deleteCustomerThirdPartyExternalIdentifier(array $parameters = []): void + { + $this->getClient()->post('/v3/Relations/DeleteCustomerThirdPartyExternalIdentifier', ['json' => $parameters]); + } + + /** + * Verwijder één of meer websitedomein Id's van een debiteur. Geeft aantal verwijderde Id's terug. + * + * @param array{ + * DebtorId?: int, + * WebsiteDomainIds?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function deleteWebsiteDomains(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Relations/DeleteWebsiteDomains', ['json' => $parameters]), + ); + } + + /** + * Verkrijg adressen o.b.v. het meegestuurde filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ChangedAfter?: string|null, + * Id?: int|null, + * AddressTypeId?: int|null, + * PhoneNumber?: string|null, + * DebtorId?: int|null, + * CreditorId?: int|null, + * ExcludeHiddenContacts?: bool, + * OwnContactNumber?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getAddresses(array $parameters = []): array + { + return array_map( + static fn (array $data) => CustomerAddress::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetAddresses', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle adrestypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getAddressTypes(): array + { + return array_map( + static fn (array $data) => AddressType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetAddressTypes'), + ), + ); + } + + /** + * Verkrijg contacten o.b.v. het meegestuurde filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ChangedAfter?: string|null, + * Id?: int|null, + * AddressTypeId?: int|null, + * PhoneNumber?: string|null, + * DebtorId?: int|null, + * CreditorId?: int|null, + * ExcludeHiddenContacts?: bool, + * OwnContactNumber?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getContacts(array $parameters = []): array + { + return array_map( + static fn (array $data) => CustomerContact::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetContacts', ['json' => $parameters]), + ), + ); + } + + /** + * Haal kenmerken met bijbehorende vertegenwoordiger op voor contacten. + * + * @param array{ + * ContactIds?: array, + * DebtorId?: int|null, + * ContactType?: mixed, + * LastCharacteristicChangeDateTime?: string|null, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getContactsCharacteristics(array $parameters = []): array + { + return array_map( + static fn (array $data) => ContactCharacteristic::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetContactsCharacteristics', ['json' => $parameters]), + ), + ); + } + + /** + * Contact types ophalen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getContactTypes(): array + { + return array_map( + static fn (array $data) => ContactType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetContactTypes'), + ), + ); + } + + /** + * Crediteur discounts ophalen (maximaal 1000). + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * Ids?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCreditorDiscounts(array $parameters = []): array + { + return array_map( + static fn (array $data) => CreditorDiscount::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetCreditorDiscounts', ['json' => $parameters]), + ), + ); + } + + /** + * Crediteur discount types ophalen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCreditorDiscountTypes(): array + { + return array_map( + static fn (array $data) => CreditorDiscountType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetCreditorDiscountTypes'), + ), + ); + } + + /** + * Verkrijg crediteuren o.b.v. het meegestuurde filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ChangedAfter?: string|null, + * LoginName?: string|null, + * Id?: int|null, + * PhoneNumber?: string|null, + * WebsiteDomainId?: int|null, + * EmailAddress?: string|null, + * EmailAddressIsExact?: bool, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCreditors(array $parameters = []): array + { + return array_map( + static fn (array $data) => Creditor::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetCreditors', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg crediteur externe identifiers o.b.v. het meegestuurde filter. + * + * @param array{ + * CreditorId?: int|null, + * TypeId?: int|null, + * Value?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCreditorThirdPartyExternalIdentifiers(array $parameters = []): array + { + return array_map( + static fn (array $data) => CreditorThirdPartyExternalIdentifer::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetCreditorThirdPartyExternalIdentifiers', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg debiteuren o.b.v. het meegestuurde filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ChangedAfter?: string|null, + * LoginName?: string|null, + * Id?: int|null, + * PhoneNumber?: string|null, + * WebsiteDomainId?: int|null, + * EmailAddress?: string|null, + * EmailAddressIsExact?: bool, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCustomers(array $parameters = []): array + { + return array_map( + static fn (array $data) => Customer::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetCustomers', ['json' => $parameters]), + ), + ); + } + + /** + * Haal kenmerken met bijbehorende vertegenwoordiger op voor debiteuren. + * + * @param array{ + * DebtorIds?: array, + * LastCharacteristicChangeDateTime?: string|null, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCustomersCharacteristics(array $parameters = []): array + { + return array_map( + static fn (array $data) => DebtorCharacteristic::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetCustomersCharacteristics', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg debiteur externe identifiers o.b.v. het meegestuurde filter. + * + * @param array{ + * DebtorId?: int|null, + * TypeId?: int|null, + * Value?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getCustomerThirdPartyExternalIdentifiers(array $parameters = []): array + { + return array_map( + static fn (array $data) => CustomerThirdPartyExternalIdentifer::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetCustomerThirdPartyExternalIdentifiers', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle geslachttypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getGenders(): array + { + return array_map( + static fn (array $data) => Gender::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetGenders'), + ), + ); + } + + /** + * Verkrijg alle relatiestatussen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getRelationStatuses(): array + { + return array_map( + static fn (array $data) => RelationStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetRelationStatuses'), + ), + ); + } + + /** + * Verkrijg alle relatietypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getRelationTypes(): array + { + return array_map( + static fn (array $data) => RelationType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetRelationTypes'), + ), + ); + } + + /** + * Verkrijg alle vertegenwoordigers. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getRepresentatives(array $parameters = []): array + { + return array_map( + static fn (array $data) => Representative::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetRepresentatives', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle typen tweede relatiecontacten. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getSecondContactGroupTypes(): array + { + return array_map( + static fn (array $data) => SecondTypeContactGroup::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetSecondContactGroupTypes'), + ), + ); + } + + /** + * Verkrijg alle externe identifiertypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getThirdPartyExternalIdentfierTypes(): array + { + return array_map( + static fn (array $data) => ThirdPartyExternalIdentifierType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetThirdPartyExternalIdentfierTypes'), + ), + ); + } + + /** + * Verkrijg alle relatiegroepen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getTypeContactGroups(): array + { + return array_map( + static fn (array $data) => TypeContactGroup::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Relations/GetTypeContactGroups'), + ), + ); + } + + /** + * Verkrijg websitedomein Id's van een debiteur o.b.v. het meegestuurde filter. + * + * @param array{ + * DebtorId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getWebsiteDomains( + array $parameters = [], + ): DebtorWebsiteDomainsList { + return DebtorWebsiteDomainsList::make( + $this->buildResponse( + $this->getClient()->post('/v3/Relations/GetWebsiteDomains', ['json' => $parameters]), + ) + ); + } + + /** + * Crediteur discount updaten. Retourneert true indien succesvol. + * + * @param array{ + * Id?: int, + * TypeId?: int, + * CreditorId?: int, + * BrandId?: int, + * DateFrom?: string|null, + * DateTo?: string|null, + * Percentage?: number|null, + * Amount?: number|null, + * Remarks?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateCreditorDiscount(array $parameters = []): void + { + $this->getClient()->post('/v3/Relations/UpdateCreditorDiscount', ['json' => $parameters]); + } + + /** + * Waarden van een bestaande debiteur updaten. + * + * @param array{ + * Id?: int, + * IsoCode?: string|null, + * CountryCode?: string|null, + * CountryId?: int, + * CompanyName?: string|null, + * FirstName?: string|null, + * LastName?: string|null, + * EmailAddress?: string|null, + * LoginName?: string|null, + * PaymentMethodId?: int|null, + * PricelistIds?: array, + * TelephoneNumber?: string|null, + * MobileNumber?: string|null, + * Faxnumber?: string|null, + * ChamberOfCommerceCode?: string|null, + * Website?: string|null, + * Discount?: number|null, + * StandardReportIdForPickingList?: int|null, + * StandardReportIdForSalesOrderDelivery?: int|null, + * City?: string|null, + * Zipcode?: string|null, + * Street?: string|null, + * HouseNumber?: string|null, + * HouseNumberAddition?: string|null, + * VatNumber?: string|null, + * DontPrintPaperInvoiceForDebtor?: bool, + * ReceiveInvoiceElectronically?: bool, + * ElectronicInvoiceAttachmentType?: int|null, + * StandardInvoiceLayoutReportId?: int|null, + * Preposition?: string|null, + * CreditLimit?: number|null, + * ShippingMethodId?: int|null, + * GlobalisationId?: int|null, + * VatCodeId?: int|null, + * StatusId?: int|null, + * RepresentativeId?: int|null, + * RelationTypeId?: int|null, + * GenderId?: int|null, + * StandardPackagingSlipLayoutReportId?: int|null, + * FreeValue1?: string|null, + * FreeValue2?: string|null, + * FreeValue3?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateCustomer(array $parameters = []): void + { + $this->getClient()->patch('/v3/Relations/UpdateCustomer', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/RoundRequest.php b/src/Requests/V30/RoundRequest.php new file mode 100644 index 0000000..4264505 --- /dev/null +++ b/src/Requests/V30/RoundRequest.php @@ -0,0 +1,237 @@ +buildResponse( + $this->getClient()->post('/v3/Round/AddRound', ['json' => $parameters]), + ); + } + + /** + * Een rit bestaat uit regels die gekoppeld zijn aan verkooporders of aan ITS opdrachten. + * Hiermee kan je één regel toevoegen aan een rit. + * Het voertuig bepaalt of je Orders, of ITS of beide mag toevoegen. + * + * @param array{ + * OrderId?: int|null, + * ITSIssueId?: int|null, + * RoundId?: int, + * Remarks?: string|null, + * StatusId?: int, + * Sorting?: int, + * EstimatedArrivalDateTime?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addRoundOrder(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Round/AddRoundOrder', ['json' => $parameters]), + ); + } + + /** + * Verwijder een rit. De response geeft 'true' terug als de actie is geslaagd. + * + * @throws Logic4ApiException + */ + public function deleteRound(int $roundId): void + { + $this->getClient()->delete('/v3/Round/DeleteRound', ['query' => ['roundId' => $roundId]]); + } + + /** + * Verwijder één rit regel. Hierbij wordt ook de status historie van deze regel verwijderd. + * + * @throws Logic4ApiException + */ + public function deleteRoundOrder(int $roundOrderId): void + { + $this->getClient()->delete('/v3/Round/DeleteRoundOrder', ['query' => ['roundOrderId' => $roundOrderId]]); + } + + /** + * Haal rit regels op voor een bepaalde rit. Het is verplicht om een rit Id op te geven. + * Het maximaal aantal regels dat wordt teruggegeven is 1000. + * Om meer regels op te halen dien je gebruik te maken van de skip/take filtering. + * + * @param array{ + * SkipRecords?: int|null, + * TakeRecords?: int|null, + * RoundId?: int, + * StatusId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getRoundOrders(array $parameters = []): array + { + return array_map( + static fn (array $data) => GetRoundOrder::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Round/GetRoundOrders', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg een collectie van statussen die gebruikt worden voor orders in ritten. + * Bijv. "Wacht op goedkeuring". + * + * @return array + * + * @throws Logic4ApiException + */ + public function getRoundOrderStatuses(): array + { + return array_map( + static fn (array $data) => TypeRoundOrderStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Round/GetRoundOrderStatuses'), + ), + ); + } + + /** + * Verkrijg een collectie van ritten (maximaal 1000 records). + * + * @param array{ + * SkipRecords?: int|null, + * TakeRecords?: int|null, + * DateTimeCreatedFrom?: string|null, + * DateTimeCreatedTo?: string|null, + * TypeId?: int|null, + * StatusId?: int|null, + * VehicleId?: int|null, + * ItsIds?: array, + * OrderIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getRounds(array $parameters = []): array + { + return array_map( + static fn (array $data) => GetRound::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Round/GetRounds', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg een collectie van statussen die gebruikt worden voor ritten. + * Bijv. "80% gevuld". + * + * @return array + * + * @throws Logic4ApiException + */ + public function getRoundStatuses(): array + { + return array_map( + static fn (array $data) => TypeRoundStatus::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Round/GetRoundStatuses'), + ), + ); + } + + /** + * Verkrijg een collectie van voertuigen die ingezet kunnen worden bij ritten. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getVehicles(): array + { + return array_map( + static fn (array $data) => Vehicle::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Round/GetVehicles'), + ), + ); + } + + /** + * Update gegevens van een rit. + * Wanneer de operatie succesvol is zal het response "True" zijn. + * Let op, je moet het gehele object vullen. Lege waardes worden ook overgenomen. + * + * @param array{ + * Id?: int, + * TypeId?: int, + * Description?: string|null, + * Memo?: string|null, + * DateTimePlanned?: string|null, + * VehicleId?: int|null, + * DriverId?: int|null, + * CoDriverId?: int|null, + * StatusId?: int, + * HideInSystem?: bool, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateRound(array $parameters = []): void + { + $this->getClient()->post('/v3/Round/UpdateRound', ['json' => $parameters]); + } + + /** + * Update de gegevens van een rit regel. + * Wanneer de operatie succesvol is zal het response "True" zijn. + * Let op, je moet het gehele object vullen. Lege waardes worden ook overgenomen. + * + * @param array{ + * Id?: int, + * Remarks?: string|null, + * StatusId?: int, + * Sorting?: int, + * EstimatedArrivalDateTime?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateRoundOrder(array $parameters = []): void + { + $this->getClient()->post('/v3/Round/UpdateRoundOrder', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/ShipmentRequest.php b/src/Requests/V30/ShipmentRequest.php new file mode 100644 index 0000000..c4778cf --- /dev/null +++ b/src/Requests/V30/ShipmentRequest.php @@ -0,0 +1,81 @@ +buildResponse( + $this->getClient()->post('/v3/Shipments/AddShipmentForDelivery', ['json' => $parameters]), + ); + } + + /** + * Verzending toevoegen aan een order of factuur. De nieuw aangemaakte verzending wordt teruggegeven als response. + * + * @param array{ + * DateTimeAdded?: string|null, + * SendEmail?: bool|null, + * OrderId?: int, + * ShipperId?: int, + * Barcode?: string|null, + * TrackTraceUrl?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function addShipmentForInvoiceOrOrder(array $parameters = []): int + { + return $this->buildResponse( + $this->getClient()->post('/v3/Shipments/AddShipmentForInvoiceOrOrder', ['json' => $parameters]), + ); + } + + /** + * Verzending verwijderen voor een order of factuur, specificeer met het ID van de verzending. De verzending moet bestaan. + * + * @throws Logic4ApiException + */ + public function deleteShipmentForInvoiceOrOrder(int $id): void + { + $this->getClient()->delete('/v3/Shipments/DeleteShipmentForInvoiceOrOrder', ['query' => ['id' => $id]]); + } + + /** + * Verzendingen van een order of factuur ophalen voor het opgestuurde nummer. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getShipmentsForInvoiceOrOrder(int $value): array + { + return array_map( + static fn (array $data) => OrderShipment::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Shipments/GetShipmentsForInvoiceOrOrder', ['json' => $value]), + ), + ); + } +} diff --git a/src/Requests/V30/ShipperRequest.php b/src/Requests/V30/ShipperRequest.php new file mode 100644 index 0000000..2bed991 --- /dev/null +++ b/src/Requests/V30/ShipperRequest.php @@ -0,0 +1,71 @@ + + * + * @throws Logic4ApiException + */ + public function getDeliveryOptions(array $parameters = []): array + { + return array_map( + static fn (array $data) => DeliveryOption::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Shippers/GetDeliveryOptions', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle verzendmethode types. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getShipperTypes(): array + { + return array_map( + static fn (array $data) => ShipperType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Shippers/GetShipperTypes'), + ), + ); + } + + /** + * Verkrijg alle verzendmethodes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getShippingMethods(): array + { + return array_map( + static fn (array $data) => ShippingMethod::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Shippers/GetShippingMethods'), + ), + ); + } +} diff --git a/src/Requests/V30/StockRequest.php b/src/Requests/V30/StockRequest.php new file mode 100644 index 0000000..f58eedf --- /dev/null +++ b/src/Requests/V30/StockRequest.php @@ -0,0 +1,538 @@ + + * + * @throws Logic4ApiException + */ + public function createProductStockMutation(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockMutationTypeV11::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/CreateProductStockMutation', ['json' => $parameters]), + ), + ); + } + + /** + * Verplaats artikelen van een normale voorraadlocatie naar de reserveerlocatie. + * Alleen wanneer in een magazijn een reserveerlocatie is gedefinieerd kunnen tot maximaal 100 mutaties worden uitgevoerd. + * + * @param array $parameters + * + * @throws Logic4ApiException + */ + public function createProductStockMutationToReservationLocation(array $parameters = []): void + { + $this->getClient()->post('/v3/Stock/CreateProductStockMutationToReservationLocation', ['json' => $parameters]); + } + + /** + * Ophalen van externe voorraadstanden voor actieve leveranciers. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * ProductStockFrom?: int|null, + * DateTimeLastUpdateSince?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getExternalStockForActiveSuppliers(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockSuppliers::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetExternalStockForActiveSuppliers', ['json' => $parameters]), + ), + ); + } + + /** + * Ophalen van externe voorraadstanden voor actieve en niet-actieve leveranciers. + * + * @param array{ + * SupplierId?: int|null, + * Active?: bool|null, + * ProductIds?: array, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getExternalStockForSuppliers(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockSupplierWithActive::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetExternalStockForSuppliers', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg minimale voorraad aantallen voor meerdere artikelen. + * + * @param array $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getMinimalStockNumbersForProducts(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductMinimalStockNumber::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetMinimalStockNumbersForProducts', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de eerstvolgende leverdata van alle actieve leveranciers, vanaf een specifieke datum. + * + * @param array{ + * NextDeliveryDate?: string, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getNextDeliveriesDatesForActiveSuppliers(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductSupplierNextDelivery::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetNextDeliveriesDatesForActiveSuppliers', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de huidige voorraadlocaties van het product op basis van het filter. + * + * @param array{ + * ProductsWithWarehouse?: array, + * ShowNegativeLocations?: bool, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductStockLocationsWithName(array $parameters = []): array + { + return array_map( + static fn (array $data) => StockLocationForProduct::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetProductStockLocationsWithName', ['json' => $parameters]), + ), + ); + } + + /** + * Haal voorraadmutaties op. Maximaal 10.000 records per keer kunnen worden opgehaald. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * PickbonIds?: array, + * DateFrom?: string|null, + * DateTo?: string|null, + * BuyOrderId?: int|null, + * StocklocationId?: int|null, + * ITSIssueId?: int|null, + * ProductCode?: string|null, + * WareHouseId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductStockMutations(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockMutation::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetProductStockMutations', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg voorraadmutatie types. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductStockMutationTypes(): array + { + return array_map( + static fn (array $data) => ProductStockMutationTypeV11::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Stock/GetProductStockMutationTypes'), + ), + ); + } + + /** + * Haal voor alle magazijnen van een of meer producten de minimale voorraadgrens, maximale voorraadgrens, + * notitie en standaard picklocatie op. + * + * @param array{ + * ProductIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductStockWarehouseWithDefaultPickLocation(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockWarehouseWithDefaultPickLocation::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetProductStockWarehouseWithDefaultPickLocation', ['json' => $parameters]), + ), + ); + } + + /** + * Haal een voorraadcontrole op aan de hand van een Id. + * + * @throws Logic4ApiException + */ + public function getStockControlHead(int $value): ProductStockControlHead + { + return ProductStockControlHead::make( + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetStockControlHead', ['json' => $value]), + ) + ); + } + + /** + * Voorraadcontrole heads ophalen op basis van het ProductStockControlHeadFilter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * StockLocationId?: int|null, + * UserId?: int|null, + * CreatedDateFrom?: string|null, + * CreatedDateTo?: string|null, + * IsProcessed?: bool|null, + * ProductStockControlHeadId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getStockControlHeads(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockControlHead::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetStockControlHeads', ['json' => $parameters]), + ), + ); + } + + /** + * Ophalen van voorraadstanden voor specifieke magazijnen. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * WareHouseId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getStockForWarehouses(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStock::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetStockForWarehouses', ['json' => $parameters]), + ), + ); + } + + /** + * Haal actuele voorraad op voor een artikel. + * + * @param array{ + * ProductCode?: string|null, + * ProductIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getStockInformationForProduct(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockInformationV2::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetStockInformationForProduct', ['json' => $parameters]), + ), + ); + } + + /** + * Haal voorraadlocaties op van een product. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getStockLocationsForProduct(int $value): array + { + return array_map( + static fn (array $data) => ProductStockLocations::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetStockLocationsForProduct', ['json' => $value]), + ), + ); + } + + /** + * Haal voorraadlocaties op van meerdere producten. + * + * @param array{ + * ProductIds?: array, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getStockLocationsForProducts(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockLocations::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetStockLocationsForProducts', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de producten die op de locatie aanwezig zouden moeten zijn. + * + * @param array{ + * LocationId?: int, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getStockProductsForStockLocation(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductStockControlRow::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetStockProductsForStockLocation', ['json' => $parameters]), + ), + ); + } + + /** + * Haal alle magazijnen op voor een administratie. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWarehousesForAdministration(int $value): array + { + return array_map( + static fn (array $data) => WareHouse::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetWarehousesForAdministration', ['json' => $value]), + ), + ); + } + + /** + * Haal alle locaties op die bij een administratie behoren. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWarehousesStockLocationsForAdministration(int $value): array + { + return array_map( + static fn (array $data) => WarehouseStockLocation::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Stock/GetWarehousesStockLocationsForAdministration', ['json' => $value]), + ), + ); + } + + /** + * Maak een voorraadverplaatsing aan. + * Return True wanneer gelukt, anders foutmelding. + * + * @param array{ + * Items?: array, + * FromStockLocationId?: int|null, + * FromWarehouseId?: int|null, + * ToStockLocationId?: int, + * Notes?: string|null, + * Name?: string|null, + * DatabaseAdministrationId?: int, + * } $parameters + * + * @throws Logic4ApiException + */ + public function postCreateStockMovement(array $parameters = []): void + { + $this->getClient()->post('/v3/Stock/PostCreateStockMovement', ['json' => $parameters]); + } + + /** + * Wijzig externe voorraadstand van een leverancier. + * + * @param array{ + * SupplierProductCode?: string|null, + * ProductId?: int|null, + * ProductCode?: string|null, + * SupplierId?: int|null, + * Quantity?: int|null, + * ProductNextDelivery?: string|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function setExternalStockForSupplier(array $parameters = []): void + { + $this->getClient()->post('/v3/Stock/SetExternalStockForSupplier', ['json' => $parameters]); + } + + /** + * Voeg eerstvolgende leverdata van leveranciers toe voor één of meer artikelen (max 100 per request). + * + * @param array $parameters + * + * @throws Logic4ApiException + */ + public function setNextDeliveriesDatesForActiveSuppliers(array $parameters = []): void + { + $this->getClient()->post('/v3/Stock/SetNextDeliveriesDatesForActiveSuppliers', ['json' => $parameters]); + } + + /** + * Verander de standaard picklocatie van artikelen naar een andere voorraad locatie. + * + * @param array $parameters + * + * @throws Logic4ApiException + */ + public function updateDefaultPickLocations(array $parameters = []): void + { + $this->getClient()->post('/v3/Stock/UpdateDefaultPickLocations', ['json' => $parameters]); + } + + /** + * Voeg een nieuwe voorraadcontrole toe of update de meegegeven head met de bijbehorende rijen als het Id van _head is meegegeven. + * + * @param array{ + * CreatedDate?: string, + * Id?: int|null, + * LocationName?: string|null, + * LocationId?: int, + * ProcessDate?: string|null, + * Username?: string|null, + * UserId?: int|null, + * Rows?: array}>, + * EventLog?: string|null, + * WarehouseStockControlEmailTemplateId?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateOrCreateStockControlHeads( + array $parameters = [], + ): ProductStockControlHead { + return ProductStockControlHead::make( + $this->buildResponse( + $this->getClient()->post('/v3/Stock/UpdateOrCreateStockControlHeads', ['json' => $parameters]), + ) + ); + } +} diff --git a/src/Requests/V30/TypeRequest.php b/src/Requests/V30/TypeRequest.php new file mode 100644 index 0000000..a65e329 --- /dev/null +++ b/src/Requests/V30/TypeRequest.php @@ -0,0 +1,110 @@ + + * + * @throws Logic4ApiException + */ + public function getCountries(array $parameters = []): array + { + return array_map( + static fn (array $data) => Country::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Types/GetCountries', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg alle globalisaties (talen). + * + * @return array + * + * @throws Logic4ApiException + */ + public function getGlobalizationTypes(): array + { + return array_map( + static fn (array $data) => GlobalizationType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Types/GetGlobalizationTypes'), + ), + ); + } + + /** + * Verkrijg alle operating system types. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getOperatingSystemTypes(): array + { + return array_map( + static fn (array $data) => OperatingSystemType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Types/GetOperatingSystemTypes'), + ), + ); + } + + /** + * Verkrijg alle product-relatietypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProductRelationTypes(): array + { + return array_map( + static fn (array $data) => ProductRelationType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Types/GetProductRelationTypes'), + ), + ); + } + + /** + * Verkrijg alle provincies o.b.v. het opgestuurde filter. + * + * @param array{ + * CountryId?: int|null, + * ISOcode?: string|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getProvinces(array $parameters = []): array + { + return array_map( + static fn (array $data) => Province::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Types/GetProvinces', ['json' => $parameters]), + ), + ); + } +} diff --git a/src/Requests/V30/UserRequest.php b/src/Requests/V30/UserRequest.php new file mode 100644 index 0000000..a87dc4f --- /dev/null +++ b/src/Requests/V30/UserRequest.php @@ -0,0 +1,51 @@ + + * + * @throws Logic4ApiException + */ + public function getAllUsers(): array + { + return array_map( + static fn (array $data) => ApiUser::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/User/GetAllUsers'), + ), + ); + } + + /** + * Notitie van de meegestuurde gebruiker. + * + * @throws Logic4ApiException + */ + public function getNotice(): string + { + return $this->buildResponse( + $this->getClient()->get('/v3/User/GetNotice'), + ); + } + + /** + * Update de notitie van gebruiker. + * + * @throws Logic4ApiException + */ + public function updateNotice(mixed $value): void + { + $this->getClient()->post('/v3/User/UpdateNotice', ['json' => $value]); + } +} diff --git a/src/Requests/V30/WebshopRequest.php b/src/Requests/V30/WebshopRequest.php new file mode 100644 index 0000000..d6e64d0 --- /dev/null +++ b/src/Requests/V30/WebshopRequest.php @@ -0,0 +1,370 @@ +buildResponse( + $this->getClient()->post('/v3/Webshop/AddWebshopUserProductToWebshopUserProductList', ['json' => $parameters]), + ); + } + + /** + * Verwijder een WebshopUserProduct op een WebshopUserProductlijst. + * + * @throws Logic4ApiException + */ + public function deleteWebshopUserProductOnWebshopUserProductList(int $value): void + { + $this->getClient()->post('/v3/Webshop/DeleteWebshopUserProductOnWebshopUserProductList', ['json' => $value]); + } + + /** + * Wanneer het type "LastViewed" is geselecteerd, houd er dan rekening mee dat alleen de laatste 8 bekeken artikelen worden opgeslagen. + * Wanneer een samengesteld artikel tot de collectie behoort, wordt alleen dit moederartikel in de aangegeven hoeveelheid getoond; + * de aantallen kindartikelen zijn altijd in verhouding tot 1 moederartikel. + * + * @param array{ + * WebshopUserProductListType?: mixed, + * WebsiteDomainId?: int|null, + * DebtorId?: int|null, + * FromCreatedDateTime?: string|null, + * FromLastModifiedDateTime?: string|null, + * SkipRecords?: int, + * TakeRecords?: int, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getVisitorBehaviorForDebtor(array $parameters = []): array + { + return array_map( + static fn (array $data) => WebshopVisitorBehaviour::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetVisitorBehaviorForDebtor', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de betaalmethodes van een WebshopUser. + * + * @param array{ + * DebtorId?: int, + * ShippingMethodId?: int, + * ShowOnlySelectedPaymentMethodDebtor?: bool|null, + * TotalPrice?: number, + * ShowOnlyAfterPayments?: bool|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebshopCheckOutPaymentMethods(array $parameters = []): array + { + return array_map( + static fn (array $data) => PaymentMethod::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopCheckOutPaymentMethods', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de aflevermethodes van een WebshopUser. + * + * @param array{ + * IsPureInclShop?: bool, + * TotalPriceIncl?: number|null, + * DebtorId?: int, + * CountryId?: int, + * PostalCode?: string|null, + * Weight?: number, + * TotalPrice?: number, + * Volume?: number, + * ShowOnlySelectedShippingMethodDebtor?: bool|null, + * ShowOnlyShippingMethodsWithPaymentCondition?: bool|null, + * ShowOnlyShippingMethodsWithPaymentConditionWithAfterPayments?: bool|null, + * AddEmptyPackageWeightToWeight?: bool|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebshopCheckOutShippingMethods(array $parameters = []): array + { + return array_map( + static fn (array $data) => ShippingMethod::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopCheckOutShippingMethods', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg productprijzen o.b.v. webshopprijslijst/debiteur. + * + * @param array{ + * DebtorId?: int, + * WebshopPriceListId?: int|null, + * ProductId?: int, + * MinSaleAmount?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebshopProductShiftPrices(array $parameters = []): array + { + return array_map( + static fn (array $data) => ProductShiftPrice::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopProductShiftPrices', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg zoekresultaten van een webshop o.b.v. meegestuurde filter. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * SearchTerm?: string|null, + * DateFrom?: string|null, + * DateTo?: string|null, + * GlobilizationId?: int|null, + * DomainId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebshopSearchWords(array $parameters = []): array + { + return array_map( + static fn (array $data) => WebshopSearchWord::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopSearchWords', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg webshopgebruiker o.b.v. webshopgebruikersnummer of debiteurnummer. + * + * @param array{ + * DebtorId?: int|null, + * WebshopUserId?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getWebshopUser(array $parameters = []): WebshopUser + { + return WebshopUser::make( + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopUser', ['json' => $parameters]), + ) + ); + } + + /** + * Verkrijg het nog te besteden bedrag voor een webshopgebruiker van een jaarbudget. + * + * @param array{ + * WebshopUserId?: int, + * IgnoreOrderstatusIds?: array, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getWebshopUserAvailableBudget(array $parameters = []): float + { + return $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopUserAvailableBudget', ['json' => $parameters]), + ); + } + + /** + * Verkrijg webshopgebruiker o.b.v. meegestuurde credentials. + * + * @param array{ + * UserName?: string|null, + * Password?: string|null, + * WebsiteDomainId?: int|null, + * IgnorePasswordCheck?: bool, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getWebshopUserByLogin(array $parameters = []): WebshopUser + { + return WebshopUser::make( + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopUserByLogin', ['json' => $parameters]), + ) + ); + } + + /** + * Verkrijg een bestellijst o.b.v. webshopgebruikersnummer of debiteurnummer voor de producttypes zie eindpunt /Webshop/GetWebshopUserOrderlistProductTypes. + * + * @param array{ + * SkipRecords?: int, + * TakeRecords?: int, + * WebshopUserProductListType?: int|null, + * DebtorId?: int|null, + * WebshopUserId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebshopUserOrderlist(array $parameters = []): array + { + return array_map( + static fn (array $data) => WebshopOrderlistProduct::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopUserOrderlist', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de bestellijstproducttypes. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebshopUserOrderlistProductTypes(): array + { + return array_map( + static fn (array $data) => WebshopUserProductType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Webshop/GetWebshopUserOrderlistProductTypes'), + ), + ); + } + + /** + * Verkrijg een WebshopUserProductlijst (Zie eindpunt /Webshop/GetWebshopUserProductListTypes voor de types) o.b.v. webshopgebruikersnummer of debiteurnummer. + * + * @param array{ + * VisitorCode?: string|null, + * WebshopUserProductListType?: mixed, + * WebshopPricelistId?: int|null, + * GetHighestShiftPrice?: bool|null, + * CountryIdForSellPrice?: int|null, + * BranchIdForSellPrice?: int|null, + * WebsiteDomainId?: int|null, + * DebtorWebshopProductTypeId?: int|null, + * DebtorId?: int|null, + * WebshopUserId?: int|null, + * } $parameters + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebshopUserProductList(array $parameters = []): array + { + return array_map( + static fn (array $data) => WebshopUserProductOfProductV12::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/Webshop/GetWebshopUserProductList', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg de type WebshopUserProductlijsten. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebshopUserProductListTypes(): array + { + return array_map( + static fn (array $data) => WebshopUserProductType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Webshop/GetWebshopUserProductListTypes'), + ), + ); + } + + /** + * Type webshopgebruikers. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebShopUserTypes(): array + { + return array_map( + static fn (array $data) => WebshopUserType::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/Webshop/GetWebShopUserTypes'), + ), + ); + } + + /** + * Update het aantal van een WebshopUserProduct op een WebshopUserProductlijst. + * + * @param array{ + * WebshopUserProductId?: int, + * Qty?: int|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function updateQtyWebshopUserProduct(array $parameters = []): void + { + $this->getClient()->put('/v3/Webshop/UpdateQtyWebshopUserProduct', ['json' => $parameters]); + } +} diff --git a/src/Requests/V30/WebsiteDomainRequest.php b/src/Requests/V30/WebsiteDomainRequest.php new file mode 100644 index 0000000..a2be7ef --- /dev/null +++ b/src/Requests/V30/WebsiteDomainRequest.php @@ -0,0 +1,76 @@ + + * + * @throws Logic4ApiException + */ + public function getAliases(array $parameters = []): array + { + return array_map( + static fn (array $data) => WebsiteAlias::make($data), + $this->buildResponse( + $this->getClient()->post('/v3/WebsiteDomains/GetAliases', ['json' => $parameters]), + ), + ); + } + + /** + * Verkrijg een websitedomein o.b.v. het meegestuurde filter. + * + * @param array{ + * Url?: string|null, + * IsStandardDomain?: bool|null, + * } $parameters + * + * @throws Logic4ApiException + */ + public function getWebSiteDomain(array $parameters = []): WebsiteDomain + { + return WebsiteDomain::make( + $this->buildResponse( + $this->getClient()->post('/v3/WebsiteDomains/GetWebSiteDomain', ['json' => $parameters]), + ) + ); + } + + /** + * Verkrijg alle websitedomeinen. + * + * @return array + * + * @throws Logic4ApiException + */ + public function getWebSiteDomains(): array + { + return array_map( + static fn (array $data) => WebsiteDomain::make($data), + $this->buildResponse( + $this->getClient()->get('/v3/WebsiteDomains/GetWebSiteDomains'), + ), + ); + } +} diff --git a/src/Responses/V30/AddressType.php b/src/Responses/V30/AddressType.php new file mode 100644 index 0000000..e754a0d --- /dev/null +++ b/src/Responses/V30/AddressType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Administration.php b/src/Responses/V30/Administration.php new file mode 100644 index 0000000..7ccadcf --- /dev/null +++ b/src/Responses/V30/Administration.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Agenda.php b/src/Responses/V30/Agenda.php new file mode 100644 index 0000000..6e3b883 --- /dev/null +++ b/src/Responses/V30/Agenda.php @@ -0,0 +1,33 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + visible: $data['Visible'] ?? false, + sortId: $data['SortId'] ?? 0, + syncWithGoogle: $data['SyncWithGoogle'] ?? false, + googleUsername: $data['GoogleUsername'] ?? null, + googleLastSyncDateTime: isset($data['GoogleLastSyncDateTime']) ? \Carbon\Carbon::parse($data['GoogleLastSyncDateTime']) : null, + ); + } +} diff --git a/src/Responses/V30/ApiUser.php b/src/Responses/V30/ApiUser.php new file mode 100644 index 0000000..06d2457 --- /dev/null +++ b/src/Responses/V30/ApiUser.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + fullName: $data['FullName'] ?? null, + userId: $data['UserId'] ?? 0, + username: $data['Username'] ?? null, + employeeNumber: $data['EmployeeNumber'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Appointment.php b/src/Responses/V30/Appointment.php new file mode 100644 index 0000000..fea1365 --- /dev/null +++ b/src/Responses/V30/Appointment.php @@ -0,0 +1,51 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + debtorId: $data['DebtorId'] ?? null, + creditorId: $data['CreditorId'] ?? null, + contactId: $data['ContactId'] ?? null, + startDateTime: isset($data['StartDateTime']) ? \Carbon\Carbon::parse($data['StartDateTime']) : null, + endDateTime: isset($data['EndDateTime']) ? \Carbon\Carbon::parse($data['EndDateTime']) : null, + allDayEvent: $data['AllDayEvent'] ?? false, + location: $data['Location'] ?? null, + agendaId: $data['AgendaId'] ?? 0, + taskForUserId: $data['TaskForUserId'] ?? null, + ITSIssueId: $data['ITS_IssueId'] ?? null, + orderId: $data['OrderId'] ?? null, + CRMProjectId: $data['CRM_ProjectId'] ?? null, + plannedDeliveryId: $data['PlannedDeliveryId'] ?? null, + subject: $data['Subject'] ?? null, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/AssemblyAction.php b/src/Responses/V30/AssemblyAction.php new file mode 100644 index 0000000..71e45db --- /dev/null +++ b/src/Responses/V30/AssemblyAction.php @@ -0,0 +1,39 @@ + $data */ + public static function make(array $data): self + { + return new self( + dateTime: isset($data['DateTime']) ? \Carbon\Carbon::parse($data['DateTime']) : null, + orderId: $data['OrderId'] ?? null, + orderRowId: $data['OrderRowId'] ?? null, + userId: $data['UserId'] ?? 0, + productCode: $data['ProductCode'] ?? null, + amount: $data['Amount'] ?? null, + stockLocationId: $data['StockLocationId'] ?? null, + description: $data['Description'] ?? null, + typeId: $data['TypeId'] ?? 0, + typeDescription: $data['TypeDescription'] ?? null, + ); + } +} diff --git a/src/Responses/V30/BasicProductData.php b/src/Responses/V30/BasicProductData.php new file mode 100644 index 0000000..f752be0 --- /dev/null +++ b/src/Responses/V30/BasicProductData.php @@ -0,0 +1,37 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + vendorCode: $data['VendorCode'] ?? null, + productCode: $data['ProductCode'] ?? null, + description1: $data['Description1'] ?? null, + description2: $data['Description2'] ?? null, + pictureName: $data['PictureName'] ?? null, + domain: $data['Domain'] ?? null, + defaultPickStockLocationId: $data['DefaultPickStockLocationId'] ?? null, + statusName: $data['StatusName'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Branch.php b/src/Responses/V30/Branch.php new file mode 100644 index 0000000..fd8cc9f --- /dev/null +++ b/src/Responses/V30/Branch.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Brand.php b/src/Responses/V30/Brand.php new file mode 100644 index 0000000..0aa2e47 --- /dev/null +++ b/src/Responses/V30/Brand.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + visibleOnWebsite: $data['VisibleOnWebsite'] ?? false, + ); + } +} diff --git a/src/Responses/V30/BundleDiscount.php b/src/Responses/V30/BundleDiscount.php new file mode 100644 index 0000000..0df2561 --- /dev/null +++ b/src/Responses/V30/BundleDiscount.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + productCount: $data['ProductCount'] ?? 0, + discountPercent: $data['DiscountPercent'] ?? 0.0, + ); + } +} diff --git a/src/Responses/V30/BundleGroupForChild.php b/src/Responses/V30/BundleGroupForChild.php new file mode 100644 index 0000000..87b9f7e --- /dev/null +++ b/src/Responses/V30/BundleGroupForChild.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + bundleGroupId: $data['BundleGroupId'] ?? 0, + parentProductId: $data['ParentProductId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/BundleGroupsForParent.php b/src/Responses/V30/BundleGroupsForParent.php new file mode 100644 index 0000000..fc1b5b4 --- /dev/null +++ b/src/Responses/V30/BundleGroupsForParent.php @@ -0,0 +1,24 @@ + $bundleGroups */ + public function __construct( + public int $parentProductId, + public ?array $bundleGroups, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + parentProductId: $data['ParentProductId'] ?? 0, + bundleGroups: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\BundleGroup::make($item), $data['BundleGroups'] ?? []), + ); + } +} diff --git a/src/Responses/V30/BuyOrderBaseInfo.php b/src/Responses/V30/BuyOrderBaseInfo.php new file mode 100644 index 0000000..4ed3249 --- /dev/null +++ b/src/Responses/V30/BuyOrderBaseInfo.php @@ -0,0 +1,45 @@ + $data */ + public static function make(array $data): self + { + return new self( + amountOfRows: $data['AmountOfRows'] ?? 0, + branchId: $data['BranchId'] ?? null, + buyOrderClosed: $data['BuyOrderClosed'] ?? false, + createdAt: isset($data['CreatedAt']) ? \Carbon\Carbon::parse($data['CreatedAt']) : null, + creditorCompanyName: $data['CreditorCompanyName'] ?? null, + creditorId: $data['CreditorId'] ?? 0, + databaseAdministrationId: $data['DatabaseAdministrationId'] ?? 0, + id: $data['Id'] ?? 0, + orderId: $data['OrderId'] ?? null, + remarks: $data['Remarks'] ?? null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + freeValue3: $data['FreeValue3'] ?? null, + ); + } +} diff --git a/src/Responses/V30/BuyOrderDeliveryAndOrderMovement.php b/src/Responses/V30/BuyOrderDeliveryAndOrderMovement.php new file mode 100644 index 0000000..2163cc0 --- /dev/null +++ b/src/Responses/V30/BuyOrderDeliveryAndOrderMovement.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + buyOrderDeliveryId: $data['BuyOrderDeliveryId'] ?? 0, + orderMovementId: $data['OrderMovementId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/BuyOrderDeliveryRead.php b/src/Responses/V30/BuyOrderDeliveryRead.php new file mode 100644 index 0000000..de46b25 --- /dev/null +++ b/src/Responses/V30/BuyOrderDeliveryRead.php @@ -0,0 +1,44 @@ + $rows */ + public function __construct( + public int $buyOrderDeliveryId, + public ?\Carbon\Carbon $dateTimeCreated, + public ?\Carbon\Carbon $dateTimeProcessed, + public int $statusId, + public int $typeId, + public ?int $supplierId, + public ?int $buyOrderId, + public ?string $remarks, + public ?string $description, + public ?int $branchId, + public ?array $rows, + public ?string $pickingListNumber, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + buyOrderDeliveryId: $data['BuyOrderDeliveryId'] ?? 0, + dateTimeCreated: isset($data['DateTimeCreated']) ? \Carbon\Carbon::parse($data['DateTimeCreated']) : null, + dateTimeProcessed: isset($data['DateTimeProcessed']) ? \Carbon\Carbon::parse($data['DateTimeProcessed']) : null, + statusId: $data['StatusId'] ?? 0, + typeId: $data['TypeId'] ?? 0, + supplierId: $data['SupplierId'] ?? null, + buyOrderId: $data['BuyOrderId'] ?? null, + remarks: $data['Remarks'] ?? null, + description: $data['Description'] ?? null, + branchId: $data['BranchId'] ?? null, + rows: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\BuyOrderDeliveryRowRead::make($item), $data['Rows'] ?? []), + pickingListNumber: $data['PickingListNumber'] ?? null, + ); + } +} diff --git a/src/Responses/V30/BuyOrderDeliveryStatusValue.php b/src/Responses/V30/BuyOrderDeliveryStatusValue.php new file mode 100644 index 0000000..d05f999 --- /dev/null +++ b/src/Responses/V30/BuyOrderDeliveryStatusValue.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/BuyOrderDeliveryTypeValue.php b/src/Responses/V30/BuyOrderDeliveryTypeValue.php new file mode 100644 index 0000000..4ea7747 --- /dev/null +++ b/src/Responses/V30/BuyOrderDeliveryTypeValue.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/BuyOrderGetInfo.php b/src/Responses/V30/BuyOrderGetInfo.php new file mode 100644 index 0000000..54ec843 --- /dev/null +++ b/src/Responses/V30/BuyOrderGetInfo.php @@ -0,0 +1,47 @@ + $data */ + public static function make(array $data): self + { + return new self( + lastChangedAt: isset($data['LastChangedAt']) ? \Carbon\Carbon::parse($data['LastChangedAt']) : null, + amountOfRows: $data['AmountOfRows'] ?? 0, + branchId: $data['BranchId'] ?? null, + buyOrderClosed: $data['BuyOrderClosed'] ?? false, + createdAt: isset($data['CreatedAt']) ? \Carbon\Carbon::parse($data['CreatedAt']) : null, + creditorCompanyName: $data['CreditorCompanyName'] ?? null, + creditorId: $data['CreditorId'] ?? 0, + databaseAdministrationId: $data['DatabaseAdministrationId'] ?? 0, + id: $data['Id'] ?? 0, + orderId: $data['OrderId'] ?? null, + remarks: $data['Remarks'] ?? null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + freeValue3: $data['FreeValue3'] ?? null, + ); + } +} diff --git a/src/Responses/V30/BuyOrderRow.php b/src/Responses/V30/BuyOrderRow.php new file mode 100644 index 0000000..a02d289 --- /dev/null +++ b/src/Responses/V30/BuyOrderRow.php @@ -0,0 +1,59 @@ + $data */ + public static function make(array $data): self + { + return new self( + buyOrderRowId: $data['BuyOrderRowId'] ?? 0, + buyOrderId: $data['BuyOrderId'] ?? 0, + debtorName: $data['DebtorName'] ?? null, + qtyToDeliver: $data['QtyToDeliver'] ?? 0.0, + creditorProductCode: $data['CreditorProductCode'] ?? null, + productDesc1: $data['ProductDesc1'] ?? null, + standardAmountQTY: $data['StandardAmountQTY'] ?? null, + standardAmountQTYUnitId: $data['StandardAmountQTYUnitId'] ?? null, + repackingQty: $data['RepackingQty'] ?? null, + orderId: $data['OrderId'] ?? null, + productCode: $data['ProductCode'] ?? null, + productId: $data['ProductId'] ?? null, + price: $data['Price'] ?? 0.0, + description: $data['Description'] ?? null, + productDesc2: $data['ProductDesc2'] ?? null, + expectedDeliveryDate: isset($data['ExpectedDeliveryDate']) ? \Carbon\Carbon::parse($data['ExpectedDeliveryDate']) : null, + qtyToOrder: $data['QtyToOrder'] ?? 0.0, + orderedOnDateByDistributor: isset($data['OrderedOnDateByDistributor']) ? \Carbon\Carbon::parse($data['OrderedOnDateByDistributor']) : null, + orderRowId: $data['OrderRowId'] ?? null, + internalNote: $data['InternalNote'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CRMActivity.php b/src/Responses/V30/CRMActivity.php new file mode 100644 index 0000000..0e68ccb --- /dev/null +++ b/src/Responses/V30/CRMActivity.php @@ -0,0 +1,53 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['id'] ?? 0, + name: $data['Name'] ?? null, + createdOnDateTime: isset($data['CreatedOnDateTime']) ? \Carbon\Carbon::parse($data['CreatedOnDateTime']) : null, + dateTimeStart: isset($data['DateTimeStart']) ? \Carbon\Carbon::parse($data['DateTimeStart']) : null, + dateTimeEnd: isset($data['DateTimeEnd']) ? \Carbon\Carbon::parse($data['DateTimeEnd']) : null, + createdByUserId: $data['CreatedByUserId'] ?? 0, + notes: $data['Notes'] ?? null, + status: isset($data['Status']) ? \Webparking\Logic4Client\Data\V30\CRMActivityStatus::make($data['Status']) : null, + type: isset($data['Type']) ? \Webparking\Logic4Client\Data\V30\CRMActivityType::make($data['Type']) : null, + completedOnDateTime: isset($data['CompletedOnDateTime']) ? \Carbon\Carbon::parse($data['CompletedOnDateTime']) : null, + CRMProjectId: $data['CRMProjectId'] ?? 0, + CRMProjectName: $data['CRMProjectName'] ?? null, + debtorContactId: $data['DebtorContactId'] ?? null, + debtorContactFullName: $data['DebtorContactFullName'] ?? null, + debtorId: $data['DebtorId'] ?? null, + carriedOutByUserId: $data['CarriedOutByUserId'] ?? null, + carriedOutByUserName: $data['CarriedOutByUserName'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CRMActivityStatus.php b/src/Responses/V30/CRMActivityStatus.php new file mode 100644 index 0000000..fe35b0d --- /dev/null +++ b/src/Responses/V30/CRMActivityStatus.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + sorting: $data['Sorting'] ?? 0, + isCompleted: $data['IsCompleted'] ?? false, + ); + } +} diff --git a/src/Responses/V30/CRMActivityType.php b/src/Responses/V30/CRMActivityType.php new file mode 100644 index 0000000..5e9235e --- /dev/null +++ b/src/Responses/V30/CRMActivityType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CRMProject.php b/src/Responses/V30/CRMProject.php new file mode 100644 index 0000000..af3f87a --- /dev/null +++ b/src/Responses/V30/CRMProject.php @@ -0,0 +1,43 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['id'] ?? 0, + name: $data['Name'] ?? null, + createdOnDateTime: isset($data['CreatedOnDateTime']) ? \Carbon\Carbon::parse($data['CreatedOnDateTime']) : null, + dateTimeStart: isset($data['DateTimeStart']) ? \Carbon\Carbon::parse($data['DateTimeStart']) : null, + dateTimeEnd: isset($data['DateTimeEnd']) ? \Carbon\Carbon::parse($data['DateTimeEnd']) : null, + createdByUserId: $data['CreatedByUserId'] ?? 0, + shortDescription: $data['ShortDescription'] ?? null, + status: isset($data['Status']) ? \Webparking\Logic4Client\Data\V30\CRMProjectStatus::make($data['Status']) : null, + type: isset($data['Type']) ? \Webparking\Logic4Client\Data\V30\CRMProjectType::make($data['Type']) : null, + responsibleByUserId: $data['ResponsibleByUserId'] ?? null, + responsibleByUserName: $data['ResponsibleByUserName'] ?? null, + projectValue: $data['ProjectValue'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CRMProjectStatus.php b/src/Responses/V30/CRMProjectStatus.php new file mode 100644 index 0000000..42482c1 --- /dev/null +++ b/src/Responses/V30/CRMProjectStatus.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + sorting: $data['Sorting'] ?? 0, + isCompleted: $data['IsCompleted'] ?? false, + ); + } +} diff --git a/src/Responses/V30/CRMProjectType.php b/src/Responses/V30/CRMProjectType.php new file mode 100644 index 0000000..4a1b49e --- /dev/null +++ b/src/Responses/V30/CRMProjectType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CompanyInformation.php b/src/Responses/V30/CompanyInformation.php new file mode 100644 index 0000000..31b3af7 --- /dev/null +++ b/src/Responses/V30/CompanyInformation.php @@ -0,0 +1,43 @@ + $data */ + public static function make(array $data): self + { + return new self( + name: $data['Name'] ?? null, + address: $data['Address'] ?? null, + houseNumber: $data['HouseNumber'] ?? null, + zipcode: $data['Zipcode'] ?? null, + city: $data['City'] ?? null, + province: $data['Province'] ?? null, + country: $data['Country'] ?? null, + email: $data['Email'] ?? null, + telephone: $data['Telephone'] ?? null, + vatnumber: $data['Vatnumber'] ?? null, + kvknumber: $data['Kvknumber'] ?? null, + bankaccount: $data['Bankaccount'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CompanyValues.php b/src/Responses/V30/CompanyValues.php new file mode 100644 index 0000000..4cf96d9 --- /dev/null +++ b/src/Responses/V30/CompanyValues.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + useMultipleAdministrations: $data['UseMultipleAdministrations'] ?? false, + isMultiChannel: $data['IsMultiChannel'] ?? false, + branchSpecificInventoryAndBuyorderSystem: $data['BranchSpecificInventoryAndBuyorderSystem'] ?? false, + ); + } +} diff --git a/src/Responses/V30/ContactCharacteristic.php b/src/Responses/V30/ContactCharacteristic.php new file mode 100644 index 0000000..7825c78 --- /dev/null +++ b/src/Responses/V30/ContactCharacteristic.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + contactId: $data['ContactId'] ?? 0, + debtorId: $data['DebtorId'] ?? null, + contactType: isset($data['ContactType']) ? \Webparking\Logic4Client\Data\V30\ContactTypeEnum::make($data['ContactType']) : null, + relationCharacteristic: $data['RelationCharacteristic'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ContactType.php b/src/Responses/V30/ContactType.php new file mode 100644 index 0000000..522a508 --- /dev/null +++ b/src/Responses/V30/ContactType.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Country.php b/src/Responses/V30/Country.php new file mode 100644 index 0000000..023d154 --- /dev/null +++ b/src/Responses/V30/Country.php @@ -0,0 +1,28 @@ + $names */ + public function __construct( + public int $id, + public int $zoneId, + public ?array $names, + public ?string $isoCode, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + zoneId: $data['ZoneId'] ?? 0, + names: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\Translation::make($item), $data['Names'] ?? []), + isoCode: $data['IsoCode'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Creditor.php b/src/Responses/V30/Creditor.php new file mode 100644 index 0000000..7b867c9 --- /dev/null +++ b/src/Responses/V30/Creditor.php @@ -0,0 +1,61 @@ + $data */ + public static function make(array $data): self + { + return new self( + address1: $data['Address1'] ?? null, + address2: $data['Address2'] ?? null, + address3: $data['Address3'] ?? null, + city: $data['City'] ?? null, + companyName: $data['CompanyName'] ?? null, + countryId: $data['CountryId'] ?? 0, + emailAddress: $data['EmailAddress'] ?? null, + faxnumber: $data['Faxnumber'] ?? null, + firstName: $data['FirstName'] ?? null, + id: $data['Id'] ?? 0, + kvkNumber: $data['KvkNumber'] ?? null, + lastName: $data['LastName'] ?? null, + mobileNumber: $data['MobileNumber'] ?? null, + notes: $data['Notes'] ?? null, + paymentCondition: isset($data['PaymentCondition']) ? \Webparking\Logic4Client\Data\V30\PaymentConditionDto::make($data['PaymentCondition']) : null, + postalCode: $data['PostalCode'] ?? null, + provinceId: $data['ProvinceId'] ?? null, + supplierGLN: $data['SupplierGLN'] ?? null, + creditorType: isset($data['CreditorType']) ? \Webparking\Logic4Client\Data\V30\CreditorTypeDto::make($data['CreditorType']) : null, + telephoneNumber: $data['TelephoneNumber'] ?? null, + vatNumber: $data['VatNumber'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CreditorDiscount.php b/src/Responses/V30/CreditorDiscount.php new file mode 100644 index 0000000..a40b911 --- /dev/null +++ b/src/Responses/V30/CreditorDiscount.php @@ -0,0 +1,37 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + typeId: $data['TypeId'] ?? 0, + creditorId: $data['CreditorId'] ?? 0, + brandId: $data['BrandId'] ?? 0, + dateFrom: isset($data['DateFrom']) ? \Carbon\Carbon::parse($data['DateFrom']) : null, + dateTo: isset($data['DateTo']) ? \Carbon\Carbon::parse($data['DateTo']) : null, + percentage: $data['Percentage'] ?? null, + amount: $data['Amount'] ?? null, + remarks: $data['Remarks'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CreditorDiscountType.php b/src/Responses/V30/CreditorDiscountType.php new file mode 100644 index 0000000..2b9043a --- /dev/null +++ b/src/Responses/V30/CreditorDiscountType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CreditorThirdPartyExternalIdentifer.php b/src/Responses/V30/CreditorThirdPartyExternalIdentifer.php new file mode 100644 index 0000000..03413c3 --- /dev/null +++ b/src/Responses/V30/CreditorThirdPartyExternalIdentifer.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + creditorId: $data['CreditorId'] ?? 0, + typeId: $data['TypeId'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Customer.php b/src/Responses/V30/Customer.php new file mode 100644 index 0000000..68e1458 --- /dev/null +++ b/src/Responses/V30/Customer.php @@ -0,0 +1,118 @@ + $pricelistIds */ + public function __construct( + public int $id, + public ?int $relationGroupId, + public ?int $relationGroup2Id, + public bool $hide, + public ?\Webparking\Logic4Client\Data\V30\VatCode $vatCode, + public ?\Webparking\Logic4Client\Data\V30\Representative $representative, + public ?\Webparking\Logic4Client\Data\V30\RelationType $type, + public ?\Webparking\Logic4Client\Data\V30\Gender $gender, + public ?\Webparking\Logic4Client\Data\V30\RelationStatus $status, + public ?string $invoiceEmail, + public ?string $paymentReminderEmail, + public ?string $firstClickGclIdValues, + public ?string $firstClickUtmValues, + public ?string $isoCode, + public ?string $countryCode, + public int $countryId, + public ?string $companyName, + public ?string $firstName, + public ?string $lastName, + public ?string $emailAddress, + public ?string $loginName, + public ?int $paymentMethodId, + public ?array $pricelistIds, + public ?string $telephoneNumber, + public ?string $mobileNumber, + public ?string $faxnumber, + public ?string $chamberOfCommerceCode, + public ?string $website, + public ?float $discount, + public ?int $standardReportIdForPickingList, + public ?int $standardReportIdForSalesOrderDelivery, + public ?string $city, + public ?string $zipcode, + public ?string $street, + public ?string $houseNumber, + public ?string $houseNumberAddition, + public ?string $vatNumber, + public bool $dontPrintPaperInvoiceForDebtor, + public bool $receiveInvoiceElectronically, + public ?int $electronicInvoiceAttachmentType, + public ?int $standardInvoiceLayoutReportId, + public ?string $preposition, + public ?float $creditLimit, + public ?int $shippingMethodId, + public ?int $globalisationId, + public ?int $standardPackagingSlipLayoutReportId, + public ?string $freeValue1, + public ?string $freeValue2, + public ?string $freeValue3, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + relationGroupId: $data['RelationGroupId'] ?? null, + relationGroup2Id: $data['RelationGroup2Id'] ?? null, + hide: $data['Hide'] ?? false, + vatCode: isset($data['VatCode']) ? \Webparking\Logic4Client\Data\V30\VatCode::make($data['VatCode']) : null, + representative: isset($data['Representative']) ? \Webparking\Logic4Client\Data\V30\Representative::make($data['Representative']) : null, + type: isset($data['Type']) ? \Webparking\Logic4Client\Data\V30\RelationType::make($data['Type']) : null, + gender: isset($data['Gender']) ? \Webparking\Logic4Client\Data\V30\Gender::make($data['Gender']) : null, + status: isset($data['Status']) ? \Webparking\Logic4Client\Data\V30\RelationStatus::make($data['Status']) : null, + invoiceEmail: $data['InvoiceEmail'] ?? null, + paymentReminderEmail: $data['PaymentReminderEmail'] ?? null, + firstClickGclIdValues: $data['FirstClickGclIdValues'] ?? null, + firstClickUtmValues: $data['FirstClickUtmValues'] ?? null, + isoCode: $data['IsoCode'] ?? null, + countryCode: $data['CountryCode'] ?? null, + countryId: $data['CountryId'] ?? 0, + companyName: $data['CompanyName'] ?? null, + firstName: $data['FirstName'] ?? null, + lastName: $data['LastName'] ?? null, + emailAddress: $data['EmailAddress'] ?? null, + loginName: $data['LoginName'] ?? null, + paymentMethodId: $data['PaymentMethodId'] ?? null, + pricelistIds: $data['PricelistIds'] ?? null, + telephoneNumber: $data['TelephoneNumber'] ?? null, + mobileNumber: $data['MobileNumber'] ?? null, + faxnumber: $data['Faxnumber'] ?? null, + chamberOfCommerceCode: $data['ChamberOfCommerceCode'] ?? null, + website: $data['Website'] ?? null, + discount: $data['Discount'] ?? null, + standardReportIdForPickingList: $data['StandardReportIdForPickingList'] ?? null, + standardReportIdForSalesOrderDelivery: $data['StandardReportIdForSalesOrderDelivery'] ?? null, + city: $data['City'] ?? null, + zipcode: $data['Zipcode'] ?? null, + street: $data['Street'] ?? null, + houseNumber: $data['HouseNumber'] ?? null, + houseNumberAddition: $data['HouseNumberAddition'] ?? null, + vatNumber: $data['VatNumber'] ?? null, + dontPrintPaperInvoiceForDebtor: $data['DontPrintPaperInvoiceForDebtor'] ?? false, + receiveInvoiceElectronically: $data['ReceiveInvoiceElectronically'] ?? false, + electronicInvoiceAttachmentType: $data['ElectronicInvoiceAttachmentType'] ?? null, + standardInvoiceLayoutReportId: $data['StandardInvoiceLayoutReportId'] ?? null, + preposition: $data['Preposition'] ?? null, + creditLimit: $data['CreditLimit'] ?? null, + shippingMethodId: $data['ShippingMethodId'] ?? null, + globalisationId: $data['GlobalisationId'] ?? null, + standardPackagingSlipLayoutReportId: $data['StandardPackagingSlipLayoutReportId'] ?? null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + freeValue3: $data['FreeValue3'] ?? null, + ); + } +} diff --git a/src/Responses/V30/CustomerAddress.php b/src/Responses/V30/CustomerAddress.php new file mode 100644 index 0000000..abfe8b0 --- /dev/null +++ b/src/Responses/V30/CustomerAddress.php @@ -0,0 +1,65 @@ + $data */ + public static function make(array $data): self + { + return new self( + type: isset($data['Type']) ? \Webparking\Logic4Client\Data\V30\AddressType::make($data['Type']) : null, + province: isset($data['Province']) ? \Webparking\Logic4Client\Data\V30\Province::make($data['Province']) : null, + email: $data['Email'] ?? null, + contactName: $data['ContactName'] ?? null, + companyName: $data['CompanyName'] ?? null, + address1: $data['Address1'] ?? null, + address2: $data['Address2'] ?? null, + id: $data['Id'] ?? null, + debtorId: $data['DebtorId'] ?? null, + creditorId: $data['CreditorId'] ?? null, + isMainContact: $data['IsMainContact'] ?? false, + isHidden: $data['IsHidden'] ?? null, + ownContactNumber: $data['OwnContactNumber'] ?? null, + countryCode: $data['CountryCode'] ?? null, + isoCode: $data['IsoCode'] ?? null, + city: $data['City'] ?? null, + zipcode: $data['Zipcode'] ?? null, + street: $data['Street'] ?? null, + houseNumber: $data['HouseNumber'] ?? null, + houseNumberAddition: $data['HouseNumberAddition'] ?? null, + telephoneNumber: $data['TelephoneNumber'] ?? null, + countryId: $data['CountryId'] ?? 0, + zoneId: $data['ZoneId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/CustomerContact.php b/src/Responses/V30/CustomerContact.php new file mode 100644 index 0000000..a288491 --- /dev/null +++ b/src/Responses/V30/CustomerContact.php @@ -0,0 +1,71 @@ + $data */ + public static function make(array $data): self + { + return new self( + emailAddress: $data['EmailAddress'] ?? null, + firstName: $data['FirstName'] ?? null, + function: $data['Function'] ?? null, + gender: isset($data['Gender']) ? \Webparking\Logic4Client\Data\V30\Gender::make($data['Gender']) : null, + initials: $data['Initials'] ?? null, + insertionName: $data['InsertionName'] ?? null, + lastName: $data['LastName'] ?? null, + mobileNumber: $data['MobileNumber'] ?? null, + createdDateTime: isset($data['CreatedDateTime']) ? \Carbon\Carbon::parse($data['CreatedDateTime']) : null, + changedDateTime: isset($data['ChangedDateTime']) ? \Carbon\Carbon::parse($data['ChangedDateTime']) : null, + id: $data['Id'] ?? null, + debtorId: $data['DebtorId'] ?? null, + creditorId: $data['CreditorId'] ?? null, + isMainContact: $data['IsMainContact'] ?? false, + isHidden: $data['IsHidden'] ?? null, + ownContactNumber: $data['OwnContactNumber'] ?? null, + countryCode: $data['CountryCode'] ?? null, + isoCode: $data['IsoCode'] ?? null, + city: $data['City'] ?? null, + zipcode: $data['Zipcode'] ?? null, + street: $data['Street'] ?? null, + houseNumber: $data['HouseNumber'] ?? null, + houseNumberAddition: $data['HouseNumberAddition'] ?? null, + telephoneNumber: $data['TelephoneNumber'] ?? null, + countryId: $data['CountryId'] ?? 0, + zoneId: $data['ZoneId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/CustomerThirdPartyExternalIdentifer.php b/src/Responses/V30/CustomerThirdPartyExternalIdentifer.php new file mode 100644 index 0000000..234dfe0 --- /dev/null +++ b/src/Responses/V30/CustomerThirdPartyExternalIdentifer.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + debtorId: $data['DebtorId'] ?? 0, + typeId: $data['TypeId'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/DatabaseConfiguration.php b/src/Responses/V30/DatabaseConfiguration.php new file mode 100644 index 0000000..762bd1c --- /dev/null +++ b/src/Responses/V30/DatabaseConfiguration.php @@ -0,0 +1,21 @@ + $data */ + public static function make(array $data): self + { + return new self( + pickbonExternalStockMovementsIntervalInSeconds: $data['PickbonExternalStockMovementsIntervalInSeconds'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/DebtorCharacteristic.php b/src/Responses/V30/DebtorCharacteristic.php new file mode 100644 index 0000000..23aeaf2 --- /dev/null +++ b/src/Responses/V30/DebtorCharacteristic.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + debtorId: $data['DebtorId'] ?? 0, + relationCharacteristic: $data['RelationCharacteristic'] ?? null, + representative: $data['Representative'] ?? null, + ); + } +} diff --git a/src/Responses/V30/DebtorWebsiteDomainsList.php b/src/Responses/V30/DebtorWebsiteDomainsList.php new file mode 100644 index 0000000..6a2ad09 --- /dev/null +++ b/src/Responses/V30/DebtorWebsiteDomainsList.php @@ -0,0 +1,22 @@ + $debtorWebsiteDomains */ + public function __construct( + public ?array $debtorWebsiteDomains, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + debtorWebsiteDomains: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\DebtorWebsiteDomains::make($item), $data['DebtorWebsiteDomains'] ?? []), + ); + } +} diff --git a/src/Responses/V30/DeliveryOption.php b/src/Responses/V30/DeliveryOption.php new file mode 100644 index 0000000..2435fb6 --- /dev/null +++ b/src/Responses/V30/DeliveryOption.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + code: $data['Code'] ?? null, + isPickupLocation: $data['IsPickupLocation'] ?? false, + shipperTypeId: $data['ShipperTypeId'] ?? 0, + externalTypeValue: $data['ExternalTypeValue'] ?? null, + ); + } +} diff --git a/src/Responses/V30/EmailAddress.php b/src/Responses/V30/EmailAddress.php new file mode 100644 index 0000000..acc9ca2 --- /dev/null +++ b/src/Responses/V30/EmailAddress.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + name: $data['Name'] ?? null, + email: $data['Email'] ?? null, + ); + } +} diff --git a/src/Responses/V30/EmailAttachment.php b/src/Responses/V30/EmailAttachment.php new file mode 100644 index 0000000..e35c6d6 --- /dev/null +++ b/src/Responses/V30/EmailAttachment.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + emailMessageId: $data['EmailMessageId'] ?? 0, + name: $data['Name'] ?? null, + contentId: $data['ContentId'] ?? null, + isEmbeddedContent: $data['IsEmbeddedContent'] ?? false, + ); + } +} diff --git a/src/Responses/V30/EmailBox.php b/src/Responses/V30/EmailBox.php new file mode 100644 index 0000000..5e58f58 --- /dev/null +++ b/src/Responses/V30/EmailBox.php @@ -0,0 +1,35 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + parentId: $data['ParentId'] ?? null, + userCanRead: $data['UserCanRead'] ?? false, + userCanDelete: $data['UserCanDelete'] ?? false, + sortId: $data['SortId'] ?? 0, + newMessages: $data['NewMessages'] ?? 0, + hasEmails: $data['HasEmails'] ?? false, + ); + } +} diff --git a/src/Responses/V30/EmailMessage.php b/src/Responses/V30/EmailMessage.php new file mode 100644 index 0000000..d6d6a63 --- /dev/null +++ b/src/Responses/V30/EmailMessage.php @@ -0,0 +1,60 @@ + $toEmailAddresses + * @param array<\Webparking\Logic4Client\Data\V30\EmailAddress> $CCEmailAddresses + * @param array<\Webparking\Logic4Client\Data\V30\EmailAddress> $BCCEmailAddresses + */ + public function __construct( + public int $id, + public ?string $subject, + public ?string $emailBody, + public bool $isHTMLBody, + public int $boxId, + public ?\Carbon\Carbon $dateTimeSend, + public bool $isInbound, + public bool $isRead, + public ?\Carbon\Carbon $isReplyedOn, + public ?\Carbon\Carbon $isForwardedOn, + public ?\Webparking\Logic4Client\Data\V30\EmailMessageStatus $status, + public ?array $toEmailAddresses, + public ?\Webparking\Logic4Client\Data\V30\EmailAddress $fromEmailAddress, + public ?array $CCEmailAddresses, + public ?array $BCCEmailAddresses, + public bool $hasAttachment, + public ?int $previousEmailId, + public ?bool $canDelete, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + subject: $data['Subject'] ?? null, + emailBody: $data['EmailBody'] ?? null, + isHTMLBody: $data['IsHTMLBody'] ?? false, + boxId: $data['BoxId'] ?? 0, + dateTimeSend: isset($data['DateTimeSend']) ? \Carbon\Carbon::parse($data['DateTimeSend']) : null, + isInbound: $data['IsInbound'] ?? false, + isRead: $data['IsRead'] ?? false, + isReplyedOn: isset($data['IsReplyedOn']) ? \Carbon\Carbon::parse($data['IsReplyedOn']) : null, + isForwardedOn: isset($data['IsForwardedOn']) ? \Carbon\Carbon::parse($data['IsForwardedOn']) : null, + status: isset($data['Status']) ? \Webparking\Logic4Client\Data\V30\EmailMessageStatus::make($data['Status']) : null, + toEmailAddresses: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\EmailAddress::make($item), $data['ToEmailAddresses'] ?? []), + fromEmailAddress: isset($data['FromEmailAddress']) ? \Webparking\Logic4Client\Data\V30\EmailAddress::make($data['FromEmailAddress']) : null, + CCEmailAddresses: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\EmailAddress::make($item), $data['CCEmailAddresses'] ?? []), + BCCEmailAddresses: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\EmailAddress::make($item), $data['BCCEmailAddresses'] ?? []), + hasAttachment: $data['HasAttachment'] ?? false, + previousEmailId: $data['PreviousEmailId'] ?? null, + canDelete: $data['CanDelete'] ?? null, + ); + } +} diff --git a/src/Responses/V30/EmailMessageStatus.php b/src/Responses/V30/EmailMessageStatus.php new file mode 100644 index 0000000..85b340c --- /dev/null +++ b/src/Responses/V30/EmailMessageStatus.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + color: $data['Color'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/EmailUser.php b/src/Responses/V30/EmailUser.php new file mode 100644 index 0000000..28e100e --- /dev/null +++ b/src/Responses/V30/EmailUser.php @@ -0,0 +1,32 @@ + $emailAddresses */ + public function __construct( + public ?array $emailAddresses, + public ?int $startBoxId, + public ?int $deleteBoxId, + public ?int $sendBoxId, + public ?int $outBoxId, + public ?int $conceptBoxId, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + emailAddresses: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\EmailUserEmailAddress::make($item), $data['EmailAddresses'] ?? []), + startBoxId: $data['StartBoxId'] ?? null, + deleteBoxId: $data['DeleteBoxId'] ?? null, + sendBoxId: $data['SendBoxId'] ?? null, + outBoxId: $data['OutBoxId'] ?? null, + conceptBoxId: $data['ConceptBoxId'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ExplodedView.php b/src/Responses/V30/ExplodedView.php new file mode 100644 index 0000000..9a307cf --- /dev/null +++ b/src/Responses/V30/ExplodedView.php @@ -0,0 +1,38 @@ + $nameTranslations + * @param array<\Webparking\Logic4Client\Data\V30\ExplodedViewHighlight> $highlights + * @param array<\Webparking\Logic4Client\Data\V30\ExplodedViewProductGroup> $productGroups + */ + public function __construct( + public int $id, + public ?string $imageUrl, + public ?int $sortId, + public ?string $name, + public ?array $nameTranslations, + public ?array $highlights, + public ?array $productGroups, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + imageUrl: $data['ImageUrl'] ?? null, + sortId: $data['SortId'] ?? null, + name: $data['Name'] ?? null, + nameTranslations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\Translation::make($item), $data['NameTranslations'] ?? []), + highlights: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ExplodedViewHighlight::make($item), $data['Highlights'] ?? []), + productGroups: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ExplodedViewProductGroup::make($item), $data['Product_Groups'] ?? []), + ); + } +} diff --git a/src/Responses/V30/FinancialBook.php b/src/Responses/V30/FinancialBook.php new file mode 100644 index 0000000..6056eb0 --- /dev/null +++ b/src/Responses/V30/FinancialBook.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + financialBookType: $data['FinancialBookType'] ?? 0, + name: $data['Name'] ?? null, + ledgerId: $data['LedgerId'] ?? null, + administrationId: $data['AdministrationId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/FinancialBookBooking.php b/src/Responses/V30/FinancialBookBooking.php new file mode 100644 index 0000000..b825f36 --- /dev/null +++ b/src/Responses/V30/FinancialBookBooking.php @@ -0,0 +1,48 @@ + $mutations */ + public function __construct( + public int $bookingId, + public int $financialBookId, + public ?\Carbon\Carbon $bookingDateTime, + public ?string $reference, + public ?\Carbon\Carbon $dateTimeCreated, + public int $userId, + public int $bookingNumberByUser, + public ?string $description, + public ?int $statusId, + public ?int $financialCostCenterId, + public ?string $freeValue1, + public ?string $freeValue2, + public ?string $freeValue3, + public ?array $mutations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + bookingId: $data['BookingId'] ?? 0, + financialBookId: $data['FinancialBookId'] ?? 0, + bookingDateTime: isset($data['BookingDateTime']) ? \Carbon\Carbon::parse($data['BookingDateTime']) : null, + reference: $data['Reference'] ?? null, + dateTimeCreated: isset($data['DateTimeCreated']) ? \Carbon\Carbon::parse($data['DateTimeCreated']) : null, + userId: $data['UserId'] ?? 0, + bookingNumberByUser: $data['BookingNumberByUser'] ?? 0, + description: $data['Description'] ?? null, + statusId: $data['StatusId'] ?? null, + financialCostCenterId: $data['FinancialCostCenterId'] ?? null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + freeValue3: $data['FreeValue3'] ?? null, + mutations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\FinancialBookBookingMutation::make($item), $data['Mutations'] ?? []), + ); + } +} diff --git a/src/Responses/V30/FinancialJournal.php b/src/Responses/V30/FinancialJournal.php new file mode 100644 index 0000000..095f249 --- /dev/null +++ b/src/Responses/V30/FinancialJournal.php @@ -0,0 +1,61 @@ + $data */ + public static function make(array $data): self + { + return new self( + ledgerId: $data['LedgerId'] ?? null, + ledgerCode: $data['LedgerCode'] ?? null, + bookingId: $data['BookingId'] ?? null, + invoiceNr: $data['InvoiceNr'] ?? null, + creditorId: $data['CreditorId'] ?? null, + debtorId: $data['DebtorId'] ?? null, + description: $data['Description'] ?? null, + costCenterId: $data['CostCenterId'] ?? null, + transactionCodeId: $data['TransactionCodeId'] ?? null, + entityCodeId: $data['EntityCodeId'] ?? null, + amount: $data['Amount'] ?? null, + amountDebit: $data['AmountDebit'] ?? null, + amountCredit: $data['AmountCredit'] ?? null, + vatAmount: $data['VatAmount'] ?? null, + vatPercent: $data['VatPercent'] ?? null, + vatId: $data['VatId'] ?? null, + userId: $data['UserId'] ?? null, + dateTime: isset($data['DateTime']) ? \Carbon\Carbon::parse($data['DateTime']) : null, + internalDateTime: isset($data['InternalDateTime']) ? \Carbon\Carbon::parse($data['InternalDateTime']) : null, + productId: $data['ProductId'] ?? null, + productCode: $data['ProductCode'] ?? null, + ); + } +} diff --git a/src/Responses/V30/FinancialJournalStatus.php b/src/Responses/V30/FinancialJournalStatus.php new file mode 100644 index 0000000..07a5974 --- /dev/null +++ b/src/Responses/V30/FinancialJournalStatus.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + blockPayment: $data['BlockPayment'] ?? false, + ); + } +} diff --git a/src/Responses/V30/Gender.php b/src/Responses/V30/Gender.php new file mode 100644 index 0000000..394a886 --- /dev/null +++ b/src/Responses/V30/Gender.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/GetRound.php b/src/Responses/V30/GetRound.php new file mode 100644 index 0000000..a42a3ea --- /dev/null +++ b/src/Responses/V30/GetRound.php @@ -0,0 +1,51 @@ + $itsIds + * @param array $orderIds + */ + public function __construct( + public int $id, + public ?\Carbon\Carbon $dateTimeCreated, + public int $createdByUserId, + public ?array $itsIds, + public ?array $orderIds, + public int $typeId, + public ?string $description, + public ?string $memo, + public ?\Carbon\Carbon $dateTimePlanned, + public ?int $vehicleId, + public ?int $driverId, + public ?int $coDriverId, + public int $statusId, + public bool $hideInSystem, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + dateTimeCreated: isset($data['DateTimeCreated']) ? \Carbon\Carbon::parse($data['DateTimeCreated']) : null, + createdByUserId: $data['CreatedByUserId'] ?? 0, + itsIds: $data['ItsIds'] ?? null, + orderIds: $data['OrderIds'] ?? null, + typeId: $data['TypeId'] ?? 0, + description: $data['Description'] ?? null, + memo: $data['Memo'] ?? null, + dateTimePlanned: isset($data['DateTimePlanned']) ? \Carbon\Carbon::parse($data['DateTimePlanned']) : null, + vehicleId: $data['VehicleId'] ?? null, + driverId: $data['DriverId'] ?? null, + coDriverId: $data['CoDriverId'] ?? null, + statusId: $data['StatusId'] ?? 0, + hideInSystem: $data['HideInSystem'] ?? false, + ); + } +} diff --git a/src/Responses/V30/GetRoundOrder.php b/src/Responses/V30/GetRoundOrder.php new file mode 100644 index 0000000..3925ee0 --- /dev/null +++ b/src/Responses/V30/GetRoundOrder.php @@ -0,0 +1,35 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + orderId: $data['OrderId'] ?? null, + ITSIssueId: $data['ITSIssueId'] ?? null, + roundId: $data['RoundId'] ?? 0, + remarks: $data['Remarks'] ?? null, + statusId: $data['StatusId'] ?? 0, + sorting: $data['Sorting'] ?? 0, + estimatedArrivalDateTime: isset($data['EstimatedArrivalDateTime']) ? \Carbon\Carbon::parse($data['EstimatedArrivalDateTime']) : null, + ); + } +} diff --git a/src/Responses/V30/GlobalizationType.php b/src/Responses/V30/GlobalizationType.php new file mode 100644 index 0000000..9094f91 --- /dev/null +++ b/src/Responses/V30/GlobalizationType.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ITSFreeValue.php b/src/Responses/V30/ITSFreeValue.php new file mode 100644 index 0000000..448cfa2 --- /dev/null +++ b/src/Responses/V30/ITSFreeValue.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ITSIssue.php b/src/Responses/V30/ITSIssue.php new file mode 100644 index 0000000..dffbc75 --- /dev/null +++ b/src/Responses/V30/ITSIssue.php @@ -0,0 +1,77 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['id'] ?? 0, + name: $data['Name'] ?? null, + dateTimeCreatedOn: isset($data['DateTimeCreatedOn']) ? \Carbon\Carbon::parse($data['DateTimeCreatedOn']) : null, + dateTimeClosed: isset($data['DateTimeClosed']) ? \Carbon\Carbon::parse($data['DateTimeClosed']) : null, + createdByUserId: $data['CreatedByUserId'] ?? 0, + description: $data['Description'] ?? null, + orderId: $data['OrderId'] ?? null, + invoiceId: $data['InvoiceId'] ?? null, + status: isset($data['Status']) ? \Webparking\Logic4Client\Data\V30\ITSIssueStatus::make($data['Status']) : null, + type: isset($data['Type']) ? \Webparking\Logic4Client\Data\V30\ITSIssueType::make($data['Type']) : null, + responsibleByUserId: $data['ResponsibleByUserId'] ?? null, + responsibleByUserName: $data['ResponsibleByUserName'] ?? null, + dateTimeMustBeCompletedOn: isset($data['DateTimeMustBeCompletedOn']) ? \Carbon\Carbon::parse($data['DateTimeMustBeCompletedOn']) : null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + priority: isset($data['Priority']) ? \Webparking\Logic4Client\Data\V30\ITSPriority::make($data['Priority']) : null, + project: isset($data['Project']) ? \Webparking\Logic4Client\Data\V30\ITSProject::make($data['Project']) : null, + group: isset($data['Group']) ? \Webparking\Logic4Client\Data\V30\ITSIssueGroup::make($data['Group']) : null, + level: isset($data['Level']) ? \Webparking\Logic4Client\Data\V30\ITSIssueLevel::make($data['Level']) : null, + productData: isset($data['ProductData']) ? \Webparking\Logic4Client\Data\V30\BasicProductData::make($data['ProductData']) : null, + freeValueType1: isset($data['FreeValueType1']) ? \Webparking\Logic4Client\Data\V30\ITSIssueFreeType::make($data['FreeValueType1']) : null, + freeValueType2: isset($data['FreeValueType2']) ? \Webparking\Logic4Client\Data\V30\ITSIssueFreeType::make($data['FreeValueType2']) : null, + lastModifiedSince: isset($data['LastModifiedSince']) ? \Carbon\Carbon::parse($data['LastModifiedSince']) : null, + reportedByDebtorId: $data['ReportedByDebtorId'] ?? null, + reportedByCreditorId: $data['ReportedByCreditorId'] ?? null, + contactId: $data['ContactId'] ?? null, + dateTimeReported: isset($data['DateTimeReported']) ? \Carbon\Carbon::parse($data['DateTimeReported']) : null, + archiveIssue: $data['ArchiveIssue'] ?? false, + minutes: $data['Minutes'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ITSIssueGroup.php b/src/Responses/V30/ITSIssueGroup.php new file mode 100644 index 0000000..59c2973 --- /dev/null +++ b/src/Responses/V30/ITSIssueGroup.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ITSIssueLevel.php b/src/Responses/V30/ITSIssueLevel.php new file mode 100644 index 0000000..becd3a6 --- /dev/null +++ b/src/Responses/V30/ITSIssueLevel.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ITSIssueStatus.php b/src/Responses/V30/ITSIssueStatus.php new file mode 100644 index 0000000..96e8c09 --- /dev/null +++ b/src/Responses/V30/ITSIssueStatus.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ITSIssueType.php b/src/Responses/V30/ITSIssueType.php new file mode 100644 index 0000000..0c6f41b --- /dev/null +++ b/src/Responses/V30/ITSIssueType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ITSProject.php b/src/Responses/V30/ITSProject.php new file mode 100644 index 0000000..8d468ba --- /dev/null +++ b/src/Responses/V30/ITSProject.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ITSTaskPriority.php b/src/Responses/V30/ITSTaskPriority.php new file mode 100644 index 0000000..3d5869c --- /dev/null +++ b/src/Responses/V30/ITSTaskPriority.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/InvoiceOpenPayment.php b/src/Responses/V30/InvoiceOpenPayment.php new file mode 100644 index 0000000..9a0a4d3 --- /dev/null +++ b/src/Responses/V30/InvoiceOpenPayment.php @@ -0,0 +1,37 @@ + $data */ + public static function make(array $data): self + { + return new self( + invoiceId: $data['InvoiceId'] ?? 0, + debtorId: $data['DebtorId'] ?? 0, + dueDate: isset($data['DueDate']) ? \Carbon\Carbon::parse($data['DueDate']) : null, + invoiceDate: isset($data['InvoiceDate']) ? \Carbon\Carbon::parse($data['InvoiceDate']) : null, + daysPastDueDate: $data['DaysPastDueDate'] ?? 0, + totalAmount: $data['TotalAmount'] ?? 0.0, + totalAmountPayed: $data['TotalAmountPayed'] ?? 0.0, + amountOutstanding: $data['AmountOutstanding'] ?? 0.0, + paymentMethodId: $data['PaymentMethodId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/Ledger.php b/src/Responses/V30/Ledger.php new file mode 100644 index 0000000..24fb409 --- /dev/null +++ b/src/Responses/V30/Ledger.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + code: $data['Code'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/OperatingSystemType.php b/src/Responses/V30/OperatingSystemType.php new file mode 100644 index 0000000..454e0ac --- /dev/null +++ b/src/Responses/V30/OperatingSystemType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Order.php b/src/Responses/V30/Order.php new file mode 100644 index 0000000..a6f7be2 --- /dev/null +++ b/src/Responses/V30/Order.php @@ -0,0 +1,114 @@ + $orderShipments + * @param array<\Webparking\Logic4Client\Data\V30\Payment> $payments + * @param array<\Webparking\Logic4Client\Data\V30\OrderRow> $orderRows + */ + public function __construct( + public int $debtorId, + public int $id, + public ?\Webparking\Logic4Client\Data\V30\OrderTotalsRead $totals, + public ?\Webparking\Logic4Client\Data\V30\PaymentMethod $paymentMethod, + public ?\Webparking\Logic4Client\Data\V30\OrderStatus $orderStatus, + public ?\Webparking\Logic4Client\Data\V30\OrderShippingMethod $shippingMethod, + public ?array $orderShipments, + public ?int $invoiceBelongsToOrderNumber, + public ?array $payments, + public ?\Webparking\Logic4Client\Data\V30\DebtorCostCentre $costCentre, + public ?\Webparking\Logic4Client\Data\V30\CustomerAddress $accountAddress, + public ?array $orderRows, + public ?int $deliveryProvinceId, + public ?int $invoiceProvinceId, + public ?int $accountProvinceId, + public ?string $lastClickGclIdValues, + public ?string $lastClickUtmValues, + public ?\Webparking\Logic4Client\Data\V30\CustomerAddress $deliveryAddress, + public ?\Webparking\Logic4Client\Data\V30\CustomerAddress $invoiceAddress, + public ?\Carbon\Carbon $creationDate, + public ?string $description, + public ?string $reference, + public ?int $branchId, + public ?int $userId, + public ?int $websiteDomainId, + public ?int $deliveryOptionId, + public ?\Carbon\Carbon $deliveryDate, + public ?\Webparking\Logic4Client\Data\V30\OrderShipmentFreeValue $orderShipmentFreeValues, + public ?string $notes, + public ?string $freeValue1, + public ?string $freeValue2, + public ?string $freeValue3, + public ?string $freeValue4, + public ?string $freeValue5, + public ?string $freeValue6, + public ?string $freeValue7, + public ?string $freeValue8, + public ?int $orderType1Id, + public ?int $orderType2Id, + public ?int $orderType3Id, + public ?int $orderType4Id, + public ?int $orderType5Id, + public ?int $orderType6Id, + public ?int $orderType7Id, + public ?int $orderType8Id, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + debtorId: $data['DebtorId'] ?? 0, + id: $data['Id'] ?? 0, + totals: isset($data['Totals']) ? \Webparking\Logic4Client\Data\V30\OrderTotalsRead::make($data['Totals']) : null, + paymentMethod: isset($data['PaymentMethod']) ? \Webparking\Logic4Client\Data\V30\PaymentMethod::make($data['PaymentMethod']) : null, + orderStatus: isset($data['OrderStatus']) ? \Webparking\Logic4Client\Data\V30\OrderStatus::make($data['OrderStatus']) : null, + shippingMethod: isset($data['ShippingMethod']) ? \Webparking\Logic4Client\Data\V30\OrderShippingMethod::make($data['ShippingMethod']) : null, + orderShipments: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\OrderShipment::make($item), $data['OrderShipments'] ?? []), + invoiceBelongsToOrderNumber: $data['InvoiceBelongsToOrderNumber'] ?? null, + payments: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\Payment::make($item), $data['Payments'] ?? []), + costCentre: isset($data['CostCentre']) ? \Webparking\Logic4Client\Data\V30\DebtorCostCentre::make($data['CostCentre']) : null, + accountAddress: isset($data['AccountAddress']) ? \Webparking\Logic4Client\Data\V30\CustomerAddress::make($data['AccountAddress']) : null, + orderRows: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\OrderRow::make($item), $data['OrderRows'] ?? []), + deliveryProvinceId: $data['DeliveryProvinceId'] ?? null, + invoiceProvinceId: $data['InvoiceProvinceId'] ?? null, + accountProvinceId: $data['AccountProvinceId'] ?? null, + lastClickGclIdValues: $data['LastClickGclIdValues'] ?? null, + lastClickUtmValues: $data['LastClickUtmValues'] ?? null, + deliveryAddress: isset($data['DeliveryAddress']) ? \Webparking\Logic4Client\Data\V30\CustomerAddress::make($data['DeliveryAddress']) : null, + invoiceAddress: isset($data['InvoiceAddress']) ? \Webparking\Logic4Client\Data\V30\CustomerAddress::make($data['InvoiceAddress']) : null, + creationDate: isset($data['CreationDate']) ? \Carbon\Carbon::parse($data['CreationDate']) : null, + description: $data['Description'] ?? null, + reference: $data['Reference'] ?? null, + branchId: $data['BranchId'] ?? null, + userId: $data['UserId'] ?? null, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + deliveryOptionId: $data['DeliveryOptionId'] ?? null, + deliveryDate: isset($data['DeliveryDate']) ? \Carbon\Carbon::parse($data['DeliveryDate']) : null, + orderShipmentFreeValues: isset($data['OrderShipmentFreeValues']) ? \Webparking\Logic4Client\Data\V30\OrderShipmentFreeValue::make($data['OrderShipmentFreeValues']) : null, + notes: $data['Notes'] ?? null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + freeValue3: $data['FreeValue3'] ?? null, + freeValue4: $data['FreeValue4'] ?? null, + freeValue5: $data['FreeValue5'] ?? null, + freeValue6: $data['FreeValue6'] ?? null, + freeValue7: $data['FreeValue7'] ?? null, + freeValue8: $data['FreeValue8'] ?? null, + orderType1Id: $data['OrderType1Id'] ?? null, + orderType2Id: $data['OrderType2Id'] ?? null, + orderType3Id: $data['OrderType3Id'] ?? null, + orderType4Id: $data['OrderType4Id'] ?? null, + orderType5Id: $data['OrderType5Id'] ?? null, + orderType6Id: $data['OrderType6Id'] ?? null, + orderType7Id: $data['OrderType7Id'] ?? null, + orderType8Id: $data['OrderType8Id'] ?? null, + ); + } +} diff --git a/src/Responses/V30/OrderAction.php b/src/Responses/V30/OrderAction.php new file mode 100644 index 0000000..0b107ac --- /dev/null +++ b/src/Responses/V30/OrderAction.php @@ -0,0 +1,33 @@ + $data */ + public static function make(array $data): self + { + return new self( + orderId: $data['OrderId'] ?? 0, + dateTimeCreated: isset($data['DateTimeCreated']) ? \Carbon\Carbon::parse($data['DateTimeCreated']) : null, + description: $data['Description'] ?? null, + userId: $data['UserId'] ?? 0, + relatedId: $data['RelatedId'] ?? null, + typeDescription: $data['TypeDescription'] ?? null, + typeId: $data['TypeId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/OrderActionType.php b/src/Responses/V30/OrderActionType.php new file mode 100644 index 0000000..ec3d0d2 --- /dev/null +++ b/src/Responses/V30/OrderActionType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/OrderHeadPickbon.php b/src/Responses/V30/OrderHeadPickbon.php new file mode 100644 index 0000000..bc21219 --- /dev/null +++ b/src/Responses/V30/OrderHeadPickbon.php @@ -0,0 +1,61 @@ + $data */ + public static function make(array $data): self + { + return new self( + isProcessed: $data['IsProcessed'] ?? false, + orderDate: isset($data['OrderDate']) ? \Carbon\Carbon::parse($data['OrderDate']) : null, + pickbonDateTimePrinted: isset($data['PickbonDateTimePrinted']) ? \Carbon\Carbon::parse($data['PickbonDateTimePrinted']) : null, + amountRows: $data['AmountRows'] ?? 0, + amountItemsToPick: $data['AmountItemsToPick'] ?? 0.0, + debtorId: $data['DebtorId'] ?? 0, + orderHeadPickbonId: $data['OrderHeadPickbonId'] ?? 0, + orderId: $data['OrderId'] ?? 0, + deliveryCompanyName: $data['Delivery_CompanyName'] ?? null, + deliveryExpDate: isset($data['DeliveryExpDate']) ? \Carbon\Carbon::parse($data['DeliveryExpDate']) : null, + deliveryContactName: $data['Delivery_ContactName'] ?? null, + deliveryAddress: $data['Delivery_Address'] ?? null, + deliveryAddress2: $data['Delivery_Address2'] ?? null, + deliveryCity: $data['Delivery_City'] ?? null, + deliveryTelephone: $data['Delivery_Telephone'] ?? null, + deliveryZipcode: $data['Delivery_Zipcode'] ?? null, + softBlockedAt: isset($data['SoftBlockedAt']) ? \Carbon\Carbon::parse($data['SoftBlockedAt']) : null, + softBlockedBy: $data['SoftBlockedBy'] ?? null, + zoneId: $data['ZoneId'] ?? null, + lastReprintedOn: isset($data['LastReprintedOn']) ? \Carbon\Carbon::parse($data['LastReprintedOn']) : null, + lastReprintedByUserId: $data['LastReprintedByUserId'] ?? null, + ); + } +} diff --git a/src/Responses/V30/OrderHeadPickbonRow.php b/src/Responses/V30/OrderHeadPickbonRow.php new file mode 100644 index 0000000..bf883d2 --- /dev/null +++ b/src/Responses/V30/OrderHeadPickbonRow.php @@ -0,0 +1,35 @@ + $data */ + public static function make(array $data): self + { + return new self( + orderRowId: $data['OrderRowId'] ?? 0, + productId: $data['ProductId'] ?? 0, + qty: $data['Qty'] ?? 0.0, + warehouseId: $data['WarehouseId'] ?? null, + orderHeadPickbonId: $data['OrderHeadPickbonId'] ?? 0, + orderRowSorting: $data['OrderRowSorting'] ?? 0, + orderHeadPickbonRowId: $data['OrderHeadPickbonRowId'] ?? 0, + productGroupTypeId: $data['ProductGroupTypeId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/OrderOpenPayment.php b/src/Responses/V30/OrderOpenPayment.php new file mode 100644 index 0000000..ffb91e2 --- /dev/null +++ b/src/Responses/V30/OrderOpenPayment.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + amount: $data['Amount'] ?? 0.0, + amountEx: $data['AmountEx'] ?? 0.0, + endDate: isset($data['EndDate']) ? \Carbon\Carbon::parse($data['EndDate']) : null, + periodDescription: $data['PeriodDescription'] ?? null, + totalPayments: $data['TotalPayments'] ?? null, + ); + } +} diff --git a/src/Responses/V30/OrderRowV11.php b/src/Responses/V30/OrderRowV11.php new file mode 100644 index 0000000..51e2d23 --- /dev/null +++ b/src/Responses/V30/OrderRowV11.php @@ -0,0 +1,108 @@ + $serialNumbers */ + public function __construct( + public ?int $composedProductOrderRowParentId, + public ?int $optionVariantProductOrderRowParentId, + public ?array $serialNumbers, + public ?float $expectedNextQtyOnDelivery, + public ?float $discountPercent, + public float $qtyReserved, + public float $inclPrice, + public ?string $internalNotes, + public bool $isAssemblyChild, + public ?int $packingMaterialDepositId, + public ?int $id, + public ?string $description, + public ?string $description2, + public ?int $productId, + public float $qty, + public ?float $buyPrice, + public ?float $grossPrice, + public ?float $nettPrice, + public float $qtyDeliverd, + public float $qtyDeliverdNotInvoiced, + public ?string $productCode, + public ?string $productBarcode1, + public ?float $VATPercentage, + public ?string $notes, + public int $debtorId, + public ?int $orderId, + public ?int $warehouseId, + public ?string $commission, + public ?int $deliveryOptionId, + public ?int $vatCodeId, + public ?int $vatCodeIdOverrule, + public ?string $freeValue1, + public ?string $freeValue2, + public ?string $freeValue3, + public ?string $freeValue4, + public ?string $freeValue5, + public ?\Carbon\Carbon $expectedNextDelivery, + public ?\Webparking\Logic4Client\Data\V30\ExternalValue $externalValue, + public ?\Carbon\Carbon $agreedDeliveryDate, + public ?int $type1Id, + public ?int $type2Id, + public ?int $type3Id, + public ?int $type4Id, + public ?int $type5Id, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + composedProductOrderRowParentId: $data['ComposedProductOrderRowParentId'] ?? null, + optionVariantProductOrderRowParentId: $data['OptionVariantProductOrderRowParentId'] ?? null, + serialNumbers: $data['SerialNumbers'] ?? null, + expectedNextQtyOnDelivery: $data['ExpectedNextQtyOnDelivery'] ?? null, + discountPercent: $data['DiscountPercent'] ?? null, + qtyReserved: $data['QtyReserved'] ?? 0.0, + inclPrice: $data['InclPrice'] ?? 0.0, + internalNotes: $data['InternalNotes'] ?? null, + isAssemblyChild: $data['IsAssemblyChild'] ?? false, + packingMaterialDepositId: $data['PackingMaterialDepositId'] ?? null, + id: $data['Id'] ?? null, + description: $data['Description'] ?? null, + description2: $data['Description2'] ?? null, + productId: $data['ProductId'] ?? null, + qty: $data['Qty'] ?? 0.0, + buyPrice: $data['BuyPrice'] ?? null, + grossPrice: $data['GrossPrice'] ?? null, + nettPrice: $data['NettPrice'] ?? null, + qtyDeliverd: $data['QtyDeliverd'] ?? 0.0, + qtyDeliverdNotInvoiced: $data['QtyDeliverd_NotInvoiced'] ?? 0.0, + productCode: $data['ProductCode'] ?? null, + productBarcode1: $data['ProductBarcode1'] ?? null, + VATPercentage: $data['VATPercentage'] ?? null, + notes: $data['Notes'] ?? null, + debtorId: $data['DebtorId'] ?? 0, + orderId: $data['OrderId'] ?? null, + warehouseId: $data['WarehouseId'] ?? null, + commission: $data['Commission'] ?? null, + deliveryOptionId: $data['DeliveryOptionId'] ?? null, + vatCodeId: $data['VatCodeId'] ?? null, + vatCodeIdOverrule: $data['VatCodeIdOverrule'] ?? null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + freeValue3: $data['FreeValue3'] ?? null, + freeValue4: $data['FreeValue4'] ?? null, + freeValue5: $data['FreeValue5'] ?? null, + expectedNextDelivery: isset($data['ExpectedNextDelivery']) ? \Carbon\Carbon::parse($data['ExpectedNextDelivery']) : null, + externalValue: isset($data['ExternalValue']) ? \Webparking\Logic4Client\Data\V30\ExternalValue::make($data['ExternalValue']) : null, + agreedDeliveryDate: isset($data['AgreedDeliveryDate']) ? \Carbon\Carbon::parse($data['AgreedDeliveryDate']) : null, + type1Id: $data['Type1Id'] ?? null, + type2Id: $data['Type2Id'] ?? null, + type3Id: $data['Type3Id'] ?? null, + type4Id: $data['Type4Id'] ?? null, + type5Id: $data['Type5Id'] ?? null, + ); + } +} diff --git a/src/Responses/V30/OrderShipment.php b/src/Responses/V30/OrderShipment.php new file mode 100644 index 0000000..f5d671a --- /dev/null +++ b/src/Responses/V30/OrderShipment.php @@ -0,0 +1,35 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + deliveryId: $data['DeliveryId'] ?? null, + dateTimeAdded: isset($data['DateTimeAdded']) ? \Carbon\Carbon::parse($data['DateTimeAdded']) : null, + sendEmail: $data['SendEmail'] ?? null, + orderId: $data['OrderId'] ?? 0, + shipperId: $data['ShipperId'] ?? 0, + barcode: $data['Barcode'] ?? null, + trackTraceUrl: $data['TrackTraceUrl'] ?? null, + ); + } +} diff --git a/src/Responses/V30/OrderStatus.php b/src/Responses/V30/OrderStatus.php new file mode 100644 index 0000000..7e3872b --- /dev/null +++ b/src/Responses/V30/OrderStatus.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/PackingMaterialDepositType.php b/src/Responses/V30/PackingMaterialDepositType.php new file mode 100644 index 0000000..a3649cd --- /dev/null +++ b/src/Responses/V30/PackingMaterialDepositType.php @@ -0,0 +1,33 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + price: $data['Price'] ?? 0.0, + returnProductId: $data['ReturnProductId'] ?? null, + purchasesLedgerId: $data['PurchasesLedgerId'] ?? null, + salesLedgerId: $data['SalesLedgerId'] ?? null, + stockLedgerId: $data['StockLedgerId'] ?? null, + ); + } +} diff --git a/src/Responses/V30/PaymentMethod.php b/src/Responses/V30/PaymentMethod.php new file mode 100644 index 0000000..1e2f6d4 --- /dev/null +++ b/src/Responses/V30/PaymentMethod.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + maxAmount: $data['MaxAmount'] ?? null, + selectKey: $data['SelectKey'] ?? null, + ); + } +} diff --git a/src/Responses/V30/PickbonSoftBlocked.php b/src/Responses/V30/PickbonSoftBlocked.php new file mode 100644 index 0000000..5c4d71d --- /dev/null +++ b/src/Responses/V30/PickbonSoftBlocked.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + userId: $data['UserId'] ?? null, + softBlockedAt: isset($data['SoftBlockedAt']) ? \Carbon\Carbon::parse($data['SoftBlockedAt']) : null, + username: $data['Username'] ?? null, + orderHeadPickbonId: $data['OrderHeadPickbonId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/ProductAssemblyRecipeItem.php b/src/Responses/V30/ProductAssemblyRecipeItem.php new file mode 100644 index 0000000..8a41f9d --- /dev/null +++ b/src/Responses/V30/ProductAssemblyRecipeItem.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + productCode: $data['ProductCode'] ?? null, + qty: $data['Qty'] ?? 0.0, + sorting: $data['Sorting'] ?? null, + isStockBasedProduct: $data['IsStockBasedProduct'] ?? false, + ); + } +} diff --git a/src/Responses/V30/ProductBarcode.php b/src/Responses/V30/ProductBarcode.php new file mode 100644 index 0000000..b11fdfc --- /dev/null +++ b/src/Responses/V30/ProductBarcode.php @@ -0,0 +1,24 @@ + $barcodes */ + public function __construct( + public ?array $barcodes, + public int $productId, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + barcodes: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\BarcodeWithAmount::make($item), $data['Barcodes'] ?? []), + productId: $data['ProductId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/ProductCodeWithSupplierCode.php b/src/Responses/V30/ProductCodeWithSupplierCode.php new file mode 100644 index 0000000..2bd27ea --- /dev/null +++ b/src/Responses/V30/ProductCodeWithSupplierCode.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + productCode: $data['ProductCode'] ?? null, + supplierCode: $data['SupplierCode'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductCompositionItem.php b/src/Responses/V30/ProductCompositionItem.php new file mode 100644 index 0000000..5c8ae91 --- /dev/null +++ b/src/Responses/V30/ProductCompositionItem.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + productCode: $data['ProductCode'] ?? null, + qty: $data['Qty'] ?? 0.0, + sorting: $data['Sorting'] ?? null, + isStockBasedProduct: $data['IsStockBasedProduct'] ?? false, + ); + } +} diff --git a/src/Responses/V30/ProductDimensions.php b/src/Responses/V30/ProductDimensions.php new file mode 100644 index 0000000..8de9f12 --- /dev/null +++ b/src/Responses/V30/ProductDimensions.php @@ -0,0 +1,59 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + productCode: $data['ProductCode'] ?? null, + piecesOnPallet: $data['PiecesOnPallet'] ?? null, + PCSinInsidePackage: $data['PCSinInsidePackage'] ?? null, + PCSinOutsidePackage: $data['PCSinOutsidePackage'] ?? null, + weightSingleProduct: $data['WeightSingleProduct'] ?? 0.0, + weightInsidePackage: $data['WeightInsidePackage'] ?? 0.0, + weightOutsidePackage: $data['WeightOutsidePackage'] ?? 0.0, + volumeSingleProduct: $data['VolumeSingleProduct'] ?? 0.0, + volumeInsidePackage: $data['VolumeInsidePackage'] ?? 0.0, + volumeOutsidePackage: $data['VolumeOutsidePackage'] ?? 0.0, + widthSingleProduct: $data['WidthSingleProduct'] ?? 0.0, + widthInsidePackage: $data['WidthInsidePackage'] ?? 0.0, + widthOutsidePackage: $data['WidthOutsidePackage'] ?? 0.0, + heightSingleProduct: $data['HeightSingleProduct'] ?? 0.0, + heightInsidePackage: $data['HeightInsidePackage'] ?? 0.0, + heightOutsidePackage: $data['HeightOutsidePackage'] ?? 0.0, + depthSingleProduct: $data['DepthSingleProduct'] ?? 0.0, + depthInsidePackage: $data['DepthInsidePackage'] ?? 0.0, + depthOutsidePackage: $data['DepthOutsidePackage'] ?? 0.0, + ); + } +} diff --git a/src/Responses/V30/ProductExtraBarcodeType.php b/src/Responses/V30/ProductExtraBarcodeType.php new file mode 100644 index 0000000..31836b9 --- /dev/null +++ b/src/Responses/V30/ProductExtraBarcodeType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductGroup.php b/src/Responses/V30/ProductGroup.php new file mode 100644 index 0000000..6d68f1e --- /dev/null +++ b/src/Responses/V30/ProductGroup.php @@ -0,0 +1,44 @@ + $translations */ + public function __construct( + public int $id, + public ?string $name, + public ?int $parentProductGroupId, + public ?string $shortname, + public ?string $pictureUrl, + public int $sortValue, + public ?string $pictureName, + public int $productGroupTypeId, + public bool $isVisibleOnWebshop, + public int $depthLevel, + public bool $showUnitOnWebsite, + public ?array $translations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + parentProductGroupId: $data['ParentProductGroupId'] ?? null, + shortname: $data['Shortname'] ?? null, + pictureUrl: $data['PictureUrl'] ?? null, + sortValue: $data['SortValue'] ?? 0, + pictureName: $data['PictureName'] ?? null, + productGroupTypeId: $data['ProductGroupTypeId'] ?? 0, + isVisibleOnWebshop: $data['IsVisibleOnWebshop'] ?? false, + depthLevel: $data['DepthLevel'] ?? 0, + showUnitOnWebsite: $data['ShowUnitOnWebsite'] ?? false, + translations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductGroupTranslation::make($item), $data['Translations'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductGroupType.php b/src/Responses/V30/ProductGroupType.php new file mode 100644 index 0000000..faeef32 --- /dev/null +++ b/src/Responses/V30/ProductGroupType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductImageV2.php b/src/Responses/V30/ProductImageV2.php new file mode 100644 index 0000000..6945b13 --- /dev/null +++ b/src/Responses/V30/ProductImageV2.php @@ -0,0 +1,24 @@ + $productImages */ + public function __construct( + public ?string $baseUrl, + public ?array $productImages, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + baseUrl: $data['BaseUrl'] ?? null, + productImages: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\GetProductImage::make($item), $data['ProductImages'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductMediaFileDto.php b/src/Responses/V30/ProductMediaFileDto.php new file mode 100644 index 0000000..b94d4ad --- /dev/null +++ b/src/Responses/V30/ProductMediaFileDto.php @@ -0,0 +1,24 @@ + $resources */ + public function __construct( + public int $productId, + public ?array $resources, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + resources: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductResource::make($item), $data['Resources'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductMinimalStockNumber.php b/src/Responses/V30/ProductMinimalStockNumber.php new file mode 100644 index 0000000..018bec5 --- /dev/null +++ b/src/Responses/V30/ProductMinimalStockNumber.php @@ -0,0 +1,28 @@ + $minimalStockWarehouses */ + public function __construct( + public int $productId, + public ?int $minimalStockForAdministrationLevel, + public ?int $minimalStockProductLevel, + public ?array $minimalStockWarehouses, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + minimalStockForAdministrationLevel: $data['MinimalStockForAdministrationLevel'] ?? null, + minimalStockProductLevel: $data['MinimalStockProductLevel'] ?? null, + minimalStockWarehouses: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\WarehouseMinimalStockNumber::make($item), $data['MinimalStockWarehouses'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductPickLocationBasedOnSystemSettings.php b/src/Responses/V30/ProductPickLocationBasedOnSystemSettings.php new file mode 100644 index 0000000..f883130 --- /dev/null +++ b/src/Responses/V30/ProductPickLocationBasedOnSystemSettings.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + defaultPickLocationId: $data['DefaultPickLocationId'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductPriceInformation.php b/src/Responses/V30/ProductPriceInformation.php new file mode 100644 index 0000000..f58ac65 --- /dev/null +++ b/src/Responses/V30/ProductPriceInformation.php @@ -0,0 +1,24 @@ + $shiftPrices */ + public function __construct( + public int $productId, + public ?array $shiftPrices, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + shiftPrices: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductShiftPrice::make($item), $data['ShiftPrices'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductPricelist.php b/src/Responses/V30/ProductPricelist.php new file mode 100644 index 0000000..9143228 --- /dev/null +++ b/src/Responses/V30/ProductPricelist.php @@ -0,0 +1,33 @@ + $debtorIds + * @param array<\Webparking\Logic4Client\Data\V30\ProductPricelistContractPrice> $contractPrices + */ + public function __construct( + public int $id, + public ?string $name, + public ?array $debtorIds, + public ?float $fixedDiscount, + public ?array $contractPrices, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + debtorIds: $data['DebtorIds'] ?? null, + fixedDiscount: $data['FixedDiscount'] ?? null, + contractPrices: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductPricelistContractPrice::make($item), $data['ContractPrices'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductRelationType.php b/src/Responses/V30/ProductRelationType.php new file mode 100644 index 0000000..1accc0b --- /dev/null +++ b/src/Responses/V30/ProductRelationType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductReview.php b/src/Responses/V30/ProductReview.php new file mode 100644 index 0000000..27447e5 --- /dev/null +++ b/src/Responses/V30/ProductReview.php @@ -0,0 +1,38 @@ + $websiteIds */ + public function __construct( + public int $id, + public ?int $productId, + public ?string $username, + public ?string $emailAddress, + public ?\Carbon\Carbon $dateTimeCreated, + public ?string $review, + public int $score, + public ?array $websiteIds, + public ?string $reaction, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + productId: $data['ProductId'] ?? null, + username: $data['Username'] ?? null, + emailAddress: $data['EmailAddress'] ?? null, + dateTimeCreated: isset($data['DateTimeCreated']) ? \Carbon\Carbon::parse($data['DateTimeCreated']) : null, + review: $data['Review'] ?? null, + score: $data['Score'] ?? 0, + websiteIds: $data['WebsiteIds'] ?? null, + reaction: $data['Reaction'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductSEOInformation.php b/src/Responses/V30/ProductSEOInformation.php new file mode 100644 index 0000000..5cde741 --- /dev/null +++ b/src/Responses/V30/ProductSEOInformation.php @@ -0,0 +1,35 @@ + $data */ + public static function make(array $data): self + { + return new self( + websiteDomainId: $data['WebsiteDomainId'] ?? null, + globalizationId: $data['GlobalizationId'] ?? null, + productId: $data['ProductId'] ?? 0, + title: $data['Title'] ?? null, + description: $data['Description'] ?? null, + USP: $data['USP'] ?? null, + metaName: $data['MetaName'] ?? null, + metaDescription: $data['MetaDescription'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductSalesInformation.php b/src/Responses/V30/ProductSalesInformation.php new file mode 100644 index 0000000..b1957c7 --- /dev/null +++ b/src/Responses/V30/ProductSalesInformation.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + productCode: $data['ProductCode'] ?? null, + productDescription: $data['ProductDescription'] ?? null, + value: $data['Value'] ?? 0.0, + dateStart: isset($data['DateStart']) ? \Carbon\Carbon::parse($data['DateStart']) : null, + dateEnd: isset($data['DateEnd']) ? \Carbon\Carbon::parse($data['DateEnd']) : null, + periodDescription: $data['PeriodDescription'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductShiftPrice.php b/src/Responses/V30/ProductShiftPrice.php new file mode 100644 index 0000000..24afbc6 --- /dev/null +++ b/src/Responses/V30/ProductShiftPrice.php @@ -0,0 +1,33 @@ + $data */ + public static function make(array $data): self + { + return new self( + qty: $data['Qty'] ?? 0, + buyPrice: $data['BuyPrice'] ?? 0.0, + margin: $data['Margin'] ?? 0.0, + sellPriceExcl: $data['SellPriceExcl'] ?? 0.0, + sellPriceGrossExcl: $data['SellPriceGrossExcl'] ?? 0.0, + description: $data['Description'] ?? null, + discountType: $data['DiscountType'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductShippingInformation.php b/src/Responses/V30/ProductShippingInformation.php new file mode 100644 index 0000000..afcb152 --- /dev/null +++ b/src/Responses/V30/ProductShippingInformation.php @@ -0,0 +1,39 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + customsTariffnumber: $data['CustomsTariffnumber'] ?? null, + productCode: $data['ProductCode'] ?? null, + packagesDecimal: $data['PackagesDecimal'] ?? null, + piecesOnPallet: $data['PiecesOnPallet'] ?? null, + weight: $data['Weight'] ?? 0.0, + volume: $data['Volume'] ?? 0.0, + width: $data['Width'] ?? 0.0, + height: $data['Height'] ?? 0.0, + depth: $data['Depth'] ?? 0.0, + ); + } +} diff --git a/src/Responses/V30/ProductStatus.php b/src/Responses/V30/ProductStatus.php new file mode 100644 index 0000000..4acdde9 --- /dev/null +++ b/src/Responses/V30/ProductStatus.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + statusId: $data['StatusId'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductStock.php b/src/Responses/V30/ProductStock.php new file mode 100644 index 0000000..c814f3b --- /dev/null +++ b/src/Responses/V30/ProductStock.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + productCode: $data['ProductCode'] ?? null, + warehouseId: $data['WarehouseId'] ?? 0, + qtyReserved: $data['QtyReserved'] ?? 0.0, + freeStock: $data['FreeStock'] ?? 0.0, + productId: $data['ProductId'] ?? 0, + qty: $data['Qty'] ?? 0.0, + ); + } +} diff --git a/src/Responses/V30/ProductStockControlHead.php b/src/Responses/V30/ProductStockControlHead.php new file mode 100644 index 0000000..46fa08e --- /dev/null +++ b/src/Responses/V30/ProductStockControlHead.php @@ -0,0 +1,40 @@ + $rows */ + public function __construct( + public ?\Carbon\Carbon $createdDate, + public ?int $id, + public ?string $locationName, + public int $locationId, + public ?\Carbon\Carbon $processDate, + public ?string $username, + public ?int $userId, + public ?array $rows, + public ?string $eventLog, + public ?int $warehouseStockControlEmailTemplateId, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + createdDate: isset($data['CreatedDate']) ? \Carbon\Carbon::parse($data['CreatedDate']) : null, + id: $data['Id'] ?? null, + locationName: $data['LocationName'] ?? null, + locationId: $data['LocationId'] ?? 0, + processDate: isset($data['ProcessDate']) ? \Carbon\Carbon::parse($data['ProcessDate']) : null, + username: $data['Username'] ?? null, + userId: $data['UserId'] ?? null, + rows: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductStockControlRow::make($item), $data['Rows'] ?? []), + eventLog: $data['EventLog'] ?? null, + warehouseStockControlEmailTemplateId: $data['WarehouseStockControlEmailTemplateId'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductStockControlRow.php b/src/Responses/V30/ProductStockControlRow.php new file mode 100644 index 0000000..3da4403 --- /dev/null +++ b/src/Responses/V30/ProductStockControlRow.php @@ -0,0 +1,50 @@ + $barcodeExtraList */ + public function __construct( + public ?int $id, + public ?int $productStockHeadId, + public int $productId, + public ?string $productDescription, + public ?string $productDescription2, + public ?string $vendorcode, + public float $stockTotal, + public float $stockOnCurrentLocation, + public ?float $stockCountedByUser, + public ?\Carbon\Carbon $stockLevelDate, + public ?string $barcode, + public ?string $productCode, + public ?string $barcode2, + public ?string $systemBarcode, + public ?array $barcodeExtraList, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? null, + productStockHeadId: $data['ProductStockHeadId'] ?? null, + productId: $data['ProductId'] ?? 0, + productDescription: $data['ProductDescription'] ?? null, + productDescription2: $data['ProductDescription2'] ?? null, + vendorcode: $data['Vendorcode'] ?? null, + stockTotal: $data['StockTotal'] ?? 0.0, + stockOnCurrentLocation: $data['StockOnCurrentLocation'] ?? 0.0, + stockCountedByUser: $data['StockCountedByUser'] ?? null, + stockLevelDate: isset($data['StockLevelDate']) ? \Carbon\Carbon::parse($data['StockLevelDate']) : null, + barcode: $data['Barcode'] ?? null, + productCode: $data['ProductCode'] ?? null, + barcode2: $data['Barcode2'] ?? null, + systemBarcode: $data['SystemBarcode'] ?? null, + barcodeExtraList: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductExtraBarcode::make($item), $data['BarcodeExtraList'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductStockInformationV2.php b/src/Responses/V30/ProductStockInformationV2.php new file mode 100644 index 0000000..1f9b6b6 --- /dev/null +++ b/src/Responses/V30/ProductStockInformationV2.php @@ -0,0 +1,35 @@ + $warehouseDefaultPickLocations + * @param array<\Webparking\Logic4Client\Data\V30\ProductStockInformationWarehouseStock> $stockInformation + */ + public function __construct( + public int $productId, + public float $totalStock, + public float $reservedStock, + public float $freeStock, + public ?array $warehouseDefaultPickLocations, + public ?array $stockInformation, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + totalStock: $data['TotalStock'] ?? 0.0, + reservedStock: $data['ReservedStock'] ?? 0.0, + freeStock: $data['FreeStock'] ?? 0.0, + warehouseDefaultPickLocations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductStockInformationWarehouseDefaultPickLocation::make($item), $data['WarehouseDefaultPickLocations'] ?? []), + stockInformation: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductStockInformationWarehouseStock::make($item), $data['StockInformation'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductStockLocations.php b/src/Responses/V30/ProductStockLocations.php new file mode 100644 index 0000000..21add59 --- /dev/null +++ b/src/Responses/V30/ProductStockLocations.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + locationId: $data['LocationId'] ?? 0, + location: $data['Location'] ?? null, + productId: $data['ProductId'] ?? 0, + qty: $data['Qty'] ?? 0.0, + freeStock: $data['FreeStock'] ?? 0.0, + zoneId: $data['ZoneId'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductStockMutation.php b/src/Responses/V30/ProductStockMutation.php new file mode 100644 index 0000000..6bb6873 --- /dev/null +++ b/src/Responses/V30/ProductStockMutation.php @@ -0,0 +1,43 @@ + $data */ + public static function make(array $data): self + { + return new self( + productCode: $data['ProductCode'] ?? null, + buyOrderId: $data['BuyOrderId'] ?? null, + mutationDateTime: isset($data['MutationDateTime']) ? \Carbon\Carbon::parse($data['MutationDateTime']) : null, + buyPrice: $data['BuyPrice'] ?? 0.0, + stockMutationType: $data['StockMutationType'] ?? null, + ITSIssueId: $data['ITS_IssueId'] ?? null, + pickbonId: $data['PickbonId'] ?? null, + productId: $data['ProductId'] ?? 0, + amount: $data['Amount'] ?? 0.0, + remarks: $data['Remarks'] ?? null, + stockLocationId: $data['StockLocationId'] ?? 0, + stockMutationTypeId: $data['StockMutationTypeId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/ProductStockMutationTypeV11.php b/src/Responses/V30/ProductStockMutationTypeV11.php new file mode 100644 index 0000000..cc49fc1 --- /dev/null +++ b/src/Responses/V30/ProductStockMutationTypeV11.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + negative: $data['Negative'] ?? false, + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductStockSupplierWithActive.php b/src/Responses/V30/ProductStockSupplierWithActive.php new file mode 100644 index 0000000..e845e34 --- /dev/null +++ b/src/Responses/V30/ProductStockSupplierWithActive.php @@ -0,0 +1,29 @@ + $data */ + public static function make(array $data): self + { + return new self( + active: $data['Active'] ?? false, + supplierId: $data['SupplierId'] ?? 0, + productNextDelivery: isset($data['ProductNextDelivery']) ? \Carbon\Carbon::parse($data['ProductNextDelivery']) : null, + productId: $data['ProductId'] ?? 0, + qty: $data['Qty'] ?? 0.0, + ); + } +} diff --git a/src/Responses/V30/ProductStockSuppliers.php b/src/Responses/V30/ProductStockSuppliers.php new file mode 100644 index 0000000..1209b20 --- /dev/null +++ b/src/Responses/V30/ProductStockSuppliers.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + supplierId: $data['SupplierId'] ?? 0, + productNextDelivery: isset($data['ProductNextDelivery']) ? \Carbon\Carbon::parse($data['ProductNextDelivery']) : null, + productId: $data['ProductId'] ?? 0, + qty: $data['Qty'] ?? 0.0, + ); + } +} diff --git a/src/Responses/V30/ProductStockWarehouseWithDefaultPickLocation.php b/src/Responses/V30/ProductStockWarehouseWithDefaultPickLocation.php new file mode 100644 index 0000000..2f00c60 --- /dev/null +++ b/src/Responses/V30/ProductStockWarehouseWithDefaultPickLocation.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + warehouseId: $data['WarehouseId'] ?? 0, + minimalStock: $data['MinimalStock'] ?? 0.0, + maximumStock: $data['MaximumStock'] ?? null, + defaultPickLocationId: $data['DefaultPickLocationId'] ?? null, + note: $data['Note'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductSupplier.php b/src/Responses/V30/ProductSupplier.php new file mode 100644 index 0000000..374a7ee --- /dev/null +++ b/src/Responses/V30/ProductSupplier.php @@ -0,0 +1,32 @@ + $creditorBuyPrices */ + public function __construct( + public int $productId, + public ?string $creditorName, + public ?string $creditorProductCode, + public bool $isActive, + public int $creditorId, + public ?array $creditorBuyPrices, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + creditorName: $data['CreditorName'] ?? null, + creditorProductCode: $data['CreditorProductCode'] ?? null, + isActive: $data['IsActive'] ?? false, + creditorId: $data['CreditorId'] ?? 0, + creditorBuyPrices: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\KeyValuePairOfintAnddecimal::make($item), $data['CreditorBuyPrices'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductSupplierNextDelivery.php b/src/Responses/V30/ProductSupplierNextDelivery.php new file mode 100644 index 0000000..06ae458 --- /dev/null +++ b/src/Responses/V30/ProductSupplierNextDelivery.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + supplierId: $data['SupplierId'] ?? 0, + deliveryDate: isset($data['DeliveryDate']) ? \Carbon\Carbon::parse($data['DeliveryDate']) : null, + ); + } +} diff --git a/src/Responses/V30/ProductTemplate.php b/src/Responses/V30/ProductTemplate.php new file mode 100644 index 0000000..d7b56f9 --- /dev/null +++ b/src/Responses/V30/ProductTemplate.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + templateId: $data['TemplateId'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductTemplateProductValue.php b/src/Responses/V30/ProductTemplateProductValue.php new file mode 100644 index 0000000..544092a --- /dev/null +++ b/src/Responses/V30/ProductTemplateProductValue.php @@ -0,0 +1,28 @@ + $values */ + public function __construct( + public int $productId, + public int $templatePropertyId, + public ?array $values, + public ?string $templatePropertyName, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + templatePropertyId: $data['TemplatePropertyId'] ?? 0, + values: $data['Values'] ?? null, + templatePropertyName: $data['TemplatePropertyName'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductTemplateProperty.php b/src/Responses/V30/ProductTemplateProperty.php new file mode 100644 index 0000000..97b22c9 --- /dev/null +++ b/src/Responses/V30/ProductTemplateProperty.php @@ -0,0 +1,41 @@ + $nameTranslations + * @param array<\Webparking\Logic4Client\Data\V30\Translation> $filterInfomations + * @param array<\Webparking\Logic4Client\Data\V30\Translation> $unitTranslations + * @param array $values + */ + public function __construct( + public int $templatePropertyId, + public ?string $name, + public ?array $nameTranslations, + public ?array $filterInfomations, + public ?string $unit, + public ?array $unitTranslations, + public ?string $remark, + public ?array $values, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + templatePropertyId: $data['TemplatePropertyId'] ?? 0, + name: $data['Name'] ?? null, + nameTranslations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\Translation::make($item), $data['NameTranslations'] ?? []), + filterInfomations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\Translation::make($item), $data['FilterInfomations'] ?? []), + unit: $data['Unit'] ?? null, + unitTranslations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\Translation::make($item), $data['UnitTranslations'] ?? []), + remark: $data['Remark'] ?? null, + values: $data['Values'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductTemplatesWithTranslation.php b/src/Responses/V30/ProductTemplatesWithTranslation.php new file mode 100644 index 0000000..5d8c22e --- /dev/null +++ b/src/Responses/V30/ProductTemplatesWithTranslation.php @@ -0,0 +1,27 @@ + $productTemplates + * @param array<\Webparking\Logic4Client\Data\V30\ProductTemplatePropertyWithTranslation> $productTemplateTranslations + */ + public function __construct( + public ?array $productTemplates, + public ?array $productTemplateTranslations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productTemplates: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductTemplateValuesWithTranslation::make($item), $data['ProductTemplates'] ?? []), + productTemplateTranslations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductTemplatePropertyWithTranslation::make($item), $data['ProductTemplateTranslations'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductUnit.php b/src/Responses/V30/ProductUnit.php new file mode 100644 index 0000000..6c94661 --- /dev/null +++ b/src/Responses/V30/ProductUnit.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + unitId: $data['UnitId'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ProductV14.php b/src/Responses/V30/ProductV14.php new file mode 100644 index 0000000..242b249 --- /dev/null +++ b/src/Responses/V30/ProductV14.php @@ -0,0 +1,194 @@ + $shiftPrices + * @param array<\Webparking\Logic4Client\Data\V30\FreeValue> $freeValues + * @param array<\Webparking\Logic4Client\Data\V30\Translation> $descriptions + * @param array<\Webparking\Logic4Client\Data\V30\ProductGroup> $productGroups + * @param array<\Webparking\Logic4Client\Data\V30\ProductExtraBarcode> $barcodeExtraList + * @param array<\Webparking\Logic4Client\Data\V30\ProductStockWarehouse> $wareHouses + * @param array $tags + */ + public function __construct( + public float $costPrice, + public ?array $shiftPrices, + public int $productId, + public ?string $productCode, + public ?string $productName1, + public ?string $productName2, + public ?string $productInfo, + public int $statusId, + public ?string $statusname, + public int $brandId, + public ?string $brandname, + public ?string $imagename1, + public ?string $imageUrl1, + public ?string $imagename2, + public ?string $imageUrl2, + public ?string $imagename3, + public ?string $imageUrl3, + public ?string $unit, + public int $unitId, + public int $minSaleAmount, + public ?int $minSaleAmountWebshop, + public ?int $minSaleBuyAmountDropShipment, + public ?int $saleCountIncrement, + public ?int $saleCountIncrementWebshop, + public ?int $saleCountIncrementDropShipment, + public ?int $minBuyAmount, + public float $vatPercent, + public ?int $vatCodeId, + public float $sellPriceGross, + public float $weight, + public float $volume, + public ?\Webparking\Logic4Client\Data\V30\ProductOffer $offer, + public ?float $sellPriceAdvice, + public float $buyPrice, + public int $productGroupId1, + public ?int $productGroupId2, + public ?int $productGroupId3, + public ?int $productGroupId4, + public ?int $buyCountIncrement, + public ?float $sellPriceLowestForWebshop, + public bool $excludePriceFromPricelistCalculations, + public ?float $additionalBuyPriceAmount, + public ?float $additionalBuyPricePercentage, + public ?bool $isComposedProduct, + public bool $isAssemblyProduct, + public bool $composedProductSetChildSellPricesToZero, + public ?bool $composedProductSetSellPriceToZero, + public float $freeStock, + public ?int $externalStockActiveSupplier, + public ?int $creditorDiscountGroupId, + public ?\Carbon\Carbon $dateTimeLastChanged, + public ?\Carbon\Carbon $dateTimeAdded, + public ?string $barCode1, + public ?array $freeValues, + public ?int $sorting, + public ?\Carbon\Carbon $nextDelivery, + public ?array $descriptions, + public ?array $productGroups, + public ?string $barcode2, + public ?array $barcodeExtraList, + public ?string $systemBarcode, + public int $productGroup1ProductGroupTypeId, + public ?array $wareHouses, + public ?int $minimalStock, + public int $PCSinInsidePackage, + public int $PCSinOutsidePackage, + public ?\Webparking\Logic4Client\Data\V30\ProductType $productType1, + public ?\Webparking\Logic4Client\Data\V30\ProductType $productType2, + public ?\Webparking\Logic4Client\Data\V30\ProductType $productType3, + public ?\Webparking\Logic4Client\Data\V30\ProductType $productType4, + public ?\Webparking\Logic4Client\Data\V30\ProductType $productType5, + public ?float $standardAmount, + public ?string $vendorCode, + public ?int $productTemplateId, + public ?string $productTemplateName, + public bool $hasVariants, + public ?int $variantParentProductId, + public ?array $tags, + public ?int $defaultPickLocation, + public ?int $defaultBulkLocation, + public bool $hidePricesOnWebsite, + public bool $showOfferButtonOnWebsite, + public bool $hideStartingPricesOnWebsite, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + costPrice: $data['CostPrice'] ?? 0.0, + shiftPrices: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductShiftPriceV14::make($item), $data['ShiftPrices'] ?? []), + productId: $data['ProductId'] ?? 0, + productCode: $data['ProductCode'] ?? null, + productName1: $data['ProductName1'] ?? null, + productName2: $data['ProductName2'] ?? null, + productInfo: $data['ProductInfo'] ?? null, + statusId: $data['StatusId'] ?? 0, + statusname: $data['Statusname'] ?? null, + brandId: $data['BrandId'] ?? 0, + brandname: $data['Brandname'] ?? null, + imagename1: $data['Imagename1'] ?? null, + imageUrl1: $data['ImageUrl1'] ?? null, + imagename2: $data['Imagename2'] ?? null, + imageUrl2: $data['ImageUrl2'] ?? null, + imagename3: $data['Imagename3'] ?? null, + imageUrl3: $data['ImageUrl3'] ?? null, + unit: $data['Unit'] ?? null, + unitId: $data['UnitId'] ?? 0, + minSaleAmount: $data['MinSaleAmount'] ?? 0, + minSaleAmountWebshop: $data['MinSaleAmountWebshop'] ?? null, + minSaleBuyAmountDropShipment: $data['MinSaleBuyAmountDropShipment'] ?? null, + saleCountIncrement: $data['SaleCountIncrement'] ?? null, + saleCountIncrementWebshop: $data['SaleCountIncrementWebshop'] ?? null, + saleCountIncrementDropShipment: $data['SaleCountIncrementDropShipment'] ?? null, + minBuyAmount: $data['MinBuyAmount'] ?? null, + vatPercent: $data['VatPercent'] ?? 0.0, + vatCodeId: $data['VatCodeId'] ?? null, + sellPriceGross: $data['SellPriceGross'] ?? 0.0, + weight: $data['Weight'] ?? 0.0, + volume: $data['Volume'] ?? 0.0, + offer: isset($data['Offer']) ? \Webparking\Logic4Client\Data\V30\ProductOffer::make($data['Offer']) : null, + sellPriceAdvice: $data['SellPriceAdvice'] ?? null, + buyPrice: $data['BuyPrice'] ?? 0.0, + productGroupId1: $data['ProductGroupId1'] ?? 0, + productGroupId2: $data['ProductGroupId2'] ?? null, + productGroupId3: $data['ProductGroupId3'] ?? null, + productGroupId4: $data['ProductGroupId4'] ?? null, + buyCountIncrement: $data['BuyCountIncrement'] ?? null, + sellPriceLowestForWebshop: $data['SellPriceLowestForWebshop'] ?? null, + excludePriceFromPricelistCalculations: $data['ExcludePriceFromPricelistCalculations'] ?? false, + additionalBuyPriceAmount: $data['AdditionalBuyPriceAmount'] ?? null, + additionalBuyPricePercentage: $data['AdditionalBuyPricePercentage'] ?? null, + isComposedProduct: $data['IsComposedProduct'] ?? null, + isAssemblyProduct: $data['IsAssemblyProduct'] ?? false, + composedProductSetChildSellPricesToZero: $data['ComposedProductSetChildSellPricesToZero'] ?? false, + composedProductSetSellPriceToZero: $data['ComposedProductSetSellPriceToZero'] ?? null, + freeStock: $data['FreeStock'] ?? 0.0, + externalStockActiveSupplier: $data['ExternalStockActiveSupplier'] ?? null, + creditorDiscountGroupId: $data['CreditorDiscountGroupId'] ?? null, + dateTimeLastChanged: isset($data['DateTimeLastChanged']) ? \Carbon\Carbon::parse($data['DateTimeLastChanged']) : null, + dateTimeAdded: isset($data['DateTimeAdded']) ? \Carbon\Carbon::parse($data['DateTimeAdded']) : null, + barCode1: $data['BarCode1'] ?? null, + freeValues: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\FreeValue::make($item), $data['FreeValues'] ?? []), + sorting: $data['Sorting'] ?? null, + nextDelivery: isset($data['NextDelivery']) ? \Carbon\Carbon::parse($data['NextDelivery']) : null, + descriptions: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\Translation::make($item), $data['Descriptions'] ?? []), + productGroups: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductGroup::make($item), $data['ProductGroups'] ?? []), + barcode2: $data['Barcode2'] ?? null, + barcodeExtraList: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductExtraBarcode::make($item), $data['BarcodeExtraList'] ?? []), + systemBarcode: $data['SystemBarcode'] ?? null, + productGroup1ProductGroupTypeId: $data['ProductGroup1ProductGroupTypeId'] ?? 0, + wareHouses: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductStockWarehouse::make($item), $data['WareHouses'] ?? []), + minimalStock: $data['MinimalStock'] ?? null, + PCSinInsidePackage: $data['PCSinInsidePackage'] ?? 0, + PCSinOutsidePackage: $data['PCSinOutsidePackage'] ?? 0, + productType1: isset($data['ProductType1']) ? \Webparking\Logic4Client\Data\V30\ProductType::make($data['ProductType1']) : null, + productType2: isset($data['ProductType2']) ? \Webparking\Logic4Client\Data\V30\ProductType::make($data['ProductType2']) : null, + productType3: isset($data['ProductType3']) ? \Webparking\Logic4Client\Data\V30\ProductType::make($data['ProductType3']) : null, + productType4: isset($data['ProductType4']) ? \Webparking\Logic4Client\Data\V30\ProductType::make($data['ProductType4']) : null, + productType5: isset($data['ProductType5']) ? \Webparking\Logic4Client\Data\V30\ProductType::make($data['ProductType5']) : null, + standardAmount: $data['StandardAmount'] ?? null, + vendorCode: $data['VendorCode'] ?? null, + productTemplateId: $data['ProductTemplateId'] ?? null, + productTemplateName: $data['ProductTemplateName'] ?? null, + hasVariants: $data['HasVariants'] ?? false, + variantParentProductId: $data['VariantParentProductId'] ?? null, + tags: $data['Tags'] ?? null, + defaultPickLocation: $data['DefaultPickLocation'] ?? null, + defaultBulkLocation: $data['DefaultBulkLocation'] ?? null, + hidePricesOnWebsite: $data['HidePricesOnWebsite'] ?? false, + showOfferButtonOnWebsite: $data['ShowOfferButtonOnWebsite'] ?? false, + hideStartingPricesOnWebsite: $data['HideStartingPricesOnWebsite'] ?? false, + ); + } +} diff --git a/src/Responses/V30/ProductVariantBalk.php b/src/Responses/V30/ProductVariantBalk.php new file mode 100644 index 0000000..bb18701 --- /dev/null +++ b/src/Responses/V30/ProductVariantBalk.php @@ -0,0 +1,31 @@ + $productVariants + * @param array<\Webparking\Logic4Client\Data\V30\ProductVariantBalkTranslation> $productVariantBalkTranslations + */ + public function __construct( + public ?string $name, + public int $id, + public ?array $productVariants, + public ?array $productVariantBalkTranslations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + name: $data['Name'] ?? null, + id: $data['Id'] ?? 0, + productVariants: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductVariant::make($item), $data['ProductVariants'] ?? []), + productVariantBalkTranslations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductVariantBalkTranslation::make($item), $data['ProductVariantBalkTranslations'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductVariantBalkChildrenGroup.php b/src/Responses/V30/ProductVariantBalkChildrenGroup.php new file mode 100644 index 0000000..a76610d --- /dev/null +++ b/src/Responses/V30/ProductVariantBalkChildrenGroup.php @@ -0,0 +1,24 @@ + $children */ + public function __construct( + public int $productId, + public ?array $children, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + children: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ProductVariantBalkChildrenGroupChildren::make($item), $data['Children'] ?? []), + ); + } +} diff --git a/src/Responses/V30/ProductWithRelatedProductsV3.php b/src/Responses/V30/ProductWithRelatedProductsV3.php new file mode 100644 index 0000000..112e6a8 --- /dev/null +++ b/src/Responses/V30/ProductWithRelatedProductsV3.php @@ -0,0 +1,24 @@ + $relatedProducts */ + public function __construct( + public int $productId, + public ?array $relatedProducts, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + relatedProducts: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\RelatedProductV3::make($item), $data['RelatedProducts'] ?? []), + ); + } +} diff --git a/src/Responses/V30/Province.php b/src/Responses/V30/Province.php new file mode 100644 index 0000000..f7b9ece --- /dev/null +++ b/src/Responses/V30/Province.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/RelationStatus.php b/src/Responses/V30/RelationStatus.php new file mode 100644 index 0000000..c379abc --- /dev/null +++ b/src/Responses/V30/RelationStatus.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/RelationType.php b/src/Responses/V30/RelationType.php new file mode 100644 index 0000000..027fe1a --- /dev/null +++ b/src/Responses/V30/RelationType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Representative.php b/src/Responses/V30/Representative.php new file mode 100644 index 0000000..d6d8846 --- /dev/null +++ b/src/Responses/V30/Representative.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ReturnCategory.php b/src/Responses/V30/ReturnCategory.php new file mode 100644 index 0000000..d885a36 --- /dev/null +++ b/src/Responses/V30/ReturnCategory.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ReturnOrderV2.php b/src/Responses/V30/ReturnOrderV2.php new file mode 100644 index 0000000..b92f1a5 --- /dev/null +++ b/src/Responses/V30/ReturnOrderV2.php @@ -0,0 +1,126 @@ + $orderShipments + * @param array<\Webparking\Logic4Client\Data\V30\Payment> $payments + * @param array<\Webparking\Logic4Client\Data\V30\OrderRow> $orderRows + */ + public function __construct( + public int $categoryId, + public ?\Webparking\Logic4Client\Data\V30\ReturnProblem $problem, + public ?\Webparking\Logic4Client\Data\V30\ReturnSolution $solution, + public int $originalOrderId, + public ?\Carbon\Carbon $approvedReturnOrderDate, + public ?\Carbon\Carbon $receivedReturnOrderDate, + public int $debtorId, + public int $id, + public ?\Webparking\Logic4Client\Data\V30\OrderTotalsRead $totals, + public ?\Webparking\Logic4Client\Data\V30\PaymentMethod $paymentMethod, + public ?\Webparking\Logic4Client\Data\V30\OrderStatus $orderStatus, + public ?\Webparking\Logic4Client\Data\V30\OrderShippingMethod $shippingMethod, + public ?array $orderShipments, + public ?int $invoiceBelongsToOrderNumber, + public ?array $payments, + public ?\Webparking\Logic4Client\Data\V30\DebtorCostCentre $costCentre, + public ?\Webparking\Logic4Client\Data\V30\CustomerAddress $accountAddress, + public ?array $orderRows, + public ?int $deliveryProvinceId, + public ?int $invoiceProvinceId, + public ?int $accountProvinceId, + public ?string $lastClickGclIdValues, + public ?string $lastClickUtmValues, + public ?\Webparking\Logic4Client\Data\V30\CustomerAddress $deliveryAddress, + public ?\Webparking\Logic4Client\Data\V30\CustomerAddress $invoiceAddress, + public ?\Carbon\Carbon $creationDate, + public ?string $description, + public ?string $reference, + public ?int $branchId, + public ?int $userId, + public ?int $websiteDomainId, + public ?int $deliveryOptionId, + public ?\Carbon\Carbon $deliveryDate, + public ?\Webparking\Logic4Client\Data\V30\OrderShipmentFreeValue $orderShipmentFreeValues, + public ?string $notes, + public ?string $freeValue1, + public ?string $freeValue2, + public ?string $freeValue3, + public ?string $freeValue4, + public ?string $freeValue5, + public ?string $freeValue6, + public ?string $freeValue7, + public ?string $freeValue8, + public ?int $orderType1Id, + public ?int $orderType2Id, + public ?int $orderType3Id, + public ?int $orderType4Id, + public ?int $orderType5Id, + public ?int $orderType6Id, + public ?int $orderType7Id, + public ?int $orderType8Id, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + categoryId: $data['CategoryId'] ?? 0, + problem: isset($data['Problem']) ? \Webparking\Logic4Client\Data\V30\ReturnProblem::make($data['Problem']) : null, + solution: isset($data['Solution']) ? \Webparking\Logic4Client\Data\V30\ReturnSolution::make($data['Solution']) : null, + originalOrderId: $data['OriginalOrderId'] ?? 0, + approvedReturnOrderDate: isset($data['ApprovedReturnOrderDate']) ? \Carbon\Carbon::parse($data['ApprovedReturnOrderDate']) : null, + receivedReturnOrderDate: isset($data['ReceivedReturnOrderDate']) ? \Carbon\Carbon::parse($data['ReceivedReturnOrderDate']) : null, + debtorId: $data['DebtorId'] ?? 0, + id: $data['Id'] ?? 0, + totals: isset($data['Totals']) ? \Webparking\Logic4Client\Data\V30\OrderTotalsRead::make($data['Totals']) : null, + paymentMethod: isset($data['PaymentMethod']) ? \Webparking\Logic4Client\Data\V30\PaymentMethod::make($data['PaymentMethod']) : null, + orderStatus: isset($data['OrderStatus']) ? \Webparking\Logic4Client\Data\V30\OrderStatus::make($data['OrderStatus']) : null, + shippingMethod: isset($data['ShippingMethod']) ? \Webparking\Logic4Client\Data\V30\OrderShippingMethod::make($data['ShippingMethod']) : null, + orderShipments: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\OrderShipment::make($item), $data['OrderShipments'] ?? []), + invoiceBelongsToOrderNumber: $data['InvoiceBelongsToOrderNumber'] ?? null, + payments: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\Payment::make($item), $data['Payments'] ?? []), + costCentre: isset($data['CostCentre']) ? \Webparking\Logic4Client\Data\V30\DebtorCostCentre::make($data['CostCentre']) : null, + accountAddress: isset($data['AccountAddress']) ? \Webparking\Logic4Client\Data\V30\CustomerAddress::make($data['AccountAddress']) : null, + orderRows: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\OrderRow::make($item), $data['OrderRows'] ?? []), + deliveryProvinceId: $data['DeliveryProvinceId'] ?? null, + invoiceProvinceId: $data['InvoiceProvinceId'] ?? null, + accountProvinceId: $data['AccountProvinceId'] ?? null, + lastClickGclIdValues: $data['LastClickGclIdValues'] ?? null, + lastClickUtmValues: $data['LastClickUtmValues'] ?? null, + deliveryAddress: isset($data['DeliveryAddress']) ? \Webparking\Logic4Client\Data\V30\CustomerAddress::make($data['DeliveryAddress']) : null, + invoiceAddress: isset($data['InvoiceAddress']) ? \Webparking\Logic4Client\Data\V30\CustomerAddress::make($data['InvoiceAddress']) : null, + creationDate: isset($data['CreationDate']) ? \Carbon\Carbon::parse($data['CreationDate']) : null, + description: $data['Description'] ?? null, + reference: $data['Reference'] ?? null, + branchId: $data['BranchId'] ?? null, + userId: $data['UserId'] ?? null, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + deliveryOptionId: $data['DeliveryOptionId'] ?? null, + deliveryDate: isset($data['DeliveryDate']) ? \Carbon\Carbon::parse($data['DeliveryDate']) : null, + orderShipmentFreeValues: isset($data['OrderShipmentFreeValues']) ? \Webparking\Logic4Client\Data\V30\OrderShipmentFreeValue::make($data['OrderShipmentFreeValues']) : null, + notes: $data['Notes'] ?? null, + freeValue1: $data['FreeValue1'] ?? null, + freeValue2: $data['FreeValue2'] ?? null, + freeValue3: $data['FreeValue3'] ?? null, + freeValue4: $data['FreeValue4'] ?? null, + freeValue5: $data['FreeValue5'] ?? null, + freeValue6: $data['FreeValue6'] ?? null, + freeValue7: $data['FreeValue7'] ?? null, + freeValue8: $data['FreeValue8'] ?? null, + orderType1Id: $data['OrderType1Id'] ?? null, + orderType2Id: $data['OrderType2Id'] ?? null, + orderType3Id: $data['OrderType3Id'] ?? null, + orderType4Id: $data['OrderType4Id'] ?? null, + orderType5Id: $data['OrderType5Id'] ?? null, + orderType6Id: $data['OrderType6Id'] ?? null, + orderType7Id: $data['OrderType7Id'] ?? null, + orderType8Id: $data['OrderType8Id'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ReturnProblemV11.php b/src/Responses/V30/ReturnProblemV11.php new file mode 100644 index 0000000..0aa8e4a --- /dev/null +++ b/src/Responses/V30/ReturnProblemV11.php @@ -0,0 +1,28 @@ + $solutions */ + public function __construct( + public ?array $solutions, + public int $id, + public ?string $name, + public ?string $description, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + solutions: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\ReturnSolution::make($item), $data['Solutions'] ?? []), + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ReturnSolution.php b/src/Responses/V30/ReturnSolution.php new file mode 100644 index 0000000..00ba920 --- /dev/null +++ b/src/Responses/V30/ReturnSolution.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/SalesOrderDelivery.php b/src/Responses/V30/SalesOrderDelivery.php new file mode 100644 index 0000000..57c1dd2 --- /dev/null +++ b/src/Responses/V30/SalesOrderDelivery.php @@ -0,0 +1,38 @@ + $details */ + public function __construct( + public int $deliveryId, + public ?int $orderId, + public int $orderStatusId, + public ?\Carbon\Carbon $deliveryDate, + public int $debtorId, + public int $shippingMethodId, + public ?int $branchId, + public ?int $websiteDomainId, + public ?array $details, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + deliveryId: $data['DeliveryId'] ?? 0, + orderId: $data['OrderId'] ?? null, + orderStatusId: $data['OrderStatusId'] ?? 0, + deliveryDate: isset($data['DeliveryDate']) ? \Carbon\Carbon::parse($data['DeliveryDate']) : null, + debtorId: $data['DebtorId'] ?? 0, + shippingMethodId: $data['ShippingMethodId'] ?? 0, + branchId: $data['BranchId'] ?? null, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + details: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\SalesOrderDeliveryDetailRow::make($item), $data['Details'] ?? []), + ); + } +} diff --git a/src/Responses/V30/SalesOrderDeliveryRow.php b/src/Responses/V30/SalesOrderDeliveryRow.php new file mode 100644 index 0000000..66efc24 --- /dev/null +++ b/src/Responses/V30/SalesOrderDeliveryRow.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + rowId: $data['RowId'] ?? 0, + amountDelivered: $data['AmountDelivered'] ?? 0.0, + ); + } +} diff --git a/src/Responses/V30/SecondTypeContactGroup.php b/src/Responses/V30/SecondTypeContactGroup.php new file mode 100644 index 0000000..26f998a --- /dev/null +++ b/src/Responses/V30/SecondTypeContactGroup.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ShipperType.php b/src/Responses/V30/ShipperType.php new file mode 100644 index 0000000..09ba0ee --- /dev/null +++ b/src/Responses/V30/ShipperType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/ShippingMethod.php b/src/Responses/V30/ShippingMethod.php new file mode 100644 index 0000000..fec4114 --- /dev/null +++ b/src/Responses/V30/ShippingMethod.php @@ -0,0 +1,47 @@ + $countryIsoCodes + * @param array<\Webparking\Logic4Client\Data\V30\WebsiteDomain> $websiteDomains + */ + public function __construct( + public int $id, + public ?string $name, + public ?string $description, + public float $shipmentCosts, + public ?string $deliveryTime, + public bool $tracing, + public ?string $selectkeyCms, + public ?array $countryIsoCodes, + public float $basicAmount, + public ?float $freeShippingAboveAmount, + public ?float $freeShippingAboveAmountInclusive, + public ?array $websiteDomains, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + description: $data['Description'] ?? null, + shipmentCosts: $data['ShipmentCosts'] ?? 0.0, + deliveryTime: $data['DeliveryTime'] ?? null, + tracing: $data['Tracing'] ?? false, + selectkeyCms: $data['SelectkeyCms'] ?? null, + countryIsoCodes: $data['CountryIsoCodes'] ?? null, + basicAmount: $data['BasicAmount'] ?? 0.0, + freeShippingAboveAmount: $data['FreeShippingAboveAmount'] ?? null, + freeShippingAboveAmountInclusive: $data['FreeShippingAboveAmountInclusive'] ?? null, + websiteDomains: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\WebsiteDomain::make($item), $data['WebsiteDomains'] ?? []), + ); + } +} diff --git a/src/Responses/V30/StockLocationForProduct.php b/src/Responses/V30/StockLocationForProduct.php new file mode 100644 index 0000000..5f58711 --- /dev/null +++ b/src/Responses/V30/StockLocationForProduct.php @@ -0,0 +1,26 @@ + $stockLocations */ + public function __construct( + public int $numberOfStockLocations, + public int $productId, + public ?array $stockLocations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + numberOfStockLocations: $data['NumberOfStockLocations'] ?? 0, + productId: $data['ProductId'] ?? 0, + stockLocations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\StockLocationForProductItem::make($item), $data['StockLocations'] ?? []), + ); + } +} diff --git a/src/Responses/V30/Subscriber.php b/src/Responses/V30/Subscriber.php new file mode 100644 index 0000000..0d015e8 --- /dev/null +++ b/src/Responses/V30/Subscriber.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + emailaddress: $data['Emailaddress'] ?? null, + globalisationId: $data['GlobalisationId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/ThirdPartyExternalIdentifierType.php b/src/Responses/V30/ThirdPartyExternalIdentifierType.php new file mode 100644 index 0000000..e9139e4 --- /dev/null +++ b/src/Responses/V30/ThirdPartyExternalIdentifierType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Top10Item.php b/src/Responses/V30/Top10Item.php new file mode 100644 index 0000000..afcfd19 --- /dev/null +++ b/src/Responses/V30/Top10Item.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? null, + name: $data['Name'] ?? null, + value: $data['Value'] ?? 0.0, + ); + } +} diff --git a/src/Responses/V30/TypeContactGroup.php b/src/Responses/V30/TypeContactGroup.php new file mode 100644 index 0000000..97ef735 --- /dev/null +++ b/src/Responses/V30/TypeContactGroup.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/TypeCostCenter.php b/src/Responses/V30/TypeCostCenter.php new file mode 100644 index 0000000..04e3c0a --- /dev/null +++ b/src/Responses/V30/TypeCostCenter.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/TypeEntityCode.php b/src/Responses/V30/TypeEntityCode.php new file mode 100644 index 0000000..94808a5 --- /dev/null +++ b/src/Responses/V30/TypeEntityCode.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/TypeFinancialBookingStatus.php b/src/Responses/V30/TypeFinancialBookingStatus.php new file mode 100644 index 0000000..3bb0f62 --- /dev/null +++ b/src/Responses/V30/TypeFinancialBookingStatus.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/TypeLedgerColumn.php b/src/Responses/V30/TypeLedgerColumn.php new file mode 100644 index 0000000..92b920f --- /dev/null +++ b/src/Responses/V30/TypeLedgerColumn.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + sortId: $data['SortId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/TypeRoundOrderStatus.php b/src/Responses/V30/TypeRoundOrderStatus.php new file mode 100644 index 0000000..000dc17 --- /dev/null +++ b/src/Responses/V30/TypeRoundOrderStatus.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + enablePlanning: $data['EnablePlanning'] ?? false, + customerAgreesToDeliver: $data['CustomerAgreesToDeliver'] ?? false, + ); + } +} diff --git a/src/Responses/V30/TypeRoundStatus.php b/src/Responses/V30/TypeRoundStatus.php new file mode 100644 index 0000000..bf68611 --- /dev/null +++ b/src/Responses/V30/TypeRoundStatus.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + blocked: $data['Blocked'] ?? false, + ); + } +} diff --git a/src/Responses/V30/TypeTransactionCode.php b/src/Responses/V30/TypeTransactionCode.php new file mode 100644 index 0000000..06f88c8 --- /dev/null +++ b/src/Responses/V30/TypeTransactionCode.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Userstatus.php b/src/Responses/V30/Userstatus.php new file mode 100644 index 0000000..4783ebc --- /dev/null +++ b/src/Responses/V30/Userstatus.php @@ -0,0 +1,39 @@ + $data */ + public static function make(array $data): self + { + return new self( + userName: $data['UserName'] ?? null, + statusDateTimeSince: isset($data['StatusDateTimeSince']) ? \Carbon\Carbon::parse($data['StatusDateTimeSince']) : null, + statusId: $data['StatusId'] ?? 0, + isAutoAwayStatus: $data['IsAutoAwayStatus'] ?? false, + isOfflineStatus: $data['IsOfflineStatus'] ?? false, + isOnlineStatus: $data['IsOnlineStatus'] ?? false, + isOnThePhoneStatus: $data['IsOnThePhoneStatus'] ?? false, + statusName: $data['StatusName'] ?? null, + statusNotes: $data['StatusNotes'] ?? null, + userId: $data['UserId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/ValuevsBudget.php b/src/Responses/V30/ValuevsBudget.php new file mode 100644 index 0000000..138eba5 --- /dev/null +++ b/src/Responses/V30/ValuevsBudget.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + budget: $data['Budget'] ?? null, + typeContactGroupId: $data['TypeContactGroupId'] ?? null, + value: $data['Value'] ?? 0.0, + dateStart: isset($data['DateStart']) ? \Carbon\Carbon::parse($data['DateStart']) : null, + dateEnd: isset($data['DateEnd']) ? \Carbon\Carbon::parse($data['DateEnd']) : null, + periodDescription: $data['PeriodDescription'] ?? null, + ); + } +} diff --git a/src/Responses/V30/VariantBalkCategory.php b/src/Responses/V30/VariantBalkCategory.php new file mode 100644 index 0000000..a3c1dd6 --- /dev/null +++ b/src/Responses/V30/VariantBalkCategory.php @@ -0,0 +1,26 @@ + $translations */ + public function __construct( + public int $id, + public ?string $value, + public ?array $translations, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + value: $data['Value'] ?? null, + translations: array_map(static fn (array $item) => \Webparking\Logic4Client\Data\V30\VariantBalkCategoryTranslation::make($item), $data['Translations'] ?? []), + ); + } +} diff --git a/src/Responses/V30/VatCode.php b/src/Responses/V30/VatCode.php new file mode 100644 index 0000000..187ca4b --- /dev/null +++ b/src/Responses/V30/VatCode.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + percent: $data['Percent'] ?? 0.0, + name: $data['Name'] ?? null, + ); + } +} diff --git a/src/Responses/V30/Vehicle.php b/src/Responses/V30/Vehicle.php new file mode 100644 index 0000000..542e199 --- /dev/null +++ b/src/Responses/V30/Vehicle.php @@ -0,0 +1,41 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + licensePlate: $data['LicensePlate'] ?? null, + startAddress: $data['StartAddress'] ?? null, + startPostalCode: $data['StartPostalCode'] ?? null, + startCity: $data['StartCity'] ?? null, + endAddress: $data['EndAddress'] ?? null, + endPostalCode: $data['EndPostalCode'] ?? null, + endCity: $data['EndCity'] ?? null, + type: $data['Type'] ?? null, + minutes: $data['Minutes'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WareHouse.php b/src/Responses/V30/WareHouse.php new file mode 100644 index 0000000..e8a1e31 --- /dev/null +++ b/src/Responses/V30/WareHouse.php @@ -0,0 +1,33 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + stockLocationIdWhenBilling: $data['StockLocationIdWhenBilling'] ?? null, + defaultPickStockLocationId: $data['DefaultPickStockLocationId'] ?? null, + defaultPickStockLocationIdForBuyorderDelivery: $data['DefaultPickStockLocationIdForBuyorderDelivery'] ?? null, + warehouseStockControlEmailTemplate: $data['WarehouseStockControlEmailTemplate'] ?? null, + reservationLocationId: $data['ReservationLocationId'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WarehouseStockLocation.php b/src/Responses/V30/WarehouseStockLocation.php new file mode 100644 index 0000000..2dc71ec --- /dev/null +++ b/src/Responses/V30/WarehouseStockLocation.php @@ -0,0 +1,61 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + sortId: $data['SortId'] ?? 0, + blockLocationForStockIncrease: $data['BlockLocationForStockIncrease'] ?? false, + blockLocationForStockDecrease: $data['BlockLocationForStockDecrease'] ?? false, + databaseAdministration: $data['DatabaseAdministration'] ?? 0, + warehouseColumnId: $data['WarehouseColumnId'] ?? 0, + warehouseColumnSortId: $data['WarehouseColumnSortId'] ?? 0, + warehouseRowId: $data['WarehouseRowId'] ?? 0, + warehouseRowSortId: $data['WarehouseRowSortId'] ?? 0, + warehouseId: $data['WarehouseId'] ?? 0, + warehouseSortId: $data['WarehouseSortId'] ?? 0, + warehouseLocationZoneId: $data['WarehouseLocationZoneId'] ?? null, + warehouseColumnZoneId: $data['WarehouseColumnZoneId'] ?? null, + warehouseRowZoneId: $data['WarehouseRowZoneId'] ?? null, + remarks: $data['Remarks'] ?? null, + locationName: $data['LocationName'] ?? null, + stockType: $data['StockType'] ?? 0, + columnName: $data['ColumnName'] ?? null, + rowName: $data['RowName'] ?? null, + warehouseName: $data['WarehouseName'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WarehouseZone.php b/src/Responses/V30/WarehouseZone.php new file mode 100644 index 0000000..1f700ba --- /dev/null +++ b/src/Responses/V30/WarehouseZone.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + name: $data['Name'] ?? null, + warehouseId: $data['WarehouseId'] ?? 0, + warehouseName: $data['WarehouseName'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WebshopOrderlistProduct.php b/src/Responses/V30/WebshopOrderlistProduct.php new file mode 100644 index 0000000..bab874d --- /dev/null +++ b/src/Responses/V30/WebshopOrderlistProduct.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + typeId: $data['TypeId'] ?? null, + qty: $data['Qty'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WebshopSearchWord.php b/src/Responses/V30/WebshopSearchWord.php new file mode 100644 index 0000000..1ef0f27 --- /dev/null +++ b/src/Responses/V30/WebshopSearchWord.php @@ -0,0 +1,31 @@ + $data */ + public static function make(array $data): self + { + return new self( + dateTimeAdded: isset($data['DateTimeAdded']) ? \Carbon\Carbon::parse($data['DateTimeAdded']) : null, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + searchTerm: $data['SearchTerm'] ?? null, + visitorCode: $data['VisitorCode'] ?? null, + resultCount: $data['ResultCount'] ?? 0, + globalisationId: $data['GlobalisationId'] ?? 0, + ); + } +} diff --git a/src/Responses/V30/WebshopUser.php b/src/Responses/V30/WebshopUser.php new file mode 100644 index 0000000..4f159b8 --- /dev/null +++ b/src/Responses/V30/WebshopUser.php @@ -0,0 +1,112 @@ + $debtorWebshopUserProductExcludedFromAnnualBudgets */ + public function __construct( + public bool $displayPricesWithoutPricelistCalculations, + public ?int $webshopUserId, + public int $debtorId, + public bool $limitedToOrderlist, + public bool $canOrderOutsideOrderListWithApproval, + public bool $canModifyOrderList, + public ?int $supervisorId1, + public ?int $supervisorId2, + public bool $hideProductPrices, + public int $showOrdersRightLevel, + public int $showInvoicesRightLevel, + public ?float $annualBudget, + public bool $hasAnualBudget, + public ?float $maxOrderAmountWithoutApproval, + public int $webShopUserTypeId, + public ?string $username, + public ?string $email, + public ?string $telephoneNumber, + public ?string $city, + public ?string $postalCode, + public ?string $address, + public ?int $deliveryAddressId, + public ?float $minOrderAmount, + public int $countryId, + public ?string $companyName, + public ?string $name, + public int $globalisationId, + public bool $webshopAssortment, + public ?int $debtorCostCenterId, + public bool $canParkOrders, + public ?\Carbon\Carbon $passwordLastchanged, + public bool $navigateWebshopUserToProductlistAfterLogin, + public bool $navigateWebshopUserToAssortmentAfterLogin, + public bool $canUseCustomDeliveryAddress, + public bool $isParticulier, + public int $relationTypeId, + public bool $canUseCustomInvoiceAddress, + public ?int $invoiceAddressId, + public bool $limitedToAssortment, + public bool $isExternalBuyer, + public bool $hideFromPrices, + public ?int $relationGroupId, + public ?float $offerModePriceMargin, + public bool $offerModeUseLocations, + public ?string $offerModeExportConfigurationJson, + public ?array $debtorWebshopUserProductExcludedFromAnnualBudgets, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + displayPricesWithoutPricelistCalculations: $data['DisplayPricesWithoutPricelistCalculations'] ?? false, + webshopUserId: $data['WebshopUserId'] ?? null, + debtorId: $data['DebtorId'] ?? 0, + limitedToOrderlist: $data['LimitedToOrderlist'] ?? false, + canOrderOutsideOrderListWithApproval: $data['CanOrderOutsideOrderListWithApproval'] ?? false, + canModifyOrderList: $data['CanModifyOrderList'] ?? false, + supervisorId1: $data['SupervisorId1'] ?? null, + supervisorId2: $data['SupervisorId2'] ?? null, + hideProductPrices: $data['HideProductPrices'] ?? false, + showOrdersRightLevel: $data['ShowOrdersRightLevel'] ?? 0, + showInvoicesRightLevel: $data['ShowInvoicesRightLevel'] ?? 0, + annualBudget: $data['AnnualBudget'] ?? null, + hasAnualBudget: $data['HasAnualBudget'] ?? false, + maxOrderAmountWithoutApproval: $data['MaxOrderAmountWithoutApproval'] ?? null, + webShopUserTypeId: $data['WebShopUserTypeId'] ?? 0, + username: $data['Username'] ?? null, + email: $data['Email'] ?? null, + telephoneNumber: $data['TelephoneNumber'] ?? null, + city: $data['City'] ?? null, + postalCode: $data['PostalCode'] ?? null, + address: $data['Address'] ?? null, + deliveryAddressId: $data['DeliveryAddressId'] ?? null, + minOrderAmount: $data['MinOrderAmount'] ?? null, + countryId: $data['CountryId'] ?? 0, + companyName: $data['CompanyName'] ?? null, + name: $data['Name'] ?? null, + globalisationId: $data['GlobalisationId'] ?? 0, + webshopAssortment: $data['WebshopAssortment'] ?? false, + debtorCostCenterId: $data['Debtor_CostCenterId'] ?? null, + canParkOrders: $data['CanParkOrders'] ?? false, + passwordLastchanged: isset($data['Password_Lastchanged']) ? \Carbon\Carbon::parse($data['Password_Lastchanged']) : null, + navigateWebshopUserToProductlistAfterLogin: $data['NavigateWebshopUser_ToProductlistAfterLogin'] ?? false, + navigateWebshopUserToAssortmentAfterLogin: $data['NavigateWebshopUser_ToAssortmentAfterLogin'] ?? false, + canUseCustomDeliveryAddress: $data['CanUseCustomDeliveryAddress'] ?? false, + isParticulier: $data['IsParticulier'] ?? false, + relationTypeId: $data['RelationTypeId'] ?? 0, + canUseCustomInvoiceAddress: $data['CanUseCustomInvoiceAddress'] ?? false, + invoiceAddressId: $data['InvoiceAddressId'] ?? null, + limitedToAssortment: $data['LimitedToAssortment'] ?? false, + isExternalBuyer: $data['IsExternalBuyer'] ?? false, + hideFromPrices: $data['HideFromPrices'] ?? false, + relationGroupId: $data['RelationGroupId'] ?? null, + offerModePriceMargin: $data['OfferModePriceMargin'] ?? null, + offerModeUseLocations: $data['OfferModeUseLocations'] ?? false, + offerModeExportConfigurationJson: $data['OfferModeExportConfigurationJson'] ?? null, + debtorWebshopUserProductExcludedFromAnnualBudgets: $data['Debtor_WebshopUser_ProductExcludedFromAnnualBudgets'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WebshopUserProductOfProductV12.php b/src/Responses/V30/WebshopUserProductOfProductV12.php new file mode 100644 index 0000000..c12df24 --- /dev/null +++ b/src/Responses/V30/WebshopUserProductOfProductV12.php @@ -0,0 +1,47 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + dateTimeAdded: isset($data['DateTimeAdded']) ? \Carbon\Carbon::parse($data['DateTimeAdded']) : null, + composedProductParentId: $data['ComposedProductParentId'] ?? null, + webshopUserId: $data['WebshopUserId'] ?? null, + productInformation: isset($data['ProductInformation']) ? \Webparking\Logic4Client\Data\V30\ProductV12::make($data['ProductInformation']) : null, + productId: $data['ProductId'] ?? 0, + qtyDec: $data['QtyDec'] ?? null, + commission: $data['Commission'] ?? null, + excludedFromAnnualBudget: $data['ExcludedFromAnnualBudget'] ?? false, + typeId: $data['TypeId'] ?? 0, + debtorId: $data['DebtorId'] ?? null, + visitorCode: $data['VisitorCode'] ?? null, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + shoppingCartKey: $data['ShoppingCartKey'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WebshopUserProductType.php b/src/Responses/V30/WebshopUserProductType.php new file mode 100644 index 0000000..925d080 --- /dev/null +++ b/src/Responses/V30/WebshopUserProductType.php @@ -0,0 +1,25 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + type: $data['Type'] ?? null, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WebshopUserType.php b/src/Responses/V30/WebshopUserType.php new file mode 100644 index 0000000..53c73d0 --- /dev/null +++ b/src/Responses/V30/WebshopUserType.php @@ -0,0 +1,23 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + description: $data['Description'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WebshopVisitorBehaviour.php b/src/Responses/V30/WebshopVisitorBehaviour.php new file mode 100644 index 0000000..13b82ef --- /dev/null +++ b/src/Responses/V30/WebshopVisitorBehaviour.php @@ -0,0 +1,39 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + dateTimeAdded: isset($data['DateTimeAdded']) ? \Carbon\Carbon::parse($data['DateTimeAdded']) : null, + dateTimeModified: isset($data['DateTimeModified']) ? \Carbon\Carbon::parse($data['DateTimeModified']) : null, + productId: $data['ProductId'] ?? 0, + composedProductParentId: $data['ComposedProductParentId'] ?? null, + qtyDec: $data['QtyDec'] ?? null, + commission: $data['Commission'] ?? null, + webshopUserProductListType: isset($data['WebshopUserProductListType']) ? \Webparking\Logic4Client\Data\V30\WebsiteProductListType::make($data['WebshopUserProductListType']) : null, + debtorId: $data['DebtorId'] ?? null, + websiteDomainId: $data['WebsiteDomainId'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WebsiteAlias.php b/src/Responses/V30/WebsiteAlias.php new file mode 100644 index 0000000..1cfb324 --- /dev/null +++ b/src/Responses/V30/WebsiteAlias.php @@ -0,0 +1,34 @@ + $websiteDomainIds */ + public function __construct( + public int $id, + public ?int $productId, + public ?int $brandId, + public ?int $productGroupId, + public ?string $aliasUrl, + public int $globalisationId, + public ?array $websiteDomainIds, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + productId: $data['ProductId'] ?? null, + brandId: $data['BrandId'] ?? null, + productGroupId: $data['ProductGroupId'] ?? null, + aliasUrl: $data['AliasUrl'] ?? null, + globalisationId: $data['GlobalisationId'] ?? 0, + websiteDomainIds: $data['WebsiteDomainIds'] ?? null, + ); + } +} diff --git a/src/Responses/V30/WebsiteDomain.php b/src/Responses/V30/WebsiteDomain.php new file mode 100644 index 0000000..addc96c --- /dev/null +++ b/src/Responses/V30/WebsiteDomain.php @@ -0,0 +1,27 @@ + $data */ + public static function make(array $data): self + { + return new self( + id: $data['Id'] ?? 0, + url: $data['Url'] ?? null, + title: $data['Title'] ?? null, + isMainDomain: $data['IsMainDomain'] ?? false, + ); + } +} diff --git a/src/Responses/V30/WebsiteDomainsForProduct.php b/src/Responses/V30/WebsiteDomainsForProduct.php new file mode 100644 index 0000000..1fd8110 --- /dev/null +++ b/src/Responses/V30/WebsiteDomainsForProduct.php @@ -0,0 +1,24 @@ + $websiteDomainIds */ + public function __construct( + public int $productId, + public ?array $websiteDomainIds, + ) { + } + + /** @param array $data */ + public static function make(array $data): self + { + return new self( + productId: $data['ProductId'] ?? 0, + websiteDomainIds: $data['WebsiteDomainIds'] ?? null, + ); + } +} From c72b357cdcca55f3962aea063e23908bd97770b5 Mon Sep 17 00:00:00 2001 From: Jeroen Stapelkamp Date: Tue, 16 Jun 2026 11:02:54 +0200 Subject: [PATCH 2/3] Restrict generator to v3 and upgrade to PHP 8.3 Filter generate.php to the v3 major version so make generate only emits the V30 namespace and leaves v1/v2 untouched. Upgrade the toolchain to PHP 8.3 (Dockerfile, CI workflows, composer require) and move the test dependencies to orchestra/testbench ^10 / phpunit ^11.5 / symfony 7, which resolves cleanly without any security advisory overrides. The remaining src changes are php-cs-fixer reformatting from the v3 ruleset. --- .github/workflows/ci.yml | 2 +- .github/workflows/update-endpoints.yml | 2 +- Dockerfile | 2 +- composer.json | 8 +++---- generate.php | 11 ++++++--- generator/Generator.php | 2 ++ src/Requests/V10/EmailRequest.php | 20 ++++------------ src/Requests/V10/ITSRequest.php | 32 +++++++------------------- src/Requests/V10/OrderRequest.php | 4 +--- src/Requests/V10/ProductRequest.php | 4 +--- src/Requests/V10/RelationsRequest.php | 4 +--- src/Requests/V10/TypeRequest.php | 4 +--- src/Requests/V11/ProductRequest.php | 4 +--- src/Requests/V12/ProductRequest.php | 4 +--- 14 files changed, 36 insertions(+), 67 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8124d84..a3fa855 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: pcov - name: Validate composer.json diff --git a/.github/workflows/update-endpoints.yml b/.github/workflows/update-endpoints.yml index 3c17569..bc456df 100644 --- a/.github/workflows/update-endpoints.yml +++ b/.github/workflows/update-endpoints.yml @@ -15,7 +15,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' - name: Validate composer.json run: composer validate diff --git a/Dockerfile b/Dockerfile index 90a6ab6..d561fa3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ${DEPENDENCY_PROXY}composer:latest AS composer -FROM ${DEPENDENCY_PROXY}php:8.1-fpm-alpine +FROM ${DEPENDENCY_PROXY}php:8.3-fpm-alpine ARG PUID=1000 ARG PGID=1000 diff --git a/composer.json b/composer.json index b7b7348..de5cf78 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "library", "license": "MIT", "require": { - "php": "^8.1", + "php": "^8.3", "guzzlehttp/guzzle": "^7.8", "nesbot/carbon": "^2.72|^3.8", "psr/simple-cache": "^3.0" @@ -14,15 +14,15 @@ "friendsofphp/php-cs-fixer": "^3.35", "mockery/mockery": "^1.6", "nette/php-generator": "^4.1", - "orchestra/testbench": "^8.13", + "orchestra/testbench": "^10.0", "phpstan/extension-installer": "^1.3", "phpstan/phpstan": "^1.10", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^10.4", + "phpunit/phpunit": "^11.5", "rector/rector": "^1.1.1", "rregeer/phpunit-coverage-check": "^0.3.1", - "symfony/var-dumper": "^6.3", + "symfony/var-dumper": "^7.2", "webmozart/assert": "^1.12" }, "autoload": { diff --git a/generate.php b/generate.php index 4345b34..4d89c4b 100644 --- a/generate.php +++ b/generate.php @@ -4,20 +4,25 @@ use Symfony\Component\ErrorHandler\Debug; use Symfony\Component\ErrorHandler\ErrorHandler; +use Webparking\Logic4Client\Generator\Generator; require_once __DIR__.'/vendor/autoload.php'; Debug::enable(); ErrorHandler::register(); -$versions = Webparking\Logic4Client\Generator\Generator::resolveVersions(); - $refresh = in_array('--refresh', $argv ?? [], true); +$versions = array_filter( + Generator::resolveVersions(), + static fn (string $version): bool => Generator::GENERATED_MAJOR_VERSION === explode('.', $version, 2)[0], + \ARRAY_FILTER_USE_KEY +); + foreach ($versions as $version => $url) { echo "Generating API namespace $version...\n"; - $generator = new Webparking\Logic4Client\Generator\Generator(); + $generator = new Generator(); $generator->setRefresh($refresh); $generator->generate($version, $url); } diff --git a/generator/Generator.php b/generator/Generator.php index 51b45b9..dbc3977 100644 --- a/generator/Generator.php +++ b/generator/Generator.php @@ -13,6 +13,8 @@ class Generator { + public const string GENERATED_MAJOR_VERSION = '3'; + public static string $scalarUrl = 'https://api.logic4server.nl/scalar/'; public static string $baseUrl = 'https://api.logic4server.nl/'; public string $localApi = __DIR__.'/../logic4-api-%s.json'; diff --git a/src/Requests/V10/EmailRequest.php b/src/Requests/V10/EmailRequest.php index 4b85ec2..fc1a9d0 100644 --- a/src/Requests/V10/EmailRequest.php +++ b/src/Requests/V10/EmailRequest.php @@ -118,9 +118,7 @@ public function addEmailMessage(array $parameters = []): Int32Logic4Response ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function deleteEmailAttachment(int $value): BooleanLogic4Response { return BooleanLogic4Response::make( @@ -144,9 +142,7 @@ public function deleteEmailBox(int $value): BooleanLogic4Response ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function deleteEmailMessage(int $value): BooleanLogic4Response { return BooleanLogic4Response::make( @@ -250,9 +246,7 @@ public function getEmailMessages(array $parameters = []): \Generator } } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getEmailMessageStatuses( ): EmailMessageStatusLogic4ResponseList { return EmailMessageStatusLogic4ResponseList::make( @@ -262,9 +256,7 @@ public function getEmailMessageStatuses( ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getEmailUser(): EmailUserLogic4Response { return EmailUserLogic4Response::make( @@ -274,9 +266,7 @@ public function getEmailUser(): EmailUserLogic4Response ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getUsedEmailAddresses(): EmailAddressLogic4ResponseList { return EmailAddressLogic4ResponseList::make( diff --git a/src/Requests/V10/ITSRequest.php b/src/Requests/V10/ITSRequest.php index 02d6a04..f5bc34a 100644 --- a/src/Requests/V10/ITSRequest.php +++ b/src/Requests/V10/ITSRequest.php @@ -17,9 +17,7 @@ class ITSRequest extends Request { - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getFreeValues1(): ITSFreeValueLogic4ResponseList { return ITSFreeValueLogic4ResponseList::make( @@ -29,9 +27,7 @@ public function getFreeValues1(): ITSFreeValueLogic4ResponseList ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getFreeValues2(): ITSFreeValueLogic4ResponseList { return ITSFreeValueLogic4ResponseList::make( @@ -41,9 +37,7 @@ public function getFreeValues2(): ITSFreeValueLogic4ResponseList ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getFreeValues3(): ITSFreeValueLogic4ResponseList { return ITSFreeValueLogic4ResponseList::make( @@ -53,9 +47,7 @@ public function getFreeValues3(): ITSFreeValueLogic4ResponseList ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getIssueGroups(): ITSIssueGroupLogic4ResponseList { return ITSIssueGroupLogic4ResponseList::make( @@ -65,9 +57,7 @@ public function getIssueGroups(): ITSIssueGroupLogic4ResponseList ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getIssueLevels(): ITSIssueLevelLogic4ResponseList { return ITSIssueLevelLogic4ResponseList::make( @@ -115,9 +105,7 @@ public function getIssues(array $parameters = []): \Generator } } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getIssueStatusses(): ITSIssueStatusLogic4ResponseList { return ITSIssueStatusLogic4ResponseList::make( @@ -127,9 +115,7 @@ public function getIssueStatusses(): ITSIssueStatusLogic4ResponseList ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getIssueTypes(): ITSIssueTypeLogic4ResponseList { return ITSIssueTypeLogic4ResponseList::make( @@ -153,9 +139,7 @@ public function getProjects(): ITSProjectLogic4ResponseList ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getTaskPriorities(): ITSTaskPriorityLogic4ResponseList { return ITSTaskPriorityLogic4ResponseList::make( diff --git a/src/Requests/V10/OrderRequest.php b/src/Requests/V10/OrderRequest.php index fc664b6..b8f1aec 100644 --- a/src/Requests/V10/OrderRequest.php +++ b/src/Requests/V10/OrderRequest.php @@ -754,9 +754,7 @@ public function getReturnSolutions(): ReturnSolutionLogic4ResponseList ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getSerialnumberTypes(): OrderLogic4ResponseList { return OrderLogic4ResponseList::make( diff --git a/src/Requests/V10/ProductRequest.php b/src/Requests/V10/ProductRequest.php index 870b8cd..d182971 100644 --- a/src/Requests/V10/ProductRequest.php +++ b/src/Requests/V10/ProductRequest.php @@ -142,9 +142,7 @@ public function getComposedProductComposition( ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getPackageMaterialDepositTypes( ): PackingMaterialDepositTypeLogic4ResponseList { return PackingMaterialDepositTypeLogic4ResponseList::make( diff --git a/src/Requests/V10/RelationsRequest.php b/src/Requests/V10/RelationsRequest.php index 6fa8f69..1d72225 100644 --- a/src/Requests/V10/RelationsRequest.php +++ b/src/Requests/V10/RelationsRequest.php @@ -436,9 +436,7 @@ public function getContactsCharacteristics(array $parameters = []): \Generator } } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getContactTypes(): ContactTypeLogic4ResponseList { return ContactTypeLogic4ResponseList::make( diff --git a/src/Requests/V10/TypeRequest.php b/src/Requests/V10/TypeRequest.php index 7e58e79..91c80e5 100644 --- a/src/Requests/V10/TypeRequest.php +++ b/src/Requests/V10/TypeRequest.php @@ -61,9 +61,7 @@ public function getOperatingSystemTypes( ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getProductRelationTypes( ): ProductRelationTypeLogic4ResponseList { return ProductRelationTypeLogic4ResponseList::make( diff --git a/src/Requests/V11/ProductRequest.php b/src/Requests/V11/ProductRequest.php index e054645..974266b 100644 --- a/src/Requests/V11/ProductRequest.php +++ b/src/Requests/V11/ProductRequest.php @@ -113,9 +113,7 @@ public function addProductImage(array $parameters = []): Int32Logic4Response ); } - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function deleteProductImage( int $productid, int $imageid, diff --git a/src/Requests/V12/ProductRequest.php b/src/Requests/V12/ProductRequest.php index 51c06f9..474e50a 100644 --- a/src/Requests/V12/ProductRequest.php +++ b/src/Requests/V12/ProductRequest.php @@ -13,9 +13,7 @@ class ProductRequest extends Request { - /** - * @throws Logic4ApiException - */ + /** @throws Logic4ApiException */ public function getBarcodeTypes(): ProductExtraBarcodeTypeLogic4ResponseList { return ProductExtraBarcodeTypeLogic4ResponseList::make( From f5660c7cabf1fefa3ba97a8b8d33a55eea0e35b2 Mon Sep 17 00:00:00 2001 From: Jeroen Stapelkamp Date: Tue, 16 Jun 2026 11:27:19 +0200 Subject: [PATCH 3/3] Fix V30 string-returning endpoints decoding raw bodies as JSON The v3 spec declares some 200 responses as a plain string schema rather than the JSON envelope used by v1/v1.1. The generator emitted those methods returning buildResponse(), which json_decodes with JSON_THROW_ON_ERROR and threw a JsonException on the raw, non-JSON body. Add buildStringResponse() to the Request base class to return the raw body, and route string return types to it in the generator. Regenerated v3: getNotice (Company, User), createBuyOrderDelivery and processPickbons now return the raw string. v1/v2 are unaffected. --- generator/RequestClassGenerator.php | 8 +++++ src/Request.php | 5 +++ src/Requests/V30/BuyOrderDeliveryRequest.php | 2 +- src/Requests/V30/CompanyRequest.php | 2 +- src/Requests/V30/PickbonsRequest.php | 2 +- src/Requests/V30/UserRequest.php | 2 +- tests/Feature/PickbonsRequestTest.php | 35 ++++++++++++++++++++ 7 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 tests/Feature/PickbonsRequestTest.php diff --git a/generator/RequestClassGenerator.php b/generator/RequestClassGenerator.php index 7b994a6..3bdd989 100644 --- a/generator/RequestClassGenerator.php +++ b/generator/RequestClassGenerator.php @@ -163,6 +163,14 @@ public function addMethod(string $httpMethod, string $uri, Operation $operation, PHP ); } + } elseif ('string' === $returnType) { + $method->setBody( + <<buildStringResponse( + \$this->getClient()->{$httpMethod}('{$uri}'{$parametersPhp}), + ); + PHP + ); } else { $method->setBody( <<getBody(), true, 512, \JSON_THROW_ON_ERROR); } + protected function buildStringResponse(ResponseInterface $response): string + { + return (string) $response->getBody(); + } + /** * @param array $body * diff --git a/src/Requests/V30/BuyOrderDeliveryRequest.php b/src/Requests/V30/BuyOrderDeliveryRequest.php index ea51de4..a4ae932 100644 --- a/src/Requests/V30/BuyOrderDeliveryRequest.php +++ b/src/Requests/V30/BuyOrderDeliveryRequest.php @@ -32,7 +32,7 @@ class BuyOrderDeliveryRequest extends Request */ public function createBuyOrderDelivery(array $parameters = []): string { - return $this->buildResponse( + return $this->buildStringResponse( $this->getClient()->post('/v3/BuyOrderDeliveries/CreateBuyOrderDelivery', ['json' => $parameters]), ); } diff --git a/src/Requests/V30/CompanyRequest.php b/src/Requests/V30/CompanyRequest.php index fd350cf..3c6503c 100644 --- a/src/Requests/V30/CompanyRequest.php +++ b/src/Requests/V30/CompanyRequest.php @@ -83,7 +83,7 @@ public function getCompanyValues(): CompanyValues */ public function getNotice(): string { - return $this->buildResponse( + return $this->buildStringResponse( $this->getClient()->get('/v3/Company/GetNotice'), ); } diff --git a/src/Requests/V30/PickbonsRequest.php b/src/Requests/V30/PickbonsRequest.php index c30432e..8d2febe 100644 --- a/src/Requests/V30/PickbonsRequest.php +++ b/src/Requests/V30/PickbonsRequest.php @@ -151,7 +151,7 @@ public function postSoftBlockPickbons(array $parameters = []): void */ public function processPickbons(array $parameters = []): string { - return $this->buildResponse( + return $this->buildStringResponse( $this->getClient()->post('/v3/Pickbons/ProcessPickbons', ['json' => $parameters]), ); } diff --git a/src/Requests/V30/UserRequest.php b/src/Requests/V30/UserRequest.php index a87dc4f..e3abc60 100644 --- a/src/Requests/V30/UserRequest.php +++ b/src/Requests/V30/UserRequest.php @@ -34,7 +34,7 @@ public function getAllUsers(): array */ public function getNotice(): string { - return $this->buildResponse( + return $this->buildStringResponse( $this->getClient()->get('/v3/User/GetNotice'), ); } diff --git a/tests/Feature/PickbonsRequestTest.php b/tests/Feature/PickbonsRequestTest.php new file mode 100644 index 0000000..b2d8fde --- /dev/null +++ b/tests/Feature/PickbonsRequestTest.php @@ -0,0 +1,35 @@ +shouldReceive('post') + ->once() + ->with('/v3/Pickbons/ProcessPickbons', ['json' => [['OrderHeadPickbonId' => 42]]]) + ->andReturn(new Response(body: 'PB-2026-0042')); + }); + + $clientFactory = \Mockery::mock(ClientFactory::class, static function (MockInterface $mock) use ($client): void { + $mock->shouldReceive('make') + ->once() + ->andReturn($client); + }); + + $response = (new PickbonsRequest($clientFactory))->processPickbons([['OrderHeadPickbonId' => 42]]); + + static::assertSame('PB-2026-0042', $response); + } +}