From d0efb0f527d21fb9b9a479b3d648f378377dc821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 10 Nov 2026 14:28:00 +0100 Subject: [PATCH 01/11] refactor: update namespaces for actions and queries Refactored the codebase to change the namespaces of various actions and queries from `App\Actions` to `App\Cqs\Actions` and `App\Queries` to `App\Cqs\Queries`. This restructuring improves organization and clarity in the codebase. --- .../Commands/SyncProductIncosCommand.php | 2 +- app/{ => Cqs}/Actions/Basket/AddToBasket.php | 4 ++-- .../Actions/Basket/AddToBasketInput.php | 2 +- app/{ => Cqs}/Actions/Basket/EmptyBasket.php | 2 +- .../Actions/Basket/RemoveFromBasket.php | 4 ++-- .../Basket/RemoveProductFromBasketInput.php | 2 +- .../Basket/RemoveQuantityFromBasketInput.php | 2 +- .../Actions/Common/ChangeModelOrder.php | 6 ++--- .../Actions/Common/ChangeModelOrderInput.php | 2 +- .../Common/ChangeModelOrderPosition.php | 6 ++--- .../Common/ChangeModelOrderPositionInput.php | 2 +- .../Actions/Common/ExecuteMassAction.php | 6 ++--- .../Actions/Common/ExecuteMassActionInput.php | 2 +- .../Actions/Common/ToggleModelStar.php | 6 ++--- .../Actions/Common/ToggleModelStarInput.php | 2 +- .../Actions/Common/ToggleModelStatus.php | 6 ++--- .../Actions/Common/ToggleModelStatusInput.php | 2 +- .../Actions/Crm/UnsubscribeFromNewsletter.php | 4 ++-- .../Crm/UnsubscribeFromNewsletterInput.php | 2 +- .../Crm/UnsubscribeFromNewsletterOutput.php | 2 +- app/{ => Cqs}/Actions/Crm/UpdateCustomer.php | 4 ++-- .../Actions/Crm/UpdateCustomerInput.php | 2 +- .../Actions/Crm/UpdateCustomerOutput.php | 2 +- .../Actions/Crm/UpdateCustomerPassword.php | 4 ++-- .../Crm/UpdateCustomerPasswordInput.php | 2 +- .../Crm/UpdateCustomerPasswordOutput.php | 2 +- .../Actions/Customers/RegisterCustomer.php | 6 ++--- .../Customers/RegisterCustomerInput.php | 2 +- .../Actions/Discounts/CreateDiscount.php | 6 ++--- .../Actions/Discounts/CreateDiscountInput.php | 2 +- .../Actions/Discounts/DeleteDiscount.php | 6 ++--- .../Actions/Discounts/DeleteDiscountInput.php | 2 +- .../Actions/Discounts/UpdateDiscount.php | 6 ++--- .../Actions/Discounts/UpdateDiscountInput.php | 2 +- .../SynchronizeEmployeesWithArcadiaApi.php | 2 +- app/{ => Cqs}/Actions/Faqs/CreateFaq.php | 6 ++--- app/{ => Cqs}/Actions/Faqs/CreateFaqInput.php | 2 +- app/{ => Cqs}/Actions/Faqs/DeleteFaq.php | 6 ++--- app/{ => Cqs}/Actions/Faqs/DeleteFaqInput.php | 2 +- app/{ => Cqs}/Actions/Faqs/UpdateFaq.php | 6 ++--- app/{ => Cqs}/Actions/Faqs/UpdateFaqInput.php | 2 +- .../Actions/Orders/ApplyPickTimeSlot.php | 6 ++--- .../Actions/Orders/ApplyPickTimeSlotInput.php | 2 +- app/{ => Cqs}/Actions/Orders/CancelOrder.php | 6 ++--- .../Actions/Orders/CancelOrderInput.php | 2 +- .../Actions/Orders/FinalizeOrder.php | 6 ++--- .../Actions/Orders/FinalizeOrderInput.php | 2 +- .../Actions/Orders/InitializeOrderTunnel.php | 6 ++--- .../Orders/InitializeOrderTunnelInput.php | 2 +- app/{ => Cqs}/Actions/Pages/UpdatePage.php | 6 ++--- .../Actions/Pages/UpdatePageInput.php | 2 +- .../CreatePickupException.php | 6 ++--- .../CreatePickupExceptionInput.php | 2 +- .../DeletePickupException.php | 6 ++--- .../DeletePickupExceptionInput.php | 2 +- .../UpdatePickupException.php | 6 ++--- .../UpdatePickupExceptionInput.php | 2 +- .../ProductIncos/AssociateProductInco.php | 6 ++--- .../AssociateProductIncoInput.php | 2 +- .../Actions/ProductIncos/SyncProductInco.php | 6 ++--- .../ProductIncos/SyncProductIncoInput.php | 2 +- .../SynchronizeProductIncosWithArcadiaApi.php | 2 +- .../Actions/Products/CreateProduct.php | 6 ++--- .../Actions/Products/CreateProductInput.php | 2 +- .../Actions/Products/DeleteProduct.php | 6 ++--- .../Actions/Products/DeleteProductInput.php | 2 +- .../Actions/Products/UpdateProduct.php | 6 ++--- .../Actions/Products/UpdateProductInput.php | 2 +- app/{ => Cqs}/Actions/Ranges/CreateRange.php | 6 ++--- .../Actions/Ranges/CreateRangeInput.php | 2 +- app/{ => Cqs}/Actions/Ranges/DeleteRange.php | 6 ++--- .../Actions/Ranges/DeleteRangeInput.php | 2 +- app/{ => Cqs}/Actions/Ranges/UpdateRange.php | 6 ++--- .../Actions/Ranges/UpdateRangeInput.php | 2 +- .../Actions/Settings/UpdateSettings.php | 6 ++--- .../Actions/Settings/UpdateSettingsInput.php | 2 +- app/{ => Cqs}/Actions/Shops/CreateShop.php | 6 ++--- .../Actions/Shops/CreateShopInput.php | 2 +- app/{ => Cqs}/Actions/Shops/DeleteShop.php | 6 ++--- .../Actions/Shops/DeleteShopInput.php | 2 +- app/{ => Cqs}/Actions/Shops/UpdateShop.php | 6 ++--- .../Actions/Shops/UpdateShopInput.php | 2 +- .../Shops/UpdateShopPickupExceptions.php | 6 ++--- .../Shops/UpdateShopPickupExceptionsInput.php | 2 +- app/{ => Cqs}/Actions/Slides/CreateSlide.php | 6 ++--- .../Actions/Slides/CreateSlideInput.php | 2 +- app/{ => Cqs}/Actions/Slides/DeleteSlide.php | 6 ++--- .../Actions/Slides/DeleteSlideInput.php | 2 +- app/{ => Cqs}/Actions/Slides/UpdateSlide.php | 6 ++--- .../Actions/Slides/UpdateSlideInput.php | 2 +- app/{ => Cqs}/Actions/Tags/CreateTag.php | 6 ++--- app/{ => Cqs}/Actions/Tags/CreateTagInput.php | 2 +- app/{ => Cqs}/Actions/Tags/DeleteTag.php | 6 ++--- app/{ => Cqs}/Actions/Tags/DeleteTagInput.php | 2 +- app/{ => Cqs}/Actions/Tags/UpdateTag.php | 6 ++--- app/{ => Cqs}/Actions/Tags/UpdateTagInput.php | 2 +- .../Queries/Basket/GetBasketQuery.php | 2 +- .../Queries/Crm/GetCrmCustomerQuery.php | 4 ++-- .../Queries/Crm/GetCrmCustomerQueryInput.php | 2 +- .../Queries/Crm/GetCrmCustomerQueryOutput.php | 2 +- .../Customers/GetCustomerByEmailQuery.php | 4 ++-- .../GetCustomerByEmailQueryInput.php | 2 +- .../Queries/Dashboard/GetBoDashboardQuery.php | 4 ++-- .../Dashboard/GetBoDashboardQueryInput.php | 2 +- .../Dashboard/GetBoDashboardQueryOutput.php | 2 +- .../Discounts/GetDiscountFormDataQuery.php | 6 ++--- .../GetDiscountFormDataQueryInput.php | 2 +- .../GetDiscountFormDataQueryOutput.php | 2 +- .../Discounts/GetPaginatedDiscountsQuery.php | 6 ++--- .../GetPaginatedDiscountsQueryInput.php | 2 +- app/{ => Cqs}/Queries/Faqs/GetFaqsQuery.php | 2 +- .../Queries/Faqs/GetPaginatedFaqsQuery.php | 4 ++-- .../Faqs/GetPaginatedFaqsQueryInput.php | 2 +- .../Queries/Orders/GetBasketSummaryQuery.php | 6 ++--- .../Orders/GetBasketSummaryQueryInput.php | 2 +- .../Orders/GetBasketSummaryQueryOutput.php | 2 +- .../Queries/Orders/GetBoOrderDetailQuery.php | 4 ++-- .../Orders/GetBoOrderDetailQueryInput.php | 2 +- .../Orders/GetBoOrderDetailQueryOutput.php | 2 +- .../Orders/GetBoPaginatedOrdersQuery.php | 4 ++-- .../Orders/GetBoPaginatedOrdersQueryInput.php | 2 +- .../GetBoPaginatedOrdersQueryOutput.php | 2 +- .../Queries/Orders/GetBoTodayOrdersQuery.php | 6 ++--- .../Orders/GetBoTodayOrdersQueryInput.php | 2 +- .../Orders/GetFoCustomerOrderDetailQuery.php | 4 ++-- .../GetFoCustomerOrderDetailQueryInput.php | 2 +- .../GetFoCustomerOrderDetailQueryOutput.php | 2 +- .../GetFoCustomerPaginatedOrdersQuery.php | 6 ++--- ...GetFoCustomerPaginatedOrdersQueryInput.php | 2 +- .../Orders/GetOrderConfirmationQuery.php | 6 ++--- .../Orders/GetOrderConfirmationQueryInput.php | 2 +- .../GetOrderConfirmationQueryOutput.php | 2 +- .../Queries/Orders/GetPickTimeSlotQuery.php | 6 ++--- .../Orders/GetPickTimeSlotQueryInput.php | 2 +- .../Orders/GetPickTimeSlotQueryOutput.php | 2 +- .../Orders/GetTunnelOrderConfirmedQuery.php | 6 ++--- .../GetTunnelOrderConfirmedQueryInput.php | 2 +- .../GetTunnelOrderConfirmedQueryOutput.php | 2 +- app/{ => Cqs}/Queries/Pages/GetPageQuery.php | 4 ++-- .../Queries/Pages/GetPageQueryInput.php | 2 +- .../GetPaginatedPickupExceptionsQuery.php | 6 ++--- ...GetPaginatedPickupExceptionsQueryInput.php | 2 +- .../GetArcadiaIncoPreviewQuery.php | 4 ++-- .../GetArcadiaIncoPreviewQueryInput.php | 2 +- .../Products/GetBoPaginatedProductsQuery.php | 4 ++-- .../GetBoPaginatedProductsQueryInput.php | 2 +- .../GetBoPaginatedProductsQueryOutput.php | 2 +- .../Products/GetFoFilteredProductsQuery.php | 4 ++-- .../GetFoFilteredProductsQueryInput.php | 2 +- .../Products/GetFoProductIndexPageQuery.php | 4 ++-- .../GetFoProductIndexPageQueryInput.php | 2 +- .../GetFoProductIndexPageQueryOutput.php | 2 +- .../Products/GetPaginatedProductsQuery.php | 4 ++-- .../GetPaginatedProductsQueryInput.php | 2 +- .../Products/GetProductFormDataQuery.php | 4 ++-- .../Products/GetProductFormDataQueryInput.php | 2 +- .../Ranges/GetPaginatedRangesQuery.php | 4 ++-- .../Ranges/GetPaginatedRangesQueryInput.php | 2 +- .../Queries/Settings/GetSettingsQuery.php | 2 +- .../Queries/Shops/GetPaginatedShopsQuery.php | 6 ++--- .../Shops/GetPaginatedShopsQueryInput.php | 2 +- .../Shops/GetPaginatedShopsQueryOutput.php | 2 +- .../Shops/GetShopPickupExceptionsQuery.php | 6 ++--- .../GetShopPickupExceptionsQueryInput.php | 2 +- .../GetShopPickupExceptionsQueryOutput.php | 2 +- app/{ => Cqs}/Queries/Shops/GetShopQuery.php | 6 ++--- .../Queries/Shops/GetShopQueryInput.php | 2 +- .../Slides/GetPaginatedSlidesQuery.php | 4 ++-- .../Slides/GetPaginatedSlidesQueryInput.php | 2 +- .../Queries/Tags/GetPaginatedTagsQuery.php | 4 ++-- .../Tags/GetPaginatedTagsQueryInput.php | 2 +- .../Timeslots/GetAvailableTimeslotsQuery.php | 4 ++-- .../GetAvailableTimeslotsQueryInput.php | 2 +- .../GetAvailableTimeslotsQueryOutput.php | 2 +- .../Controllers/Bo/DashboardController.php | 2 +- .../Controllers/Bo/DiscountsController.php | 16 +++++++------- app/Http/Controllers/Bo/FaqsController.php | 12 +++++----- app/Http/Controllers/Bo/OrdersController.php | 14 ++++++------ app/Http/Controllers/Bo/PageController.php | 2 +- .../Bo/PickupExceptionsController.php | 12 +++++----- .../Controllers/Bo/ProductIncosController.php | 6 ++--- .../Controllers/Bo/ProductsController.php | 14 ++++++------ app/Http/Controllers/Bo/RangesController.php | 12 +++++----- .../Controllers/Bo/SettingsController.php | 4 ++-- app/Http/Controllers/Bo/ShopsController.php | 18 +++++++-------- app/Http/Controllers/Bo/SlidesController.php | 12 +++++----- app/Http/Controllers/Bo/TagsController.php | 12 +++++----- .../Controllers/Fo/Ajax/BasketController.php | 8 +++---- .../Controllers/Fo/Ajax/PickupController.php | 4 ++-- .../Fo/Ajax/ProductsController.php | 2 +- .../Fo/Auth/ForgotPasswordController.php | 4 ++-- .../Fo/Auth/RegisterController.php | 2 +- .../Fo/Customers/CustomerController.php | 6 ++--- .../Fo/Customers/OrderController.php | 8 +++---- .../Fo/Customers/PasswordController.php | 2 +- .../Controllers/Fo/NewsletterController.php | 6 ++--- .../Fo/Pages/ContactController.php | 8 +++---- .../Controllers/Fo/Pages/HomeController.php | 12 +++++----- .../Controllers/Fo/Pages/PageController.php | 6 ++--- .../Fo/Pages/ProductsController.php | 4 ++-- app/Http/Controllers/Fo/TunnelController.php | 22 +++++++++---------- app/Http/Requests/Basket/AddBasketRequest.php | 2 +- .../Requests/Basket/RemoveBasketRequest.php | 4 ++-- .../Bo/ChangeSelectedOrderRequest.php | 2 +- .../Bo/Dashboard/DashboardRequest.php | 2 +- .../Bo/Discounts/StoreDiscountRequest.php | 2 +- .../Bo/Discounts/UpdateDiscountRequest.php | 2 +- app/Http/Requests/Bo/Faqs/StoreFaqRequest.php | 2 +- .../Requests/Bo/Faqs/UpdateFaqRequest.php | 2 +- app/Http/Requests/Bo/MassActionRequest.php | 2 +- .../Requests/Bo/Orders/IndexOrdersRequest.php | 2 +- .../Requests/Bo/Pages/UpdatePageRequest.php | 2 +- .../StorePickupExceptionRequest.php | 2 +- .../UpdatePickupExceptionRequest.php | 2 +- .../AssociateProductIncoRequest.php | 2 +- .../PreviewArcadiaIncoRequest.php | 2 +- .../ProductIncos/SyncProductIncoRequest.php | 2 +- .../Bo/Products/IndexProductRequest.php | 2 +- .../Bo/Products/StoreProductRequest.php | 2 +- .../Bo/Products/UpdateProductRequest.php | 2 +- .../Requests/Bo/Ranges/StoreRangeRequest.php | 2 +- .../Requests/Bo/Ranges/UpdateRangeRequest.php | 2 +- .../Bo/Settings/UpdateSettingsRequest.php | 2 +- .../Requests/Bo/Shops/StoreShopRequest.php | 2 +- .../UpdateShopPickupExceptionsRequest.php | 2 +- .../Requests/Bo/Shops/UpdateShopRequest.php | 2 +- .../Requests/Bo/Slides/StoreSlideRequest.php | 2 +- .../Requests/Bo/Slides/UpdateSlideRequest.php | 2 +- app/Http/Requests/Bo/Tags/StoreTagRequest.php | 2 +- .../Requests/Bo/Tags/UpdateTagRequest.php | 2 +- .../Fo/Ajax/FilterProductsRequest.php | 2 +- app/Http/Requests/Fo/Auth/RegisterRequest.php | 2 +- .../Fo/Customer/UpdateInfosRequest.php | 2 +- .../Fo/Customer/UpdatePasswordRequest.php | 2 +- .../Fo/Orders/ConfirmOrderRequest.php | 2 +- .../Fo/Orders/PickTimeSlotRequest.php | 2 +- .../Fo/Orders/ValidateSummaryRequest.php | 2 +- app/Jobs/FetchAndUpsertArcadiaEmployees.php | 2 +- .../FetchAndUpsertArcadiaProductIncos.php | 2 +- app/Services/EmployeeSyncService.php | 2 +- app/Traits/Controllers/ChangesModelOrder.php | 6 ++--- app/Traits/Controllers/HasMassActions.php | 2 +- app/Traits/Controllers/TogglesModelStar.php | 4 ++-- app/Traits/Controllers/TogglesModelStatus.php | 4 ++-- tests/Architecture/ApplicationTest.php | 9 ++++---- .../Controllers/Fo/TunnelControllerTest.php | 6 ++--- .../Bo/Dashboard/DashboardRequestTest.php | 2 +- .../Requests/Bo/MassActionRequestTest.php | 2 +- .../Bo/Orders/IndexOrdersRequestTest.php | 2 +- .../Requests/Fo/Auth/RegisterRequestTest.php | 2 +- .../Fo/Customer/UpdateInfosRequestTest.php | 2 +- .../Fo/Orders/ConfirmOrderRequestTest.php | 2 +- .../Fo/Orders/PickTimeSlotRequestTest.php | 2 +- .../Fo/Orders/ValidateSummaryRequestTest.php | 2 +- .../Common/ChangeModelOrderPositionTest.php | 4 ++-- .../Actions/Common/ChangeModelOrderTest.php | 4 ++-- .../Actions/Common/ExecuteMassActionTest.php | 4 ++-- .../Actions/Common/ToggleModelStarTest.php | 4 ++-- .../Actions/Common/ToggleModelStatusTest.php | 4 ++-- .../Customers/RegisterCustomerTest.php | 4 ++-- .../Actions/Discounts/CreateDiscountTest.php | 6 ++--- .../Actions/Discounts/DeleteDiscountTest.php | 6 ++--- .../Actions/Discounts/UpdateDiscountTest.php | 6 ++--- .../App/Actions/Faqs/CreateFaqTest.php | 4 ++-- .../App/Actions/Faqs/DeleteFaqTest.php | 4 ++-- .../App/Actions/Faqs/UpdateFaqTest.php | 4 ++-- .../App/Actions/Pages/UpdatePageTest.php | 4 ++-- .../CreatePickupExceptionTest.php | 4 ++-- .../DeletePickupExceptionTest.php | 4 ++-- .../UpdatePickupExceptionTest.php | 4 ++-- .../ProductIncos/AssociateProductIncoTest.php | 4 ++-- ...chronizeProductIncosWithArcadiaApiTest.php | 2 +- .../App/Actions/Ranges/CreateRangeTest.php | 4 ++-- .../App/Actions/Ranges/DeleteRangeTest.php | 4 ++-- .../App/Actions/Ranges/UpdateRangeTest.php | 4 ++-- .../Actions/Settings/UpdateSettingsTest.php | 4 ++-- .../App/Actions/Shops/CreateShopTest.php | 4 ++-- .../App/Actions/Shops/DeleteShopTest.php | 4 ++-- .../Shops/UpdateShopPickupExceptionsTest.php | 4 ++-- .../App/Actions/Shops/UpdateShopTest.php | 4 ++-- .../App/Actions/Slides/CreateSlideTest.php | 4 ++-- .../App/Actions/Slides/DeleteSlideTest.php | 4 ++-- .../App/Actions/Slides/UpdateSlideTest.php | 4 ++-- .../App/Actions/Tags/CreateTagTest.php | 4 ++-- .../App/Actions/Tags/DeleteTagTest.php | 4 ++-- .../App/Actions/Tags/UpdateTagTest.php | 4 ++-- .../Customers/GetCustomerByEmailQueryTest.php | 4 ++-- .../GetDiscountFormDataQueryTest.php | 6 ++--- .../GetPaginatedDiscountsQueryTest.php | 6 ++--- .../App/Queries/Faqs/GetFaqsQueryTest.php | 2 +- .../Faqs/GetPaginatedFaqsQueryTest.php | 4 ++-- .../GetTunnelOrderConfirmedQueryTest.php | 8 +++---- .../Queries/Pages/GetPageBySlugQueryTest.php | 4 ++-- .../GetPaginatedPickupExceptionsQueryTest.php | 4 ++-- .../GetBoPaginatedProductsQueryTest.php | 6 ++--- .../Products/GetProductFormDataQueryTest.php | 6 ++--- .../Ranges/GetPaginatedRangesQueryTest.php | 4 ++-- .../Queries/Settings/GetSettingsQueryTest.php | 2 +- .../Shops/GetPaginatedShopsQueryTest.php | 6 ++--- .../GetShopPickupExceptionsQueryTest.php | 6 ++--- .../App/Queries/Shops/GetShopQueryTest.php | 6 ++--- .../Slides/GetPaginatedSlidesQueryTest.php | 4 ++-- .../App/Services/EmployeeSyncServiceTest.php | 2 +- tests/Pest.php | 4 ++-- .../Common/ChangeModelOrderInputTest.php | 2 +- .../ChangeModelOrderPositionInputTest.php | 2 +- .../Common/ExecuteMassActionInputTest.php | 2 +- .../Common/ToggleModelStarInputTest.php | 2 +- .../Common/ToggleModelStatusInputTest.php | 2 +- .../Customers/RegisterCustomerInputTest.php | 2 +- .../Discounts/CreateDiscountInputTest.php | 4 ++-- .../Discounts/DeleteDiscountInputTest.php | 4 ++-- .../Discounts/UpdateDiscountInputTest.php | 4 ++-- .../App/Actions/Faqs/CreateFaqInputTest.php | 2 +- .../App/Actions/Faqs/DeleteFaqInputTest.php | 2 +- .../App/Actions/Faqs/UpdateFaqInputTest.php | 2 +- .../Orders/ApplyPickTimeSlotInputTest.php | 2 +- .../Actions/Orders/ApplyPickTimeSlotTest.php | 4 ++-- .../Actions/Orders/FinalizeOrderInputTest.php | 2 +- .../App/Actions/Orders/FinalizeOrderTest.php | 4 ++-- .../Orders/InitializeOrderTunnelInputTest.php | 2 +- .../Orders/InitializeOrderTunnelTest.php | 4 ++-- .../App/Actions/Pages/UpdatePageInputTest.php | 2 +- .../CreatePickupExceptionInputTest.php | 2 +- .../DeletePickupExceptionInputTest.php | 2 +- .../UpdatePickupExceptionInputTest.php | 2 +- .../AssociateProductIncoInputTest.php | 4 ++-- .../Actions/Ranges/CreateRangeInputTest.php | 2 +- .../Actions/Ranges/DeleteRangeInputTest.php | 2 +- .../Actions/Ranges/UpdateRangeInputTest.php | 2 +- .../Settings/UpdateSettingsInputTest.php | 2 +- .../App/Actions/Shops/CreateShopInputTest.php | 2 +- .../App/Actions/Shops/DeleteShopInputTest.php | 2 +- .../App/Actions/Shops/UpdateShopInputTest.php | 2 +- .../UpdateShopPickupExceptionsInputTest.php | 2 +- .../Actions/Slides/CreateSlideInputTest.php | 2 +- .../Actions/Slides/DeleteSlideInputTest.php | 2 +- .../Actions/Slides/UpdateSlideInputTest.php | 2 +- .../App/Actions/Tags/CreateTagInputTest.php | 2 +- .../App/Actions/Tags/DeleteTagInputTest.php | 2 +- .../App/Actions/Tags/UpdateTagInputTest.php | 2 +- .../Orders/GetBasketSummaryQueryTest.php | 6 ++--- .../Orders/GetOrderConfirmationQueryTest.php | 6 ++--- .../Orders/GetPickTimeSlotQueryTest.php | 6 ++--- .../GetArcadiaIncoPreviewQueryTest.php | 6 ++--- .../Queries/Shops/GetShopQueryInputTest.php | 4 ++-- 346 files changed, 644 insertions(+), 643 deletions(-) rename app/{ => Cqs}/Actions/Basket/AddToBasket.php (82%) rename app/{ => Cqs}/Actions/Basket/AddToBasketInput.php (91%) rename app/{ => Cqs}/Actions/Basket/EmptyBasket.php (95%) rename app/{ => Cqs}/Actions/Basket/RemoveFromBasket.php (83%) rename app/{ => Cqs}/Actions/Basket/RemoveProductFromBasketInput.php (89%) rename app/{ => Cqs}/Actions/Basket/RemoveQuantityFromBasketInput.php (91%) rename app/{ => Cqs}/Actions/Common/ChangeModelOrder.php (91%) rename app/{ => Cqs}/Actions/Common/ChangeModelOrderInput.php (93%) rename app/{ => Cqs}/Actions/Common/ChangeModelOrderPosition.php (93%) rename app/{ => Cqs}/Actions/Common/ChangeModelOrderPositionInput.php (94%) rename app/{ => Cqs}/Actions/Common/ExecuteMassAction.php (93%) rename app/{ => Cqs}/Actions/Common/ExecuteMassActionInput.php (96%) rename app/{ => Cqs}/Actions/Common/ToggleModelStar.php (68%) rename app/{ => Cqs}/Actions/Common/ToggleModelStarInput.php (93%) rename app/{ => Cqs}/Actions/Common/ToggleModelStatus.php (68%) rename app/{ => Cqs}/Actions/Common/ToggleModelStatusInput.php (93%) rename app/{ => Cqs}/Actions/Crm/UnsubscribeFromNewsletter.php (83%) rename app/{ => Cqs}/Actions/Crm/UnsubscribeFromNewsletterInput.php (89%) rename app/{ => Cqs}/Actions/Crm/UnsubscribeFromNewsletterOutput.php (81%) rename app/{ => Cqs}/Actions/Crm/UpdateCustomer.php (91%) rename app/{ => Cqs}/Actions/Crm/UpdateCustomerInput.php (93%) rename app/{ => Cqs}/Actions/Crm/UpdateCustomerOutput.php (90%) rename app/{ => Cqs}/Actions/Crm/UpdateCustomerPassword.php (88%) rename app/{ => Cqs}/Actions/Crm/UpdateCustomerPasswordInput.php (94%) rename app/{ => Cqs}/Actions/Crm/UpdateCustomerPasswordOutput.php (90%) rename app/{ => Cqs}/Actions/Customers/RegisterCustomer.php (93%) rename app/{ => Cqs}/Actions/Customers/RegisterCustomerInput.php (97%) rename app/{ => Cqs}/Actions/Discounts/CreateDiscount.php (88%) rename app/{ => Cqs}/Actions/Discounts/CreateDiscountInput.php (95%) rename app/{ => Cqs}/Actions/Discounts/DeleteDiscount.php (65%) rename app/{ => Cqs}/Actions/Discounts/DeleteDiscountInput.php (86%) rename app/{ => Cqs}/Actions/Discounts/UpdateDiscount.php (88%) rename app/{ => Cqs}/Actions/Discounts/UpdateDiscountInput.php (95%) rename app/{ => Cqs}/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php (96%) rename app/{ => Cqs}/Actions/Faqs/CreateFaq.php (74%) rename app/{ => Cqs}/Actions/Faqs/CreateFaqInput.php (94%) rename app/{ => Cqs}/Actions/Faqs/DeleteFaq.php (68%) rename app/{ => Cqs}/Actions/Faqs/DeleteFaqInput.php (87%) rename app/{ => Cqs}/Actions/Faqs/UpdateFaq.php (74%) rename app/{ => Cqs}/Actions/Faqs/UpdateFaqInput.php (95%) rename app/{ => Cqs}/Actions/Orders/ApplyPickTimeSlot.php (80%) rename app/{ => Cqs}/Actions/Orders/ApplyPickTimeSlotInput.php (90%) rename app/{ => Cqs}/Actions/Orders/CancelOrder.php (76%) rename app/{ => Cqs}/Actions/Orders/CancelOrderInput.php (90%) rename app/{ => Cqs}/Actions/Orders/FinalizeOrder.php (76%) rename app/{ => Cqs}/Actions/Orders/FinalizeOrderInput.php (89%) rename app/{ => Cqs}/Actions/Orders/InitializeOrderTunnel.php (75%) rename app/{ => Cqs}/Actions/Orders/InitializeOrderTunnelInput.php (90%) rename app/{ => Cqs}/Actions/Pages/UpdatePage.php (78%) rename app/{ => Cqs}/Actions/Pages/UpdatePageInput.php (94%) rename app/{ => Cqs}/Actions/PickupExceptions/CreatePickupException.php (76%) rename app/{ => Cqs}/Actions/PickupExceptions/CreatePickupExceptionInput.php (93%) rename app/{ => Cqs}/Actions/PickupExceptions/DeletePickupException.php (64%) rename app/{ => Cqs}/Actions/PickupExceptions/DeletePickupExceptionInput.php (85%) rename app/{ => Cqs}/Actions/PickupExceptions/UpdatePickupException.php (75%) rename app/{ => Cqs}/Actions/PickupExceptions/UpdatePickupExceptionInput.php (94%) rename app/{ => Cqs}/Actions/ProductIncos/AssociateProductInco.php (87%) rename app/{ => Cqs}/Actions/ProductIncos/AssociateProductIncoInput.php (91%) rename app/{ => Cqs}/Actions/ProductIncos/SyncProductInco.php (86%) rename app/{ => Cqs}/Actions/ProductIncos/SyncProductIncoInput.php (85%) rename app/{ => Cqs}/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApi.php (98%) rename app/{ => Cqs}/Actions/Products/CreateProduct.php (94%) rename app/{ => Cqs}/Actions/Products/CreateProductInput.php (97%) rename app/{ => Cqs}/Actions/Products/DeleteProduct.php (67%) rename app/{ => Cqs}/Actions/Products/DeleteProductInput.php (86%) rename app/{ => Cqs}/Actions/Products/UpdateProduct.php (94%) rename app/{ => Cqs}/Actions/Products/UpdateProductInput.php (98%) rename app/{ => Cqs}/Actions/Ranges/CreateRange.php (82%) rename app/{ => Cqs}/Actions/Ranges/CreateRangeInput.php (97%) rename app/{ => Cqs}/Actions/Ranges/DeleteRange.php (68%) rename app/{ => Cqs}/Actions/Ranges/DeleteRangeInput.php (87%) rename app/{ => Cqs}/Actions/Ranges/UpdateRange.php (82%) rename app/{ => Cqs}/Actions/Ranges/UpdateRangeInput.php (97%) rename app/{ => Cqs}/Actions/Settings/UpdateSettings.php (79%) rename app/{ => Cqs}/Actions/Settings/UpdateSettingsInput.php (93%) rename app/{ => Cqs}/Actions/Shops/CreateShop.php (83%) rename app/{ => Cqs}/Actions/Shops/CreateShopInput.php (97%) rename app/{ => Cqs}/Actions/Shops/DeleteShop.php (68%) rename app/{ => Cqs}/Actions/Shops/DeleteShopInput.php (87%) rename app/{ => Cqs}/Actions/Shops/UpdateShop.php (83%) rename app/{ => Cqs}/Actions/Shops/UpdateShopInput.php (97%) rename app/{ => Cqs}/Actions/Shops/UpdateShopPickupExceptions.php (68%) rename app/{ => Cqs}/Actions/Shops/UpdateShopPickupExceptionsInput.php (98%) rename app/{ => Cqs}/Actions/Slides/CreateSlide.php (86%) rename app/{ => Cqs}/Actions/Slides/CreateSlideInput.php (97%) rename app/{ => Cqs}/Actions/Slides/DeleteSlide.php (68%) rename app/{ => Cqs}/Actions/Slides/DeleteSlideInput.php (87%) rename app/{ => Cqs}/Actions/Slides/UpdateSlide.php (86%) rename app/{ => Cqs}/Actions/Slides/UpdateSlideInput.php (97%) rename app/{ => Cqs}/Actions/Tags/CreateTag.php (74%) rename app/{ => Cqs}/Actions/Tags/CreateTagInput.php (92%) rename app/{ => Cqs}/Actions/Tags/DeleteTag.php (68%) rename app/{ => Cqs}/Actions/Tags/DeleteTagInput.php (87%) rename app/{ => Cqs}/Actions/Tags/UpdateTag.php (74%) rename app/{ => Cqs}/Actions/Tags/UpdateTagInput.php (93%) rename app/{ => Cqs}/Queries/Basket/GetBasketQuery.php (95%) rename app/{ => Cqs}/Queries/Crm/GetCrmCustomerQuery.php (84%) rename app/{ => Cqs}/Queries/Crm/GetCrmCustomerQueryInput.php (90%) rename app/{ => Cqs}/Queries/Crm/GetCrmCustomerQueryOutput.php (93%) rename app/{ => Cqs}/Queries/Customers/GetCustomerByEmailQuery.php (76%) rename app/{ => Cqs}/Queries/Customers/GetCustomerByEmailQueryInput.php (87%) rename app/{ => Cqs}/Queries/Dashboard/GetBoDashboardQuery.php (90%) rename app/{ => Cqs}/Queries/Dashboard/GetBoDashboardQueryInput.php (89%) rename app/{ => Cqs}/Queries/Dashboard/GetBoDashboardQueryOutput.php (94%) rename app/{ => Cqs}/Queries/Discounts/GetDiscountFormDataQuery.php (87%) rename app/{ => Cqs}/Queries/Discounts/GetDiscountFormDataQueryInput.php (87%) rename app/{ => Cqs}/Queries/Discounts/GetDiscountFormDataQueryOutput.php (94%) rename app/{ => Cqs}/Queries/Discounts/GetPaginatedDiscountsQuery.php (86%) rename app/{ => Cqs}/Queries/Discounts/GetPaginatedDiscountsQueryInput.php (87%) rename app/{ => Cqs}/Queries/Faqs/GetFaqsQuery.php (96%) rename app/{ => Cqs}/Queries/Faqs/GetPaginatedFaqsQuery.php (82%) rename app/{ => Cqs}/Queries/Faqs/GetPaginatedFaqsQueryInput.php (89%) rename app/{ => Cqs}/Queries/Orders/GetBasketSummaryQuery.php (73%) rename app/{ => Cqs}/Queries/Orders/GetBasketSummaryQueryInput.php (84%) rename app/{ => Cqs}/Queries/Orders/GetBasketSummaryQueryOutput.php (88%) rename app/{ => Cqs}/Queries/Orders/GetBoOrderDetailQuery.php (89%) rename app/{ => Cqs}/Queries/Orders/GetBoOrderDetailQueryInput.php (90%) rename app/{ => Cqs}/Queries/Orders/GetBoOrderDetailQueryOutput.php (92%) rename app/{ => Cqs}/Queries/Orders/GetBoPaginatedOrdersQuery.php (94%) rename app/{ => Cqs}/Queries/Orders/GetBoPaginatedOrdersQueryInput.php (94%) rename app/{ => Cqs}/Queries/Orders/GetBoPaginatedOrdersQueryOutput.php (93%) rename app/{ => Cqs}/Queries/Orders/GetBoTodayOrdersQuery.php (89%) rename app/{ => Cqs}/Queries/Orders/GetBoTodayOrdersQueryInput.php (88%) rename app/{ => Cqs}/Queries/Orders/GetFoCustomerOrderDetailQuery.php (83%) rename app/{ => Cqs}/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php (90%) rename app/{ => Cqs}/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php (87%) rename app/{ => Cqs}/Queries/Orders/GetFoCustomerPaginatedOrdersQuery.php (90%) rename app/{ => Cqs}/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php (92%) rename app/{ => Cqs}/Queries/Orders/GetOrderConfirmationQuery.php (83%) rename app/{ => Cqs}/Queries/Orders/GetOrderConfirmationQueryInput.php (84%) rename app/{ => Cqs}/Queries/Orders/GetOrderConfirmationQueryOutput.php (92%) rename app/{ => Cqs}/Queries/Orders/GetPickTimeSlotQuery.php (82%) rename app/{ => Cqs}/Queries/Orders/GetPickTimeSlotQueryInput.php (88%) rename app/{ => Cqs}/Queries/Orders/GetPickTimeSlotQueryOutput.php (92%) rename app/{ => Cqs}/Queries/Orders/GetTunnelOrderConfirmedQuery.php (81%) rename app/{ => Cqs}/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php (87%) rename app/{ => Cqs}/Queries/Orders/GetTunnelOrderConfirmedQueryOutput.php (91%) rename app/{ => Cqs}/Queries/Pages/GetPageQuery.php (79%) rename app/{ => Cqs}/Queries/Pages/GetPageQueryInput.php (87%) rename app/{ => Cqs}/Queries/PickupExceptions/GetPaginatedPickupExceptionsQuery.php (84%) rename app/{ => Cqs}/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php (86%) rename app/{ => Cqs}/Queries/ProductIncos/GetArcadiaIncoPreviewQuery.php (78%) rename app/{ => Cqs}/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php (89%) rename app/{ => Cqs}/Queries/Products/GetBoPaginatedProductsQuery.php (95%) rename app/{ => Cqs}/Queries/Products/GetBoPaginatedProductsQueryInput.php (93%) rename app/{ => Cqs}/Queries/Products/GetBoPaginatedProductsQueryOutput.php (95%) rename app/{ => Cqs}/Queries/Products/GetFoFilteredProductsQuery.php (94%) rename app/{ => Cqs}/Queries/Products/GetFoFilteredProductsQueryInput.php (94%) rename app/{ => Cqs}/Queries/Products/GetFoProductIndexPageQuery.php (92%) rename app/{ => Cqs}/Queries/Products/GetFoProductIndexPageQueryInput.php (88%) rename app/{ => Cqs}/Queries/Products/GetFoProductIndexPageQueryOutput.php (96%) rename app/{ => Cqs}/Queries/Products/GetPaginatedProductsQuery.php (95%) rename app/{ => Cqs}/Queries/Products/GetPaginatedProductsQueryInput.php (91%) rename app/{ => Cqs}/Queries/Products/GetProductFormDataQuery.php (94%) rename app/{ => Cqs}/Queries/Products/GetProductFormDataQueryInput.php (87%) rename app/{ => Cqs}/Queries/Ranges/GetPaginatedRangesQuery.php (83%) rename app/{ => Cqs}/Queries/Ranges/GetPaginatedRangesQueryInput.php (89%) rename app/{ => Cqs}/Queries/Settings/GetSettingsQuery.php (94%) rename app/{ => Cqs}/Queries/Shops/GetPaginatedShopsQuery.php (85%) rename app/{ => Cqs}/Queries/Shops/GetPaginatedShopsQueryInput.php (92%) rename app/{ => Cqs}/Queries/Shops/GetPaginatedShopsQueryOutput.php (94%) rename app/{ => Cqs}/Queries/Shops/GetShopPickupExceptionsQuery.php (84%) rename app/{ => Cqs}/Queries/Shops/GetShopPickupExceptionsQueryInput.php (87%) rename app/{ => Cqs}/Queries/Shops/GetShopPickupExceptionsQueryOutput.php (93%) rename app/{ => Cqs}/Queries/Shops/GetShopQuery.php (94%) rename app/{ => Cqs}/Queries/Shops/GetShopQueryInput.php (79%) rename app/{ => Cqs}/Queries/Slides/GetPaginatedSlidesQuery.php (88%) rename app/{ => Cqs}/Queries/Slides/GetPaginatedSlidesQueryInput.php (91%) rename app/{ => Cqs}/Queries/Tags/GetPaginatedTagsQuery.php (83%) rename app/{ => Cqs}/Queries/Tags/GetPaginatedTagsQueryInput.php (89%) rename app/{ => Cqs}/Queries/Timeslots/GetAvailableTimeslotsQuery.php (87%) rename app/{ => Cqs}/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php (87%) rename app/{ => Cqs}/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php (93%) diff --git a/app/Console/Commands/SyncProductIncosCommand.php b/app/Console/Commands/SyncProductIncosCommand.php index 4216f118..144cbaf2 100644 --- a/app/Console/Commands/SyncProductIncosCommand.php +++ b/app/Console/Commands/SyncProductIncosCommand.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Console\Commands; -use App\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; +use App\Cqs\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; use App\Contracts\ActionInputEmpty; use App\Contracts\Executor; use App\Jobs\FetchAndUpsertArcadiaProductIncos; diff --git a/app/Actions/Basket/AddToBasket.php b/app/Cqs/Actions/Basket/AddToBasket.php similarity index 82% rename from app/Actions/Basket/AddToBasket.php rename to app/Cqs/Actions/Basket/AddToBasket.php index 8d4cfa67..dd4a6a9f 100644 --- a/app/Actions/Basket/AddToBasket.php +++ b/app/Cqs/Actions/Basket/AddToBasket.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Basket; +namespace App\Cqs\Actions\Basket; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,7 +10,7 @@ use Domain\Services\BasketService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Basket\AddToBasketInput, void> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Basket\AddToBasketInput, void> */ final class AddToBasket implements Action { diff --git a/app/Actions/Basket/AddToBasketInput.php b/app/Cqs/Actions/Basket/AddToBasketInput.php similarity index 91% rename from app/Actions/Basket/AddToBasketInput.php rename to app/Cqs/Actions/Basket/AddToBasketInput.php index 407dccc2..9d2d7008 100644 --- a/app/Actions/Basket/AddToBasketInput.php +++ b/app/Cqs/Actions/Basket/AddToBasketInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Basket; +namespace App\Cqs\Actions\Basket; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\Entities\ProductId; diff --git a/app/Actions/Basket/EmptyBasket.php b/app/Cqs/Actions/Basket/EmptyBasket.php similarity index 95% rename from app/Actions/Basket/EmptyBasket.php rename to app/Cqs/Actions/Basket/EmptyBasket.php index be0c6df5..8dabe627 100644 --- a/app/Actions/Basket/EmptyBasket.php +++ b/app/Cqs/Actions/Basket/EmptyBasket.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Basket; +namespace App\Cqs\Actions\Basket; use App\Contracts\Action; use App\Contracts\ActionInput; diff --git a/app/Actions/Basket/RemoveFromBasket.php b/app/Cqs/Actions/Basket/RemoveFromBasket.php similarity index 83% rename from app/Actions/Basket/RemoveFromBasket.php rename to app/Cqs/Actions/Basket/RemoveFromBasket.php index a612173e..2ab33454 100644 --- a/app/Actions/Basket/RemoveFromBasket.php +++ b/app/Cqs/Actions/Basket/RemoveFromBasket.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Basket; +namespace App\Cqs\Actions\Basket; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,7 +10,7 @@ use Domain\Services\BasketService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Basket\RemoveQuantityFromBasketInput|\App\Actions\Basket\RemoveProductFromBasketInput, void> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Basket\RemoveQuantityFromBasketInput|\App\Cqs\Actions\Basket\RemoveProductFromBasketInput, void> */ final class RemoveFromBasket implements Action { diff --git a/app/Actions/Basket/RemoveProductFromBasketInput.php b/app/Cqs/Actions/Basket/RemoveProductFromBasketInput.php similarity index 89% rename from app/Actions/Basket/RemoveProductFromBasketInput.php rename to app/Cqs/Actions/Basket/RemoveProductFromBasketInput.php index 79b35ba8..7e601267 100644 --- a/app/Actions/Basket/RemoveProductFromBasketInput.php +++ b/app/Cqs/Actions/Basket/RemoveProductFromBasketInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Basket; +namespace App\Cqs\Actions\Basket; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\Entities\ProductId; diff --git a/app/Actions/Basket/RemoveQuantityFromBasketInput.php b/app/Cqs/Actions/Basket/RemoveQuantityFromBasketInput.php similarity index 91% rename from app/Actions/Basket/RemoveQuantityFromBasketInput.php rename to app/Cqs/Actions/Basket/RemoveQuantityFromBasketInput.php index ec4e127e..4de83590 100644 --- a/app/Actions/Basket/RemoveQuantityFromBasketInput.php +++ b/app/Cqs/Actions/Basket/RemoveQuantityFromBasketInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Basket; +namespace App\Cqs\Actions\Basket; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\Entities\ProductId; diff --git a/app/Actions/Common/ChangeModelOrder.php b/app/Cqs/Actions/Common/ChangeModelOrder.php similarity index 91% rename from app/Actions/Common/ChangeModelOrder.php rename to app/Cqs/Actions/Common/ChangeModelOrder.php index 509417cb..4025ebcb 100644 --- a/app/Actions/Common/ChangeModelOrder.php +++ b/app/Cqs/Actions/Common/ChangeModelOrder.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -14,14 +14,14 @@ use SortDirection; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Common\ChangeModelOrderInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ChangeModelOrderInput, bool> */ final class ChangeModelOrder implements Action { private const int MAX_ORDER_VALUE = 4294967295; /** - * @param \App\Actions\Common\ChangeModelOrderInput $input + * @param \App\Cqs\Actions\Common\ChangeModelOrderInput $input */ #[\Override] public function __invoke(ActionInput $input): bool diff --git a/app/Actions/Common/ChangeModelOrderInput.php b/app/Cqs/Actions/Common/ChangeModelOrderInput.php similarity index 93% rename from app/Actions/Common/ChangeModelOrderInput.php rename to app/Cqs/Actions/Common/ChangeModelOrderInput.php index a175026b..007ce603 100644 --- a/app/Actions/Common/ChangeModelOrderInput.php +++ b/app/Cqs/Actions/Common/ChangeModelOrderInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\ActionInput; use App\Interfaces\ModelWithOrder; diff --git a/app/Actions/Common/ChangeModelOrderPosition.php b/app/Cqs/Actions/Common/ChangeModelOrderPosition.php similarity index 93% rename from app/Actions/Common/ChangeModelOrderPosition.php rename to app/Cqs/Actions/Common/ChangeModelOrderPosition.php index a9f8ffaa..64a2c40b 100644 --- a/app/Actions/Common/ChangeModelOrderPosition.php +++ b/app/Cqs/Actions/Common/ChangeModelOrderPosition.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -13,14 +13,14 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Common\ChangeModelOrderPositionInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ChangeModelOrderPositionInput, bool> */ final class ChangeModelOrderPosition implements Action { private const int MAX_ORDER_VALUE = 4294967295; /** - * @param \App\Actions\Common\ChangeModelOrderPositionInput $input + * @param \App\Cqs\Actions\Common\ChangeModelOrderPositionInput $input */ #[\Override] public function __invoke(ActionInput $input): bool diff --git a/app/Actions/Common/ChangeModelOrderPositionInput.php b/app/Cqs/Actions/Common/ChangeModelOrderPositionInput.php similarity index 94% rename from app/Actions/Common/ChangeModelOrderPositionInput.php rename to app/Cqs/Actions/Common/ChangeModelOrderPositionInput.php index 897a6bcd..23ff8799 100644 --- a/app/Actions/Common/ChangeModelOrderPositionInput.php +++ b/app/Cqs/Actions/Common/ChangeModelOrderPositionInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\ActionInput; use App\Interfaces\ModelWithOrder; diff --git a/app/Actions/Common/ExecuteMassAction.php b/app/Cqs/Actions/Common/ExecuteMassAction.php similarity index 93% rename from app/Actions/Common/ExecuteMassAction.php rename to app/Cqs/Actions/Common/ExecuteMassAction.php index 056b53e2..f46042b7 100644 --- a/app/Actions/Common/ExecuteMassAction.php +++ b/app/Cqs/Actions/Common/ExecuteMassAction.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -13,12 +13,12 @@ use Illuminate\Database\Eloquent\Model; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Common\ExecuteMassActionInput, int> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ExecuteMassActionInput, int> */ final class ExecuteMassAction implements Action { /** - * @param \App\Actions\Common\ExecuteMassActionInput $input + * @param \App\Cqs\Actions\Common\ExecuteMassActionInput $input */ #[\Override] public function __invoke(ActionInput $input): int diff --git a/app/Actions/Common/ExecuteMassActionInput.php b/app/Cqs/Actions/Common/ExecuteMassActionInput.php similarity index 96% rename from app/Actions/Common/ExecuteMassActionInput.php rename to app/Cqs/Actions/Common/ExecuteMassActionInput.php index 8818e3cb..6ba28d46 100644 --- a/app/Actions/Common/ExecuteMassActionInput.php +++ b/app/Cqs/Actions/Common/ExecuteMassActionInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\ActionInput; use App\Enums\MassActionType; diff --git a/app/Actions/Common/ToggleModelStar.php b/app/Cqs/Actions/Common/ToggleModelStar.php similarity index 68% rename from app/Actions/Common/ToggleModelStar.php rename to app/Cqs/Actions/Common/ToggleModelStar.php index 9ec546a7..34b7cd56 100644 --- a/app/Actions/Common/ToggleModelStar.php +++ b/app/Cqs/Actions/Common/ToggleModelStar.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,12 +11,12 @@ use Illuminate\Database\Eloquent\Model; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Common\ToggleModelStarInput, \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStar> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ToggleModelStarInput, \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStar> */ final class ToggleModelStar implements Action { /** - * @param \App\Actions\Common\ToggleModelStarInput $input + * @param \App\Cqs\Actions\Common\ToggleModelStarInput $input */ #[\Override] public function __invoke(ActionInput $input): Model & ModelWithStar diff --git a/app/Actions/Common/ToggleModelStarInput.php b/app/Cqs/Actions/Common/ToggleModelStarInput.php similarity index 93% rename from app/Actions/Common/ToggleModelStarInput.php rename to app/Cqs/Actions/Common/ToggleModelStarInput.php index 0ce672da..14b6a1ef 100644 --- a/app/Actions/Common/ToggleModelStarInput.php +++ b/app/Cqs/Actions/Common/ToggleModelStarInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\ActionInput; use App\Interfaces\ModelWithStar; diff --git a/app/Actions/Common/ToggleModelStatus.php b/app/Cqs/Actions/Common/ToggleModelStatus.php similarity index 68% rename from app/Actions/Common/ToggleModelStatus.php rename to app/Cqs/Actions/Common/ToggleModelStatus.php index 038d3484..acf003ee 100644 --- a/app/Actions/Common/ToggleModelStatus.php +++ b/app/Cqs/Actions/Common/ToggleModelStatus.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,12 +11,12 @@ use Illuminate\Database\Eloquent\Model; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Common\ToggleModelStatusInput, \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStatus> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ToggleModelStatusInput, \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStatus> */ final class ToggleModelStatus implements Action { /** - * @param \App\Actions\Common\ToggleModelStatusInput $input + * @param \App\Cqs\Actions\Common\ToggleModelStatusInput $input */ #[\Override] public function __invoke(ActionInput $input): Model & ModelWithStatus diff --git a/app/Actions/Common/ToggleModelStatusInput.php b/app/Cqs/Actions/Common/ToggleModelStatusInput.php similarity index 93% rename from app/Actions/Common/ToggleModelStatusInput.php rename to app/Cqs/Actions/Common/ToggleModelStatusInput.php index deab9ef8..293cae51 100644 --- a/app/Actions/Common/ToggleModelStatusInput.php +++ b/app/Cqs/Actions/Common/ToggleModelStatusInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Common; +namespace App\Cqs\Actions\Common; use App\Contracts\ActionInput; use App\Interfaces\ModelWithStatus; diff --git a/app/Actions/Crm/UnsubscribeFromNewsletter.php b/app/Cqs/Actions/Crm/UnsubscribeFromNewsletter.php similarity index 83% rename from app/Actions/Crm/UnsubscribeFromNewsletter.php rename to app/Cqs/Actions/Crm/UnsubscribeFromNewsletter.php index a317ba90..1ec72d44 100644 --- a/app/Actions/Crm/UnsubscribeFromNewsletter.php +++ b/app/Cqs/Actions/Crm/UnsubscribeFromNewsletter.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,7 +10,7 @@ use App\Services\CrmService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Crm\UnsubscribeFromNewsletterInput, \App\Actions\Crm\UnsubscribeFromNewsletterOutput> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Crm\UnsubscribeFromNewsletterInput, \App\Cqs\Actions\Crm\UnsubscribeFromNewsletterOutput> */ final class UnsubscribeFromNewsletter implements Action { diff --git a/app/Actions/Crm/UnsubscribeFromNewsletterInput.php b/app/Cqs/Actions/Crm/UnsubscribeFromNewsletterInput.php similarity index 89% rename from app/Actions/Crm/UnsubscribeFromNewsletterInput.php rename to app/Cqs/Actions/Crm/UnsubscribeFromNewsletterInput.php index 00f2d1e8..10fc1ced 100644 --- a/app/Actions/Crm/UnsubscribeFromNewsletterInput.php +++ b/app/Cqs/Actions/Crm/UnsubscribeFromNewsletterInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; use App\Contracts\ActionInput; use Shared\ValueObjects\CrmHashcode; diff --git a/app/Actions/Crm/UnsubscribeFromNewsletterOutput.php b/app/Cqs/Actions/Crm/UnsubscribeFromNewsletterOutput.php similarity index 81% rename from app/Actions/Crm/UnsubscribeFromNewsletterOutput.php rename to app/Cqs/Actions/Crm/UnsubscribeFromNewsletterOutput.php index a269ad37..73f989ea 100644 --- a/app/Actions/Crm/UnsubscribeFromNewsletterOutput.php +++ b/app/Cqs/Actions/Crm/UnsubscribeFromNewsletterOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; enum UnsubscribeFromNewsletterOutput { diff --git a/app/Actions/Crm/UpdateCustomer.php b/app/Cqs/Actions/Crm/UpdateCustomer.php similarity index 91% rename from app/Actions/Crm/UpdateCustomer.php rename to app/Cqs/Actions/Crm/UpdateCustomer.php index 1bd26f5c..85120207 100644 --- a/app/Actions/Crm/UpdateCustomer.php +++ b/app/Cqs/Actions/Crm/UpdateCustomer.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,7 +11,7 @@ use Infrastructure\Adapters\Services\AppCustomerAuthService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Crm\UpdateCustomerInput, \App\Actions\Crm\UpdateCustomerOutput> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Crm\UpdateCustomerInput, \App\Cqs\Actions\Crm\UpdateCustomerOutput> */ final class UpdateCustomer implements Action { diff --git a/app/Actions/Crm/UpdateCustomerInput.php b/app/Cqs/Actions/Crm/UpdateCustomerInput.php similarity index 93% rename from app/Actions/Crm/UpdateCustomerInput.php rename to app/Cqs/Actions/Crm/UpdateCustomerInput.php index 51cf202e..78ad6fff 100644 --- a/app/Actions/Crm/UpdateCustomerInput.php +++ b/app/Cqs/Actions/Crm/UpdateCustomerInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; use App\Contracts\ActionInput; diff --git a/app/Actions/Crm/UpdateCustomerOutput.php b/app/Cqs/Actions/Crm/UpdateCustomerOutput.php similarity index 90% rename from app/Actions/Crm/UpdateCustomerOutput.php rename to app/Cqs/Actions/Crm/UpdateCustomerOutput.php index 238f614c..6e96cf04 100644 --- a/app/Actions/Crm/UpdateCustomerOutput.php +++ b/app/Cqs/Actions/Crm/UpdateCustomerOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; use Domain\Models\ValueObjects\CrmCustomer; use Illuminate\Validation\ValidationException; diff --git a/app/Actions/Crm/UpdateCustomerPassword.php b/app/Cqs/Actions/Crm/UpdateCustomerPassword.php similarity index 88% rename from app/Actions/Crm/UpdateCustomerPassword.php rename to app/Cqs/Actions/Crm/UpdateCustomerPassword.php index 524dcd2c..77c363c1 100644 --- a/app/Actions/Crm/UpdateCustomerPassword.php +++ b/app/Cqs/Actions/Crm/UpdateCustomerPassword.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -12,7 +12,7 @@ use Infrastructure\Adapters\Services\AppCustomerAuthService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Crm\UpdateCustomerPasswordInput, \App\Actions\Crm\UpdateCustomerPasswordOutput> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Crm\UpdateCustomerPasswordInput, \App\Cqs\Actions\Crm\UpdateCustomerPasswordOutput> */ final class UpdateCustomerPassword implements Action { diff --git a/app/Actions/Crm/UpdateCustomerPasswordInput.php b/app/Cqs/Actions/Crm/UpdateCustomerPasswordInput.php similarity index 94% rename from app/Actions/Crm/UpdateCustomerPasswordInput.php rename to app/Cqs/Actions/Crm/UpdateCustomerPasswordInput.php index aea1a967..ec46fc29 100644 --- a/app/Actions/Crm/UpdateCustomerPasswordInput.php +++ b/app/Cqs/Actions/Crm/UpdateCustomerPasswordInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; diff --git a/app/Actions/Crm/UpdateCustomerPasswordOutput.php b/app/Cqs/Actions/Crm/UpdateCustomerPasswordOutput.php similarity index 90% rename from app/Actions/Crm/UpdateCustomerPasswordOutput.php rename to app/Cqs/Actions/Crm/UpdateCustomerPasswordOutput.php index f304b9ca..5b2c3242 100644 --- a/app/Actions/Crm/UpdateCustomerPasswordOutput.php +++ b/app/Cqs/Actions/Crm/UpdateCustomerPasswordOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Crm; +namespace App\Cqs\Actions\Crm; use Domain\Models\ValueObjects\CrmCustomer; use Illuminate\Validation\ValidationException; diff --git a/app/Actions/Customers/RegisterCustomer.php b/app/Cqs/Actions/Customers/RegisterCustomer.php similarity index 93% rename from app/Actions/Customers/RegisterCustomer.php rename to app/Cqs/Actions/Customers/RegisterCustomer.php index b3b2ca61..fb287d60 100644 --- a/app/Actions/Customers/RegisterCustomer.php +++ b/app/Cqs/Actions/Customers/RegisterCustomer.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Customers; +namespace App\Cqs\Actions\Customers; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -21,7 +21,7 @@ use Shared\ValueObjects\CrmHashcode; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Customers\RegisterCustomerInput, \App\Models\Customer> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Customers\RegisterCustomerInput, \App\Models\Customer> */ final class RegisterCustomer implements Action { @@ -33,7 +33,7 @@ final class RegisterCustomer implements Action } /** - * @param \App\Actions\Customers\RegisterCustomerInput $input + * @param \App\Cqs\Actions\Customers\RegisterCustomerInput $input * * @throws ValidationException * @throws \UnexpectedValueException diff --git a/app/Actions/Customers/RegisterCustomerInput.php b/app/Cqs/Actions/Customers/RegisterCustomerInput.php similarity index 97% rename from app/Actions/Customers/RegisterCustomerInput.php rename to app/Cqs/Actions/Customers/RegisterCustomerInput.php index 9be0658d..79cc9989 100644 --- a/app/Actions/Customers/RegisterCustomerInput.php +++ b/app/Cqs/Actions/Customers/RegisterCustomerInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Customers; +namespace App\Cqs\Actions\Customers; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\Code; diff --git a/app/Actions/Discounts/CreateDiscount.php b/app/Cqs/Actions/Discounts/CreateDiscount.php similarity index 88% rename from app/Actions/Discounts/CreateDiscount.php rename to app/Cqs/Actions/Discounts/CreateDiscount.php index d731e330..f0e30b07 100644 --- a/app/Actions/Discounts/CreateDiscount.php +++ b/app/Cqs/Actions/Discounts/CreateDiscount.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Discounts; +namespace App\Cqs\Actions\Discounts; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -12,12 +12,12 @@ use Illuminate\Support\Carbon; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Discounts\CreateDiscountInput, \App\Models\Discount> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Discounts\CreateDiscountInput, \App\Models\Discount> */ final class CreateDiscount implements Action { /** - * @param \App\Actions\Discounts\CreateDiscountInput $input + * @param \App\Cqs\Actions\Discounts\CreateDiscountInput $input */ public function __invoke(ActionInput $input): Discount { diff --git a/app/Actions/Discounts/CreateDiscountInput.php b/app/Cqs/Actions/Discounts/CreateDiscountInput.php similarity index 95% rename from app/Actions/Discounts/CreateDiscountInput.php rename to app/Cqs/Actions/Discounts/CreateDiscountInput.php index 4792a00f..8143d402 100644 --- a/app/Actions/Discounts/CreateDiscountInput.php +++ b/app/Cqs/Actions/Discounts/CreateDiscountInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Discounts; +namespace App\Cqs\Actions\Discounts; use App\Contracts\ActionInput; use Domain\Enums\DiscountType; diff --git a/app/Actions/Discounts/DeleteDiscount.php b/app/Cqs/Actions/Discounts/DeleteDiscount.php similarity index 65% rename from app/Actions/Discounts/DeleteDiscount.php rename to app/Cqs/Actions/Discounts/DeleteDiscount.php index b4f91e46..9a48d68f 100644 --- a/app/Actions/Discounts/DeleteDiscount.php +++ b/app/Cqs/Actions/Discounts/DeleteDiscount.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\Discounts; +namespace App\Cqs\Actions\Discounts; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Discounts\DeleteDiscountInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Discounts\DeleteDiscountInput, bool> */ final class DeleteDiscount implements Action { /** - * @param \App\Actions\Discounts\DeleteDiscountInput $input + * @param \App\Cqs\Actions\Discounts\DeleteDiscountInput $input */ public function __invoke(ActionInput $input): bool { diff --git a/app/Actions/Discounts/DeleteDiscountInput.php b/app/Cqs/Actions/Discounts/DeleteDiscountInput.php similarity index 86% rename from app/Actions/Discounts/DeleteDiscountInput.php rename to app/Cqs/Actions/Discounts/DeleteDiscountInput.php index f256f40b..8549ab1e 100644 --- a/app/Actions/Discounts/DeleteDiscountInput.php +++ b/app/Cqs/Actions/Discounts/DeleteDiscountInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Discounts; +namespace App\Cqs\Actions\Discounts; use App\Contracts\ActionInput; use App\Models\Discount; diff --git a/app/Actions/Discounts/UpdateDiscount.php b/app/Cqs/Actions/Discounts/UpdateDiscount.php similarity index 88% rename from app/Actions/Discounts/UpdateDiscount.php rename to app/Cqs/Actions/Discounts/UpdateDiscount.php index 5a0bf888..7fd3f8ab 100644 --- a/app/Actions/Discounts/UpdateDiscount.php +++ b/app/Cqs/Actions/Discounts/UpdateDiscount.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Discounts; +namespace App\Cqs\Actions\Discounts; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -12,12 +12,12 @@ use Illuminate\Support\Carbon; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Discounts\UpdateDiscountInput, \App\Models\Discount> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Discounts\UpdateDiscountInput, \App\Models\Discount> */ final class UpdateDiscount implements Action { /** - * @param \App\Actions\Discounts\UpdateDiscountInput $input + * @param \App\Cqs\Actions\Discounts\UpdateDiscountInput $input */ public function __invoke(ActionInput $input): Discount { diff --git a/app/Actions/Discounts/UpdateDiscountInput.php b/app/Cqs/Actions/Discounts/UpdateDiscountInput.php similarity index 95% rename from app/Actions/Discounts/UpdateDiscountInput.php rename to app/Cqs/Actions/Discounts/UpdateDiscountInput.php index f8ed9d86..bf27e924 100644 --- a/app/Actions/Discounts/UpdateDiscountInput.php +++ b/app/Cqs/Actions/Discounts/UpdateDiscountInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Discounts; +namespace App\Cqs\Actions\Discounts; use App\Contracts\ActionInput; use App\Models\Discount; diff --git a/app/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php b/app/Cqs/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php similarity index 96% rename from app/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php rename to app/Cqs/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php index 8e4492cd..2a32a385 100644 --- a/app/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php +++ b/app/Cqs/Actions/Employee/SynchronizeEmployeesWithArcadiaApi.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Employee; +namespace App\Cqs\Actions\Employee; use App\Contracts\Action; use App\Contracts\ActionInput; diff --git a/app/Actions/Faqs/CreateFaq.php b/app/Cqs/Actions/Faqs/CreateFaq.php similarity index 74% rename from app/Actions/Faqs/CreateFaq.php rename to app/Cqs/Actions/Faqs/CreateFaq.php index eb64470f..9f7bbcfa 100644 --- a/app/Actions/Faqs/CreateFaq.php +++ b/app/Cqs/Actions/Faqs/CreateFaq.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Faqs; +namespace App\Cqs\Actions\Faqs; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Faq; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Faqs\CreateFaqInput, \App\Models\Faq> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Faqs\CreateFaqInput, \App\Models\Faq> */ final class CreateFaq implements Action { /** - * @param \App\Actions\Faqs\CreateFaqInput $input + * @param \App\Cqs\Actions\Faqs\CreateFaqInput $input */ #[\Override] public function __invoke(ActionInput $input): Faq diff --git a/app/Actions/Faqs/CreateFaqInput.php b/app/Cqs/Actions/Faqs/CreateFaqInput.php similarity index 94% rename from app/Actions/Faqs/CreateFaqInput.php rename to app/Cqs/Actions/Faqs/CreateFaqInput.php index 54c1a4df..b0fe8668 100644 --- a/app/Actions/Faqs/CreateFaqInput.php +++ b/app/Cqs/Actions/Faqs/CreateFaqInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Faqs; +namespace App\Cqs\Actions\Faqs; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; diff --git a/app/Actions/Faqs/DeleteFaq.php b/app/Cqs/Actions/Faqs/DeleteFaq.php similarity index 68% rename from app/Actions/Faqs/DeleteFaq.php rename to app/Cqs/Actions/Faqs/DeleteFaq.php index ed107870..cad213ad 100644 --- a/app/Actions/Faqs/DeleteFaq.php +++ b/app/Cqs/Actions/Faqs/DeleteFaq.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\Faqs; +namespace App\Cqs\Actions\Faqs; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Faqs\DeleteFaqInput, void> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Faqs\DeleteFaqInput, void> */ final class DeleteFaq implements Action { /** - * @param \App\Actions\Faqs\DeleteFaqInput $input + * @param \App\Cqs\Actions\Faqs\DeleteFaqInput $input */ #[\Override] public function __invoke(ActionInput $input): void diff --git a/app/Actions/Faqs/DeleteFaqInput.php b/app/Cqs/Actions/Faqs/DeleteFaqInput.php similarity index 87% rename from app/Actions/Faqs/DeleteFaqInput.php rename to app/Cqs/Actions/Faqs/DeleteFaqInput.php index df6851dc..8b96cbb4 100644 --- a/app/Actions/Faqs/DeleteFaqInput.php +++ b/app/Cqs/Actions/Faqs/DeleteFaqInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Faqs; +namespace App\Cqs\Actions\Faqs; use App\Contracts\ActionInput; use App\Models\Faq; diff --git a/app/Actions/Faqs/UpdateFaq.php b/app/Cqs/Actions/Faqs/UpdateFaq.php similarity index 74% rename from app/Actions/Faqs/UpdateFaq.php rename to app/Cqs/Actions/Faqs/UpdateFaq.php index cccfa885..00ce2f89 100644 --- a/app/Actions/Faqs/UpdateFaq.php +++ b/app/Cqs/Actions/Faqs/UpdateFaq.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Faqs; +namespace App\Cqs\Actions\Faqs; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Faq; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Faqs\UpdateFaqInput, \App\Models\Faq> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Faqs\UpdateFaqInput, \App\Models\Faq> */ final class UpdateFaq implements Action { /** - * @param \App\Actions\Faqs\UpdateFaqInput $input + * @param \App\Cqs\Actions\Faqs\UpdateFaqInput $input */ #[\Override] public function __invoke(ActionInput $input): Faq diff --git a/app/Actions/Faqs/UpdateFaqInput.php b/app/Cqs/Actions/Faqs/UpdateFaqInput.php similarity index 95% rename from app/Actions/Faqs/UpdateFaqInput.php rename to app/Cqs/Actions/Faqs/UpdateFaqInput.php index 8575c164..950b8b6a 100644 --- a/app/Actions/Faqs/UpdateFaqInput.php +++ b/app/Cqs/Actions/Faqs/UpdateFaqInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Faqs; +namespace App\Cqs\Actions\Faqs; use App\Contracts\ActionInput; use App\Models\Faq; diff --git a/app/Actions/Orders/ApplyPickTimeSlot.php b/app/Cqs/Actions/Orders/ApplyPickTimeSlot.php similarity index 80% rename from app/Actions/Orders/ApplyPickTimeSlot.php rename to app/Cqs/Actions/Orders/ApplyPickTimeSlot.php index fb96685a..5b18bb24 100644 --- a/app/Actions/Orders/ApplyPickTimeSlot.php +++ b/app/Cqs/Actions/Orders/ApplyPickTimeSlot.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Orders; +namespace App\Cqs\Actions\Orders; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,7 +11,7 @@ use Domain\Services\OrderTunnelService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Orders\ApplyPickTimeSlotInput, ?\Domain\Models\ValueObjects\PickupTimeSlot> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Orders\ApplyPickTimeSlotInput, ?\Domain\Models\ValueObjects\PickupTimeSlot> */ final class ApplyPickTimeSlot implements Action { @@ -21,7 +21,7 @@ final class ApplyPickTimeSlot implements Action } /** - * @param \App\Actions\Orders\ApplyPickTimeSlotInput $input + * @param \App\Cqs\Actions\Orders\ApplyPickTimeSlotInput $input */ #[\Override] public function __invoke(ActionInput $input): ?PickupTimeSlot diff --git a/app/Actions/Orders/ApplyPickTimeSlotInput.php b/app/Cqs/Actions/Orders/ApplyPickTimeSlotInput.php similarity index 90% rename from app/Actions/Orders/ApplyPickTimeSlotInput.php rename to app/Cqs/Actions/Orders/ApplyPickTimeSlotInput.php index 351f4662..f5f27f8a 100644 --- a/app/Actions/Orders/ApplyPickTimeSlotInput.php +++ b/app/Cqs/Actions/Orders/ApplyPickTimeSlotInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Orders; +namespace App\Cqs\Actions\Orders; use App\Contracts\ActionInput; use Carbon\CarbonInterface; diff --git a/app/Actions/Orders/CancelOrder.php b/app/Cqs/Actions/Orders/CancelOrder.php similarity index 76% rename from app/Actions/Orders/CancelOrder.php rename to app/Cqs/Actions/Orders/CancelOrder.php index 70492a75..6ae05985 100644 --- a/app/Actions/Orders/CancelOrder.php +++ b/app/Cqs/Actions/Orders/CancelOrder.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Orders; +namespace App\Cqs\Actions\Orders; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,7 +10,7 @@ use Domain\Services\OrderService as DomainOrderService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Orders\CancelOrderInput, void> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Orders\CancelOrderInput, void> */ final class CancelOrder implements Action { @@ -20,7 +20,7 @@ final class CancelOrder implements Action } /** - * @param \App\Actions\Orders\CancelOrderInput $input + * @param \App\Cqs\Actions\Orders\CancelOrderInput $input */ #[\Override] public function __invoke(ActionInput $input): void diff --git a/app/Actions/Orders/CancelOrderInput.php b/app/Cqs/Actions/Orders/CancelOrderInput.php similarity index 90% rename from app/Actions/Orders/CancelOrderInput.php rename to app/Cqs/Actions/Orders/CancelOrderInput.php index 8382a31c..f50a2ecf 100644 --- a/app/Actions/Orders/CancelOrderInput.php +++ b/app/Cqs/Actions/Orders/CancelOrderInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Orders; +namespace App\Cqs\Actions\Orders; use App\Contracts\ActionInput; use App\Models\Order; diff --git a/app/Actions/Orders/FinalizeOrder.php b/app/Cqs/Actions/Orders/FinalizeOrder.php similarity index 76% rename from app/Actions/Orders/FinalizeOrder.php rename to app/Cqs/Actions/Orders/FinalizeOrder.php index d0a4545a..df65eb30 100644 --- a/app/Actions/Orders/FinalizeOrder.php +++ b/app/Cqs/Actions/Orders/FinalizeOrder.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Orders; +namespace App\Cqs\Actions\Orders; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,7 +11,7 @@ use Domain\Services\OrderTunnelService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Orders\FinalizeOrderInput, \Domain\Models\ValueObjects\OrderReference> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Orders\FinalizeOrderInput, \Domain\Models\ValueObjects\OrderReference> */ final class FinalizeOrder implements Action { @@ -21,7 +21,7 @@ final class FinalizeOrder implements Action } /** - * @param \App\Actions\Orders\FinalizeOrderInput $input + * @param \App\Cqs\Actions\Orders\FinalizeOrderInput $input */ #[\Override] public function __invoke(ActionInput $input): OrderReference diff --git a/app/Actions/Orders/FinalizeOrderInput.php b/app/Cqs/Actions/Orders/FinalizeOrderInput.php similarity index 89% rename from app/Actions/Orders/FinalizeOrderInput.php rename to app/Cqs/Actions/Orders/FinalizeOrderInput.php index 37f6ea0a..9e9b6f75 100644 --- a/app/Actions/Orders/FinalizeOrderInput.php +++ b/app/Cqs/Actions/Orders/FinalizeOrderInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Orders; +namespace App\Cqs\Actions\Orders; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\Entities\ShopperId; diff --git a/app/Actions/Orders/InitializeOrderTunnel.php b/app/Cqs/Actions/Orders/InitializeOrderTunnel.php similarity index 75% rename from app/Actions/Orders/InitializeOrderTunnel.php rename to app/Cqs/Actions/Orders/InitializeOrderTunnel.php index 18881f38..28712982 100644 --- a/app/Actions/Orders/InitializeOrderTunnel.php +++ b/app/Cqs/Actions/Orders/InitializeOrderTunnel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Orders; +namespace App\Cqs\Actions\Orders; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,7 +10,7 @@ use Domain\Services\OrderTunnelService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Orders\InitializeOrderTunnelInput, void> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Orders\InitializeOrderTunnelInput, void> */ final class InitializeOrderTunnel implements Action { @@ -20,7 +20,7 @@ final class InitializeOrderTunnel implements Action } /** - * @param \App\Actions\Orders\InitializeOrderTunnelInput $input + * @param \App\Cqs\Actions\Orders\InitializeOrderTunnelInput $input */ #[\Override] public function __invoke(ActionInput $input): void diff --git a/app/Actions/Orders/InitializeOrderTunnelInput.php b/app/Cqs/Actions/Orders/InitializeOrderTunnelInput.php similarity index 90% rename from app/Actions/Orders/InitializeOrderTunnelInput.php rename to app/Cqs/Actions/Orders/InitializeOrderTunnelInput.php index 3bd31b09..1abd37e5 100644 --- a/app/Actions/Orders/InitializeOrderTunnelInput.php +++ b/app/Cqs/Actions/Orders/InitializeOrderTunnelInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Orders; +namespace App\Cqs\Actions\Orders; use App\Contracts\ActionInput; use Domain\Models\Entities\Basket; diff --git a/app/Actions/Pages/UpdatePage.php b/app/Cqs/Actions/Pages/UpdatePage.php similarity index 78% rename from app/Actions/Pages/UpdatePage.php rename to app/Cqs/Actions/Pages/UpdatePage.php index 0eec0af7..6f8905b4 100644 --- a/app/Actions/Pages/UpdatePage.php +++ b/app/Cqs/Actions/Pages/UpdatePage.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Pages; +namespace App\Cqs\Actions\Pages; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Page; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Pages\UpdatePageInput, \App\Models\Page> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Pages\UpdatePageInput, \App\Models\Page> */ final class UpdatePage implements Action { /** - * @param \App\Actions\Pages\UpdatePageInput $input + * @param \App\Cqs\Actions\Pages\UpdatePageInput $input */ #[\Override] public function __invoke(ActionInput $input): Page diff --git a/app/Actions/Pages/UpdatePageInput.php b/app/Cqs/Actions/Pages/UpdatePageInput.php similarity index 94% rename from app/Actions/Pages/UpdatePageInput.php rename to app/Cqs/Actions/Pages/UpdatePageInput.php index 15a88286..f8981d4f 100644 --- a/app/Actions/Pages/UpdatePageInput.php +++ b/app/Cqs/Actions/Pages/UpdatePageInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Pages; +namespace App\Cqs\Actions\Pages; use App\Contracts\ActionInput; use App\Models\Page; diff --git a/app/Actions/PickupExceptions/CreatePickupException.php b/app/Cqs/Actions/PickupExceptions/CreatePickupException.php similarity index 76% rename from app/Actions/PickupExceptions/CreatePickupException.php rename to app/Cqs/Actions/PickupExceptions/CreatePickupException.php index ba9ab622..09b52d64 100644 --- a/app/Actions/PickupExceptions/CreatePickupException.php +++ b/app/Cqs/Actions/PickupExceptions/CreatePickupException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\PickupExceptions; +namespace App\Cqs\Actions\PickupExceptions; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\PickupException; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\PickupExceptions\CreatePickupExceptionInput, \App\Models\PickupException> + * @implements \App\Contracts\Action<\App\Cqs\Actions\PickupExceptions\CreatePickupExceptionInput, \App\Models\PickupException> */ final class CreatePickupException implements Action { /** - * @param \App\Actions\PickupExceptions\CreatePickupExceptionInput $input + * @param \App\Cqs\Actions\PickupExceptions\CreatePickupExceptionInput $input */ #[\Override] public function __invoke(ActionInput $input): PickupException diff --git a/app/Actions/PickupExceptions/CreatePickupExceptionInput.php b/app/Cqs/Actions/PickupExceptions/CreatePickupExceptionInput.php similarity index 93% rename from app/Actions/PickupExceptions/CreatePickupExceptionInput.php rename to app/Cqs/Actions/PickupExceptions/CreatePickupExceptionInput.php index b32e2589..88657bd2 100644 --- a/app/Actions/PickupExceptions/CreatePickupExceptionInput.php +++ b/app/Cqs/Actions/PickupExceptions/CreatePickupExceptionInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\PickupExceptions; +namespace App\Cqs\Actions\PickupExceptions; use App\Contracts\ActionInput; use Domain\Enums\RepeatFrequency; diff --git a/app/Actions/PickupExceptions/DeletePickupException.php b/app/Cqs/Actions/PickupExceptions/DeletePickupException.php similarity index 64% rename from app/Actions/PickupExceptions/DeletePickupException.php rename to app/Cqs/Actions/PickupExceptions/DeletePickupException.php index f2f0b3bd..cd0c7380 100644 --- a/app/Actions/PickupExceptions/DeletePickupException.php +++ b/app/Cqs/Actions/PickupExceptions/DeletePickupException.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\PickupExceptions; +namespace App\Cqs\Actions\PickupExceptions; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\PickupExceptions\DeletePickupExceptionInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\PickupExceptions\DeletePickupExceptionInput, bool> */ final class DeletePickupException implements Action { /** - * @param \App\Actions\PickupExceptions\DeletePickupExceptionInput $input + * @param \App\Cqs\Actions\PickupExceptions\DeletePickupExceptionInput $input */ #[\Override] public function __invoke(ActionInput $input): bool diff --git a/app/Actions/PickupExceptions/DeletePickupExceptionInput.php b/app/Cqs/Actions/PickupExceptions/DeletePickupExceptionInput.php similarity index 85% rename from app/Actions/PickupExceptions/DeletePickupExceptionInput.php rename to app/Cqs/Actions/PickupExceptions/DeletePickupExceptionInput.php index d303a5b5..eec73538 100644 --- a/app/Actions/PickupExceptions/DeletePickupExceptionInput.php +++ b/app/Cqs/Actions/PickupExceptions/DeletePickupExceptionInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\PickupExceptions; +namespace App\Cqs\Actions\PickupExceptions; use App\Contracts\ActionInput; use App\Models\PickupException; diff --git a/app/Actions/PickupExceptions/UpdatePickupException.php b/app/Cqs/Actions/PickupExceptions/UpdatePickupException.php similarity index 75% rename from app/Actions/PickupExceptions/UpdatePickupException.php rename to app/Cqs/Actions/PickupExceptions/UpdatePickupException.php index 3e898de9..9932a5d1 100644 --- a/app/Actions/PickupExceptions/UpdatePickupException.php +++ b/app/Cqs/Actions/PickupExceptions/UpdatePickupException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\PickupExceptions; +namespace App\Cqs\Actions\PickupExceptions; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\PickupException; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\PickupExceptions\UpdatePickupExceptionInput, \App\Models\PickupException> + * @implements \App\Contracts\Action<\App\Cqs\Actions\PickupExceptions\UpdatePickupExceptionInput, \App\Models\PickupException> */ final class UpdatePickupException implements Action { /** - * @param \App\Actions\PickupExceptions\UpdatePickupExceptionInput $input + * @param \App\Cqs\Actions\PickupExceptions\UpdatePickupExceptionInput $input */ #[\Override] public function __invoke(ActionInput $input): PickupException diff --git a/app/Actions/PickupExceptions/UpdatePickupExceptionInput.php b/app/Cqs/Actions/PickupExceptions/UpdatePickupExceptionInput.php similarity index 94% rename from app/Actions/PickupExceptions/UpdatePickupExceptionInput.php rename to app/Cqs/Actions/PickupExceptions/UpdatePickupExceptionInput.php index 35f9a7e4..e4f9ddcf 100644 --- a/app/Actions/PickupExceptions/UpdatePickupExceptionInput.php +++ b/app/Cqs/Actions/PickupExceptions/UpdatePickupExceptionInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\PickupExceptions; +namespace App\Cqs\Actions\PickupExceptions; use App\Contracts\ActionInput; use App\Models\PickupException; diff --git a/app/Actions/ProductIncos/AssociateProductInco.php b/app/Cqs/Actions/ProductIncos/AssociateProductInco.php similarity index 87% rename from app/Actions/ProductIncos/AssociateProductInco.php rename to app/Cqs/Actions/ProductIncos/AssociateProductInco.php index 93789e5c..4a31d27d 100644 --- a/app/Actions/ProductIncos/AssociateProductInco.php +++ b/app/Cqs/Actions/ProductIncos/AssociateProductInco.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\ProductIncos; +namespace App\Cqs\Actions\ProductIncos; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,7 +11,7 @@ use App\Services\ArcadiaIncoService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\ProductIncos\AssociateProductIncoInput, \App\Models\ProductInco> + * @implements \App\Contracts\Action<\App\Cqs\Actions\ProductIncos\AssociateProductIncoInput, \App\Models\ProductInco> */ final class AssociateProductInco implements Action { @@ -21,7 +21,7 @@ final class AssociateProductInco implements Action } /** - * @param \App\Actions\ProductIncos\AssociateProductIncoInput $input + * @param \App\Cqs\Actions\ProductIncos\AssociateProductIncoInput $input */ #[\Override] public function __invoke(ActionInput $input): ProductInco diff --git a/app/Actions/ProductIncos/AssociateProductIncoInput.php b/app/Cqs/Actions/ProductIncos/AssociateProductIncoInput.php similarity index 91% rename from app/Actions/ProductIncos/AssociateProductIncoInput.php rename to app/Cqs/Actions/ProductIncos/AssociateProductIncoInput.php index e6eda895..673ffbfc 100644 --- a/app/Actions/ProductIncos/AssociateProductIncoInput.php +++ b/app/Cqs/Actions/ProductIncos/AssociateProductIncoInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\ProductIncos; +namespace App\Cqs\Actions\ProductIncos; use App\Contracts\ActionInput; use App\Models\Product; diff --git a/app/Actions/ProductIncos/SyncProductInco.php b/app/Cqs/Actions/ProductIncos/SyncProductInco.php similarity index 86% rename from app/Actions/ProductIncos/SyncProductInco.php rename to app/Cqs/Actions/ProductIncos/SyncProductInco.php index ae2379d6..fd92e08d 100644 --- a/app/Actions/ProductIncos/SyncProductInco.php +++ b/app/Cqs/Actions/ProductIncos/SyncProductInco.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\ProductIncos; +namespace App\Cqs\Actions\ProductIncos; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,7 +11,7 @@ use App\Services\ArcadiaIncoService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\ProductIncos\SyncProductIncoInput, \App\Models\ProductInco> + * @implements \App\Contracts\Action<\App\Cqs\Actions\ProductIncos\SyncProductIncoInput, \App\Models\ProductInco> */ final class SyncProductInco implements Action { @@ -21,7 +21,7 @@ final class SyncProductInco implements Action } /** - * @param \App\Actions\ProductIncos\SyncProductIncoInput $input + * @param \App\Cqs\Actions\ProductIncos\SyncProductIncoInput $input */ #[\Override] public function __invoke(ActionInput $input): ProductInco diff --git a/app/Actions/ProductIncos/SyncProductIncoInput.php b/app/Cqs/Actions/ProductIncos/SyncProductIncoInput.php similarity index 85% rename from app/Actions/ProductIncos/SyncProductIncoInput.php rename to app/Cqs/Actions/ProductIncos/SyncProductIncoInput.php index bcce4aff..dede8ae3 100644 --- a/app/Actions/ProductIncos/SyncProductIncoInput.php +++ b/app/Cqs/Actions/ProductIncos/SyncProductIncoInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\ProductIncos; +namespace App\Cqs\Actions\ProductIncos; use App\Contracts\ActionInput; use App\Models\Product; diff --git a/app/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApi.php b/app/Cqs/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApi.php similarity index 98% rename from app/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApi.php rename to app/Cqs/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApi.php index c5a33542..094830ec 100644 --- a/app/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApi.php +++ b/app/Cqs/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApi.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\ProductIncos; +namespace App\Cqs\Actions\ProductIncos; use App\Contracts\Action; use App\Contracts\ActionInput; diff --git a/app/Actions/Products/CreateProduct.php b/app/Cqs/Actions/Products/CreateProduct.php similarity index 94% rename from app/Actions/Products/CreateProduct.php rename to app/Cqs/Actions/Products/CreateProduct.php index 175b83ae..8cdf4f30 100644 --- a/app/Actions/Products/CreateProduct.php +++ b/app/Cqs/Actions/Products/CreateProduct.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Products; +namespace App\Cqs\Actions\Products; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -13,12 +13,12 @@ use Illuminate\Support\Str; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Products\CreateProductInput, \App\Models\Product> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Products\CreateProductInput, \App\Models\Product> */ final class CreateProduct implements Action { /** - * @param \App\Actions\Products\CreateProductInput $input + * @param \App\Cqs\Actions\Products\CreateProductInput $input */ #[\Override] public function __invoke(ActionInput $input): Product diff --git a/app/Actions/Products/CreateProductInput.php b/app/Cqs/Actions/Products/CreateProductInput.php similarity index 97% rename from app/Actions/Products/CreateProductInput.php rename to app/Cqs/Actions/Products/CreateProductInput.php index 1c3b5fc3..f2d4748c 100644 --- a/app/Actions/Products/CreateProductInput.php +++ b/app/Cqs/Actions/Products/CreateProductInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Products; +namespace App\Cqs\Actions\Products; use App\Contracts\ActionInput; use Carbon\CarbonInterface; diff --git a/app/Actions/Products/DeleteProduct.php b/app/Cqs/Actions/Products/DeleteProduct.php similarity index 67% rename from app/Actions/Products/DeleteProduct.php rename to app/Cqs/Actions/Products/DeleteProduct.php index 8b201e58..8af950c1 100644 --- a/app/Actions/Products/DeleteProduct.php +++ b/app/Cqs/Actions/Products/DeleteProduct.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\Products; +namespace App\Cqs\Actions\Products; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Products\DeleteProductInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Products\DeleteProductInput, bool> */ final class DeleteProduct implements Action { /** - * @param \App\Actions\Products\DeleteProductInput $input + * @param \App\Cqs\Actions\Products\DeleteProductInput $input */ #[\Override] public function __invoke(ActionInput $input): bool diff --git a/app/Actions/Products/DeleteProductInput.php b/app/Cqs/Actions/Products/DeleteProductInput.php similarity index 86% rename from app/Actions/Products/DeleteProductInput.php rename to app/Cqs/Actions/Products/DeleteProductInput.php index 75a43027..43a1f2cf 100644 --- a/app/Actions/Products/DeleteProductInput.php +++ b/app/Cqs/Actions/Products/DeleteProductInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Products; +namespace App\Cqs\Actions\Products; use App\Contracts\ActionInput; use App\Models\Product; diff --git a/app/Actions/Products/UpdateProduct.php b/app/Cqs/Actions/Products/UpdateProduct.php similarity index 94% rename from app/Actions/Products/UpdateProduct.php rename to app/Cqs/Actions/Products/UpdateProduct.php index db837e9d..a4acab0b 100644 --- a/app/Actions/Products/UpdateProduct.php +++ b/app/Cqs/Actions/Products/UpdateProduct.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Products; +namespace App\Cqs\Actions\Products; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -13,12 +13,12 @@ use Illuminate\Support\Str; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Products\UpdateProductInput, \App\Models\Product> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Products\UpdateProductInput, \App\Models\Product> */ final class UpdateProduct implements Action { /** - * @param \App\Actions\Products\UpdateProductInput $input + * @param \App\Cqs\Actions\Products\UpdateProductInput $input */ #[\Override] public function __invoke(ActionInput $input): Product diff --git a/app/Actions/Products/UpdateProductInput.php b/app/Cqs/Actions/Products/UpdateProductInput.php similarity index 98% rename from app/Actions/Products/UpdateProductInput.php rename to app/Cqs/Actions/Products/UpdateProductInput.php index fe488a21..b3f75990 100644 --- a/app/Actions/Products/UpdateProductInput.php +++ b/app/Cqs/Actions/Products/UpdateProductInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Products; +namespace App\Cqs\Actions\Products; use App\Contracts\ActionInput; use App\Models\Product; diff --git a/app/Actions/Ranges/CreateRange.php b/app/Cqs/Actions/Ranges/CreateRange.php similarity index 82% rename from app/Actions/Ranges/CreateRange.php rename to app/Cqs/Actions/Ranges/CreateRange.php index 306ec953..634d6ad1 100644 --- a/app/Actions/Ranges/CreateRange.php +++ b/app/Cqs/Actions/Ranges/CreateRange.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Ranges; +namespace App\Cqs\Actions\Ranges; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Range; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Ranges\CreateRangeInput, \App\Models\Range> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Ranges\CreateRangeInput, \App\Models\Range> */ final class CreateRange implements Action { /** - * @param \App\Actions\Ranges\CreateRangeInput $input + * @param \App\Cqs\Actions\Ranges\CreateRangeInput $input */ #[\Override] public function __invoke(ActionInput $input): Range diff --git a/app/Actions/Ranges/CreateRangeInput.php b/app/Cqs/Actions/Ranges/CreateRangeInput.php similarity index 97% rename from app/Actions/Ranges/CreateRangeInput.php rename to app/Cqs/Actions/Ranges/CreateRangeInput.php index c58dc9e2..6031b01e 100644 --- a/app/Actions/Ranges/CreateRangeInput.php +++ b/app/Cqs/Actions/Ranges/CreateRangeInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Ranges; +namespace App\Cqs\Actions\Ranges; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\PictureMetadata; diff --git a/app/Actions/Ranges/DeleteRange.php b/app/Cqs/Actions/Ranges/DeleteRange.php similarity index 68% rename from app/Actions/Ranges/DeleteRange.php rename to app/Cqs/Actions/Ranges/DeleteRange.php index 07c78765..228248fb 100644 --- a/app/Actions/Ranges/DeleteRange.php +++ b/app/Cqs/Actions/Ranges/DeleteRange.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\Ranges; +namespace App\Cqs\Actions\Ranges; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Ranges\DeleteRangeInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Ranges\DeleteRangeInput, bool> */ final class DeleteRange implements Action { /** - * @param \App\Actions\Ranges\DeleteRangeInput $input + * @param \App\Cqs\Actions\Ranges\DeleteRangeInput $input */ #[\Override] public function __invoke(ActionInput $input): bool diff --git a/app/Actions/Ranges/DeleteRangeInput.php b/app/Cqs/Actions/Ranges/DeleteRangeInput.php similarity index 87% rename from app/Actions/Ranges/DeleteRangeInput.php rename to app/Cqs/Actions/Ranges/DeleteRangeInput.php index d35a9811..97a10c6d 100644 --- a/app/Actions/Ranges/DeleteRangeInput.php +++ b/app/Cqs/Actions/Ranges/DeleteRangeInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Ranges; +namespace App\Cqs\Actions\Ranges; use App\Contracts\ActionInput; use App\Models\Range; diff --git a/app/Actions/Ranges/UpdateRange.php b/app/Cqs/Actions/Ranges/UpdateRange.php similarity index 82% rename from app/Actions/Ranges/UpdateRange.php rename to app/Cqs/Actions/Ranges/UpdateRange.php index a44bfc91..5e37f58a 100644 --- a/app/Actions/Ranges/UpdateRange.php +++ b/app/Cqs/Actions/Ranges/UpdateRange.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Ranges; +namespace App\Cqs\Actions\Ranges; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Range; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Ranges\UpdateRangeInput, \App\Models\Range> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Ranges\UpdateRangeInput, \App\Models\Range> */ final class UpdateRange implements Action { /** - * @param \App\Actions\Ranges\UpdateRangeInput $input + * @param \App\Cqs\Actions\Ranges\UpdateRangeInput $input */ #[\Override] public function __invoke(ActionInput $input): Range diff --git a/app/Actions/Ranges/UpdateRangeInput.php b/app/Cqs/Actions/Ranges/UpdateRangeInput.php similarity index 97% rename from app/Actions/Ranges/UpdateRangeInput.php rename to app/Cqs/Actions/Ranges/UpdateRangeInput.php index d12b046f..496dc782 100644 --- a/app/Actions/Ranges/UpdateRangeInput.php +++ b/app/Cqs/Actions/Ranges/UpdateRangeInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Ranges; +namespace App\Cqs\Actions\Ranges; use App\Contracts\ActionInput; use App\Models\Range; diff --git a/app/Actions/Settings/UpdateSettings.php b/app/Cqs/Actions/Settings/UpdateSettings.php similarity index 79% rename from app/Actions/Settings/UpdateSettings.php rename to app/Cqs/Actions/Settings/UpdateSettings.php index 219b1799..a2fab7b0 100644 --- a/app/Actions/Settings/UpdateSettings.php +++ b/app/Cqs/Actions/Settings/UpdateSettings.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Settings; +namespace App\Cqs\Actions\Settings; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,12 +11,12 @@ use Domain\Models\ValueObjects\ShopperSiteCode; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Settings\UpdateSettingsInput, \App\Models\Setting> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Settings\UpdateSettingsInput, \App\Models\Setting> */ final class UpdateSettings implements Action { /** - * @param \App\Actions\Settings\UpdateSettingsInput $input + * @param \App\Cqs\Actions\Settings\UpdateSettingsInput $input */ #[\Override] public function __invoke(ActionInput $input): Setting diff --git a/app/Actions/Settings/UpdateSettingsInput.php b/app/Cqs/Actions/Settings/UpdateSettingsInput.php similarity index 93% rename from app/Actions/Settings/UpdateSettingsInput.php rename to app/Cqs/Actions/Settings/UpdateSettingsInput.php index 28b113f1..dd569c33 100644 --- a/app/Actions/Settings/UpdateSettingsInput.php +++ b/app/Cqs/Actions/Settings/UpdateSettingsInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Settings; +namespace App\Cqs\Actions\Settings; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\ShopperSiteCode; diff --git a/app/Actions/Shops/CreateShop.php b/app/Cqs/Actions/Shops/CreateShop.php similarity index 83% rename from app/Actions/Shops/CreateShop.php rename to app/Cqs/Actions/Shops/CreateShop.php index 00f2779a..1f9760bf 100644 --- a/app/Actions/Shops/CreateShop.php +++ b/app/Cqs/Actions/Shops/CreateShop.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Shops; +namespace App\Cqs\Actions\Shops; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Shop; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Shops\CreateShopInput, \App\Models\Shop> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Shops\CreateShopInput, \App\Models\Shop> */ final class CreateShop implements Action { /** - * @param \App\Actions\Shops\CreateShopInput $input + * @param \App\Cqs\Actions\Shops\CreateShopInput $input */ #[\Override] public function __invoke(ActionInput $input): Shop diff --git a/app/Actions/Shops/CreateShopInput.php b/app/Cqs/Actions/Shops/CreateShopInput.php similarity index 97% rename from app/Actions/Shops/CreateShopInput.php rename to app/Cqs/Actions/Shops/CreateShopInput.php index 3adb5556..10e6b07c 100644 --- a/app/Actions/Shops/CreateShopInput.php +++ b/app/Cqs/Actions/Shops/CreateShopInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Shops; +namespace App\Cqs\Actions\Shops; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\Coordinates; diff --git a/app/Actions/Shops/DeleteShop.php b/app/Cqs/Actions/Shops/DeleteShop.php similarity index 68% rename from app/Actions/Shops/DeleteShop.php rename to app/Cqs/Actions/Shops/DeleteShop.php index 751a3f18..194bcca6 100644 --- a/app/Actions/Shops/DeleteShop.php +++ b/app/Cqs/Actions/Shops/DeleteShop.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\Shops; +namespace App\Cqs\Actions\Shops; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Shops\DeleteShopInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Shops\DeleteShopInput, bool> */ final class DeleteShop implements Action { /** - * @param \App\Actions\Shops\DeleteShopInput $input + * @param \App\Cqs\Actions\Shops\DeleteShopInput $input */ #[\Override] public function __invoke(ActionInput $input): bool diff --git a/app/Actions/Shops/DeleteShopInput.php b/app/Cqs/Actions/Shops/DeleteShopInput.php similarity index 87% rename from app/Actions/Shops/DeleteShopInput.php rename to app/Cqs/Actions/Shops/DeleteShopInput.php index 43ced6c3..acd7e5bd 100644 --- a/app/Actions/Shops/DeleteShopInput.php +++ b/app/Cqs/Actions/Shops/DeleteShopInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Shops; +namespace App\Cqs\Actions\Shops; use App\Contracts\ActionInput; use App\Models\Shop; diff --git a/app/Actions/Shops/UpdateShop.php b/app/Cqs/Actions/Shops/UpdateShop.php similarity index 83% rename from app/Actions/Shops/UpdateShop.php rename to app/Cqs/Actions/Shops/UpdateShop.php index f53989cf..0d522942 100644 --- a/app/Actions/Shops/UpdateShop.php +++ b/app/Cqs/Actions/Shops/UpdateShop.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Shops; +namespace App\Cqs\Actions\Shops; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Shop; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Shops\UpdateShopInput, \App\Models\Shop> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Shops\UpdateShopInput, \App\Models\Shop> */ final class UpdateShop implements Action { /** - * @param \App\Actions\Shops\UpdateShopInput $input + * @param \App\Cqs\Actions\Shops\UpdateShopInput $input */ #[\Override] public function __invoke(ActionInput $input): Shop diff --git a/app/Actions/Shops/UpdateShopInput.php b/app/Cqs/Actions/Shops/UpdateShopInput.php similarity index 97% rename from app/Actions/Shops/UpdateShopInput.php rename to app/Cqs/Actions/Shops/UpdateShopInput.php index 83e932d9..5c03b190 100644 --- a/app/Actions/Shops/UpdateShopInput.php +++ b/app/Cqs/Actions/Shops/UpdateShopInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Shops; +namespace App\Cqs\Actions\Shops; use App\Contracts\ActionInput; use App\Models\Shop; diff --git a/app/Actions/Shops/UpdateShopPickupExceptions.php b/app/Cqs/Actions/Shops/UpdateShopPickupExceptions.php similarity index 68% rename from app/Actions/Shops/UpdateShopPickupExceptions.php rename to app/Cqs/Actions/Shops/UpdateShopPickupExceptions.php index 40828e28..182cf291 100644 --- a/app/Actions/Shops/UpdateShopPickupExceptions.php +++ b/app/Cqs/Actions/Shops/UpdateShopPickupExceptions.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\Shops; +namespace App\Cqs\Actions\Shops; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Shops\UpdateShopPickupExceptionsInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Shops\UpdateShopPickupExceptionsInput, bool> */ final class UpdateShopPickupExceptions implements Action { /** - * @param \App\Actions\Shops\UpdateShopPickupExceptionsInput $input + * @param \App\Cqs\Actions\Shops\UpdateShopPickupExceptionsInput $input */ #[\Override] public function __invoke(ActionInput $input): bool diff --git a/app/Actions/Shops/UpdateShopPickupExceptionsInput.php b/app/Cqs/Actions/Shops/UpdateShopPickupExceptionsInput.php similarity index 98% rename from app/Actions/Shops/UpdateShopPickupExceptionsInput.php rename to app/Cqs/Actions/Shops/UpdateShopPickupExceptionsInput.php index 2a48b2d9..5105a841 100644 --- a/app/Actions/Shops/UpdateShopPickupExceptionsInput.php +++ b/app/Cqs/Actions/Shops/UpdateShopPickupExceptionsInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Shops; +namespace App\Cqs\Actions\Shops; use App\Contracts\ActionInput; use App\Models\Shop; diff --git a/app/Actions/Slides/CreateSlide.php b/app/Cqs/Actions/Slides/CreateSlide.php similarity index 86% rename from app/Actions/Slides/CreateSlide.php rename to app/Cqs/Actions/Slides/CreateSlide.php index f6bdf4a7..92823dc1 100644 --- a/app/Actions/Slides/CreateSlide.php +++ b/app/Cqs/Actions/Slides/CreateSlide.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Slides; +namespace App\Cqs\Actions\Slides; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,12 +11,12 @@ use Illuminate\Support\Carbon; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Slides\CreateSlideInput, \App\Models\Slide> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Slides\CreateSlideInput, \App\Models\Slide> */ final class CreateSlide implements Action { /** - * @param \App\Actions\Slides\CreateSlideInput $input + * @param \App\Cqs\Actions\Slides\CreateSlideInput $input */ #[\Override] public function __invoke(ActionInput $input): Slide diff --git a/app/Actions/Slides/CreateSlideInput.php b/app/Cqs/Actions/Slides/CreateSlideInput.php similarity index 97% rename from app/Actions/Slides/CreateSlideInput.php rename to app/Cqs/Actions/Slides/CreateSlideInput.php index a0232444..9cf21571 100644 --- a/app/Actions/Slides/CreateSlideInput.php +++ b/app/Cqs/Actions/Slides/CreateSlideInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Slides; +namespace App\Cqs\Actions\Slides; use App\Contracts\ActionInput; use Domain\Models\ValueObjects\DatePeriod; diff --git a/app/Actions/Slides/DeleteSlide.php b/app/Cqs/Actions/Slides/DeleteSlide.php similarity index 68% rename from app/Actions/Slides/DeleteSlide.php rename to app/Cqs/Actions/Slides/DeleteSlide.php index c18847bf..dc9f8e96 100644 --- a/app/Actions/Slides/DeleteSlide.php +++ b/app/Cqs/Actions/Slides/DeleteSlide.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\Slides; +namespace App\Cqs\Actions\Slides; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Slides\DeleteSlideInput, bool> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Slides\DeleteSlideInput, bool> */ final class DeleteSlide implements Action { /** - * @param \App\Actions\Slides\DeleteSlideInput $input + * @param \App\Cqs\Actions\Slides\DeleteSlideInput $input */ #[\Override] public function __invoke(ActionInput $input): bool diff --git a/app/Actions/Slides/DeleteSlideInput.php b/app/Cqs/Actions/Slides/DeleteSlideInput.php similarity index 87% rename from app/Actions/Slides/DeleteSlideInput.php rename to app/Cqs/Actions/Slides/DeleteSlideInput.php index fc57ab1d..98f2b515 100644 --- a/app/Actions/Slides/DeleteSlideInput.php +++ b/app/Cqs/Actions/Slides/DeleteSlideInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Slides; +namespace App\Cqs\Actions\Slides; use App\Contracts\ActionInput; use App\Models\Slide; diff --git a/app/Actions/Slides/UpdateSlide.php b/app/Cqs/Actions/Slides/UpdateSlide.php similarity index 86% rename from app/Actions/Slides/UpdateSlide.php rename to app/Cqs/Actions/Slides/UpdateSlide.php index 2525da9e..075af4e7 100644 --- a/app/Actions/Slides/UpdateSlide.php +++ b/app/Cqs/Actions/Slides/UpdateSlide.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Slides; +namespace App\Cqs\Actions\Slides; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -11,12 +11,12 @@ use Illuminate\Support\Carbon; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Slides\UpdateSlideInput, \App\Models\Slide> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Slides\UpdateSlideInput, \App\Models\Slide> */ final class UpdateSlide implements Action { /** - * @param \App\Actions\Slides\UpdateSlideInput $input + * @param \App\Cqs\Actions\Slides\UpdateSlideInput $input */ #[\Override] public function __invoke(ActionInput $input): Slide diff --git a/app/Actions/Slides/UpdateSlideInput.php b/app/Cqs/Actions/Slides/UpdateSlideInput.php similarity index 97% rename from app/Actions/Slides/UpdateSlideInput.php rename to app/Cqs/Actions/Slides/UpdateSlideInput.php index 5cf8845d..d2c71a53 100644 --- a/app/Actions/Slides/UpdateSlideInput.php +++ b/app/Cqs/Actions/Slides/UpdateSlideInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Slides; +namespace App\Cqs\Actions\Slides; use App\Contracts\ActionInput; use App\Models\Slide; diff --git a/app/Actions/Tags/CreateTag.php b/app/Cqs/Actions/Tags/CreateTag.php similarity index 74% rename from app/Actions/Tags/CreateTag.php rename to app/Cqs/Actions/Tags/CreateTag.php index 89152292..2f68fa78 100644 --- a/app/Actions/Tags/CreateTag.php +++ b/app/Cqs/Actions/Tags/CreateTag.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Tags; +namespace App\Cqs\Actions\Tags; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Tag; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Tags\CreateTagInput, \App\Models\Tag> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Tags\CreateTagInput, \App\Models\Tag> */ final class CreateTag implements Action { /** - * @param \App\Actions\Tags\CreateTagInput $input + * @param \App\Cqs\Actions\Tags\CreateTagInput $input */ #[\Override] public function __invoke(ActionInput $input): Tag diff --git a/app/Actions/Tags/CreateTagInput.php b/app/Cqs/Actions/Tags/CreateTagInput.php similarity index 92% rename from app/Actions/Tags/CreateTagInput.php rename to app/Cqs/Actions/Tags/CreateTagInput.php index a333f1a1..22226df6 100644 --- a/app/Actions/Tags/CreateTagInput.php +++ b/app/Cqs/Actions/Tags/CreateTagInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Tags; +namespace App\Cqs\Actions\Tags; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; diff --git a/app/Actions/Tags/DeleteTag.php b/app/Cqs/Actions/Tags/DeleteTag.php similarity index 68% rename from app/Actions/Tags/DeleteTag.php rename to app/Cqs/Actions/Tags/DeleteTag.php index 33b80771..74e6616f 100644 --- a/app/Actions/Tags/DeleteTag.php +++ b/app/Cqs/Actions/Tags/DeleteTag.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Actions\Tags; +namespace App\Cqs\Actions\Tags; use App\Contracts\Action; use App\Contracts\ActionInput; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Tags\DeleteTagInput, void> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Tags\DeleteTagInput, void> */ final class DeleteTag implements Action { /** - * @param \App\Actions\Tags\DeleteTagInput $input + * @param \App\Cqs\Actions\Tags\DeleteTagInput $input */ #[\Override] public function __invoke(ActionInput $input): void diff --git a/app/Actions/Tags/DeleteTagInput.php b/app/Cqs/Actions/Tags/DeleteTagInput.php similarity index 87% rename from app/Actions/Tags/DeleteTagInput.php rename to app/Cqs/Actions/Tags/DeleteTagInput.php index 500d8083..9fe18009 100644 --- a/app/Actions/Tags/DeleteTagInput.php +++ b/app/Cqs/Actions/Tags/DeleteTagInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Tags; +namespace App\Cqs\Actions\Tags; use App\Contracts\ActionInput; use App\Models\Tag; diff --git a/app/Actions/Tags/UpdateTag.php b/app/Cqs/Actions/Tags/UpdateTag.php similarity index 74% rename from app/Actions/Tags/UpdateTag.php rename to app/Cqs/Actions/Tags/UpdateTag.php index 851cae06..9d9c0777 100644 --- a/app/Actions/Tags/UpdateTag.php +++ b/app/Cqs/Actions/Tags/UpdateTag.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Tags; +namespace App\Cqs\Actions\Tags; use App\Contracts\Action; use App\Contracts\ActionInput; @@ -10,12 +10,12 @@ use App\Models\Tag; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Actions\Tags\UpdateTagInput, \App\Models\Tag> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Tags\UpdateTagInput, \App\Models\Tag> */ final class UpdateTag implements Action { /** - * @param \App\Actions\Tags\UpdateTagInput $input + * @param \App\Cqs\Actions\Tags\UpdateTagInput $input */ #[\Override] public function __invoke(ActionInput $input): Tag diff --git a/app/Actions/Tags/UpdateTagInput.php b/app/Cqs/Actions/Tags/UpdateTagInput.php similarity index 93% rename from app/Actions/Tags/UpdateTagInput.php rename to app/Cqs/Actions/Tags/UpdateTagInput.php index e5cc0786..13b4fb71 100644 --- a/app/Actions/Tags/UpdateTagInput.php +++ b/app/Cqs/Actions/Tags/UpdateTagInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Actions\Tags; +namespace App\Cqs\Actions\Tags; use App\Contracts\ActionInput; use App\Models\Tag; diff --git a/app/Queries/Basket/GetBasketQuery.php b/app/Cqs/Queries/Basket/GetBasketQuery.php similarity index 95% rename from app/Queries/Basket/GetBasketQuery.php rename to app/Cqs/Queries/Basket/GetBasketQuery.php index 2e23b43e..57009010 100644 --- a/app/Queries/Basket/GetBasketQuery.php +++ b/app/Cqs/Queries/Basket/GetBasketQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Basket; +namespace App\Cqs\Queries\Basket; use App\Contracts\Query; use App\Contracts\QueryInput; diff --git a/app/Queries/Crm/GetCrmCustomerQuery.php b/app/Cqs/Queries/Crm/GetCrmCustomerQuery.php similarity index 84% rename from app/Queries/Crm/GetCrmCustomerQuery.php rename to app/Cqs/Queries/Crm/GetCrmCustomerQuery.php index 13ce06ec..aac5d82d 100644 --- a/app/Queries/Crm/GetCrmCustomerQuery.php +++ b/app/Cqs/Queries/Crm/GetCrmCustomerQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Crm; +namespace App\Cqs\Queries\Crm; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -11,7 +11,7 @@ use Infrastructure\Adapters\Services\AppCustomerAuthService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Crm\GetCrmCustomerQueryInput, \App\Queries\Crm\GetCrmCustomerQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Crm\GetCrmCustomerQueryInput, \App\Cqs\Queries\Crm\GetCrmCustomerQueryOutput> */ final readonly class GetCrmCustomerQuery implements Query { diff --git a/app/Queries/Crm/GetCrmCustomerQueryInput.php b/app/Cqs/Queries/Crm/GetCrmCustomerQueryInput.php similarity index 90% rename from app/Queries/Crm/GetCrmCustomerQueryInput.php rename to app/Cqs/Queries/Crm/GetCrmCustomerQueryInput.php index 9e0d26de..bf3e659f 100644 --- a/app/Queries/Crm/GetCrmCustomerQueryInput.php +++ b/app/Cqs/Queries/Crm/GetCrmCustomerQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Crm; +namespace App\Cqs\Queries\Crm; use App\Contracts\QueryInput; use Shared\ValueObjects\CrmHashcode; diff --git a/app/Queries/Crm/GetCrmCustomerQueryOutput.php b/app/Cqs/Queries/Crm/GetCrmCustomerQueryOutput.php similarity index 93% rename from app/Queries/Crm/GetCrmCustomerQueryOutput.php rename to app/Cqs/Queries/Crm/GetCrmCustomerQueryOutput.php index 3e0c41bd..8008625e 100644 --- a/app/Queries/Crm/GetCrmCustomerQueryOutput.php +++ b/app/Cqs/Queries/Crm/GetCrmCustomerQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Crm; +namespace App\Cqs\Queries\Crm; use App\Exceptions\CrmServiceException as ExceptionsCrmServiceException; use Domain\Models\ValueObjects\CrmCustomer; diff --git a/app/Queries/Customers/GetCustomerByEmailQuery.php b/app/Cqs/Queries/Customers/GetCustomerByEmailQuery.php similarity index 76% rename from app/Queries/Customers/GetCustomerByEmailQuery.php rename to app/Cqs/Queries/Customers/GetCustomerByEmailQuery.php index e9043aab..cfe352eb 100644 --- a/app/Queries/Customers/GetCustomerByEmailQuery.php +++ b/app/Cqs/Queries/Customers/GetCustomerByEmailQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Customers; +namespace App\Cqs\Queries\Customers; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -11,7 +11,7 @@ use Domain\Models\ValueObjects\Entities\ShopperId; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Customers\GetCustomerByEmailQueryInput, \Domain\Models\ValueObjects\Entities\ShopperId|null> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Customers\GetCustomerByEmailQueryInput, \Domain\Models\ValueObjects\Entities\ShopperId|null> */ final readonly class GetCustomerByEmailQuery implements Query { diff --git a/app/Queries/Customers/GetCustomerByEmailQueryInput.php b/app/Cqs/Queries/Customers/GetCustomerByEmailQueryInput.php similarity index 87% rename from app/Queries/Customers/GetCustomerByEmailQueryInput.php rename to app/Cqs/Queries/Customers/GetCustomerByEmailQueryInput.php index 6dcfdc56..bd49c4e7 100644 --- a/app/Queries/Customers/GetCustomerByEmailQueryInput.php +++ b/app/Cqs/Queries/Customers/GetCustomerByEmailQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Customers; +namespace App\Cqs\Queries\Customers; use App\Contracts\QueryInput; use Domain\Models\ValueObjects\Email; diff --git a/app/Queries/Dashboard/GetBoDashboardQuery.php b/app/Cqs/Queries/Dashboard/GetBoDashboardQuery.php similarity index 90% rename from app/Queries/Dashboard/GetBoDashboardQuery.php rename to app/Cqs/Queries/Dashboard/GetBoDashboardQuery.php index 97da47c4..8454aeca 100644 --- a/app/Queries/Dashboard/GetBoDashboardQuery.php +++ b/app/Cqs/Queries/Dashboard/GetBoDashboardQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Dashboard; +namespace App\Cqs\Queries\Dashboard; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -13,7 +13,7 @@ use Domain\Enums\StatsShopType; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Dashboard\GetBoDashboardQueryInput, \App\Queries\Dashboard\GetBoDashboardQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Dashboard\GetBoDashboardQueryInput, \App\Cqs\Queries\Dashboard\GetBoDashboardQueryOutput> */ final readonly class GetBoDashboardQuery implements Query { diff --git a/app/Queries/Dashboard/GetBoDashboardQueryInput.php b/app/Cqs/Queries/Dashboard/GetBoDashboardQueryInput.php similarity index 89% rename from app/Queries/Dashboard/GetBoDashboardQueryInput.php rename to app/Cqs/Queries/Dashboard/GetBoDashboardQueryInput.php index 4aca7faa..4297b5c1 100644 --- a/app/Queries/Dashboard/GetBoDashboardQueryInput.php +++ b/app/Cqs/Queries/Dashboard/GetBoDashboardQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Dashboard; +namespace App\Cqs\Queries\Dashboard; use App\Contracts\QueryInput; use Carbon\CarbonInterface; diff --git a/app/Queries/Dashboard/GetBoDashboardQueryOutput.php b/app/Cqs/Queries/Dashboard/GetBoDashboardQueryOutput.php similarity index 94% rename from app/Queries/Dashboard/GetBoDashboardQueryOutput.php rename to app/Cqs/Queries/Dashboard/GetBoDashboardQueryOutput.php index f74d9837..2c36b200 100644 --- a/app/Queries/Dashboard/GetBoDashboardQueryOutput.php +++ b/app/Cqs/Queries/Dashboard/GetBoDashboardQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Dashboard; +namespace App\Cqs\Queries\Dashboard; use Carbon\CarbonPeriod; diff --git a/app/Queries/Discounts/GetDiscountFormDataQuery.php b/app/Cqs/Queries/Discounts/GetDiscountFormDataQuery.php similarity index 87% rename from app/Queries/Discounts/GetDiscountFormDataQuery.php rename to app/Cqs/Queries/Discounts/GetDiscountFormDataQuery.php index 3975f1d3..4a9c67a6 100644 --- a/app/Queries/Discounts/GetDiscountFormDataQuery.php +++ b/app/Cqs/Queries/Discounts/GetDiscountFormDataQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Discounts; +namespace App\Cqs\Queries\Discounts; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -13,12 +13,12 @@ use Domain\Enums\DiscountType; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Discounts\GetDiscountFormDataQueryInput, \App\Queries\Discounts\GetDiscountFormDataQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Discounts\GetDiscountFormDataQueryInput, \App\Cqs\Queries\Discounts\GetDiscountFormDataQueryOutput> */ final readonly class GetDiscountFormDataQuery implements Query { /** - * @param \App\Queries\Discounts\GetDiscountFormDataQueryInput $input + * @param \App\Cqs\Queries\Discounts\GetDiscountFormDataQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): GetDiscountFormDataQueryOutput diff --git a/app/Queries/Discounts/GetDiscountFormDataQueryInput.php b/app/Cqs/Queries/Discounts/GetDiscountFormDataQueryInput.php similarity index 87% rename from app/Queries/Discounts/GetDiscountFormDataQueryInput.php rename to app/Cqs/Queries/Discounts/GetDiscountFormDataQueryInput.php index 1d283ed1..7c1aa5c6 100644 --- a/app/Queries/Discounts/GetDiscountFormDataQueryInput.php +++ b/app/Cqs/Queries/Discounts/GetDiscountFormDataQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Discounts; +namespace App\Cqs\Queries\Discounts; use App\Contracts\QueryInput; use App\Models\Discount; diff --git a/app/Queries/Discounts/GetDiscountFormDataQueryOutput.php b/app/Cqs/Queries/Discounts/GetDiscountFormDataQueryOutput.php similarity index 94% rename from app/Queries/Discounts/GetDiscountFormDataQueryOutput.php rename to app/Cqs/Queries/Discounts/GetDiscountFormDataQueryOutput.php index cbb3f3d9..f357e472 100644 --- a/app/Queries/Discounts/GetDiscountFormDataQueryOutput.php +++ b/app/Cqs/Queries/Discounts/GetDiscountFormDataQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Discounts; +namespace App\Cqs\Queries\Discounts; use App\Dto\DiscountDto; use App\Dto\DiscountProductDto; diff --git a/app/Queries/Discounts/GetPaginatedDiscountsQuery.php b/app/Cqs/Queries/Discounts/GetPaginatedDiscountsQuery.php similarity index 86% rename from app/Queries/Discounts/GetPaginatedDiscountsQuery.php rename to app/Cqs/Queries/Discounts/GetPaginatedDiscountsQuery.php index a7e799de..5991323e 100644 --- a/app/Queries/Discounts/GetPaginatedDiscountsQuery.php +++ b/app/Cqs/Queries/Discounts/GetPaginatedDiscountsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Discounts; +namespace App\Cqs\Queries\Discounts; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -14,7 +14,7 @@ use Webmozart\Assert\Assert; /** * @implements \App\Contracts\Query< - * \App\Queries\Discounts\GetPaginatedDiscountsQueryInput, + * \App\Cqs\Queries\Discounts\GetPaginatedDiscountsQueryInput, * \Illuminate\Contracts\Pagination\LengthAwarePaginator * > */ @@ -26,7 +26,7 @@ final readonly class GetPaginatedDiscountsQuery implements Query } /** - * @param \App\Queries\Discounts\GetPaginatedDiscountsQueryInput $input + * @param \App\Cqs\Queries\Discounts\GetPaginatedDiscountsQueryInput $input * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ #[\Override] diff --git a/app/Queries/Discounts/GetPaginatedDiscountsQueryInput.php b/app/Cqs/Queries/Discounts/GetPaginatedDiscountsQueryInput.php similarity index 87% rename from app/Queries/Discounts/GetPaginatedDiscountsQueryInput.php rename to app/Cqs/Queries/Discounts/GetPaginatedDiscountsQueryInput.php index 4db3b7c4..159ef66a 100644 --- a/app/Queries/Discounts/GetPaginatedDiscountsQueryInput.php +++ b/app/Cqs/Queries/Discounts/GetPaginatedDiscountsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Discounts; +namespace App\Cqs\Queries\Discounts; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Faqs/GetFaqsQuery.php b/app/Cqs/Queries/Faqs/GetFaqsQuery.php similarity index 96% rename from app/Queries/Faqs/GetFaqsQuery.php rename to app/Cqs/Queries/Faqs/GetFaqsQuery.php index 76c4e62d..3772da5b 100644 --- a/app/Queries/Faqs/GetFaqsQuery.php +++ b/app/Cqs/Queries/Faqs/GetFaqsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Faqs; +namespace App\Cqs\Queries\Faqs; use App\Contracts\Query; use App\Contracts\QueryInput; diff --git a/app/Queries/Faqs/GetPaginatedFaqsQuery.php b/app/Cqs/Queries/Faqs/GetPaginatedFaqsQuery.php similarity index 82% rename from app/Queries/Faqs/GetPaginatedFaqsQuery.php rename to app/Cqs/Queries/Faqs/GetPaginatedFaqsQuery.php index d654859c..485ecbfb 100644 --- a/app/Queries/Faqs/GetPaginatedFaqsQuery.php +++ b/app/Cqs/Queries/Faqs/GetPaginatedFaqsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Faqs; +namespace App\Cqs\Queries\Faqs; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -15,7 +15,7 @@ use Webmozart\Assert\Assert; /** * phpcs:disable Generic.Files.LineLength.TooLong * - * @implements \App\Contracts\Query<\App\Queries\Faqs\GetPaginatedFaqsQueryInput, \Illuminate\Contracts\Pagination\LengthAwarePaginator> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Faqs\GetPaginatedFaqsQueryInput, \Illuminate\Contracts\Pagination\LengthAwarePaginator> */ final readonly class GetPaginatedFaqsQuery implements Query { diff --git a/app/Queries/Faqs/GetPaginatedFaqsQueryInput.php b/app/Cqs/Queries/Faqs/GetPaginatedFaqsQueryInput.php similarity index 89% rename from app/Queries/Faqs/GetPaginatedFaqsQueryInput.php rename to app/Cqs/Queries/Faqs/GetPaginatedFaqsQueryInput.php index bb667224..18dd8354 100644 --- a/app/Queries/Faqs/GetPaginatedFaqsQueryInput.php +++ b/app/Cqs/Queries/Faqs/GetPaginatedFaqsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Faqs; +namespace App\Cqs\Queries\Faqs; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Orders/GetBasketSummaryQuery.php b/app/Cqs/Queries/Orders/GetBasketSummaryQuery.php similarity index 73% rename from app/Queries/Orders/GetBasketSummaryQuery.php rename to app/Cqs/Queries/Orders/GetBasketSummaryQuery.php index 373c43cf..586e5457 100644 --- a/app/Queries/Orders/GetBasketSummaryQuery.php +++ b/app/Cqs/Queries/Orders/GetBasketSummaryQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -11,7 +11,7 @@ use Domain\Services\BasketService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Orders\GetBasketSummaryQueryInput, \App\Queries\Orders\GetBasketSummaryQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetBasketSummaryQueryInput, \App\Cqs\Queries\Orders\GetBasketSummaryQueryOutput> */ final readonly class GetBasketSummaryQuery implements Query { @@ -21,7 +21,7 @@ final readonly class GetBasketSummaryQuery implements Query } /** - * @param \App\Queries\Orders\GetBasketSummaryQueryInput $input + * @param \App\Cqs\Queries\Orders\GetBasketSummaryQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): GetBasketSummaryQueryOutput diff --git a/app/Queries/Orders/GetBasketSummaryQueryInput.php b/app/Cqs/Queries/Orders/GetBasketSummaryQueryInput.php similarity index 84% rename from app/Queries/Orders/GetBasketSummaryQueryInput.php rename to app/Cqs/Queries/Orders/GetBasketSummaryQueryInput.php index 6c2e4c51..07dde717 100644 --- a/app/Queries/Orders/GetBasketSummaryQueryInput.php +++ b/app/Cqs/Queries/Orders/GetBasketSummaryQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; diff --git a/app/Queries/Orders/GetBasketSummaryQueryOutput.php b/app/Cqs/Queries/Orders/GetBasketSummaryQueryOutput.php similarity index 88% rename from app/Queries/Orders/GetBasketSummaryQueryOutput.php rename to app/Cqs/Queries/Orders/GetBasketSummaryQueryOutput.php index c972648e..b013a4e0 100644 --- a/app/Queries/Orders/GetBasketSummaryQueryOutput.php +++ b/app/Cqs/Queries/Orders/GetBasketSummaryQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use Domain\Enums\OrderTunnelStep; use Domain\Models\Entities\Basket; diff --git a/app/Queries/Orders/GetBoOrderDetailQuery.php b/app/Cqs/Queries/Orders/GetBoOrderDetailQuery.php similarity index 89% rename from app/Queries/Orders/GetBoOrderDetailQuery.php rename to app/Cqs/Queries/Orders/GetBoOrderDetailQuery.php index c541dff7..56ff62c0 100644 --- a/app/Queries/Orders/GetBoOrderDetailQuery.php +++ b/app/Cqs/Queries/Orders/GetBoOrderDetailQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -14,7 +14,7 @@ use Illuminate\Contracts\Database\Query\Builder; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Orders\GetBoOrderDetailQueryInput, \App\Queries\Orders\GetBoOrderDetailQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetBoOrderDetailQueryInput, \App\Cqs\Queries\Orders\GetBoOrderDetailQueryOutput> */ final readonly class GetBoOrderDetailQuery implements Query { diff --git a/app/Queries/Orders/GetBoOrderDetailQueryInput.php b/app/Cqs/Queries/Orders/GetBoOrderDetailQueryInput.php similarity index 90% rename from app/Queries/Orders/GetBoOrderDetailQueryInput.php rename to app/Cqs/Queries/Orders/GetBoOrderDetailQueryInput.php index fe2afd32..a71855a4 100644 --- a/app/Queries/Orders/GetBoOrderDetailQueryInput.php +++ b/app/Cqs/Queries/Orders/GetBoOrderDetailQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; use App\Models\Order; diff --git a/app/Queries/Orders/GetBoOrderDetailQueryOutput.php b/app/Cqs/Queries/Orders/GetBoOrderDetailQueryOutput.php similarity index 92% rename from app/Queries/Orders/GetBoOrderDetailQueryOutput.php rename to app/Cqs/Queries/Orders/GetBoOrderDetailQueryOutput.php index c248cc7a..4aa422bd 100644 --- a/app/Queries/Orders/GetBoOrderDetailQueryOutput.php +++ b/app/Cqs/Queries/Orders/GetBoOrderDetailQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Dto\OrderDto; use App\Dto\ShopDto; diff --git a/app/Queries/Orders/GetBoPaginatedOrdersQuery.php b/app/Cqs/Queries/Orders/GetBoPaginatedOrdersQuery.php similarity index 94% rename from app/Queries/Orders/GetBoPaginatedOrdersQuery.php rename to app/Cqs/Queries/Orders/GetBoPaginatedOrdersQuery.php index 8d32b2c2..f02650e4 100644 --- a/app/Queries/Orders/GetBoPaginatedOrdersQuery.php +++ b/app/Cqs/Queries/Orders/GetBoPaginatedOrdersQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -14,7 +14,7 @@ use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Orders\GetBoPaginatedOrdersQueryInput, \App\Queries\Orders\GetBoPaginatedOrdersQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetBoPaginatedOrdersQueryInput, \App\Cqs\Queries\Orders\GetBoPaginatedOrdersQueryOutput> */ final readonly class GetBoPaginatedOrdersQuery implements Query { diff --git a/app/Queries/Orders/GetBoPaginatedOrdersQueryInput.php b/app/Cqs/Queries/Orders/GetBoPaginatedOrdersQueryInput.php similarity index 94% rename from app/Queries/Orders/GetBoPaginatedOrdersQueryInput.php rename to app/Cqs/Queries/Orders/GetBoPaginatedOrdersQueryInput.php index 1cac9dc3..119a06dc 100644 --- a/app/Queries/Orders/GetBoPaginatedOrdersQueryInput.php +++ b/app/Cqs/Queries/Orders/GetBoPaginatedOrdersQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; use Carbon\CarbonInterface; diff --git a/app/Queries/Orders/GetBoPaginatedOrdersQueryOutput.php b/app/Cqs/Queries/Orders/GetBoPaginatedOrdersQueryOutput.php similarity index 93% rename from app/Queries/Orders/GetBoPaginatedOrdersQueryOutput.php rename to app/Cqs/Queries/Orders/GetBoPaginatedOrdersQueryOutput.php index 098a9147..e5c94613 100644 --- a/app/Queries/Orders/GetBoPaginatedOrdersQueryOutput.php +++ b/app/Cqs/Queries/Orders/GetBoPaginatedOrdersQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Dto\OrderDto; use Domain\Enums\OrderStatus; diff --git a/app/Queries/Orders/GetBoTodayOrdersQuery.php b/app/Cqs/Queries/Orders/GetBoTodayOrdersQuery.php similarity index 89% rename from app/Queries/Orders/GetBoTodayOrdersQuery.php rename to app/Cqs/Queries/Orders/GetBoTodayOrdersQuery.php index dbe7507c..a12bd5ad 100644 --- a/app/Queries/Orders/GetBoTodayOrdersQuery.php +++ b/app/Cqs/Queries/Orders/GetBoTodayOrdersQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -15,7 +15,7 @@ use Webmozart\Assert\Assert; /** * @implements \App\Contracts\Query< - * \App\Queries\Orders\GetBoTodayOrdersQueryInput, + * \App\Cqs\Queries\Orders\GetBoTodayOrdersQueryInput, * \Illuminate\Contracts\Pagination\LengthAwarePaginator * > */ @@ -27,7 +27,7 @@ final readonly class GetBoTodayOrdersQuery implements Query } /** - * @param \App\Queries\Orders\GetBoTodayOrdersQueryInput $input + * @param \App\Cqs\Queries\Orders\GetBoTodayOrdersQueryInput $input * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ #[\Override] diff --git a/app/Queries/Orders/GetBoTodayOrdersQueryInput.php b/app/Cqs/Queries/Orders/GetBoTodayOrdersQueryInput.php similarity index 88% rename from app/Queries/Orders/GetBoTodayOrdersQueryInput.php rename to app/Cqs/Queries/Orders/GetBoTodayOrdersQueryInput.php index 89d46004..c4d65bf9 100644 --- a/app/Queries/Orders/GetBoTodayOrdersQueryInput.php +++ b/app/Cqs/Queries/Orders/GetBoTodayOrdersQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Orders/GetFoCustomerOrderDetailQuery.php b/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQuery.php similarity index 83% rename from app/Queries/Orders/GetFoCustomerOrderDetailQuery.php rename to app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQuery.php index 6f3d59bc..51212192 100644 --- a/app/Queries/Orders/GetFoCustomerOrderDetailQuery.php +++ b/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -11,7 +11,7 @@ use App\Services\MapUrlService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Orders\GetFoCustomerOrderDetailQueryInput, \App\Queries\Orders\GetFoCustomerOrderDetailQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQueryInput, \App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQueryOutput> */ final readonly class GetFoCustomerOrderDetailQuery implements Query { diff --git a/app/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php b/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php similarity index 90% rename from app/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php rename to app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php index 2e89a3ff..a5f03b1b 100644 --- a/app/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php +++ b/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; use App\Models\Order; diff --git a/app/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php b/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php similarity index 87% rename from app/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php rename to app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php index faa206f6..4d19eedb 100644 --- a/app/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php +++ b/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Dto\OrderDto; diff --git a/app/Queries/Orders/GetFoCustomerPaginatedOrdersQuery.php b/app/Cqs/Queries/Orders/GetFoCustomerPaginatedOrdersQuery.php similarity index 90% rename from app/Queries/Orders/GetFoCustomerPaginatedOrdersQuery.php rename to app/Cqs/Queries/Orders/GetFoCustomerPaginatedOrdersQuery.php index e2222819..eea184b1 100644 --- a/app/Queries/Orders/GetFoCustomerPaginatedOrdersQuery.php +++ b/app/Cqs/Queries/Orders/GetFoCustomerPaginatedOrdersQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -15,14 +15,14 @@ use Webmozart\Assert\Assert; /** * @implements \App\Contracts\Query< - * \App\Queries\Orders\GetFoCustomerPaginatedOrdersQueryInput, + * \App\Cqs\Queries\Orders\GetFoCustomerPaginatedOrdersQueryInput, * \Illuminate\Contracts\Pagination\LengthAwarePaginator * > */ final readonly class GetFoCustomerPaginatedOrdersQuery implements Query { /** - * @param \App\Queries\Orders\GetFoCustomerPaginatedOrdersQueryInput $input + * @param \App\Cqs\Queries\Orders\GetFoCustomerPaginatedOrdersQueryInput $input * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ #[\Override] diff --git a/app/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php b/app/Cqs/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php similarity index 92% rename from app/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php rename to app/Cqs/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php index 245bf405..ac924921 100644 --- a/app/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php +++ b/app/Cqs/Queries/Orders/GetFoCustomerPaginatedOrdersQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; use App\Models\Customer; diff --git a/app/Queries/Orders/GetOrderConfirmationQuery.php b/app/Cqs/Queries/Orders/GetOrderConfirmationQuery.php similarity index 83% rename from app/Queries/Orders/GetOrderConfirmationQuery.php rename to app/Cqs/Queries/Orders/GetOrderConfirmationQuery.php index 8a1202d5..fc2233c4 100644 --- a/app/Queries/Orders/GetOrderConfirmationQuery.php +++ b/app/Cqs/Queries/Orders/GetOrderConfirmationQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -14,7 +14,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Orders\GetOrderConfirmationQueryInput, \App\Queries\Orders\GetOrderConfirmationQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetOrderConfirmationQueryInput, \App\Cqs\Queries\Orders\GetOrderConfirmationQueryOutput> */ final readonly class GetOrderConfirmationQuery implements Query { @@ -25,7 +25,7 @@ final readonly class GetOrderConfirmationQuery implements Query } /** - * @param \App\Queries\Orders\GetOrderConfirmationQueryInput $input + * @param \App\Cqs\Queries\Orders\GetOrderConfirmationQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): GetOrderConfirmationQueryOutput diff --git a/app/Queries/Orders/GetOrderConfirmationQueryInput.php b/app/Cqs/Queries/Orders/GetOrderConfirmationQueryInput.php similarity index 84% rename from app/Queries/Orders/GetOrderConfirmationQueryInput.php rename to app/Cqs/Queries/Orders/GetOrderConfirmationQueryInput.php index b2585d9e..0fc693d0 100644 --- a/app/Queries/Orders/GetOrderConfirmationQueryInput.php +++ b/app/Cqs/Queries/Orders/GetOrderConfirmationQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; diff --git a/app/Queries/Orders/GetOrderConfirmationQueryOutput.php b/app/Cqs/Queries/Orders/GetOrderConfirmationQueryOutput.php similarity index 92% rename from app/Queries/Orders/GetOrderConfirmationQueryOutput.php rename to app/Cqs/Queries/Orders/GetOrderConfirmationQueryOutput.php index a5e0c8a4..9e5e70ba 100644 --- a/app/Queries/Orders/GetOrderConfirmationQueryOutput.php +++ b/app/Cqs/Queries/Orders/GetOrderConfirmationQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Dto\ShopDto; use Domain\Builders\OrderBuilderCompleted; diff --git a/app/Queries/Orders/GetPickTimeSlotQuery.php b/app/Cqs/Queries/Orders/GetPickTimeSlotQuery.php similarity index 82% rename from app/Queries/Orders/GetPickTimeSlotQuery.php rename to app/Cqs/Queries/Orders/GetPickTimeSlotQuery.php index c3d5ff60..d01f7b87 100644 --- a/app/Queries/Orders/GetPickTimeSlotQuery.php +++ b/app/Cqs/Queries/Orders/GetPickTimeSlotQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -13,7 +13,7 @@ use Domain\Services\OrderTunnelService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Orders\GetPickTimeSlotQueryInput, \App\Queries\Orders\GetPickTimeSlotQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetPickTimeSlotQueryInput, \App\Cqs\Queries\Orders\GetPickTimeSlotQueryOutput> */ final readonly class GetPickTimeSlotQuery implements Query { @@ -24,7 +24,7 @@ final readonly class GetPickTimeSlotQuery implements Query } /** - * @param \App\Queries\Orders\GetPickTimeSlotQueryInput $input + * @param \App\Cqs\Queries\Orders\GetPickTimeSlotQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): GetPickTimeSlotQueryOutput diff --git a/app/Queries/Orders/GetPickTimeSlotQueryInput.php b/app/Cqs/Queries/Orders/GetPickTimeSlotQueryInput.php similarity index 88% rename from app/Queries/Orders/GetPickTimeSlotQueryInput.php rename to app/Cqs/Queries/Orders/GetPickTimeSlotQueryInput.php index 3266d40e..d2439f85 100644 --- a/app/Queries/Orders/GetPickTimeSlotQueryInput.php +++ b/app/Cqs/Queries/Orders/GetPickTimeSlotQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; use Domain\Models\ValueObjects\Entities\ShopperId; diff --git a/app/Queries/Orders/GetPickTimeSlotQueryOutput.php b/app/Cqs/Queries/Orders/GetPickTimeSlotQueryOutput.php similarity index 92% rename from app/Queries/Orders/GetPickTimeSlotQueryOutput.php rename to app/Cqs/Queries/Orders/GetPickTimeSlotQueryOutput.php index 3c1971ca..48a3cf93 100644 --- a/app/Queries/Orders/GetPickTimeSlotQueryOutput.php +++ b/app/Cqs/Queries/Orders/GetPickTimeSlotQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Dto\ShopDto; use Domain\Enums\OrderTunnelStep; diff --git a/app/Queries/Orders/GetTunnelOrderConfirmedQuery.php b/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQuery.php similarity index 81% rename from app/Queries/Orders/GetTunnelOrderConfirmedQuery.php rename to app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQuery.php index cec60aca..595314c1 100644 --- a/app/Queries/Orders/GetTunnelOrderConfirmedQuery.php +++ b/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -13,7 +13,7 @@ use Domain\Enums\OrderTunnelStep; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Orders\GetTunnelOrderConfirmedQueryInput, \App\Queries\Orders\GetTunnelOrderConfirmedQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryInput, \App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryOutput> */ final readonly class GetTunnelOrderConfirmedQuery implements Query { @@ -23,7 +23,7 @@ final readonly class GetTunnelOrderConfirmedQuery implements Query } /** - * @param \App\Queries\Orders\GetTunnelOrderConfirmedQueryInput $input + * @param \App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): GetTunnelOrderConfirmedQueryOutput diff --git a/app/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php b/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php similarity index 87% rename from app/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php rename to app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php index d28a06c4..0145c109 100644 --- a/app/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php +++ b/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Contracts\QueryInput; use App\Models\Order; diff --git a/app/Queries/Orders/GetTunnelOrderConfirmedQueryOutput.php b/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQueryOutput.php similarity index 91% rename from app/Queries/Orders/GetTunnelOrderConfirmedQueryOutput.php rename to app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQueryOutput.php index e4fed765..9ea5a384 100644 --- a/app/Queries/Orders/GetTunnelOrderConfirmedQueryOutput.php +++ b/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Orders; +namespace App\Cqs\Queries\Orders; use App\Dto\OrderDto; use App\Dto\ShopDto; diff --git a/app/Queries/Pages/GetPageQuery.php b/app/Cqs/Queries/Pages/GetPageQuery.php similarity index 79% rename from app/Queries/Pages/GetPageQuery.php rename to app/Cqs/Queries/Pages/GetPageQuery.php index bcefbe3a..d5e99f5d 100644 --- a/app/Queries/Pages/GetPageQuery.php +++ b/app/Cqs/Queries/Pages/GetPageQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Pages; +namespace App\Cqs\Queries\Pages; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -11,7 +11,7 @@ use App\Models\Page; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Pages\GetPageQueryInput, \App\Dto\PageDto> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Pages\GetPageQueryInput, \App\Dto\PageDto> */ final readonly class GetPageQuery implements Query { diff --git a/app/Queries/Pages/GetPageQueryInput.php b/app/Cqs/Queries/Pages/GetPageQueryInput.php similarity index 87% rename from app/Queries/Pages/GetPageQueryInput.php rename to app/Cqs/Queries/Pages/GetPageQueryInput.php index 23bb3ba6..6b59da60 100644 --- a/app/Queries/Pages/GetPageQueryInput.php +++ b/app/Cqs/Queries/Pages/GetPageQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Pages; +namespace App\Cqs\Queries\Pages; use App\Contracts\QueryInput; use Domain\Models\ValueObjects\Slug; diff --git a/app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQuery.php b/app/Cqs/Queries/PickupExceptions/GetPaginatedPickupExceptionsQuery.php similarity index 84% rename from app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQuery.php rename to app/Cqs/Queries/PickupExceptions/GetPaginatedPickupExceptionsQuery.php index ab593867..e7c0e577 100644 --- a/app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQuery.php +++ b/app/Cqs/Queries/PickupExceptions/GetPaginatedPickupExceptionsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\PickupExceptions; +namespace App\Cqs\Queries\PickupExceptions; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -14,7 +14,7 @@ use Webmozart\Assert\Assert; /** * @implements \App\Contracts\Query< - * \App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput, + * \App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput, * \Illuminate\Contracts\Pagination\LengthAwarePaginator * > */ @@ -26,7 +26,7 @@ final readonly class GetPaginatedPickupExceptionsQuery implements Query } /** - * @param \App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput $input + * @param \App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput $input * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ #[\Override] diff --git a/app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php b/app/Cqs/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php similarity index 86% rename from app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php rename to app/Cqs/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php index e2726f7f..288e00df 100644 --- a/app/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php +++ b/app/Cqs/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\PickupExceptions; +namespace App\Cqs\Queries\PickupExceptions; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/ProductIncos/GetArcadiaIncoPreviewQuery.php b/app/Cqs/Queries/ProductIncos/GetArcadiaIncoPreviewQuery.php similarity index 78% rename from app/Queries/ProductIncos/GetArcadiaIncoPreviewQuery.php rename to app/Cqs/Queries/ProductIncos/GetArcadiaIncoPreviewQuery.php index 79deacab..1bad4eb4 100644 --- a/app/Queries/ProductIncos/GetArcadiaIncoPreviewQuery.php +++ b/app/Cqs/Queries/ProductIncos/GetArcadiaIncoPreviewQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\ProductIncos; +namespace App\Cqs\Queries\ProductIncos; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -11,7 +11,7 @@ use App\Services\ArcadiaIncoService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\ProductIncos\GetArcadiaIncoPreviewQueryInput, ?\App\Dto\ArcadiaIncoPreviewDto> + * @implements \App\Contracts\Query<\App\Cqs\Queries\ProductIncos\GetArcadiaIncoPreviewQueryInput, ?\App\Dto\ArcadiaIncoPreviewDto> */ final readonly class GetArcadiaIncoPreviewQuery implements Query { diff --git a/app/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php b/app/Cqs/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php similarity index 89% rename from app/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php rename to app/Cqs/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php index 2d3f6af4..8cbccf2a 100644 --- a/app/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php +++ b/app/Cqs/Queries/ProductIncos/GetArcadiaIncoPreviewQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\ProductIncos; +namespace App\Cqs\Queries\ProductIncos; use App\Contracts\QueryInput; use Webmozart\Assert\Assert; diff --git a/app/Queries/Products/GetBoPaginatedProductsQuery.php b/app/Cqs/Queries/Products/GetBoPaginatedProductsQuery.php similarity index 95% rename from app/Queries/Products/GetBoPaginatedProductsQuery.php rename to app/Cqs/Queries/Products/GetBoPaginatedProductsQuery.php index a1bc1c27..2008f14b 100644 --- a/app/Queries/Products/GetBoPaginatedProductsQuery.php +++ b/app/Cqs/Queries/Products/GetBoPaginatedProductsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -18,7 +18,7 @@ use Money\Formatter\IntlMoneyFormatter; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Products\GetBoPaginatedProductsQueryInput, \App\Queries\Products\GetBoPaginatedProductsQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Products\GetBoPaginatedProductsQueryInput, \App\Cqs\Queries\Products\GetBoPaginatedProductsQueryOutput> */ final readonly class GetBoPaginatedProductsQuery implements Query { diff --git a/app/Queries/Products/GetBoPaginatedProductsQueryInput.php b/app/Cqs/Queries/Products/GetBoPaginatedProductsQueryInput.php similarity index 93% rename from app/Queries/Products/GetBoPaginatedProductsQueryInput.php rename to app/Cqs/Queries/Products/GetBoPaginatedProductsQueryInput.php index c6ceb52e..aa195ce7 100644 --- a/app/Queries/Products/GetBoPaginatedProductsQueryInput.php +++ b/app/Cqs/Queries/Products/GetBoPaginatedProductsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Products/GetBoPaginatedProductsQueryOutput.php b/app/Cqs/Queries/Products/GetBoPaginatedProductsQueryOutput.php similarity index 95% rename from app/Queries/Products/GetBoPaginatedProductsQueryOutput.php rename to app/Cqs/Queries/Products/GetBoPaginatedProductsQueryOutput.php index ad207949..f3793b1f 100644 --- a/app/Queries/Products/GetBoPaginatedProductsQueryOutput.php +++ b/app/Cqs/Queries/Products/GetBoPaginatedProductsQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Dto\ProductDto; use Domain\Enums\ProductBrand; diff --git a/app/Queries/Products/GetFoFilteredProductsQuery.php b/app/Cqs/Queries/Products/GetFoFilteredProductsQuery.php similarity index 94% rename from app/Queries/Products/GetFoFilteredProductsQuery.php rename to app/Cqs/Queries/Products/GetFoFilteredProductsQuery.php index 08c2b13a..7b05f9ef 100644 --- a/app/Queries/Products/GetFoFilteredProductsQuery.php +++ b/app/Cqs/Queries/Products/GetFoFilteredProductsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -13,7 +13,7 @@ use Webmozart\Assert\Assert; /** * @implements \App\Contracts\Query< - * \App\Queries\Products\GetFoFilteredProductsQueryInput, + * \App\Cqs\Queries\Products\GetFoFilteredProductsQueryInput, * \Illuminate\Contracts\Pagination\LengthAwarePaginator * > */ diff --git a/app/Queries/Products/GetFoFilteredProductsQueryInput.php b/app/Cqs/Queries/Products/GetFoFilteredProductsQueryInput.php similarity index 94% rename from app/Queries/Products/GetFoFilteredProductsQueryInput.php rename to app/Cqs/Queries/Products/GetFoFilteredProductsQueryInput.php index b965ac61..21db7bcc 100644 --- a/app/Queries/Products/GetFoFilteredProductsQueryInput.php +++ b/app/Cqs/Queries/Products/GetFoFilteredProductsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Products/GetFoProductIndexPageQuery.php b/app/Cqs/Queries/Products/GetFoProductIndexPageQuery.php similarity index 92% rename from app/Queries/Products/GetFoProductIndexPageQuery.php rename to app/Cqs/Queries/Products/GetFoProductIndexPageQuery.php index 083c985f..b0626398 100644 --- a/app/Queries/Products/GetFoProductIndexPageQuery.php +++ b/app/Cqs/Queries/Products/GetFoProductIndexPageQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -19,7 +19,7 @@ use SortDirection; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Products\GetFoProductIndexPageQueryInput, \App\Queries\Products\GetFoProductIndexPageQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Products\GetFoProductIndexPageQueryInput, \App\Cqs\Queries\Products\GetFoProductIndexPageQueryOutput> */ final readonly class GetFoProductIndexPageQuery implements Query { diff --git a/app/Queries/Products/GetFoProductIndexPageQueryInput.php b/app/Cqs/Queries/Products/GetFoProductIndexPageQueryInput.php similarity index 88% rename from app/Queries/Products/GetFoProductIndexPageQueryInput.php rename to app/Cqs/Queries/Products/GetFoProductIndexPageQueryInput.php index ae96464b..c85d2c93 100644 --- a/app/Queries/Products/GetFoProductIndexPageQueryInput.php +++ b/app/Cqs/Queries/Products/GetFoProductIndexPageQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Products/GetFoProductIndexPageQueryOutput.php b/app/Cqs/Queries/Products/GetFoProductIndexPageQueryOutput.php similarity index 96% rename from app/Queries/Products/GetFoProductIndexPageQueryOutput.php rename to app/Cqs/Queries/Products/GetFoProductIndexPageQueryOutput.php index 79c2b673..dc2992f8 100644 --- a/app/Queries/Products/GetFoProductIndexPageQueryOutput.php +++ b/app/Cqs/Queries/Products/GetFoProductIndexPageQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Dto\DiscountDto; use App\Dto\RangeDto; diff --git a/app/Queries/Products/GetPaginatedProductsQuery.php b/app/Cqs/Queries/Products/GetPaginatedProductsQuery.php similarity index 95% rename from app/Queries/Products/GetPaginatedProductsQuery.php rename to app/Cqs/Queries/Products/GetPaginatedProductsQuery.php index 2e58785d..6ae3deee 100644 --- a/app/Queries/Products/GetPaginatedProductsQuery.php +++ b/app/Cqs/Queries/Products/GetPaginatedProductsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -16,7 +16,7 @@ use Webmozart\Assert\Assert; /** * @implements \App\Contracts\Query< - * \App\Queries\Products\GetPaginatedProductsQueryInput, + * \App\Cqs\Queries\Products\GetPaginatedProductsQueryInput, * \Illuminate\Contracts\Pagination\LengthAwarePaginator * > */ diff --git a/app/Queries/Products/GetPaginatedProductsQueryInput.php b/app/Cqs/Queries/Products/GetPaginatedProductsQueryInput.php similarity index 91% rename from app/Queries/Products/GetPaginatedProductsQueryInput.php rename to app/Cqs/Queries/Products/GetPaginatedProductsQueryInput.php index c27ae829..8ac05f9d 100644 --- a/app/Queries/Products/GetPaginatedProductsQueryInput.php +++ b/app/Cqs/Queries/Products/GetPaginatedProductsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Products/GetProductFormDataQuery.php b/app/Cqs/Queries/Products/GetProductFormDataQuery.php similarity index 94% rename from app/Queries/Products/GetProductFormDataQuery.php rename to app/Cqs/Queries/Products/GetProductFormDataQuery.php index dfda279d..c39ffecd 100644 --- a/app/Queries/Products/GetProductFormDataQuery.php +++ b/app/Cqs/Queries/Products/GetProductFormDataQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -21,7 +21,7 @@ use Illuminate\Support\Collection; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Products\GetProductFormDataQueryInput, \App\Dto\ProductFormDataDto> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Products\GetProductFormDataQueryInput, \App\Dto\ProductFormDataDto> */ final readonly class GetProductFormDataQuery implements Query { diff --git a/app/Queries/Products/GetProductFormDataQueryInput.php b/app/Cqs/Queries/Products/GetProductFormDataQueryInput.php similarity index 87% rename from app/Queries/Products/GetProductFormDataQueryInput.php rename to app/Cqs/Queries/Products/GetProductFormDataQueryInput.php index 44825238..b6c76de8 100644 --- a/app/Queries/Products/GetProductFormDataQueryInput.php +++ b/app/Cqs/Queries/Products/GetProductFormDataQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Products; +namespace App\Cqs\Queries\Products; use App\Contracts\QueryInput; use App\Models\Product; diff --git a/app/Queries/Ranges/GetPaginatedRangesQuery.php b/app/Cqs/Queries/Ranges/GetPaginatedRangesQuery.php similarity index 83% rename from app/Queries/Ranges/GetPaginatedRangesQuery.php rename to app/Cqs/Queries/Ranges/GetPaginatedRangesQuery.php index eef1c1d9..a327f693 100644 --- a/app/Queries/Ranges/GetPaginatedRangesQuery.php +++ b/app/Cqs/Queries/Ranges/GetPaginatedRangesQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Ranges; +namespace App\Cqs\Queries\Ranges; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -15,7 +15,7 @@ use Webmozart\Assert\Assert; /** * phpcs:disable Generic.Files.LineLength.TooLong * - * @implements \App\Contracts\Query<\App\Queries\Ranges\GetPaginatedRangesQueryInput, \Illuminate\Contracts\Pagination\LengthAwarePaginator> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Ranges\GetPaginatedRangesQueryInput, \Illuminate\Contracts\Pagination\LengthAwarePaginator> */ final readonly class GetPaginatedRangesQuery implements Query { diff --git a/app/Queries/Ranges/GetPaginatedRangesQueryInput.php b/app/Cqs/Queries/Ranges/GetPaginatedRangesQueryInput.php similarity index 89% rename from app/Queries/Ranges/GetPaginatedRangesQueryInput.php rename to app/Cqs/Queries/Ranges/GetPaginatedRangesQueryInput.php index c6663f06..e51a2e07 100644 --- a/app/Queries/Ranges/GetPaginatedRangesQueryInput.php +++ b/app/Cqs/Queries/Ranges/GetPaginatedRangesQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Ranges; +namespace App\Cqs\Queries\Ranges; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Settings/GetSettingsQuery.php b/app/Cqs/Queries/Settings/GetSettingsQuery.php similarity index 94% rename from app/Queries/Settings/GetSettingsQuery.php rename to app/Cqs/Queries/Settings/GetSettingsQuery.php index 058be825..d2cbcc9c 100644 --- a/app/Queries/Settings/GetSettingsQuery.php +++ b/app/Cqs/Queries/Settings/GetSettingsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Settings; +namespace App\Cqs\Queries\Settings; use App\Contracts\Query; use App\Contracts\QueryInput; diff --git a/app/Queries/Shops/GetPaginatedShopsQuery.php b/app/Cqs/Queries/Shops/GetPaginatedShopsQuery.php similarity index 85% rename from app/Queries/Shops/GetPaginatedShopsQuery.php rename to app/Cqs/Queries/Shops/GetPaginatedShopsQuery.php index 66628484..6bb7f6a8 100644 --- a/app/Queries/Shops/GetPaginatedShopsQuery.php +++ b/app/Cqs/Queries/Shops/GetPaginatedShopsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Shops; +namespace App\Cqs\Queries\Shops; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -15,7 +15,7 @@ use Illuminate\Contracts\Database\Query\Builder; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Shops\GetPaginatedShopsQueryInput, \App\Queries\Shops\GetPaginatedShopsQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Shops\GetPaginatedShopsQueryInput, \App\Cqs\Queries\Shops\GetPaginatedShopsQueryOutput> */ final readonly class GetPaginatedShopsQuery implements Query { @@ -25,7 +25,7 @@ final readonly class GetPaginatedShopsQuery implements Query } /** - * @param \App\Queries\Shops\GetPaginatedShopsQueryInput $input + * @param \App\Cqs\Queries\Shops\GetPaginatedShopsQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): GetPaginatedShopsQueryOutput diff --git a/app/Queries/Shops/GetPaginatedShopsQueryInput.php b/app/Cqs/Queries/Shops/GetPaginatedShopsQueryInput.php similarity index 92% rename from app/Queries/Shops/GetPaginatedShopsQueryInput.php rename to app/Cqs/Queries/Shops/GetPaginatedShopsQueryInput.php index e05f1d66..d301b1d7 100644 --- a/app/Queries/Shops/GetPaginatedShopsQueryInput.php +++ b/app/Cqs/Queries/Shops/GetPaginatedShopsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Shops; +namespace App\Cqs\Queries\Shops; use App\Contracts\QueryInput; use Domain\Models\ValueObjects\Entities\PickupExceptionId; diff --git a/app/Queries/Shops/GetPaginatedShopsQueryOutput.php b/app/Cqs/Queries/Shops/GetPaginatedShopsQueryOutput.php similarity index 94% rename from app/Queries/Shops/GetPaginatedShopsQueryOutput.php rename to app/Cqs/Queries/Shops/GetPaginatedShopsQueryOutput.php index 1cddb513..fbf138e9 100644 --- a/app/Queries/Shops/GetPaginatedShopsQueryOutput.php +++ b/app/Cqs/Queries/Shops/GetPaginatedShopsQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Shops; +namespace App\Cqs\Queries\Shops; use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; diff --git a/app/Queries/Shops/GetShopPickupExceptionsQuery.php b/app/Cqs/Queries/Shops/GetShopPickupExceptionsQuery.php similarity index 84% rename from app/Queries/Shops/GetShopPickupExceptionsQuery.php rename to app/Cqs/Queries/Shops/GetShopPickupExceptionsQuery.php index 18dcfee0..ec907b4c 100644 --- a/app/Queries/Shops/GetShopPickupExceptionsQuery.php +++ b/app/Cqs/Queries/Shops/GetShopPickupExceptionsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Shops; +namespace App\Cqs\Queries\Shops; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -13,7 +13,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Shops\GetShopPickupExceptionsQueryInput, \App\Queries\Shops\GetShopPickupExceptionsQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryInput, \App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryOutput> */ final readonly class GetShopPickupExceptionsQuery implements Query { @@ -24,7 +24,7 @@ final readonly class GetShopPickupExceptionsQuery implements Query } /** - * @param \App\Queries\Shops\GetShopPickupExceptionsQueryInput $input + * @param \App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): GetShopPickupExceptionsQueryOutput diff --git a/app/Queries/Shops/GetShopPickupExceptionsQueryInput.php b/app/Cqs/Queries/Shops/GetShopPickupExceptionsQueryInput.php similarity index 87% rename from app/Queries/Shops/GetShopPickupExceptionsQueryInput.php rename to app/Cqs/Queries/Shops/GetShopPickupExceptionsQueryInput.php index 4be2d8d4..6aabed2a 100644 --- a/app/Queries/Shops/GetShopPickupExceptionsQueryInput.php +++ b/app/Cqs/Queries/Shops/GetShopPickupExceptionsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Shops; +namespace App\Cqs\Queries\Shops; use App\Contracts\QueryInput; use App\Models\Shop; diff --git a/app/Queries/Shops/GetShopPickupExceptionsQueryOutput.php b/app/Cqs/Queries/Shops/GetShopPickupExceptionsQueryOutput.php similarity index 93% rename from app/Queries/Shops/GetShopPickupExceptionsQueryOutput.php rename to app/Cqs/Queries/Shops/GetShopPickupExceptionsQueryOutput.php index 68b6cbf1..28031f8c 100644 --- a/app/Queries/Shops/GetShopPickupExceptionsQueryOutput.php +++ b/app/Cqs/Queries/Shops/GetShopPickupExceptionsQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Shops; +namespace App\Cqs\Queries\Shops; use App\Dto\ShopDto; use Carbon\CarbonPeriod; diff --git a/app/Queries/Shops/GetShopQuery.php b/app/Cqs/Queries/Shops/GetShopQuery.php similarity index 94% rename from app/Queries/Shops/GetShopQuery.php rename to app/Cqs/Queries/Shops/GetShopQuery.php index 44932580..2fc0a37a 100644 --- a/app/Queries/Shops/GetShopQuery.php +++ b/app/Cqs/Queries/Shops/GetShopQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Shops; +namespace App\Cqs\Queries\Shops; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -18,7 +18,7 @@ use Illuminate\Support\Collection; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Shops\GetShopQueryInput, \App\Dto\ShopDto> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Shops\GetShopQueryInput, \App\Dto\ShopDto> */ final readonly class GetShopQuery implements Query { @@ -29,7 +29,7 @@ final readonly class GetShopQuery implements Query } /** - * @param \App\Queries\Shops\GetShopQueryInput $input + * @param \App\Cqs\Queries\Shops\GetShopQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): ShopDto diff --git a/app/Queries/Shops/GetShopQueryInput.php b/app/Cqs/Queries/Shops/GetShopQueryInput.php similarity index 79% rename from app/Queries/Shops/GetShopQueryInput.php rename to app/Cqs/Queries/Shops/GetShopQueryInput.php index 50cfbcac..5b99aa53 100644 --- a/app/Queries/Shops/GetShopQueryInput.php +++ b/app/Cqs/Queries/Shops/GetShopQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Shops; +namespace App\Cqs\Queries\Shops; use App\Contracts\QueryInput; diff --git a/app/Queries/Slides/GetPaginatedSlidesQuery.php b/app/Cqs/Queries/Slides/GetPaginatedSlidesQuery.php similarity index 88% rename from app/Queries/Slides/GetPaginatedSlidesQuery.php rename to app/Cqs/Queries/Slides/GetPaginatedSlidesQuery.php index bf1b94c5..0bb590fc 100644 --- a/app/Queries/Slides/GetPaginatedSlidesQuery.php +++ b/app/Cqs/Queries/Slides/GetPaginatedSlidesQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Slides; +namespace App\Cqs\Queries\Slides; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -16,7 +16,7 @@ use Webmozart\Assert\Assert; /** * phpcs:disable Generic.Files.LineLength.TooLong * - * @implements \App\Contracts\Query<\App\Queries\Slides\GetPaginatedSlidesQueryInput, \Illuminate\Contracts\Pagination\LengthAwarePaginator> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Slides\GetPaginatedSlidesQueryInput, \Illuminate\Contracts\Pagination\LengthAwarePaginator> */ final readonly class GetPaginatedSlidesQuery implements Query { diff --git a/app/Queries/Slides/GetPaginatedSlidesQueryInput.php b/app/Cqs/Queries/Slides/GetPaginatedSlidesQueryInput.php similarity index 91% rename from app/Queries/Slides/GetPaginatedSlidesQueryInput.php rename to app/Cqs/Queries/Slides/GetPaginatedSlidesQueryInput.php index 4b93fc68..dcdf5adf 100644 --- a/app/Queries/Slides/GetPaginatedSlidesQueryInput.php +++ b/app/Cqs/Queries/Slides/GetPaginatedSlidesQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Slides; +namespace App\Cqs\Queries\Slides; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Tags/GetPaginatedTagsQuery.php b/app/Cqs/Queries/Tags/GetPaginatedTagsQuery.php similarity index 83% rename from app/Queries/Tags/GetPaginatedTagsQuery.php rename to app/Cqs/Queries/Tags/GetPaginatedTagsQuery.php index bb020027..ae45a2db 100644 --- a/app/Queries/Tags/GetPaginatedTagsQuery.php +++ b/app/Cqs/Queries/Tags/GetPaginatedTagsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Tags; +namespace App\Cqs\Queries\Tags; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -15,7 +15,7 @@ use Webmozart\Assert\Assert; /** * phpcs:disable Generic.Files.LineLength.TooLong * - * @implements \App\Contracts\Query<\App\Queries\Tags\GetPaginatedTagsQueryInput, \Illuminate\Contracts\Pagination\LengthAwarePaginator> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Tags\GetPaginatedTagsQueryInput, \Illuminate\Contracts\Pagination\LengthAwarePaginator> */ final readonly class GetPaginatedTagsQuery implements Query { diff --git a/app/Queries/Tags/GetPaginatedTagsQueryInput.php b/app/Cqs/Queries/Tags/GetPaginatedTagsQueryInput.php similarity index 89% rename from app/Queries/Tags/GetPaginatedTagsQueryInput.php rename to app/Cqs/Queries/Tags/GetPaginatedTagsQueryInput.php index e36e6046..123f5951 100644 --- a/app/Queries/Tags/GetPaginatedTagsQueryInput.php +++ b/app/Cqs/Queries/Tags/GetPaginatedTagsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Tags; +namespace App\Cqs\Queries\Tags; use App\Contracts\QueryInput; use Shared\Pagination\Pagination; diff --git a/app/Queries/Timeslots/GetAvailableTimeslotsQuery.php b/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQuery.php similarity index 87% rename from app/Queries/Timeslots/GetAvailableTimeslotsQuery.php rename to app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQuery.php index 22c081ee..890f1c91 100644 --- a/app/Queries/Timeslots/GetAvailableTimeslotsQuery.php +++ b/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQuery.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Timeslots; +namespace App\Cqs\Queries\Timeslots; use App\Contracts\Query; use App\Contracts\QueryInput; @@ -13,7 +13,7 @@ use Domain\Services\PickupSchedulingService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Queries\Timeslots\GetAvailableTimeslotsQueryInput, \App\Queries\Timeslots\GetAvailableTimeslotsQueryOutput> + * @implements \App\Contracts\Query<\App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryInput, \App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryOutput> */ final readonly class GetAvailableTimeslotsQuery implements Query { diff --git a/app/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php b/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php similarity index 87% rename from app/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php rename to app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php index 4d9a2ebf..3aaf5971 100644 --- a/app/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php +++ b/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQueryInput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Timeslots; +namespace App\Cqs\Queries\Timeslots; use App\Contracts\QueryInput; use Domain\Models\ValueObjects\Entities\ShopId; diff --git a/app/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php b/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php similarity index 93% rename from app/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php rename to app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php index cb800062..39883a6e 100644 --- a/app/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php +++ b/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Queries\Timeslots; +namespace App\Cqs\Queries\Timeslots; use Domain\Models\ValueObjects\PickupTimeSlot; use Webmozart\Assert\Assert; diff --git a/app/Http/Controllers/Bo/DashboardController.php b/app/Http/Controllers/Bo/DashboardController.php index fbbc7c3f..0387b2fd 100644 --- a/app/Http/Controllers/Bo/DashboardController.php +++ b/app/Http/Controllers/Bo/DashboardController.php @@ -7,7 +7,7 @@ namespace App\Http\Controllers\Bo; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Dashboard\DashboardRequest; -use App\Queries\Dashboard\GetBoDashboardQuery; +use App\Cqs\Queries\Dashboard\GetBoDashboardQuery; use Illuminate\Contracts\View\View; class DashboardController extends Controller diff --git a/app/Http/Controllers/Bo/DiscountsController.php b/app/Http/Controllers/Bo/DiscountsController.php index fa664670..b14eae95 100644 --- a/app/Http/Controllers/Bo/DiscountsController.php +++ b/app/Http/Controllers/Bo/DiscountsController.php @@ -4,20 +4,20 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Discounts\CreateDiscount; -use App\Actions\Discounts\DeleteDiscount; -use App\Actions\Discounts\DeleteDiscountInput; -use App\Actions\Discounts\UpdateDiscount; +use App\Cqs\Actions\Discounts\CreateDiscount; +use App\Cqs\Actions\Discounts\DeleteDiscount; +use App\Cqs\Actions\Discounts\DeleteDiscountInput; +use App\Cqs\Actions\Discounts\UpdateDiscount; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Discounts\StoreDiscountRequest; use App\Http\Requests\Bo\Discounts\UpdateDiscountRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Discount; -use App\Queries\Discounts\GetDiscountFormDataQuery; -use App\Queries\Discounts\GetDiscountFormDataQueryInput; -use App\Queries\Discounts\GetPaginatedDiscountsQuery; -use App\Queries\Discounts\GetPaginatedDiscountsQueryInput; +use App\Cqs\Queries\Discounts\GetDiscountFormDataQuery; +use App\Cqs\Queries\Discounts\GetDiscountFormDataQueryInput; +use App\Cqs\Queries\Discounts\GetPaginatedDiscountsQuery; +use App\Cqs\Queries\Discounts\GetPaginatedDiscountsQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Bo/FaqsController.php b/app/Http/Controllers/Bo/FaqsController.php index 14266538..0879bd7e 100644 --- a/app/Http/Controllers/Bo/FaqsController.php +++ b/app/Http/Controllers/Bo/FaqsController.php @@ -4,18 +4,18 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Faqs\CreateFaq; -use App\Actions\Faqs\DeleteFaq; -use App\Actions\Faqs\DeleteFaqInput; -use App\Actions\Faqs\UpdateFaq; +use App\Cqs\Actions\Faqs\CreateFaq; +use App\Cqs\Actions\Faqs\DeleteFaq; +use App\Cqs\Actions\Faqs\DeleteFaqInput; +use App\Cqs\Actions\Faqs\UpdateFaq; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Faqs\StoreFaqRequest; use App\Http\Requests\Bo\Faqs\UpdateFaqRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Faq; -use App\Queries\Faqs\GetPaginatedFaqsQuery; -use App\Queries\Faqs\GetPaginatedFaqsQueryInput; +use App\Cqs\Queries\Faqs\GetPaginatedFaqsQuery; +use App\Cqs\Queries\Faqs\GetPaginatedFaqsQueryInput; use App\Traits\Controllers\ChangesModelOrder; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/Bo/OrdersController.php b/app/Http/Controllers/Bo/OrdersController.php index cc248703..75c5c69f 100644 --- a/app/Http/Controllers/Bo/OrdersController.php +++ b/app/Http/Controllers/Bo/OrdersController.php @@ -4,18 +4,18 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Orders\CancelOrder; -use App\Actions\Orders\CancelOrderInput; +use App\Cqs\Actions\Orders\CancelOrder; +use App\Cqs\Actions\Orders\CancelOrderInput; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Orders\IndexOrdersRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Order; -use App\Queries\Orders\GetBoOrderDetailQuery; -use App\Queries\Orders\GetBoOrderDetailQueryInput; -use App\Queries\Orders\GetBoPaginatedOrdersQuery; -use App\Queries\Orders\GetBoTodayOrdersQuery; -use App\Queries\Orders\GetBoTodayOrdersQueryInput; +use App\Cqs\Queries\Orders\GetBoOrderDetailQuery; +use App\Cqs\Queries\Orders\GetBoOrderDetailQueryInput; +use App\Cqs\Queries\Orders\GetBoPaginatedOrdersQuery; +use App\Cqs\Queries\Orders\GetBoTodayOrdersQuery; +use App\Cqs\Queries\Orders\GetBoTodayOrdersQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Bo/PageController.php b/app/Http/Controllers/Bo/PageController.php index d7b54129..80d49a68 100644 --- a/app/Http/Controllers/Bo/PageController.php +++ b/app/Http/Controllers/Bo/PageController.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Pages\UpdatePage; +use App\Cqs\Actions\Pages\UpdatePage; use App\Contracts\Executor; use App\Dto\PageDto; use App\Http\Controllers\Controller; diff --git a/app/Http/Controllers/Bo/PickupExceptionsController.php b/app/Http/Controllers/Bo/PickupExceptionsController.php index 6f1cef58..e3cc991b 100644 --- a/app/Http/Controllers/Bo/PickupExceptionsController.php +++ b/app/Http/Controllers/Bo/PickupExceptionsController.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\PickupExceptions\CreatePickupException; -use App\Actions\PickupExceptions\DeletePickupException; -use App\Actions\PickupExceptions\DeletePickupExceptionInput; -use App\Actions\PickupExceptions\UpdatePickupException; +use App\Cqs\Actions\PickupExceptions\CreatePickupException; +use App\Cqs\Actions\PickupExceptions\DeletePickupException; +use App\Cqs\Actions\PickupExceptions\DeletePickupExceptionInput; +use App\Cqs\Actions\PickupExceptions\UpdatePickupException; use App\Contracts\Executor; use App\Dto\PickupExceptionDto; use App\Http\Controllers\Controller; @@ -15,8 +15,8 @@ use App\Http\Requests\Bo\PickupExceptions\StorePickupExceptionRequest; use App\Http\Requests\Bo\PickupExceptions\UpdatePickupExceptionRequest; use App\Lib\Helpers\RequestHelper; use App\Models\PickupException; -use App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQuery; -use App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput; +use App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQuery; +use App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Bo/ProductIncosController.php b/app/Http/Controllers/Bo/ProductIncosController.php index 308053ca..2c6a8a53 100644 --- a/app/Http/Controllers/Bo/ProductIncosController.php +++ b/app/Http/Controllers/Bo/ProductIncosController.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\ProductIncos\AssociateProductInco; -use App\Actions\ProductIncos\SyncProductInco; +use App\Cqs\Actions\ProductIncos\AssociateProductInco; +use App\Cqs\Actions\ProductIncos\SyncProductInco; use App\Contracts\Executor; use App\Dto\ProductDto; use App\Dto\ProductIncoDto; @@ -15,7 +15,7 @@ use App\Http\Requests\Bo\ProductIncos\PreviewArcadiaIncoRequest; use App\Http\Requests\Bo\ProductIncos\SyncProductIncoRequest; use App\Models\Product; use App\Models\ProductInco; -use App\Queries\ProductIncos\GetArcadiaIncoPreviewQuery; +use App\Cqs\Queries\ProductIncos\GetArcadiaIncoPreviewQuery; use Illuminate\Contracts\View\View; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/Bo/ProductsController.php b/app/Http/Controllers/Bo/ProductsController.php index 5e5ed076..f6597973 100644 --- a/app/Http/Controllers/Bo/ProductsController.php +++ b/app/Http/Controllers/Bo/ProductsController.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Products\CreateProduct; -use App\Actions\Products\DeleteProduct; -use App\Actions\Products\DeleteProductInput; -use App\Actions\Products\UpdateProduct; +use App\Cqs\Actions\Products\CreateProduct; +use App\Cqs\Actions\Products\DeleteProduct; +use App\Cqs\Actions\Products\DeleteProductInput; +use App\Cqs\Actions\Products\UpdateProduct; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Products\IndexProductRequest; @@ -15,9 +15,9 @@ use App\Http\Requests\Bo\Products\StoreProductRequest; use App\Http\Requests\Bo\Products\UpdateProductRequest; use App\Interfaces\MassActions; use App\Models\Product; -use App\Queries\Products\GetBoPaginatedProductsQuery; -use App\Queries\Products\GetProductFormDataQuery; -use App\Queries\Products\GetProductFormDataQueryInput; +use App\Cqs\Queries\Products\GetBoPaginatedProductsQuery; +use App\Cqs\Queries\Products\GetProductFormDataQuery; +use App\Cqs\Queries\Products\GetProductFormDataQueryInput; use App\Traits\Controllers\ChangesModelOrder; use App\Traits\Controllers\HasMassActions; use App\Traits\Controllers\TogglesModelStar; diff --git a/app/Http/Controllers/Bo/RangesController.php b/app/Http/Controllers/Bo/RangesController.php index c6955ee8..66545480 100644 --- a/app/Http/Controllers/Bo/RangesController.php +++ b/app/Http/Controllers/Bo/RangesController.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Ranges\CreateRange; -use App\Actions\Ranges\DeleteRange; -use App\Actions\Ranges\DeleteRangeInput; -use App\Actions\Ranges\UpdateRange; +use App\Cqs\Actions\Ranges\CreateRange; +use App\Cqs\Actions\Ranges\DeleteRange; +use App\Cqs\Actions\Ranges\DeleteRangeInput; +use App\Cqs\Actions\Ranges\UpdateRange; use App\Contracts\Executor; use App\Dto\RangeDto; use App\Http\Controllers\Controller; @@ -15,8 +15,8 @@ use App\Http\Requests\Bo\Ranges\StoreRangeRequest; use App\Http\Requests\Bo\Ranges\UpdateRangeRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Range; -use App\Queries\Ranges\GetPaginatedRangesQuery; -use App\Queries\Ranges\GetPaginatedRangesQueryInput; +use App\Cqs\Queries\Ranges\GetPaginatedRangesQuery; +use App\Cqs\Queries\Ranges\GetPaginatedRangesQueryInput; use App\Traits\Controllers\ChangesModelOrder; use App\Traits\Controllers\TogglesModelStatus; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Bo/SettingsController.php b/app/Http/Controllers/Bo/SettingsController.php index 04e6ebdc..cfbed3e2 100644 --- a/app/Http/Controllers/Bo/SettingsController.php +++ b/app/Http/Controllers/Bo/SettingsController.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Settings\UpdateSettings; +use App\Cqs\Actions\Settings\UpdateSettings; use App\Contracts\Executor; use App\Contracts\QueryInputEmpty; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Settings\UpdateSettingsRequest; use App\Models\Setting; -use App\Queries\Settings\GetSettingsQuery; +use App\Cqs\Queries\Settings\GetSettingsQuery; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Str; diff --git a/app/Http/Controllers/Bo/ShopsController.php b/app/Http/Controllers/Bo/ShopsController.php index e2b19882..03f32a42 100644 --- a/app/Http/Controllers/Bo/ShopsController.php +++ b/app/Http/Controllers/Bo/ShopsController.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Shops\CreateShop; -use App\Actions\Shops\DeleteShop; -use App\Actions\Shops\DeleteShopInput; -use App\Actions\Shops\UpdateShop; -use App\Actions\Shops\UpdateShopPickupExceptions; +use App\Cqs\Actions\Shops\CreateShop; +use App\Cqs\Actions\Shops\DeleteShop; +use App\Cqs\Actions\Shops\DeleteShopInput; +use App\Cqs\Actions\Shops\UpdateShop; +use App\Cqs\Actions\Shops\UpdateShopPickupExceptions; use App\Contracts\Executor; use App\Dto\ShopDto; use App\Http\Controllers\Controller; @@ -18,10 +18,10 @@ use App\Http\Requests\Bo\Shops\UpdateShopPickupExceptionsRequest; use App\Http\Requests\Bo\Shops\UpdateShopRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Shop; -use App\Queries\Shops\GetPaginatedShopsQuery; -use App\Queries\Shops\GetPaginatedShopsQueryInput; -use App\Queries\Shops\GetShopPickupExceptionsQuery; -use App\Queries\Shops\GetShopPickupExceptionsQueryInput; +use App\Cqs\Queries\Shops\GetPaginatedShopsQuery; +use App\Cqs\Queries\Shops\GetPaginatedShopsQueryInput; +use App\Cqs\Queries\Shops\GetShopPickupExceptionsQuery; +use App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Str; diff --git a/app/Http/Controllers/Bo/SlidesController.php b/app/Http/Controllers/Bo/SlidesController.php index 1c35c5ad..269bf05f 100644 --- a/app/Http/Controllers/Bo/SlidesController.php +++ b/app/Http/Controllers/Bo/SlidesController.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Slides\CreateSlide; -use App\Actions\Slides\DeleteSlide; -use App\Actions\Slides\DeleteSlideInput; -use App\Actions\Slides\UpdateSlide; +use App\Cqs\Actions\Slides\CreateSlide; +use App\Cqs\Actions\Slides\DeleteSlide; +use App\Cqs\Actions\Slides\DeleteSlideInput; +use App\Cqs\Actions\Slides\UpdateSlide; use App\Contracts\Executor; use App\Dto\SlideDto; use App\Http\Controllers\Controller; @@ -15,8 +15,8 @@ use App\Http\Requests\Bo\Slides\StoreSlideRequest; use App\Http\Requests\Bo\Slides\UpdateSlideRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Slide; -use App\Queries\Slides\GetPaginatedSlidesQuery; -use App\Queries\Slides\GetPaginatedSlidesQueryInput; +use App\Cqs\Queries\Slides\GetPaginatedSlidesQuery; +use App\Cqs\Queries\Slides\GetPaginatedSlidesQueryInput; use App\Traits\Controllers\ChangesModelOrder; use App\Traits\Controllers\TogglesModelStatus; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Bo/TagsController.php b/app/Http/Controllers/Bo/TagsController.php index d92cd093..c7ec0d6b 100644 --- a/app/Http/Controllers/Bo/TagsController.php +++ b/app/Http/Controllers/Bo/TagsController.php @@ -4,18 +4,18 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Actions\Tags\CreateTag; -use App\Actions\Tags\DeleteTag; -use App\Actions\Tags\DeleteTagInput; -use App\Actions\Tags\UpdateTag; +use App\Cqs\Actions\Tags\CreateTag; +use App\Cqs\Actions\Tags\DeleteTag; +use App\Cqs\Actions\Tags\DeleteTagInput; +use App\Cqs\Actions\Tags\UpdateTag; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Tags\StoreTagRequest; use App\Http\Requests\Bo\Tags\UpdateTagRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Tag; -use App\Queries\Tags\GetPaginatedTagsQuery; -use App\Queries\Tags\GetPaginatedTagsQueryInput; +use App\Cqs\Queries\Tags\GetPaginatedTagsQuery; +use App\Cqs\Queries\Tags\GetPaginatedTagsQueryInput; use App\Traits\Controllers\ChangesModelOrder; use App\Traits\Controllers\TogglesModelStatus; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Ajax/BasketController.php b/app/Http/Controllers/Fo/Ajax/BasketController.php index d7dd27bf..d4123d53 100644 --- a/app/Http/Controllers/Fo/Ajax/BasketController.php +++ b/app/Http/Controllers/Fo/Ajax/BasketController.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Ajax; -use App\Actions\Basket\AddToBasket; -use App\Actions\Basket\EmptyBasket; -use App\Actions\Basket\RemoveFromBasket; +use App\Cqs\Actions\Basket\AddToBasket; +use App\Cqs\Actions\Basket\EmptyBasket; +use App\Cqs\Actions\Basket\RemoveFromBasket; use App\Contracts\ActionInputEmpty; use App\Contracts\Executor; use App\Contracts\QueryInputEmpty; @@ -14,7 +14,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Basket\AddBasketRequest; use App\Http\Requests\Basket\RemoveBasketRequest; use App\Http\Resources\Fo\Ajax\BasketResource; -use App\Queries\Basket\GetBasketQuery; +use App\Cqs\Queries\Basket\GetBasketQuery; use Illuminate\Http\JsonResponse; class BasketController extends Controller diff --git a/app/Http/Controllers/Fo/Ajax/PickupController.php b/app/Http/Controllers/Fo/Ajax/PickupController.php index 341c71ae..01c149b4 100644 --- a/app/Http/Controllers/Fo/Ajax/PickupController.php +++ b/app/Http/Controllers/Fo/Ajax/PickupController.php @@ -8,8 +8,8 @@ use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Resources\Fo\Ajax\TimeSlotResource; use App\Models\Shop; -use App\Queries\Timeslots\GetAvailableTimeslotsQuery; -use App\Queries\Timeslots\GetAvailableTimeslotsQueryInput; +use App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQuery; +use App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryInput; use Illuminate\Http\JsonResponse; use Illuminate\Http\Resources\Json\AnonymousResourceCollection; diff --git a/app/Http/Controllers/Fo/Ajax/ProductsController.php b/app/Http/Controllers/Fo/Ajax/ProductsController.php index 2b132413..399a9a6a 100644 --- a/app/Http/Controllers/Fo/Ajax/ProductsController.php +++ b/app/Http/Controllers/Fo/Ajax/ProductsController.php @@ -8,7 +8,7 @@ use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Fo\Ajax\FilterProductsRequest; use App\Http\Resources\Fo\Ajax\FilteredProductResource; -use App\Queries\Products\GetFoFilteredProductsQuery; +use App\Cqs\Queries\Products\GetFoFilteredProductsQuery; use Illuminate\Http\Resources\Json\JsonResource; class ProductsController extends Controller diff --git a/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php b/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php index ac38c492..ac255f7f 100644 --- a/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php @@ -6,8 +6,8 @@ namespace App\Http\Controllers\Fo\Auth; use App\Contracts\Executor; use App\Exceptions\CustomerNotEmployedException; -use App\Queries\Customers\GetCustomerByEmailQuery; -use App\Queries\Customers\GetCustomerByEmailQueryInput; +use App\Cqs\Queries\Customers\GetCustomerByEmailQuery; +use App\Cqs\Queries\Customers\GetCustomerByEmailQueryInput; use Domain\Models\ValueObjects\Email; use Domain\Models\ValueObjects\Entities\ShopperId; use Domain\Services\ShopperService; diff --git a/app/Http/Controllers/Fo/Auth/RegisterController.php b/app/Http/Controllers/Fo/Auth/RegisterController.php index 62df13c8..14c927ba 100644 --- a/app/Http/Controllers/Fo/Auth/RegisterController.php +++ b/app/Http/Controllers/Fo/Auth/RegisterController.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Auth; -use App\Actions\Customers\RegisterCustomer; +use App\Cqs\Actions\Customers\RegisterCustomer; use App\Contracts\Executor; use App\Http\Requests\Fo\Auth\RegisterRequest; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Customers/CustomerController.php b/app/Http/Controllers/Fo/Customers/CustomerController.php index 69d3df33..9b1b9f56 100644 --- a/app/Http/Controllers/Fo/Customers/CustomerController.php +++ b/app/Http/Controllers/Fo/Customers/CustomerController.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Customers; -use App\Actions\Crm\UpdateCustomer; +use App\Cqs\Actions\Crm\UpdateCustomer; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Fo\Customer\UpdateInfosRequest; use App\Models\Customer; -use App\Queries\Crm\GetCrmCustomerQuery; -use App\Queries\Crm\GetCrmCustomerQueryInput; +use App\Cqs\Queries\Crm\GetCrmCustomerQuery; +use App\Cqs\Queries\Crm\GetCrmCustomerQueryInput; use Domain\Models\ValueObjects\CrmCustomer; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/Fo/Customers/OrderController.php b/app/Http/Controllers/Fo/Customers/OrderController.php index 0a664343..a92096e0 100644 --- a/app/Http/Controllers/Fo/Customers/OrderController.php +++ b/app/Http/Controllers/Fo/Customers/OrderController.php @@ -8,10 +8,10 @@ use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Lib\Helpers\RequestHelper; use App\Models\Order; -use App\Queries\Orders\GetFoCustomerOrderDetailQuery; -use App\Queries\Orders\GetFoCustomerOrderDetailQueryInput; -use App\Queries\Orders\GetFoCustomerPaginatedOrdersQuery; -use App\Queries\Orders\GetFoCustomerPaginatedOrdersQueryInput; +use App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQuery; +use App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQueryInput; +use App\Cqs\Queries\Orders\GetFoCustomerPaginatedOrdersQuery; +use App\Cqs\Queries\Orders\GetFoCustomerPaginatedOrdersQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\Request; use Infrastructure\Adapters\Services\AppCustomerAuthService; diff --git a/app/Http/Controllers/Fo/Customers/PasswordController.php b/app/Http/Controllers/Fo/Customers/PasswordController.php index ed7005da..afbba8d7 100644 --- a/app/Http/Controllers/Fo/Customers/PasswordController.php +++ b/app/Http/Controllers/Fo/Customers/PasswordController.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Customers; -use App\Actions\Crm\UpdateCustomerPassword; +use App\Cqs\Actions\Crm\UpdateCustomerPassword; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Fo\Customer\UpdatePasswordRequest; diff --git a/app/Http/Controllers/Fo/NewsletterController.php b/app/Http/Controllers/Fo/NewsletterController.php index b302ca0f..9ca58823 100644 --- a/app/Http/Controllers/Fo/NewsletterController.php +++ b/app/Http/Controllers/Fo/NewsletterController.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo; -use App\Actions\Crm\UnsubscribeFromNewsletter; -use App\Actions\Crm\UnsubscribeFromNewsletterInput; -use App\Actions\Crm\UnsubscribeFromNewsletterOutput; +use App\Cqs\Actions\Crm\UnsubscribeFromNewsletter; +use App\Cqs\Actions\Crm\UnsubscribeFromNewsletterInput; +use App\Cqs\Actions\Crm\UnsubscribeFromNewsletterOutput; use App\Contracts\Executor; use App\Http\Requests\Fo\UnsubscribeNewsletterRequest; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Pages/ContactController.php b/app/Http/Controllers/Fo/Pages/ContactController.php index c7643df4..edcc24b2 100644 --- a/app/Http/Controllers/Fo/Pages/ContactController.php +++ b/app/Http/Controllers/Fo/Pages/ContactController.php @@ -8,10 +8,10 @@ use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Fo\ContactFormRequest; use App\Mail\SendContactMail; -use App\Queries\Pages\GetPageQuery; -use App\Queries\Pages\GetPageQueryInput; -use App\Queries\Shops\GetShopQuery; -use App\Queries\Shops\GetShopQueryInput; +use App\Cqs\Queries\Pages\GetPageQuery; +use App\Cqs\Queries\Pages\GetPageQueryInput; +use App\Cqs\Queries\Shops\GetShopQuery; +use App\Cqs\Queries\Shops\GetShopQueryInput; use Domain\Enums\StaticPageSlug; use Domain\Models\ValueObjects\Slug; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Pages/HomeController.php b/app/Http/Controllers/Fo/Pages/HomeController.php index 54e9b4f4..784f7790 100644 --- a/app/Http/Controllers/Fo/Pages/HomeController.php +++ b/app/Http/Controllers/Fo/Pages/HomeController.php @@ -6,12 +6,12 @@ namespace App\Http\Controllers\Fo\Pages; use App\Contracts\Executor; use App\Http\Controllers\Controller; -use App\Queries\Products\GetPaginatedProductsQuery; -use App\Queries\Products\GetPaginatedProductsQueryInput; -use App\Queries\Ranges\GetPaginatedRangesQuery; -use App\Queries\Ranges\GetPaginatedRangesQueryInput; -use App\Queries\Slides\GetPaginatedSlidesQuery; -use App\Queries\Slides\GetPaginatedSlidesQueryInput; +use App\Cqs\Queries\Products\GetPaginatedProductsQuery; +use App\Cqs\Queries\Products\GetPaginatedProductsQueryInput; +use App\Cqs\Queries\Ranges\GetPaginatedRangesQuery; +use App\Cqs\Queries\Ranges\GetPaginatedRangesQueryInput; +use App\Cqs\Queries\Slides\GetPaginatedSlidesQuery; +use App\Cqs\Queries\Slides\GetPaginatedSlidesQueryInput; use Illuminate\Contracts\View\View; use Infrastructure\Adapters\Services\AppCustomerAuthService; use Shared\Pagination\Pagination; diff --git a/app/Http/Controllers/Fo/Pages/PageController.php b/app/Http/Controllers/Fo/Pages/PageController.php index 3efc1e5d..b619fa90 100644 --- a/app/Http/Controllers/Fo/Pages/PageController.php +++ b/app/Http/Controllers/Fo/Pages/PageController.php @@ -8,9 +8,9 @@ use App\Contracts\Executor; use App\Contracts\QueryInputEmpty; use App\Dto\PageDto; use App\Http\Controllers\Controller; -use App\Queries\Faqs\GetFaqsQuery; -use App\Queries\Pages\GetPageQuery; -use App\Queries\Pages\GetPageQueryInput; +use App\Cqs\Queries\Faqs\GetFaqsQuery; +use App\Cqs\Queries\Pages\GetPageQuery; +use App\Cqs\Queries\Pages\GetPageQueryInput; use Domain\Enums\StaticPageSlug; use Domain\Models\ValueObjects\Slug; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Pages/ProductsController.php b/app/Http/Controllers/Fo/Pages/ProductsController.php index 43e77812..411d837b 100644 --- a/app/Http/Controllers/Fo/Pages/ProductsController.php +++ b/app/Http/Controllers/Fo/Pages/ProductsController.php @@ -8,8 +8,8 @@ use App\Contracts\Executor; use App\Dto\ProductWithPricingDto; use App\Http\Controllers\Controller; use App\Http\Resources\Fo\Ajax\FilteredProductResource; -use App\Queries\Products\GetFoProductIndexPageQuery; -use App\Queries\Products\GetFoProductIndexPageQueryInput; +use App\Cqs\Queries\Products\GetFoProductIndexPageQuery; +use App\Cqs\Queries\Products\GetFoProductIndexPageQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\Request; use Shared\Pagination\PageSize; diff --git a/app/Http/Controllers/Fo/TunnelController.php b/app/Http/Controllers/Fo/TunnelController.php index b10bf74d..37eb9c1d 100644 --- a/app/Http/Controllers/Fo/TunnelController.php +++ b/app/Http/Controllers/Fo/TunnelController.php @@ -4,23 +4,23 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo; -use App\Actions\Orders\ApplyPickTimeSlot; -use App\Actions\Orders\FinalizeOrder; -use App\Actions\Orders\InitializeOrderTunnel; +use App\Cqs\Actions\Orders\ApplyPickTimeSlot; +use App\Cqs\Actions\Orders\FinalizeOrder; +use App\Cqs\Actions\Orders\InitializeOrderTunnel; use App\Contracts\Executor; use App\Http\Controllers\Controller; use App\Http\Requests\Fo\Orders\ConfirmOrderRequest; use App\Http\Requests\Fo\Orders\PickTimeSlotRequest; use App\Http\Requests\Fo\Orders\ValidateSummaryRequest; use App\Models\Order; -use App\Queries\Orders\GetBasketSummaryQuery; -use App\Queries\Orders\GetBasketSummaryQueryInput; -use App\Queries\Orders\GetOrderConfirmationQuery; -use App\Queries\Orders\GetOrderConfirmationQueryInput; -use App\Queries\Orders\GetPickTimeSlotQuery; -use App\Queries\Orders\GetPickTimeSlotQueryInput; -use App\Queries\Orders\GetTunnelOrderConfirmedQuery; -use App\Queries\Orders\GetTunnelOrderConfirmedQueryInput; +use App\Cqs\Queries\Orders\GetBasketSummaryQuery; +use App\Cqs\Queries\Orders\GetBasketSummaryQueryInput; +use App\Cqs\Queries\Orders\GetOrderConfirmationQuery; +use App\Cqs\Queries\Orders\GetOrderConfirmationQueryInput; +use App\Cqs\Queries\Orders\GetPickTimeSlotQuery; +use App\Cqs\Queries\Orders\GetPickTimeSlotQueryInput; +use App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQuery; +use App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryInput; use Domain\Enums\OrderTunnelStep; use Domain\Exceptions\OrderTunnel\OrderLimitExceededException; use Domain\Exceptions\OrderTunnel\WeeklyLimitExceededException; diff --git a/app/Http/Requests/Basket/AddBasketRequest.php b/app/Http/Requests/Basket/AddBasketRequest.php index c7aa7f7f..f6712ab7 100644 --- a/app/Http/Requests/Basket/AddBasketRequest.php +++ b/app/Http/Requests/Basket/AddBasketRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Basket; -use App\Actions\Basket\AddToBasketInput; +use App\Cqs\Actions\Basket\AddToBasketInput; use App\Models\Product; use Domain\Models\ValueObjects\Entities\ProductId; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Basket/RemoveBasketRequest.php b/app/Http/Requests/Basket/RemoveBasketRequest.php index 0ad38811..ec523d6b 100644 --- a/app/Http/Requests/Basket/RemoveBasketRequest.php +++ b/app/Http/Requests/Basket/RemoveBasketRequest.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Http\Requests\Basket; -use App\Actions\Basket\RemoveProductFromBasketInput; -use App\Actions\Basket\RemoveQuantityFromBasketInput; +use App\Cqs\Actions\Basket\RemoveProductFromBasketInput; +use App\Cqs\Actions\Basket\RemoveQuantityFromBasketInput; use Domain\Models\ValueObjects\Entities\ProductId; use Illuminate\Foundation\Http\FormRequest; use Ramsey\Uuid\Uuid; diff --git a/app/Http/Requests/Bo/ChangeSelectedOrderRequest.php b/app/Http/Requests/Bo/ChangeSelectedOrderRequest.php index 993ff37d..4f1d56d7 100644 --- a/app/Http/Requests/Bo/ChangeSelectedOrderRequest.php +++ b/app/Http/Requests/Bo/ChangeSelectedOrderRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo; -use App\Actions\Common\ChangeModelOrderPositionInput; +use App\Cqs\Actions\Common\ChangeModelOrderPositionInput; use App\Interfaces\ModelWithOrder; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Bo/Dashboard/DashboardRequest.php b/app/Http/Requests/Bo/Dashboard/DashboardRequest.php index 6c634ce0..b8491d12 100644 --- a/app/Http/Requests/Bo/Dashboard/DashboardRequest.php +++ b/app/Http/Requests/Bo/Dashboard/DashboardRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Dashboard; -use App\Queries\Dashboard\GetBoDashboardQueryInput; +use App\Cqs\Queries\Dashboard\GetBoDashboardQueryInput; use Carbon\CarbonInterface; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Date; diff --git a/app/Http/Requests/Bo/Discounts/StoreDiscountRequest.php b/app/Http/Requests/Bo/Discounts/StoreDiscountRequest.php index 288a2726..a9e30202 100644 --- a/app/Http/Requests/Bo/Discounts/StoreDiscountRequest.php +++ b/app/Http/Requests/Bo/Discounts/StoreDiscountRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Discounts; -use App\Actions\Discounts\CreateDiscountInput; +use App\Cqs\Actions\Discounts\CreateDiscountInput; use Domain\Enums\DiscountType; use Domain\Models\ValueObjects\DatePeriod; use Domain\Models\ValueObjects\DiscountValue; diff --git a/app/Http/Requests/Bo/Discounts/UpdateDiscountRequest.php b/app/Http/Requests/Bo/Discounts/UpdateDiscountRequest.php index 1b3c8086..772883a1 100644 --- a/app/Http/Requests/Bo/Discounts/UpdateDiscountRequest.php +++ b/app/Http/Requests/Bo/Discounts/UpdateDiscountRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Discounts; -use App\Actions\Discounts\UpdateDiscountInput; +use App\Cqs\Actions\Discounts\UpdateDiscountInput; use App\Models\Discount; class UpdateDiscountRequest extends StoreDiscountRequest diff --git a/app/Http/Requests/Bo/Faqs/StoreFaqRequest.php b/app/Http/Requests/Bo/Faqs/StoreFaqRequest.php index 7311bff3..18d15e10 100644 --- a/app/Http/Requests/Bo/Faqs/StoreFaqRequest.php +++ b/app/Http/Requests/Bo/Faqs/StoreFaqRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Faqs; -use App\Actions\Faqs\CreateFaqInput; +use App\Cqs\Actions\Faqs\CreateFaqInput; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/app/Http/Requests/Bo/Faqs/UpdateFaqRequest.php b/app/Http/Requests/Bo/Faqs/UpdateFaqRequest.php index aeac3218..44086684 100644 --- a/app/Http/Requests/Bo/Faqs/UpdateFaqRequest.php +++ b/app/Http/Requests/Bo/Faqs/UpdateFaqRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Faqs; -use App\Actions\Faqs\UpdateFaqInput; +use App\Cqs\Actions\Faqs\UpdateFaqInput; use App\Models\Faq; class UpdateFaqRequest extends StoreFaqRequest diff --git a/app/Http/Requests/Bo/MassActionRequest.php b/app/Http/Requests/Bo/MassActionRequest.php index 91800716..75449dc1 100644 --- a/app/Http/Requests/Bo/MassActionRequest.php +++ b/app/Http/Requests/Bo/MassActionRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo; -use App\Actions\Common\ExecuteMassActionInput; +use App\Cqs\Actions\Common\ExecuteMassActionInput; use App\Enums\MassActionType; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php b/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php index 0c71bd40..ddd6e321 100644 --- a/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php +++ b/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Orders; use App\Lib\Helpers\RequestHelper; -use App\Queries\Orders\GetBoPaginatedOrdersQueryInput; +use App\Cqs\Queries\Orders\GetBoPaginatedOrdersQueryInput; use Carbon\CarbonInterface; use Domain\Enums\OrderStatus; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Bo/Pages/UpdatePageRequest.php b/app/Http/Requests/Bo/Pages/UpdatePageRequest.php index e6ac734a..f370c026 100644 --- a/app/Http/Requests/Bo/Pages/UpdatePageRequest.php +++ b/app/Http/Requests/Bo/Pages/UpdatePageRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Pages; -use App\Actions\Pages\UpdatePageInput; +use App\Cqs\Actions\Pages\UpdatePageInput; use App\Models\Page; use Domain\Models\ValueObjects\SeoMetadata; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequest.php b/app/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequest.php index 0c62e0d1..401d0f83 100644 --- a/app/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequest.php +++ b/app/Http/Requests/Bo/PickupExceptions/StorePickupExceptionRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\PickupExceptions; -use App\Actions\PickupExceptions\CreatePickupExceptionInput; +use App\Cqs\Actions\PickupExceptions\CreatePickupExceptionInput; use Domain\Enums\RepeatFrequency; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/Requests/Bo/PickupExceptions/UpdatePickupExceptionRequest.php b/app/Http/Requests/Bo/PickupExceptions/UpdatePickupExceptionRequest.php index 45b49699..22a43376 100644 --- a/app/Http/Requests/Bo/PickupExceptions/UpdatePickupExceptionRequest.php +++ b/app/Http/Requests/Bo/PickupExceptions/UpdatePickupExceptionRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\PickupExceptions; -use App\Actions\PickupExceptions\UpdatePickupExceptionInput; +use App\Cqs\Actions\PickupExceptions\UpdatePickupExceptionInput; use App\Models\PickupException; class UpdatePickupExceptionRequest extends StorePickupExceptionRequest diff --git a/app/Http/Requests/Bo/ProductIncos/AssociateProductIncoRequest.php b/app/Http/Requests/Bo/ProductIncos/AssociateProductIncoRequest.php index ffd102b0..892222e0 100644 --- a/app/Http/Requests/Bo/ProductIncos/AssociateProductIncoRequest.php +++ b/app/Http/Requests/Bo/ProductIncos/AssociateProductIncoRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\ProductIncos; -use App\Actions\ProductIncos\AssociateProductIncoInput; +use App\Cqs\Actions\ProductIncos\AssociateProductIncoInput; use App\Models\Product; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/app/Http/Requests/Bo/ProductIncos/PreviewArcadiaIncoRequest.php b/app/Http/Requests/Bo/ProductIncos/PreviewArcadiaIncoRequest.php index b99805ee..551346f7 100644 --- a/app/Http/Requests/Bo/ProductIncos/PreviewArcadiaIncoRequest.php +++ b/app/Http/Requests/Bo/ProductIncos/PreviewArcadiaIncoRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\ProductIncos; -use App\Queries\ProductIncos\GetArcadiaIncoPreviewQueryInput; +use App\Cqs\Queries\ProductIncos\GetArcadiaIncoPreviewQueryInput; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/app/Http/Requests/Bo/ProductIncos/SyncProductIncoRequest.php b/app/Http/Requests/Bo/ProductIncos/SyncProductIncoRequest.php index 254b8f37..486eab31 100644 --- a/app/Http/Requests/Bo/ProductIncos/SyncProductIncoRequest.php +++ b/app/Http/Requests/Bo/ProductIncos/SyncProductIncoRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\ProductIncos; -use App\Actions\ProductIncos\SyncProductIncoInput; +use App\Cqs\Actions\ProductIncos\SyncProductIncoInput; use App\Models\Product; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/app/Http/Requests/Bo/Products/IndexProductRequest.php b/app/Http/Requests/Bo/Products/IndexProductRequest.php index a3b9f6b1..8642e550 100644 --- a/app/Http/Requests/Bo/Products/IndexProductRequest.php +++ b/app/Http/Requests/Bo/Products/IndexProductRequest.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Products; use App\Lib\Helpers\RequestHelper; -use App\Queries\Products\GetBoPaginatedProductsQueryInput; +use App\Cqs\Queries\Products\GetBoPaginatedProductsQueryInput; use Illuminate\Contracts\Session\Session; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/app/Http/Requests/Bo/Products/StoreProductRequest.php b/app/Http/Requests/Bo/Products/StoreProductRequest.php index 748678dd..2efc596c 100644 --- a/app/Http/Requests/Bo/Products/StoreProductRequest.php +++ b/app/Http/Requests/Bo/Products/StoreProductRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Products; -use App\Actions\Products\CreateProductInput; +use App\Cqs\Actions\Products\CreateProductInput; use App\Traits\Requests\HasPicture; use Carbon\CarbonImmutable; use Domain\Enums\ProductBrand; diff --git a/app/Http/Requests/Bo/Products/UpdateProductRequest.php b/app/Http/Requests/Bo/Products/UpdateProductRequest.php index 1d104b51..b49fa77d 100644 --- a/app/Http/Requests/Bo/Products/UpdateProductRequest.php +++ b/app/Http/Requests/Bo/Products/UpdateProductRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Products; -use App\Actions\Products\UpdateProductInput; +use App\Cqs\Actions\Products\UpdateProductInput; use App\Models\Product; use Carbon\CarbonImmutable; use Domain\Enums\ProductBrand; diff --git a/app/Http/Requests/Bo/Ranges/StoreRangeRequest.php b/app/Http/Requests/Bo/Ranges/StoreRangeRequest.php index b55c9d0a..e91a52b4 100644 --- a/app/Http/Requests/Bo/Ranges/StoreRangeRequest.php +++ b/app/Http/Requests/Bo/Ranges/StoreRangeRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Ranges; -use App\Actions\Ranges\CreateRangeInput; +use App\Cqs\Actions\Ranges\CreateRangeInput; use App\Traits\Requests\HasPicture; use Domain\Models\ValueObjects\PictureMetadata; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Bo/Ranges/UpdateRangeRequest.php b/app/Http/Requests/Bo/Ranges/UpdateRangeRequest.php index f8c39523..9369d3ba 100644 --- a/app/Http/Requests/Bo/Ranges/UpdateRangeRequest.php +++ b/app/Http/Requests/Bo/Ranges/UpdateRangeRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Ranges; -use App\Actions\Ranges\UpdateRangeInput; +use App\Cqs\Actions\Ranges\UpdateRangeInput; use App\Models\Range; use Domain\Models\ValueObjects\PictureMetadata; diff --git a/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php b/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php index 8e2f6c5a..5abda6a1 100644 --- a/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php +++ b/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Settings; -use App\Actions\Settings\UpdateSettingsInput; +use App\Cqs\Actions\Settings\UpdateSettingsInput; use Domain\Models\ValueObjects\ShopperSiteCode; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/app/Http/Requests/Bo/Shops/StoreShopRequest.php b/app/Http/Requests/Bo/Shops/StoreShopRequest.php index 74c70c35..4abcd091 100644 --- a/app/Http/Requests/Bo/Shops/StoreShopRequest.php +++ b/app/Http/Requests/Bo/Shops/StoreShopRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Shops; -use App\Actions\Shops\CreateShopInput; +use App\Cqs\Actions\Shops\CreateShopInput; use Domain\Models\ValueObjects\Coordinates; use Domain\Models\ValueObjects\PhoneNumber as DomainPhoneNumber; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequest.php b/app/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequest.php index 8072f7e8..832e8c46 100644 --- a/app/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequest.php +++ b/app/Http/Requests/Bo/Shops/UpdateShopPickupExceptionsRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Shops; -use App\Actions\Shops\UpdateShopPickupExceptionsInput; +use App\Cqs\Actions\Shops\UpdateShopPickupExceptionsInput; use App\Models\Shop; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Date; diff --git a/app/Http/Requests/Bo/Shops/UpdateShopRequest.php b/app/Http/Requests/Bo/Shops/UpdateShopRequest.php index a69e6ec8..3249b8bd 100644 --- a/app/Http/Requests/Bo/Shops/UpdateShopRequest.php +++ b/app/Http/Requests/Bo/Shops/UpdateShopRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Shops; -use App\Actions\Shops\UpdateShopInput; +use App\Cqs\Actions\Shops\UpdateShopInput; use App\Models\Shop; class UpdateShopRequest extends StoreShopRequest diff --git a/app/Http/Requests/Bo/Slides/StoreSlideRequest.php b/app/Http/Requests/Bo/Slides/StoreSlideRequest.php index 77186fb2..8ae5461f 100644 --- a/app/Http/Requests/Bo/Slides/StoreSlideRequest.php +++ b/app/Http/Requests/Bo/Slides/StoreSlideRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Slides; -use App\Actions\Slides\CreateSlideInput; +use App\Cqs\Actions\Slides\CreateSlideInput; use App\Traits\Requests\HasPicture; use Domain\Models\ValueObjects\DatePeriod; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Bo/Slides/UpdateSlideRequest.php b/app/Http/Requests/Bo/Slides/UpdateSlideRequest.php index bfd7247e..13817bbe 100644 --- a/app/Http/Requests/Bo/Slides/UpdateSlideRequest.php +++ b/app/Http/Requests/Bo/Slides/UpdateSlideRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Slides; -use App\Actions\Slides\UpdateSlideInput; +use App\Cqs\Actions\Slides\UpdateSlideInput; use App\Models\Slide; class UpdateSlideRequest extends StoreSlideRequest diff --git a/app/Http/Requests/Bo/Tags/StoreTagRequest.php b/app/Http/Requests/Bo/Tags/StoreTagRequest.php index 5abff206..765ce27b 100644 --- a/app/Http/Requests/Bo/Tags/StoreTagRequest.php +++ b/app/Http/Requests/Bo/Tags/StoreTagRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Tags; -use App\Actions\Tags\CreateTagInput; +use App\Cqs\Actions\Tags\CreateTagInput; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/app/Http/Requests/Bo/Tags/UpdateTagRequest.php b/app/Http/Requests/Bo/Tags/UpdateTagRequest.php index 5b06b028..eed39030 100644 --- a/app/Http/Requests/Bo/Tags/UpdateTagRequest.php +++ b/app/Http/Requests/Bo/Tags/UpdateTagRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Tags; -use App\Actions\Tags\UpdateTagInput; +use App\Cqs\Actions\Tags\UpdateTagInput; use App\Models\Tag; class UpdateTagRequest extends StoreTagRequest diff --git a/app/Http/Requests/Fo/Ajax/FilterProductsRequest.php b/app/Http/Requests/Fo/Ajax/FilterProductsRequest.php index d06897bd..117a13c3 100644 --- a/app/Http/Requests/Fo/Ajax/FilterProductsRequest.php +++ b/app/Http/Requests/Fo/Ajax/FilterProductsRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Fo\Ajax; -use App\Queries\Products\GetFoFilteredProductsQueryInput; +use App\Cqs\Queries\Products\GetFoFilteredProductsQueryInput; use Domain\Enums\ProductBrand; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/Requests/Fo/Auth/RegisterRequest.php b/app/Http/Requests/Fo/Auth/RegisterRequest.php index f0c35ce6..78b02fff 100644 --- a/app/Http/Requests/Fo/Auth/RegisterRequest.php +++ b/app/Http/Requests/Fo/Auth/RegisterRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Fo\Auth; -use App\Actions\Customers\RegisterCustomerInput; +use App\Cqs\Actions\Customers\RegisterCustomerInput; use App\Rules\Adult; use Domain\Models\ValueObjects\Code; use Domain\Models\ValueObjects\Email; diff --git a/app/Http/Requests/Fo/Customer/UpdateInfosRequest.php b/app/Http/Requests/Fo/Customer/UpdateInfosRequest.php index 0281488e..d5a74eb2 100644 --- a/app/Http/Requests/Fo/Customer/UpdateInfosRequest.php +++ b/app/Http/Requests/Fo/Customer/UpdateInfosRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Fo\Customer; -use App\Actions\Crm\UpdateCustomerInput; +use App\Cqs\Actions\Crm\UpdateCustomerInput; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Date; use Infrastructure\Adapters\Services\AppCustomerAuthService; diff --git a/app/Http/Requests/Fo/Customer/UpdatePasswordRequest.php b/app/Http/Requests/Fo/Customer/UpdatePasswordRequest.php index 9ad06405..c382d395 100644 --- a/app/Http/Requests/Fo/Customer/UpdatePasswordRequest.php +++ b/app/Http/Requests/Fo/Customer/UpdatePasswordRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Fo\Customer; -use App\Actions\Crm\UpdateCustomerPasswordInput; +use App\Cqs\Actions\Crm\UpdateCustomerPasswordInput; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rules\Password; use Infrastructure\Adapters\Services\AppCustomerAuthService; diff --git a/app/Http/Requests/Fo/Orders/ConfirmOrderRequest.php b/app/Http/Requests/Fo/Orders/ConfirmOrderRequest.php index 9399e55c..487adf43 100644 --- a/app/Http/Requests/Fo/Orders/ConfirmOrderRequest.php +++ b/app/Http/Requests/Fo/Orders/ConfirmOrderRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Fo\Orders; -use App\Actions\Orders\FinalizeOrderInput; +use App\Cqs\Actions\Orders\FinalizeOrderInput; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppCustomerAuthService; diff --git a/app/Http/Requests/Fo/Orders/PickTimeSlotRequest.php b/app/Http/Requests/Fo/Orders/PickTimeSlotRequest.php index 7799d40d..47ec13b5 100644 --- a/app/Http/Requests/Fo/Orders/PickTimeSlotRequest.php +++ b/app/Http/Requests/Fo/Orders/PickTimeSlotRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Fo\Orders; -use App\Actions\Orders\ApplyPickTimeSlotInput; +use App\Cqs\Actions\Orders\ApplyPickTimeSlotInput; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Domain\Exceptions\OrderTunnel\WeeklyLimitExceededException; diff --git a/app/Http/Requests/Fo/Orders/ValidateSummaryRequest.php b/app/Http/Requests/Fo/Orders/ValidateSummaryRequest.php index 5adc0b3b..d9f6d1cb 100644 --- a/app/Http/Requests/Fo/Orders/ValidateSummaryRequest.php +++ b/app/Http/Requests/Fo/Orders/ValidateSummaryRequest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Http\Requests\Fo\Orders; -use App\Actions\Orders\InitializeOrderTunnelInput; +use App\Cqs\Actions\Orders\InitializeOrderTunnelInput; use Domain\Exceptions\OrderTunnel\OrderLimitExceededException; use Domain\Services\BasketService; use Domain\Services\OrderTunnelService; diff --git a/app/Jobs/FetchAndUpsertArcadiaEmployees.php b/app/Jobs/FetchAndUpsertArcadiaEmployees.php index d1e4b77d..453c56f2 100644 --- a/app/Jobs/FetchAndUpsertArcadiaEmployees.php +++ b/app/Jobs/FetchAndUpsertArcadiaEmployees.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Jobs; -use App\Actions\Employee\SynchronizeEmployeesWithArcadiaApi; +use App\Cqs\Actions\Employee\SynchronizeEmployeesWithArcadiaApi; use App\Contracts\ActionInputEmpty; use App\Contracts\Executor; use Illuminate\Contracts\Queue\ShouldBeUnique; diff --git a/app/Jobs/FetchAndUpsertArcadiaProductIncos.php b/app/Jobs/FetchAndUpsertArcadiaProductIncos.php index 8a80b69f..6c990c58 100644 --- a/app/Jobs/FetchAndUpsertArcadiaProductIncos.php +++ b/app/Jobs/FetchAndUpsertArcadiaProductIncos.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Jobs; -use App\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; +use App\Cqs\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; use App\Contracts\ActionInputEmpty; use App\Contracts\Executor; use Illuminate\Contracts\Queue\ShouldBeUnique; diff --git a/app/Services/EmployeeSyncService.php b/app/Services/EmployeeSyncService.php index e4f99f75..8de82f88 100644 --- a/app/Services/EmployeeSyncService.php +++ b/app/Services/EmployeeSyncService.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace App\Services; use App\Contracts\QueryInputEmpty; -use App\Queries\Settings\GetSettingsQuery; +use App\Cqs\Queries\Settings\GetSettingsQuery; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Domain\Models\ValueObjects\EmployeeUpsertData; diff --git a/app/Traits/Controllers/ChangesModelOrder.php b/app/Traits/Controllers/ChangesModelOrder.php index cb0b4b23..4066fd62 100644 --- a/app/Traits/Controllers/ChangesModelOrder.php +++ b/app/Traits/Controllers/ChangesModelOrder.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace App\Traits\Controllers; -use App\Actions\Common\ChangeModelOrder; -use App\Actions\Common\ChangeModelOrderInput; -use App\Actions\Common\ChangeModelOrderPosition; +use App\Cqs\Actions\Common\ChangeModelOrder; +use App\Cqs\Actions\Common\ChangeModelOrderInput; +use App\Cqs\Actions\Common\ChangeModelOrderPosition; use App\Contracts\Executor; use App\Http\Requests\Bo\ChangeOrderRequest; use App\Http\Requests\Bo\ChangeSelectedOrderRequest; diff --git a/app/Traits/Controllers/HasMassActions.php b/app/Traits/Controllers/HasMassActions.php index de5ed57d..5ade3a83 100644 --- a/app/Traits/Controllers/HasMassActions.php +++ b/app/Traits/Controllers/HasMassActions.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Traits\Controllers; -use App\Actions\Common\ExecuteMassAction; +use App\Cqs\Actions\Common\ExecuteMassAction; use App\Contracts\Executor; use App\Enums\MassActionType; use App\Http\Requests\Bo\MassActionRequest; diff --git a/app/Traits/Controllers/TogglesModelStar.php b/app/Traits/Controllers/TogglesModelStar.php index 3e4bff68..d569c64e 100644 --- a/app/Traits/Controllers/TogglesModelStar.php +++ b/app/Traits/Controllers/TogglesModelStar.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Traits\Controllers; -use App\Actions\Common\ToggleModelStar; -use App\Actions\Common\ToggleModelStarInput; +use App\Cqs\Actions\Common\ToggleModelStar; +use App\Cqs\Actions\Common\ToggleModelStarInput; use App\Contracts\Executor; use App\Interfaces\ModelWithStar; use Illuminate\Database\Eloquent\Model; diff --git a/app/Traits/Controllers/TogglesModelStatus.php b/app/Traits/Controllers/TogglesModelStatus.php index 31e2ab3d..d708886b 100644 --- a/app/Traits/Controllers/TogglesModelStatus.php +++ b/app/Traits/Controllers/TogglesModelStatus.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Traits\Controllers; -use App\Actions\Common\ToggleModelStatus; -use App\Actions\Common\ToggleModelStatusInput; +use App\Cqs\Actions\Common\ToggleModelStatus; +use App\Cqs\Actions\Common\ToggleModelStatusInput; use App\Contracts\Executor; use App\Interfaces\ModelWithStatus; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Architecture/ApplicationTest.php b/tests/Architecture/ApplicationTest.php index ce6c0104..35859915 100644 --- a/tests/Architecture/ApplicationTest.php +++ b/tests/Architecture/ApplicationTest.php @@ -1,6 +1,7 @@ toBeReadonly(); arch('App Actions implement App\Contracts\Action and Inputs implement ActionInput', function (): void { - $path = __DIR__ . '/../../app/Actions'; + $path = __DIR__ . '/../../app/Cqs/Actions'; $files = (new Finder())->files()->in($path)->name('*.php'); foreach ($files as $file) { $subPath = $file->getRelativePathname(); - $className = 'App\\Actions\\' . str_replace(['/', '.php'], ['\\', ''], $subPath); + $className = 'App\\Cqs\\Actions\\' . str_replace(['/', '.php'], ['\\', ''], $subPath); $reflection = new \ReflectionClass($className); if (str_ends_with($className, 'Input')) { @@ -59,12 +60,12 @@ describe('application coding rules', function (): void { }); arch('App Queries implement App\Contracts\Query and Inputs implement QueryInput', function (): void { - $path = __DIR__ . '/../../app/Queries'; + $path = __DIR__ . '/../../app/Cqs/Queries'; $files = (new Finder())->files()->in($path)->name('*.php'); foreach ($files as $file) { $subPath = $file->getRelativePathname(); - $className = 'App\\Queries\\' . str_replace(['/', '.php'], ['\\', ''], $subPath); + $className = 'App\\Cqs\\Queries\\' . str_replace(['/', '.php'], ['\\', ''], $subPath); $reflection = new \ReflectionClass($className); if (str_ends_with($className, 'Input')) { diff --git a/tests/Feature/App/Http/Controllers/Fo/TunnelControllerTest.php b/tests/Feature/App/Http/Controllers/Fo/TunnelControllerTest.php index 10d5a56b..f5d9319f 100644 --- a/tests/Feature/App/Http/Controllers/Fo/TunnelControllerTest.php +++ b/tests/Feature/App/Http/Controllers/Fo/TunnelControllerTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use App\Contracts\Executor; +use App\Cqs\Queries\Orders\GetBasketSummaryQueryOutput; +use App\Cqs\Queries\Orders\GetOrderConfirmationQueryOutput; +use App\Cqs\Queries\Orders\GetPickTimeSlotQueryOutput; use App\Dto\ShopDto; use App\Http\Middleware\CustomerIsEmployed; use App\Http\Middleware\EnsureCustomerEmailIsVerified; @@ -10,9 +13,6 @@ use App\Models\Customer; use App\Models\Order; use App\Models\Page; use App\Models\Shop; -use App\Queries\Orders\GetBasketSummaryQueryOutput; -use App\Queries\Orders\GetOrderConfirmationQueryOutput; -use App\Queries\Orders\GetPickTimeSlotQueryOutput; use Database\Seeders\ContentSeeder; use Domain\Builders\OrderBuilderCompleted; use Domain\Enums\OrderStatus; diff --git a/tests/Feature/App/Http/Requests/Bo/Dashboard/DashboardRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Dashboard/DashboardRequestTest.php index 5debb823..34dcc54c 100644 --- a/tests/Feature/App/Http/Requests/Bo/Dashboard/DashboardRequestTest.php +++ b/tests/Feature/App/Http/Requests/Bo/Dashboard/DashboardRequestTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); +use App\Cqs\Queries\Dashboard\GetBoDashboardQueryInput; use App\Http\Requests\Bo\Dashboard\DashboardRequest; -use App\Queries\Dashboard\GetBoDashboardQueryInput; use Infrastructure\Adapters\Services\AppAdminAuthService; use function Pest\Laravel\mock; diff --git a/tests/Feature/App/Http/Requests/Bo/MassActionRequestTest.php b/tests/Feature/App/Http/Requests/Bo/MassActionRequestTest.php index 7a39a22f..e64bd930 100644 --- a/tests/Feature/App/Http/Requests/Bo/MassActionRequestTest.php +++ b/tests/Feature/App/Http/Requests/Bo/MassActionRequestTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Common\ExecuteMassActionInput; +use App\Cqs\Actions\Common\ExecuteMassActionInput; use App\Enums\MassActionType; use App\Http\Requests\Bo\MassActionRequest; use App\Models\Product; diff --git a/tests/Feature/App/Http/Requests/Bo/Orders/IndexOrdersRequestTest.php b/tests/Feature/App/Http/Requests/Bo/Orders/IndexOrdersRequestTest.php index 6e8254c8..3caa969c 100644 --- a/tests/Feature/App/Http/Requests/Bo/Orders/IndexOrdersRequestTest.php +++ b/tests/Feature/App/Http/Requests/Bo/Orders/IndexOrdersRequestTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); +use App\Cqs\Queries\Orders\GetBoPaginatedOrdersQueryInput; use App\Http\Requests\Bo\Orders\IndexOrdersRequest; -use App\Queries\Orders\GetBoPaginatedOrdersQueryInput; use Domain\Enums\OrderStatus; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/tests/Feature/App/Http/Requests/Fo/Auth/RegisterRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Auth/RegisterRequestTest.php index 930d05d6..c7433c30 100644 --- a/tests/Feature/App/Http/Requests/Fo/Auth/RegisterRequestTest.php +++ b/tests/Feature/App/Http/Requests/Fo/Auth/RegisterRequestTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Customers\RegisterCustomerInput; +use App\Cqs\Actions\Customers\RegisterCustomerInput; use App\Http\Requests\Fo\Auth\RegisterRequest; use Infrastructure\Adapters\Services\AppCustomerAuthService; diff --git a/tests/Feature/App/Http/Requests/Fo/Customer/UpdateInfosRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Customer/UpdateInfosRequestTest.php index df6f6ea2..4c8ccaea 100644 --- a/tests/Feature/App/Http/Requests/Fo/Customer/UpdateInfosRequestTest.php +++ b/tests/Feature/App/Http/Requests/Fo/Customer/UpdateInfosRequestTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Crm\UpdateCustomerInput; +use App\Cqs\Actions\Crm\UpdateCustomerInput; use App\Http\Requests\Fo\Customer\UpdateInfosRequest; use Infrastructure\Adapters\Services\AppCustomerAuthService; diff --git a/tests/Feature/App/Http/Requests/Fo/Orders/ConfirmOrderRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Orders/ConfirmOrderRequestTest.php index f1dcabaf..462d09fb 100644 --- a/tests/Feature/App/Http/Requests/Fo/Orders/ConfirmOrderRequestTest.php +++ b/tests/Feature/App/Http/Requests/Fo/Orders/ConfirmOrderRequestTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Orders\FinalizeOrderInput; +use App\Cqs\Actions\Orders\FinalizeOrderInput; use App\Http\Requests\Fo\Orders\ConfirmOrderRequest; use App\Models\Customer; use Domain\Models\ValueObjects\Entities\ShopperId; diff --git a/tests/Feature/App/Http/Requests/Fo/Orders/PickTimeSlotRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Orders/PickTimeSlotRequestTest.php index 08862a8f..883a70b9 100644 --- a/tests/Feature/App/Http/Requests/Fo/Orders/PickTimeSlotRequestTest.php +++ b/tests/Feature/App/Http/Requests/Fo/Orders/PickTimeSlotRequestTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Orders\ApplyPickTimeSlotInput; +use App\Cqs\Actions\Orders\ApplyPickTimeSlotInput; use App\Http\Requests\Fo\Orders\PickTimeSlotRequest; use App\Models\Customer; use Carbon\CarbonInterface; diff --git a/tests/Feature/App/Http/Requests/Fo/Orders/ValidateSummaryRequestTest.php b/tests/Feature/App/Http/Requests/Fo/Orders/ValidateSummaryRequestTest.php index dd16bb0b..9fa35826 100644 --- a/tests/Feature/App/Http/Requests/Fo/Orders/ValidateSummaryRequestTest.php +++ b/tests/Feature/App/Http/Requests/Fo/Orders/ValidateSummaryRequestTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Orders\InitializeOrderTunnelInput; +use App\Cqs\Actions\Orders\InitializeOrderTunnelInput; use App\Http\Requests\Fo\Orders\ValidateSummaryRequest; use App\Models\Customer; use Domain\Exceptions\OrderTunnel\OrderLimitExceededException; diff --git a/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderPositionTest.php b/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderPositionTest.php index 263bf96b..e9b2d58d 100644 --- a/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderPositionTest.php +++ b/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderPositionTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Common\ChangeModelOrderPosition; -use App\Actions\Common\ChangeModelOrderPositionInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Common\ChangeModelOrderPosition; +use App\Cqs\Actions\Common\ChangeModelOrderPositionInput; use App\Models\Product; use App\Models\Range; use App\Models\Tag; diff --git a/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderTest.php b/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderTest.php index af023f8b..10594ca7 100644 --- a/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderTest.php +++ b/tests/Integration/WithApp/App/Actions/Common/ChangeModelOrderTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Common\ChangeModelOrder; -use App\Actions\Common\ChangeModelOrderInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Common\ChangeModelOrder; +use App\Cqs\Actions\Common\ChangeModelOrderInput; use App\Models\Product; use App\Models\Range; use App\Models\Tag; diff --git a/tests/Integration/WithApp/App/Actions/Common/ExecuteMassActionTest.php b/tests/Integration/WithApp/App/Actions/Common/ExecuteMassActionTest.php index cce33895..7866a664 100644 --- a/tests/Integration/WithApp/App/Actions/Common/ExecuteMassActionTest.php +++ b/tests/Integration/WithApp/App/Actions/Common/ExecuteMassActionTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use App\Actions\Common\ExecuteMassAction; -use App\Actions\Common\ExecuteMassActionInput; +use App\Cqs\Actions\Common\ExecuteMassAction; +use App\Cqs\Actions\Common\ExecuteMassActionInput; use App\Enums\MassActionType; use App\Models\Product; use App\Models\Range; diff --git a/tests/Integration/WithApp/App/Actions/Common/ToggleModelStarTest.php b/tests/Integration/WithApp/App/Actions/Common/ToggleModelStarTest.php index 67680f7a..c779520a 100644 --- a/tests/Integration/WithApp/App/Actions/Common/ToggleModelStarTest.php +++ b/tests/Integration/WithApp/App/Actions/Common/ToggleModelStarTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Common\ToggleModelStar; -use App\Actions\Common\ToggleModelStarInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Common\ToggleModelStar; +use App\Cqs\Actions\Common\ToggleModelStarInput; use App\Models\Product; use App\Models\Range; use Domain\Enums\ProductBrand; diff --git a/tests/Integration/WithApp/App/Actions/Common/ToggleModelStatusTest.php b/tests/Integration/WithApp/App/Actions/Common/ToggleModelStatusTest.php index cbdcac8b..1721e71e 100644 --- a/tests/Integration/WithApp/App/Actions/Common/ToggleModelStatusTest.php +++ b/tests/Integration/WithApp/App/Actions/Common/ToggleModelStatusTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Common\ToggleModelStatus; -use App\Actions\Common\ToggleModelStatusInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Common\ToggleModelStatus; +use App\Cqs\Actions\Common\ToggleModelStatusInput; use App\Models\Tag; describe('ToggleModelStatus action', function (): void { diff --git a/tests/Integration/WithApp/App/Actions/Customers/RegisterCustomerTest.php b/tests/Integration/WithApp/App/Actions/Customers/RegisterCustomerTest.php index 241f65bd..c421f910 100644 --- a/tests/Integration/WithApp/App/Actions/Customers/RegisterCustomerTest.php +++ b/tests/Integration/WithApp/App/Actions/Customers/RegisterCustomerTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -use App\Actions\Customers\RegisterCustomer; -use App\Actions\Customers\RegisterCustomerInput; use App\Contracts\ActionInput; use App\Contracts\Repositories\EmployeeRepository; +use App\Cqs\Actions\Customers\RegisterCustomer; +use App\Cqs\Actions\Customers\RegisterCustomerInput; use App\Exceptions\Crm\CrmCustomerExistsException; use App\Exceptions\CrmServiceException; use App\Models\Customer; diff --git a/tests/Integration/WithApp/App/Actions/Discounts/CreateDiscountTest.php b/tests/Integration/WithApp/App/Actions/Discounts/CreateDiscountTest.php index 81d37d46..737057fd 100644 --- a/tests/Integration/WithApp/App/Actions/Discounts/CreateDiscountTest.php +++ b/tests/Integration/WithApp/App/Actions/Discounts/CreateDiscountTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Actions\Discounts; +namespace Tests\Integration\WithApp\App\Cqs\Actions\Discounts; -use App\Actions\Discounts\CreateDiscount; -use App\Actions\Discounts\CreateDiscountInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Discounts\CreateDiscount; +use App\Cqs\Actions\Discounts\CreateDiscountInput; use App\Models\Discount; use App\Models\Product; use App\Models\Range; diff --git a/tests/Integration/WithApp/App/Actions/Discounts/DeleteDiscountTest.php b/tests/Integration/WithApp/App/Actions/Discounts/DeleteDiscountTest.php index d72ef9a6..edc17b93 100644 --- a/tests/Integration/WithApp/App/Actions/Discounts/DeleteDiscountTest.php +++ b/tests/Integration/WithApp/App/Actions/Discounts/DeleteDiscountTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Actions\Discounts; +namespace Tests\Integration\WithApp\App\Cqs\Actions\Discounts; -use App\Actions\Discounts\DeleteDiscount; -use App\Actions\Discounts\DeleteDiscountInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Discounts\DeleteDiscount; +use App\Cqs\Actions\Discounts\DeleteDiscountInput; use App\Models\Discount; use App\Models\Product; use App\Models\Range; diff --git a/tests/Integration/WithApp/App/Actions/Discounts/UpdateDiscountTest.php b/tests/Integration/WithApp/App/Actions/Discounts/UpdateDiscountTest.php index 731ff4b2..dadc639f 100644 --- a/tests/Integration/WithApp/App/Actions/Discounts/UpdateDiscountTest.php +++ b/tests/Integration/WithApp/App/Actions/Discounts/UpdateDiscountTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Actions\Discounts; +namespace Tests\Integration\WithApp\App\Cqs\Actions\Discounts; -use App\Actions\Discounts\UpdateDiscount; -use App\Actions\Discounts\UpdateDiscountInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Discounts\UpdateDiscount; +use App\Cqs\Actions\Discounts\UpdateDiscountInput; use App\Models\Discount; use App\Models\Product; use App\Models\Range; diff --git a/tests/Integration/WithApp/App/Actions/Faqs/CreateFaqTest.php b/tests/Integration/WithApp/App/Actions/Faqs/CreateFaqTest.php index e676edbc..bec06a46 100644 --- a/tests/Integration/WithApp/App/Actions/Faqs/CreateFaqTest.php +++ b/tests/Integration/WithApp/App/Actions/Faqs/CreateFaqTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Faqs\CreateFaq; -use App\Actions\Faqs\CreateFaqInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Faqs\CreateFaq; +use App\Cqs\Actions\Faqs\CreateFaqInput; use App\Models\Faq; describe('CreateFaq action', function (): void { diff --git a/tests/Integration/WithApp/App/Actions/Faqs/DeleteFaqTest.php b/tests/Integration/WithApp/App/Actions/Faqs/DeleteFaqTest.php index 43bbca79..90cde2bf 100644 --- a/tests/Integration/WithApp/App/Actions/Faqs/DeleteFaqTest.php +++ b/tests/Integration/WithApp/App/Actions/Faqs/DeleteFaqTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Faqs\DeleteFaq; -use App\Actions\Faqs\DeleteFaqInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Faqs\DeleteFaq; +use App\Cqs\Actions\Faqs\DeleteFaqInput; use App\Models\Faq; describe('DeleteFaq action', function (): void { diff --git a/tests/Integration/WithApp/App/Actions/Faqs/UpdateFaqTest.php b/tests/Integration/WithApp/App/Actions/Faqs/UpdateFaqTest.php index ead8286a..a305aef9 100644 --- a/tests/Integration/WithApp/App/Actions/Faqs/UpdateFaqTest.php +++ b/tests/Integration/WithApp/App/Actions/Faqs/UpdateFaqTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Faqs\UpdateFaq; -use App\Actions\Faqs\UpdateFaqInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Faqs\UpdateFaq; +use App\Cqs\Actions\Faqs\UpdateFaqInput; use App\Models\Faq; describe('UpdateFaq action', function (): void { diff --git a/tests/Integration/WithApp/App/Actions/Pages/UpdatePageTest.php b/tests/Integration/WithApp/App/Actions/Pages/UpdatePageTest.php index 06dd69f7..fb1890a4 100644 --- a/tests/Integration/WithApp/App/Actions/Pages/UpdatePageTest.php +++ b/tests/Integration/WithApp/App/Actions/Pages/UpdatePageTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Pages\UpdatePage; -use App\Actions\Pages\UpdatePageInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Pages\UpdatePage; +use App\Cqs\Actions\Pages\UpdatePageInput; use App\Models\Page; use Domain\Enums\StaticPageSlug; use Domain\Models\ValueObjects\SeoMetadata; diff --git a/tests/Integration/WithApp/App/Actions/PickupExceptions/CreatePickupExceptionTest.php b/tests/Integration/WithApp/App/Actions/PickupExceptions/CreatePickupExceptionTest.php index 7c299d08..af1f77c0 100644 --- a/tests/Integration/WithApp/App/Actions/PickupExceptions/CreatePickupExceptionTest.php +++ b/tests/Integration/WithApp/App/Actions/PickupExceptions/CreatePickupExceptionTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\PickupExceptions\CreatePickupException; -use App\Actions\PickupExceptions\CreatePickupExceptionInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\PickupExceptions\CreatePickupException; +use App\Cqs\Actions\PickupExceptions\CreatePickupExceptionInput; use App\Models\PickupException; use Domain\Enums\RepeatFrequency; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/PickupExceptions/DeletePickupExceptionTest.php b/tests/Integration/WithApp/App/Actions/PickupExceptions/DeletePickupExceptionTest.php index 8dc9fd5f..e04f2607 100644 --- a/tests/Integration/WithApp/App/Actions/PickupExceptions/DeletePickupExceptionTest.php +++ b/tests/Integration/WithApp/App/Actions/PickupExceptions/DeletePickupExceptionTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\PickupExceptions\DeletePickupException; -use App\Actions\PickupExceptions\DeletePickupExceptionInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\PickupExceptions\DeletePickupException; +use App\Cqs\Actions\PickupExceptions\DeletePickupExceptionInput; use App\Models\PickupException; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/PickupExceptions/UpdatePickupExceptionTest.php b/tests/Integration/WithApp/App/Actions/PickupExceptions/UpdatePickupExceptionTest.php index e6b0f31d..709f022d 100644 --- a/tests/Integration/WithApp/App/Actions/PickupExceptions/UpdatePickupExceptionTest.php +++ b/tests/Integration/WithApp/App/Actions/PickupExceptions/UpdatePickupExceptionTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\PickupExceptions\UpdatePickupException; -use App\Actions\PickupExceptions\UpdatePickupExceptionInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\PickupExceptions\UpdatePickupException; +use App\Cqs\Actions\PickupExceptions\UpdatePickupExceptionInput; use App\Models\PickupException; use Domain\Enums\RepeatFrequency; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/ProductIncos/AssociateProductIncoTest.php b/tests/Integration/WithApp/App/Actions/ProductIncos/AssociateProductIncoTest.php index cef767a5..d080856a 100644 --- a/tests/Integration/WithApp/App/Actions/ProductIncos/AssociateProductIncoTest.php +++ b/tests/Integration/WithApp/App/Actions/ProductIncos/AssociateProductIncoTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\ProductIncos\AssociateProductInco; -use App\Actions\ProductIncos\AssociateProductIncoInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\ProductIncos\AssociateProductInco; +use App\Cqs\Actions\ProductIncos\AssociateProductIncoInput; use App\Dto\ArcadiaIncoDataDto; use App\Models\Product; use App\Models\ProductInco; diff --git a/tests/Integration/WithApp/App/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApiTest.php b/tests/Integration/WithApp/App/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApiTest.php index ba72ed2c..c139e76f 100644 --- a/tests/Integration/WithApp/App/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApiTest.php +++ b/tests/Integration/WithApp/App/Actions/ProductIncos/SynchronizeProductIncosWithArcadiaApiTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use App\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; use App\Contracts\ActionInputEmpty; +use App\Cqs\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; use App\Dto\ArcadiaIncoDataDto; use App\Models\Product; use App\Models\ProductInco; diff --git a/tests/Integration/WithApp/App/Actions/Ranges/CreateRangeTest.php b/tests/Integration/WithApp/App/Actions/Ranges/CreateRangeTest.php index 7d2064ea..31aadc91 100644 --- a/tests/Integration/WithApp/App/Actions/Ranges/CreateRangeTest.php +++ b/tests/Integration/WithApp/App/Actions/Ranges/CreateRangeTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Ranges\CreateRange; -use App\Actions\Ranges\CreateRangeInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Ranges\CreateRange; +use App\Cqs\Actions\Ranges\CreateRangeInput; use App\Models\Range; use Domain\Models\ValueObjects\PictureMetadata; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/Ranges/DeleteRangeTest.php b/tests/Integration/WithApp/App/Actions/Ranges/DeleteRangeTest.php index 6c433f09..19ae58dd 100644 --- a/tests/Integration/WithApp/App/Actions/Ranges/DeleteRangeTest.php +++ b/tests/Integration/WithApp/App/Actions/Ranges/DeleteRangeTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Ranges\DeleteRange; -use App\Actions\Ranges\DeleteRangeInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Ranges\DeleteRange; +use App\Cqs\Actions\Ranges\DeleteRangeInput; use App\Models\Range; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/Ranges/UpdateRangeTest.php b/tests/Integration/WithApp/App/Actions/Ranges/UpdateRangeTest.php index a0dfcdfd..326ef02c 100644 --- a/tests/Integration/WithApp/App/Actions/Ranges/UpdateRangeTest.php +++ b/tests/Integration/WithApp/App/Actions/Ranges/UpdateRangeTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Ranges\UpdateRange; -use App\Actions\Ranges\UpdateRangeInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Ranges\UpdateRange; +use App\Cqs\Actions\Ranges\UpdateRangeInput; use App\Models\Range; use Domain\Models\ValueObjects\PictureMetadata; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/Settings/UpdateSettingsTest.php b/tests/Integration/WithApp/App/Actions/Settings/UpdateSettingsTest.php index 5c1df5c5..e279a8a8 100644 --- a/tests/Integration/WithApp/App/Actions/Settings/UpdateSettingsTest.php +++ b/tests/Integration/WithApp/App/Actions/Settings/UpdateSettingsTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use App\Actions\Settings\UpdateSettings; -use App\Actions\Settings\UpdateSettingsInput; +use App\Cqs\Actions\Settings\UpdateSettings; +use App\Cqs\Actions\Settings\UpdateSettingsInput; use App\Models\Setting; use Domain\Models\ValueObjects\ShopperSiteCode; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/Shops/CreateShopTest.php b/tests/Integration/WithApp/App/Actions/Shops/CreateShopTest.php index d8c6cef3..faf7452a 100644 --- a/tests/Integration/WithApp/App/Actions/Shops/CreateShopTest.php +++ b/tests/Integration/WithApp/App/Actions/Shops/CreateShopTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Shops\CreateShop; -use App\Actions\Shops\CreateShopInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Shops\CreateShop; +use App\Cqs\Actions\Shops\CreateShopInput; use App\Models\Shop; use Domain\Models\ValueObjects\Coordinates; use Domain\Models\ValueObjects\PhoneNumber; diff --git a/tests/Integration/WithApp/App/Actions/Shops/DeleteShopTest.php b/tests/Integration/WithApp/App/Actions/Shops/DeleteShopTest.php index 9eb38171..0185c097 100644 --- a/tests/Integration/WithApp/App/Actions/Shops/DeleteShopTest.php +++ b/tests/Integration/WithApp/App/Actions/Shops/DeleteShopTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Shops\DeleteShop; -use App\Actions\Shops\DeleteShopInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Shops\DeleteShop; +use App\Cqs\Actions\Shops\DeleteShopInput; use App\Models\Shop; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/Shops/UpdateShopPickupExceptionsTest.php b/tests/Integration/WithApp/App/Actions/Shops/UpdateShopPickupExceptionsTest.php index df17c93e..c4333ceb 100644 --- a/tests/Integration/WithApp/App/Actions/Shops/UpdateShopPickupExceptionsTest.php +++ b/tests/Integration/WithApp/App/Actions/Shops/UpdateShopPickupExceptionsTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Shops\UpdateShopPickupExceptions; -use App\Actions\Shops\UpdateShopPickupExceptionsInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Shops\UpdateShopPickupExceptions; +use App\Cqs\Actions\Shops\UpdateShopPickupExceptionsInput; use App\Models\PickupException; use App\Models\Shop; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Actions/Shops/UpdateShopTest.php b/tests/Integration/WithApp/App/Actions/Shops/UpdateShopTest.php index 23311324..dbb9ab51 100644 --- a/tests/Integration/WithApp/App/Actions/Shops/UpdateShopTest.php +++ b/tests/Integration/WithApp/App/Actions/Shops/UpdateShopTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Shops\UpdateShop; -use App\Actions\Shops\UpdateShopInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Shops\UpdateShop; +use App\Cqs\Actions\Shops\UpdateShopInput; use App\Models\Shop; use Domain\Models\ValueObjects\Coordinates; use Domain\Models\ValueObjects\PhoneNumber; diff --git a/tests/Integration/WithApp/App/Actions/Slides/CreateSlideTest.php b/tests/Integration/WithApp/App/Actions/Slides/CreateSlideTest.php index d2b0f2c9..0ae8ff06 100644 --- a/tests/Integration/WithApp/App/Actions/Slides/CreateSlideTest.php +++ b/tests/Integration/WithApp/App/Actions/Slides/CreateSlideTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Slides\CreateSlide; -use App\Actions\Slides\CreateSlideInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Slides\CreateSlide; +use App\Cqs\Actions\Slides\CreateSlideInput; use App\Models\Slide; use Domain\Models\ValueObjects\DatePeriod; diff --git a/tests/Integration/WithApp/App/Actions/Slides/DeleteSlideTest.php b/tests/Integration/WithApp/App/Actions/Slides/DeleteSlideTest.php index f62eee68..a9e22ebc 100644 --- a/tests/Integration/WithApp/App/Actions/Slides/DeleteSlideTest.php +++ b/tests/Integration/WithApp/App/Actions/Slides/DeleteSlideTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Slides\DeleteSlide; -use App\Actions\Slides\DeleteSlideInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Slides\DeleteSlide; +use App\Cqs\Actions\Slides\DeleteSlideInput; use App\Models\Slide; describe('DeleteSlide action', function (): void { diff --git a/tests/Integration/WithApp/App/Actions/Slides/UpdateSlideTest.php b/tests/Integration/WithApp/App/Actions/Slides/UpdateSlideTest.php index 254f666c..cd8e3676 100644 --- a/tests/Integration/WithApp/App/Actions/Slides/UpdateSlideTest.php +++ b/tests/Integration/WithApp/App/Actions/Slides/UpdateSlideTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Slides\UpdateSlide; -use App\Actions\Slides\UpdateSlideInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Slides\UpdateSlide; +use App\Cqs\Actions\Slides\UpdateSlideInput; use App\Models\Slide; use Domain\Models\ValueObjects\DatePeriod; diff --git a/tests/Integration/WithApp/App/Actions/Tags/CreateTagTest.php b/tests/Integration/WithApp/App/Actions/Tags/CreateTagTest.php index 81f6d107..0ed3c304 100644 --- a/tests/Integration/WithApp/App/Actions/Tags/CreateTagTest.php +++ b/tests/Integration/WithApp/App/Actions/Tags/CreateTagTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Tags\CreateTag; -use App\Actions\Tags\CreateTagInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Tags\CreateTag; +use App\Cqs\Actions\Tags\CreateTagInput; use App\Models\Tag; describe('CreateTag action', function (): void { diff --git a/tests/Integration/WithApp/App/Actions/Tags/DeleteTagTest.php b/tests/Integration/WithApp/App/Actions/Tags/DeleteTagTest.php index 480ecc87..e4ff9530 100644 --- a/tests/Integration/WithApp/App/Actions/Tags/DeleteTagTest.php +++ b/tests/Integration/WithApp/App/Actions/Tags/DeleteTagTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Tags\DeleteTag; -use App\Actions\Tags\DeleteTagInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Tags\DeleteTag; +use App\Cqs\Actions\Tags\DeleteTagInput; use App\Models\Tag; describe('DeleteTag action', function (): void { diff --git a/tests/Integration/WithApp/App/Actions/Tags/UpdateTagTest.php b/tests/Integration/WithApp/App/Actions/Tags/UpdateTagTest.php index 78c99082..827b41af 100644 --- a/tests/Integration/WithApp/App/Actions/Tags/UpdateTagTest.php +++ b/tests/Integration/WithApp/App/Actions/Tags/UpdateTagTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Actions\Tags\UpdateTag; -use App\Actions\Tags\UpdateTagInput; use App\Contracts\ActionInput; +use App\Cqs\Actions\Tags\UpdateTag; +use App\Cqs\Actions\Tags\UpdateTagInput; use App\Models\Tag; describe('UpdateTag action', function (): void { diff --git a/tests/Integration/WithApp/App/Queries/Customers/GetCustomerByEmailQueryTest.php b/tests/Integration/WithApp/App/Queries/Customers/GetCustomerByEmailQueryTest.php index 7e41426a..23a4c25f 100644 --- a/tests/Integration/WithApp/App/Queries/Customers/GetCustomerByEmailQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Customers/GetCustomerByEmailQueryTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); +use App\Cqs\Queries\Customers\GetCustomerByEmailQuery; +use App\Cqs\Queries\Customers\GetCustomerByEmailQueryInput; use App\Models\Customer; -use App\Queries\Customers\GetCustomerByEmailQuery; -use App\Queries\Customers\GetCustomerByEmailQueryInput; use Domain\Models\ValueObjects\Email; use Domain\Models\ValueObjects\Entities\ShopperId; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Queries/Discounts/GetDiscountFormDataQueryTest.php b/tests/Integration/WithApp/App/Queries/Discounts/GetDiscountFormDataQueryTest.php index 2813618c..c990c405 100644 --- a/tests/Integration/WithApp/App/Queries/Discounts/GetDiscountFormDataQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Discounts/GetDiscountFormDataQueryTest.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Queries\Discounts; +namespace Tests\Integration\WithApp\App\Cqs\Queries\Discounts; use App\Contracts\QueryInput; +use App\Cqs\Queries\Discounts\GetDiscountFormDataQuery; +use App\Cqs\Queries\Discounts\GetDiscountFormDataQueryInput; use App\Dto\DiscountDto; use App\Dto\DiscountProductDto; use App\Models\Discount; use App\Models\Product; use App\Models\Range; -use App\Queries\Discounts\GetDiscountFormDataQuery; -use App\Queries\Discounts\GetDiscountFormDataQueryInput; use Domain\Enums\DiscountType; use Domain\Enums\ProductBrand; use Domain\Enums\SellUnit; diff --git a/tests/Integration/WithApp/App/Queries/Discounts/GetPaginatedDiscountsQueryTest.php b/tests/Integration/WithApp/App/Queries/Discounts/GetPaginatedDiscountsQueryTest.php index 139cf3bf..0ee7988e 100644 --- a/tests/Integration/WithApp/App/Queries/Discounts/GetPaginatedDiscountsQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Discounts/GetPaginatedDiscountsQueryTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Queries\Discounts; +namespace Tests\Integration\WithApp\App\Cqs\Queries\Discounts; use App\Contracts\QueryInput; +use App\Cqs\Queries\Discounts\GetPaginatedDiscountsQuery; +use App\Cqs\Queries\Discounts\GetPaginatedDiscountsQueryInput; use App\Dto\DiscountDto; use App\Models\Discount; -use App\Queries\Discounts\GetPaginatedDiscountsQuery; -use App\Queries\Discounts\GetPaginatedDiscountsQueryInput; use App\Services\DataTableService; use Domain\Enums\DiscountType; use Domain\Models\ValueObjects\DiscountValue; diff --git a/tests/Integration/WithApp/App/Queries/Faqs/GetFaqsQueryTest.php b/tests/Integration/WithApp/App/Queries/Faqs/GetFaqsQueryTest.php index 65273798..3e02f970 100644 --- a/tests/Integration/WithApp/App/Queries/Faqs/GetFaqsQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Faqs/GetFaqsQueryTest.php @@ -3,9 +3,9 @@ declare(strict_types=1); use App\Contracts\QueryInputEmpty; +use App\Cqs\Queries\Faqs\GetFaqsQuery; use App\Dto\FaqDto; use App\Models\Faq; -use App\Queries\Faqs\GetFaqsQuery; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Collection; diff --git a/tests/Integration/WithApp/App/Queries/Faqs/GetPaginatedFaqsQueryTest.php b/tests/Integration/WithApp/App/Queries/Faqs/GetPaginatedFaqsQueryTest.php index c191c6d2..23e3707b 100644 --- a/tests/Integration/WithApp/App/Queries/Faqs/GetPaginatedFaqsQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Faqs/GetPaginatedFaqsQueryTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use App\Cqs\Queries\Faqs\GetPaginatedFaqsQuery; +use App\Cqs\Queries\Faqs\GetPaginatedFaqsQueryInput; use App\Dto\FaqDto; use App\Models\Faq; -use App\Queries\Faqs\GetPaginatedFaqsQuery; -use App\Queries\Faqs\GetPaginatedFaqsQueryInput; use Shared\Pagination\PageNumber; use Shared\Pagination\PageSize; use Shared\Pagination\Pagination; diff --git a/tests/Integration/WithApp/App/Queries/Orders/GetTunnelOrderConfirmedQueryTest.php b/tests/Integration/WithApp/App/Queries/Orders/GetTunnelOrderConfirmedQueryTest.php index 827b5d74..33c1fb23 100644 --- a/tests/Integration/WithApp/App/Queries/Orders/GetTunnelOrderConfirmedQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Orders/GetTunnelOrderConfirmedQueryTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Queries\Orders; +namespace Tests\Integration\WithApp\App\Cqs\Queries\Orders; +use App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQuery; +use App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryInput; +use App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryOutput; use App\Dto\OrderDto; use App\Dto\ShopDto; use App\Models\Order; use App\Models\Shop; -use App\Queries\Orders\GetTunnelOrderConfirmedQuery; -use App\Queries\Orders\GetTunnelOrderConfirmedQueryInput; -use App\Queries\Orders\GetTunnelOrderConfirmedQueryOutput; use Domain\Enums\OrderStatus; use Domain\Enums\OrderTunnelStep; use Domain\Models\ValueObjects\DeliveryAddress; diff --git a/tests/Integration/WithApp/App/Queries/Pages/GetPageBySlugQueryTest.php b/tests/Integration/WithApp/App/Queries/Pages/GetPageBySlugQueryTest.php index bac78717..598a16fc 100644 --- a/tests/Integration/WithApp/App/Queries/Pages/GetPageBySlugQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Pages/GetPageBySlugQueryTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use App\Cqs\Queries\Pages\GetPageQuery; +use App\Cqs\Queries\Pages\GetPageQueryInput; use App\Dto\PageDto; use App\Models\Page; -use App\Queries\Pages\GetPageQuery; -use App\Queries\Pages\GetPageQueryInput; use Domain\Enums\StaticPageSlug; use Domain\Models\ValueObjects\Slug; use Illuminate\Database\Eloquent\ModelNotFoundException; diff --git a/tests/Integration/WithApp/App/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryTest.php b/tests/Integration/WithApp/App/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryTest.php index 66104389..561ec7c1 100644 --- a/tests/Integration/WithApp/App/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/PickupExceptions/GetPaginatedPickupExceptionsQueryTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQuery; +use App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput; use App\Dto\PickupExceptionDto; use App\Models\PickupException; -use App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQuery; -use App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput; use App\Services\DataTableService; use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/Integration/WithApp/App/Queries/Products/GetBoPaginatedProductsQueryTest.php b/tests/Integration/WithApp/App/Queries/Products/GetBoPaginatedProductsQueryTest.php index 6fd5ecd3..1456943c 100644 --- a/tests/Integration/WithApp/App/Queries/Products/GetBoPaginatedProductsQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Products/GetBoPaginatedProductsQueryTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Queries\Products; +namespace Tests\Integration\WithApp\App\Cqs\Queries\Products; +use App\Cqs\Queries\Products\GetBoPaginatedProductsQuery; +use App\Cqs\Queries\Products\GetBoPaginatedProductsQueryInput; use App\Models\Discount; use App\Models\Product; use App\Models\Range; -use App\Queries\Products\GetBoPaginatedProductsQuery; -use App\Queries\Products\GetBoPaginatedProductsQueryInput; use Domain\Enums\DiscountType; use Domain\Enums\ProductBrand; use Domain\Enums\SellUnit; diff --git a/tests/Integration/WithApp/App/Queries/Products/GetProductFormDataQueryTest.php b/tests/Integration/WithApp/App/Queries/Products/GetProductFormDataQueryTest.php index 9d385a11..4ff512c3 100644 --- a/tests/Integration/WithApp/App/Queries/Products/GetProductFormDataQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Products/GetProductFormDataQueryTest.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Queries\Products; +namespace Tests\Integration\WithApp\App\Cqs\Queries\Products; use App\Contracts\QueryInput; +use App\Cqs\Queries\Products\GetProductFormDataQuery; +use App\Cqs\Queries\Products\GetProductFormDataQueryInput; use App\Dto\ProductDto; use App\Dto\ProductFormDataDto; use App\Models\Product; use App\Models\Range; use App\Models\Tag; -use App\Queries\Products\GetProductFormDataQuery; -use App\Queries\Products\GetProductFormDataQueryInput; use Domain\Enums\ProductBrand; use Domain\Enums\SellUnit; use Domain\Enums\TaxRate; diff --git a/tests/Integration/WithApp/App/Queries/Ranges/GetPaginatedRangesQueryTest.php b/tests/Integration/WithApp/App/Queries/Ranges/GetPaginatedRangesQueryTest.php index 0e501014..1adefb8a 100644 --- a/tests/Integration/WithApp/App/Queries/Ranges/GetPaginatedRangesQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Ranges/GetPaginatedRangesQueryTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use App\Cqs\Queries\Ranges\GetPaginatedRangesQuery; +use App\Cqs\Queries\Ranges\GetPaginatedRangesQueryInput; use App\Dto\RangeDto; use App\Models\Range; -use App\Queries\Ranges\GetPaginatedRangesQuery; -use App\Queries\Ranges\GetPaginatedRangesQueryInput; use App\Services\DataTableService; use Illuminate\Foundation\Testing\RefreshDatabase; use Shared\Pagination\PageNumber; diff --git a/tests/Integration/WithApp/App/Queries/Settings/GetSettingsQueryTest.php b/tests/Integration/WithApp/App/Queries/Settings/GetSettingsQueryTest.php index 82ec5574..f762a335 100644 --- a/tests/Integration/WithApp/App/Queries/Settings/GetSettingsQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Settings/GetSettingsQueryTest.php @@ -3,9 +3,9 @@ declare(strict_types=1); use App\Contracts\QueryInputEmpty; +use App\Cqs\Queries\Settings\GetSettingsQuery; use App\Dto\SettingDto; use App\Models\Setting; -use App\Queries\Settings\GetSettingsQuery; use Illuminate\Foundation\Testing\RefreshDatabase; uses(RefreshDatabase::class); diff --git a/tests/Integration/WithApp/App/Queries/Shops/GetPaginatedShopsQueryTest.php b/tests/Integration/WithApp/App/Queries/Shops/GetPaginatedShopsQueryTest.php index e7025210..2c68b2b5 100644 --- a/tests/Integration/WithApp/App/Queries/Shops/GetPaginatedShopsQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Shops/GetPaginatedShopsQueryTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); +use App\Cqs\Queries\Shops\GetPaginatedShopsQuery; +use App\Cqs\Queries\Shops\GetPaginatedShopsQueryInput; +use App\Cqs\Queries\Shops\GetPaginatedShopsQueryOutput; use App\Dto\PickupExceptionDto; use App\Dto\ShopDto; use App\Models\PickupException; use App\Models\Shop; -use App\Queries\Shops\GetPaginatedShopsQuery; -use App\Queries\Shops\GetPaginatedShopsQueryInput; -use App\Queries\Shops\GetPaginatedShopsQueryOutput; use App\Services\DataTableService; use Illuminate\Foundation\Testing\RefreshDatabase; use Shared\Pagination\PageNumber; diff --git a/tests/Integration/WithApp/App/Queries/Shops/GetShopPickupExceptionsQueryTest.php b/tests/Integration/WithApp/App/Queries/Shops/GetShopPickupExceptionsQueryTest.php index b5b89aa1..0ec5838e 100644 --- a/tests/Integration/WithApp/App/Queries/Shops/GetShopPickupExceptionsQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Shops/GetShopPickupExceptionsQueryTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); +use App\Cqs\Queries\Shops\GetShopPickupExceptionsQuery; +use App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryInput; +use App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryOutput; use App\Dto\ShopDto; use App\Models\Shop; -use App\Queries\Shops\GetShopPickupExceptionsQuery; -use App\Queries\Shops\GetShopPickupExceptionsQueryInput; -use App\Queries\Shops\GetShopPickupExceptionsQueryOutput; use Illuminate\Foundation\Testing\RefreshDatabase; uses(RefreshDatabase::class); diff --git a/tests/Integration/WithApp/App/Queries/Shops/GetShopQueryTest.php b/tests/Integration/WithApp/App/Queries/Shops/GetShopQueryTest.php index e84cc5d0..8983d26c 100644 --- a/tests/Integration/WithApp/App/Queries/Shops/GetShopQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Shops/GetShopQueryTest.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Tests\Integration\WithApp\App\Queries\Shops; +namespace Tests\Integration\WithApp\App\Cqs\Queries\Shops; use App\Contracts\QueryInput; +use App\Cqs\Queries\Shops\GetShopQuery; +use App\Cqs\Queries\Shops\GetShopQueryInput; use App\Dto\ShopDto; use App\Models\PickupException; use App\Models\Shop; -use App\Queries\Shops\GetShopQuery; -use App\Queries\Shops\GetShopQueryInput; use Carbon\Carbon; use Domain\Enums\RepeatFrequency; use Illuminate\Database\Eloquent\ModelNotFoundException; diff --git a/tests/Integration/WithApp/App/Queries/Slides/GetPaginatedSlidesQueryTest.php b/tests/Integration/WithApp/App/Queries/Slides/GetPaginatedSlidesQueryTest.php index bf5bfdde..1a21db33 100644 --- a/tests/Integration/WithApp/App/Queries/Slides/GetPaginatedSlidesQueryTest.php +++ b/tests/Integration/WithApp/App/Queries/Slides/GetPaginatedSlidesQueryTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use App\Cqs\Queries\Slides\GetPaginatedSlidesQuery; +use App\Cqs\Queries\Slides\GetPaginatedSlidesQueryInput; use App\Dto\SlideDto; use App\Models\Slide; -use App\Queries\Slides\GetPaginatedSlidesQuery; -use App\Queries\Slides\GetPaginatedSlidesQueryInput; use Illuminate\Support\Facades\Date; use Shared\Pagination\PageNumber; use Shared\Pagination\PageSize; diff --git a/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php b/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php index f608434d..10f21b3b 100644 --- a/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php +++ b/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); +use App\Cqs\Queries\Settings\GetSettingsQuery; use App\Models\Setting; -use App\Queries\Settings\GetSettingsQuery; use App\Services\ArcadiaEmployee; use App\Services\ArcadiaEmployeeService; use App\Services\CodeGenerationService; diff --git a/tests/Pest.php b/tests/Pest.php index b27afdfe..579b6d24 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -10,9 +10,9 @@ use Tests\TestCase as LaravelTestCase; BypassFinals::enable(bypassReadOnly: false, bypassFinal: true); BypassFinals::denyPaths([ - '*/app/Actions/*', + '*/app/Cqs/Actions/*', '*/app/Dto/*', - '*/app/Queries/*', + '*/app/Cqs/Queries/*', '*/domain/Models/*', '*/shared/DDD/*', ]); diff --git a/tests/Unit/App/Actions/Common/ChangeModelOrderInputTest.php b/tests/Unit/App/Actions/Common/ChangeModelOrderInputTest.php index 529b7b61..2e32b182 100644 --- a/tests/Unit/App/Actions/Common/ChangeModelOrderInputTest.php +++ b/tests/Unit/App/Actions/Common/ChangeModelOrderInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Common\ChangeModelOrderInput; +use App\Cqs\Actions\Common\ChangeModelOrderInput; use App\Interfaces\ModelWithOrder; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Unit/App/Actions/Common/ChangeModelOrderPositionInputTest.php b/tests/Unit/App/Actions/Common/ChangeModelOrderPositionInputTest.php index ed3aadf2..4a681f65 100644 --- a/tests/Unit/App/Actions/Common/ChangeModelOrderPositionInputTest.php +++ b/tests/Unit/App/Actions/Common/ChangeModelOrderPositionInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Common\ChangeModelOrderPositionInput; +use App\Cqs\Actions\Common\ChangeModelOrderPositionInput; use App\Interfaces\ModelWithOrder; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Unit/App/Actions/Common/ExecuteMassActionInputTest.php b/tests/Unit/App/Actions/Common/ExecuteMassActionInputTest.php index f5dab1ab..cb1a478d 100644 --- a/tests/Unit/App/Actions/Common/ExecuteMassActionInputTest.php +++ b/tests/Unit/App/Actions/Common/ExecuteMassActionInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Common\ExecuteMassActionInput; +use App\Cqs\Actions\Common\ExecuteMassActionInput; use App\Enums\MassActionType; use App\Models\Product; diff --git a/tests/Unit/App/Actions/Common/ToggleModelStarInputTest.php b/tests/Unit/App/Actions/Common/ToggleModelStarInputTest.php index 5bfdc681..9b30791f 100644 --- a/tests/Unit/App/Actions/Common/ToggleModelStarInputTest.php +++ b/tests/Unit/App/Actions/Common/ToggleModelStarInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Common\ToggleModelStarInput; +use App\Cqs\Actions\Common\ToggleModelStarInput; use App\Interfaces\ModelWithStar; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Unit/App/Actions/Common/ToggleModelStatusInputTest.php b/tests/Unit/App/Actions/Common/ToggleModelStatusInputTest.php index c7535aff..171e57ec 100644 --- a/tests/Unit/App/Actions/Common/ToggleModelStatusInputTest.php +++ b/tests/Unit/App/Actions/Common/ToggleModelStatusInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Common\ToggleModelStatusInput; +use App\Cqs\Actions\Common\ToggleModelStatusInput; use App\Interfaces\ModelWithStatus; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Unit/App/Actions/Customers/RegisterCustomerInputTest.php b/tests/Unit/App/Actions/Customers/RegisterCustomerInputTest.php index b031465a..ece9b841 100644 --- a/tests/Unit/App/Actions/Customers/RegisterCustomerInputTest.php +++ b/tests/Unit/App/Actions/Customers/RegisterCustomerInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Customers\RegisterCustomerInput; +use App\Cqs\Actions\Customers\RegisterCustomerInput; use Domain\Models\ValueObjects\Code; use Domain\Models\ValueObjects\Email; use Domain\Models\ValueObjects\Matricule; diff --git a/tests/Unit/App/Actions/Discounts/CreateDiscountInputTest.php b/tests/Unit/App/Actions/Discounts/CreateDiscountInputTest.php index 6456490b..12e40481 100644 --- a/tests/Unit/App/Actions/Discounts/CreateDiscountInputTest.php +++ b/tests/Unit/App/Actions/Discounts/CreateDiscountInputTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Tests\Unit\App\Actions\Discounts; +namespace Tests\Unit\App\Cqs\Actions\Discounts; -use App\Actions\Discounts\CreateDiscountInput; +use App\Cqs\Actions\Discounts\CreateDiscountInput; use Domain\Enums\DiscountType; use Domain\Models\ValueObjects\DatePeriod; use Domain\Models\ValueObjects\DiscountValue; diff --git a/tests/Unit/App/Actions/Discounts/DeleteDiscountInputTest.php b/tests/Unit/App/Actions/Discounts/DeleteDiscountInputTest.php index a7572f0a..d51fb269 100644 --- a/tests/Unit/App/Actions/Discounts/DeleteDiscountInputTest.php +++ b/tests/Unit/App/Actions/Discounts/DeleteDiscountInputTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Tests\Unit\App\Actions\Discounts; +namespace Tests\Unit\App\Cqs\Actions\Discounts; -use App\Actions\Discounts\DeleteDiscountInput; +use App\Cqs\Actions\Discounts\DeleteDiscountInput; use App\Models\Discount; describe('DeleteDiscountInput', function (): void { diff --git a/tests/Unit/App/Actions/Discounts/UpdateDiscountInputTest.php b/tests/Unit/App/Actions/Discounts/UpdateDiscountInputTest.php index 0cfb6731..a543819f 100644 --- a/tests/Unit/App/Actions/Discounts/UpdateDiscountInputTest.php +++ b/tests/Unit/App/Actions/Discounts/UpdateDiscountInputTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Tests\Unit\App\Actions\Discounts; +namespace Tests\Unit\App\Cqs\Actions\Discounts; -use App\Actions\Discounts\UpdateDiscountInput; +use App\Cqs\Actions\Discounts\UpdateDiscountInput; use App\Models\Discount; use Domain\Enums\DiscountType; use Domain\Models\ValueObjects\DatePeriod; diff --git a/tests/Unit/App/Actions/Faqs/CreateFaqInputTest.php b/tests/Unit/App/Actions/Faqs/CreateFaqInputTest.php index d513a29b..5b0bf469 100644 --- a/tests/Unit/App/Actions/Faqs/CreateFaqInputTest.php +++ b/tests/Unit/App/Actions/Faqs/CreateFaqInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Faqs\CreateFaqInput; +use App\Cqs\Actions\Faqs\CreateFaqInput; describe('CreateFaqInput', function (): void { it('can be instantiated with valid data', function (): void { diff --git a/tests/Unit/App/Actions/Faqs/DeleteFaqInputTest.php b/tests/Unit/App/Actions/Faqs/DeleteFaqInputTest.php index 2da29d69..ae7ba13d 100644 --- a/tests/Unit/App/Actions/Faqs/DeleteFaqInputTest.php +++ b/tests/Unit/App/Actions/Faqs/DeleteFaqInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Faqs\DeleteFaqInput; +use App\Cqs\Actions\Faqs\DeleteFaqInput; use App\Models\Faq; describe('DeleteFaqInput', function (): void { diff --git a/tests/Unit/App/Actions/Faqs/UpdateFaqInputTest.php b/tests/Unit/App/Actions/Faqs/UpdateFaqInputTest.php index 9d805fce..1cdd118d 100644 --- a/tests/Unit/App/Actions/Faqs/UpdateFaqInputTest.php +++ b/tests/Unit/App/Actions/Faqs/UpdateFaqInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Faqs\UpdateFaqInput; +use App\Cqs\Actions\Faqs\UpdateFaqInput; use App\Models\Faq; describe('UpdateFaqInput', function (): void { diff --git a/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotInputTest.php b/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotInputTest.php index dc6f4e30..deaebdae 100644 --- a/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotInputTest.php +++ b/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Orders\ApplyPickTimeSlotInput; +use App\Cqs\Actions\Orders\ApplyPickTimeSlotInput; use Carbon\CarbonImmutable; use Domain\Models\ValueObjects\Entities\ShopperId; use Ramsey\Uuid\Uuid; diff --git a/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotTest.php b/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotTest.php index 371c4f58..ffc67a68 100644 --- a/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotTest.php +++ b/tests/Unit/App/Actions/Orders/ApplyPickTimeSlotTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use App\Actions\Orders\ApplyPickTimeSlot; -use App\Actions\Orders\ApplyPickTimeSlotInput; +use App\Cqs\Actions\Orders\ApplyPickTimeSlot; +use App\Cqs\Actions\Orders\ApplyPickTimeSlotInput; use Carbon\CarbonImmutable; use Domain\Builders\OrderBuilderWithBasket; use Domain\Models\Entities\Shop; diff --git a/tests/Unit/App/Actions/Orders/FinalizeOrderInputTest.php b/tests/Unit/App/Actions/Orders/FinalizeOrderInputTest.php index f3341781..a283e7d7 100644 --- a/tests/Unit/App/Actions/Orders/FinalizeOrderInputTest.php +++ b/tests/Unit/App/Actions/Orders/FinalizeOrderInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Orders\FinalizeOrderInput; +use App\Cqs\Actions\Orders\FinalizeOrderInput; use Domain\Models\ValueObjects\Entities\ShopperId; use Ramsey\Uuid\Uuid; diff --git a/tests/Unit/App/Actions/Orders/FinalizeOrderTest.php b/tests/Unit/App/Actions/Orders/FinalizeOrderTest.php index 6e3cb009..3db69d85 100644 --- a/tests/Unit/App/Actions/Orders/FinalizeOrderTest.php +++ b/tests/Unit/App/Actions/Orders/FinalizeOrderTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use App\Actions\Orders\FinalizeOrder; -use App\Actions\Orders\FinalizeOrderInput; +use App\Cqs\Actions\Orders\FinalizeOrder; +use App\Cqs\Actions\Orders\FinalizeOrderInput; use Domain\Builders\OrderBuilderCompleted; use Domain\Enums\OrderStatus; use Domain\Models\Entities\Order; diff --git a/tests/Unit/App/Actions/Orders/InitializeOrderTunnelInputTest.php b/tests/Unit/App/Actions/Orders/InitializeOrderTunnelInputTest.php index 88a00f54..0b415706 100644 --- a/tests/Unit/App/Actions/Orders/InitializeOrderTunnelInputTest.php +++ b/tests/Unit/App/Actions/Orders/InitializeOrderTunnelInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Orders\InitializeOrderTunnelInput; +use App\Cqs\Actions\Orders\InitializeOrderTunnelInput; use Domain\Models\Entities\Basket; use Domain\Models\ValueObjects\Entities\BasketId; use Domain\Models\ValueObjects\Entities\ShopperId; diff --git a/tests/Unit/App/Actions/Orders/InitializeOrderTunnelTest.php b/tests/Unit/App/Actions/Orders/InitializeOrderTunnelTest.php index 3ebc0cde..40d840b9 100644 --- a/tests/Unit/App/Actions/Orders/InitializeOrderTunnelTest.php +++ b/tests/Unit/App/Actions/Orders/InitializeOrderTunnelTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use App\Actions\Orders\InitializeOrderTunnel; -use App\Actions\Orders\InitializeOrderTunnelInput; +use App\Cqs\Actions\Orders\InitializeOrderTunnel; +use App\Cqs\Actions\Orders\InitializeOrderTunnelInput; use Domain\Models\Entities\Basket; use Domain\Models\ValueObjects\Entities\BasketId; use Domain\Models\ValueObjects\Entities\ShopperId; diff --git a/tests/Unit/App/Actions/Pages/UpdatePageInputTest.php b/tests/Unit/App/Actions/Pages/UpdatePageInputTest.php index 73b8c8b3..27e6e2fa 100644 --- a/tests/Unit/App/Actions/Pages/UpdatePageInputTest.php +++ b/tests/Unit/App/Actions/Pages/UpdatePageInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Pages\UpdatePageInput; +use App\Cqs\Actions\Pages\UpdatePageInput; use App\Models\Page; use Domain\Models\ValueObjects\SeoMetadata; diff --git a/tests/Unit/App/Actions/PickupExceptions/CreatePickupExceptionInputTest.php b/tests/Unit/App/Actions/PickupExceptions/CreatePickupExceptionInputTest.php index 3f6f21e7..dba30af5 100644 --- a/tests/Unit/App/Actions/PickupExceptions/CreatePickupExceptionInputTest.php +++ b/tests/Unit/App/Actions/PickupExceptions/CreatePickupExceptionInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\PickupExceptions\CreatePickupExceptionInput; +use App\Cqs\Actions\PickupExceptions\CreatePickupExceptionInput; use Domain\Enums\RepeatFrequency; describe('CreatePickupExceptionInput', function () { diff --git a/tests/Unit/App/Actions/PickupExceptions/DeletePickupExceptionInputTest.php b/tests/Unit/App/Actions/PickupExceptions/DeletePickupExceptionInputTest.php index 7dc01fb0..13d66b94 100644 --- a/tests/Unit/App/Actions/PickupExceptions/DeletePickupExceptionInputTest.php +++ b/tests/Unit/App/Actions/PickupExceptions/DeletePickupExceptionInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\PickupExceptions\DeletePickupExceptionInput; +use App\Cqs\Actions\PickupExceptions\DeletePickupExceptionInput; use App\Models\PickupException; describe('DeletePickupExceptionInput', function () { diff --git a/tests/Unit/App/Actions/PickupExceptions/UpdatePickupExceptionInputTest.php b/tests/Unit/App/Actions/PickupExceptions/UpdatePickupExceptionInputTest.php index 8bf9a8f5..372ffc1e 100644 --- a/tests/Unit/App/Actions/PickupExceptions/UpdatePickupExceptionInputTest.php +++ b/tests/Unit/App/Actions/PickupExceptions/UpdatePickupExceptionInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\PickupExceptions\UpdatePickupExceptionInput; +use App\Cqs\Actions\PickupExceptions\UpdatePickupExceptionInput; use App\Models\PickupException; use Domain\Enums\RepeatFrequency; diff --git a/tests/Unit/App/Actions/ProductIncos/AssociateProductIncoInputTest.php b/tests/Unit/App/Actions/ProductIncos/AssociateProductIncoInputTest.php index fd0feff0..80d09a5c 100644 --- a/tests/Unit/App/Actions/ProductIncos/AssociateProductIncoInputTest.php +++ b/tests/Unit/App/Actions/ProductIncos/AssociateProductIncoInputTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Tests\Unit\App\Actions\ProductIncos; +namespace Tests\Unit\App\Cqs\Actions\ProductIncos; -use App\Actions\ProductIncos\AssociateProductIncoInput; +use App\Cqs\Actions\ProductIncos\AssociateProductIncoInput; use App\Models\Product; describe('AssociateProductIncoInput', function (): void { diff --git a/tests/Unit/App/Actions/Ranges/CreateRangeInputTest.php b/tests/Unit/App/Actions/Ranges/CreateRangeInputTest.php index 6855b9f1..1bb18171 100644 --- a/tests/Unit/App/Actions/Ranges/CreateRangeInputTest.php +++ b/tests/Unit/App/Actions/Ranges/CreateRangeInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Ranges\CreateRangeInput; +use App\Cqs\Actions\Ranges\CreateRangeInput; use Domain\Models\ValueObjects\PictureMetadata; use Illuminate\Http\UploadedFile; diff --git a/tests/Unit/App/Actions/Ranges/DeleteRangeInputTest.php b/tests/Unit/App/Actions/Ranges/DeleteRangeInputTest.php index 4e2be89e..28a5ca6e 100644 --- a/tests/Unit/App/Actions/Ranges/DeleteRangeInputTest.php +++ b/tests/Unit/App/Actions/Ranges/DeleteRangeInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Ranges\DeleteRangeInput; +use App\Cqs\Actions\Ranges\DeleteRangeInput; use App\Models\Range; describe('DeleteRangeInput', function () { diff --git a/tests/Unit/App/Actions/Ranges/UpdateRangeInputTest.php b/tests/Unit/App/Actions/Ranges/UpdateRangeInputTest.php index 76c9b49d..2ebb21d5 100644 --- a/tests/Unit/App/Actions/Ranges/UpdateRangeInputTest.php +++ b/tests/Unit/App/Actions/Ranges/UpdateRangeInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Ranges\UpdateRangeInput; +use App\Cqs\Actions\Ranges\UpdateRangeInput; use App\Models\Range; use Domain\Models\ValueObjects\PictureMetadata; use Illuminate\Http\UploadedFile; diff --git a/tests/Unit/App/Actions/Settings/UpdateSettingsInputTest.php b/tests/Unit/App/Actions/Settings/UpdateSettingsInputTest.php index 5904f798..2acc7d88 100644 --- a/tests/Unit/App/Actions/Settings/UpdateSettingsInputTest.php +++ b/tests/Unit/App/Actions/Settings/UpdateSettingsInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Settings\UpdateSettingsInput; +use App\Cqs\Actions\Settings\UpdateSettingsInput; use Domain\Models\ValueObjects\ShopperSiteCode; describe('UpdateSettingsInput', function (): void { diff --git a/tests/Unit/App/Actions/Shops/CreateShopInputTest.php b/tests/Unit/App/Actions/Shops/CreateShopInputTest.php index 7a92f4fc..6c670ff9 100644 --- a/tests/Unit/App/Actions/Shops/CreateShopInputTest.php +++ b/tests/Unit/App/Actions/Shops/CreateShopInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Shops\CreateShopInput; +use App\Cqs\Actions\Shops\CreateShopInput; use Domain\Models\ValueObjects\Coordinates; use Domain\Models\ValueObjects\PhoneNumber; diff --git a/tests/Unit/App/Actions/Shops/DeleteShopInputTest.php b/tests/Unit/App/Actions/Shops/DeleteShopInputTest.php index bf988822..3762173b 100644 --- a/tests/Unit/App/Actions/Shops/DeleteShopInputTest.php +++ b/tests/Unit/App/Actions/Shops/DeleteShopInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Shops\DeleteShopInput; +use App\Cqs\Actions\Shops\DeleteShopInput; use App\Models\Shop; describe('DeleteShopInput', function () { diff --git a/tests/Unit/App/Actions/Shops/UpdateShopInputTest.php b/tests/Unit/App/Actions/Shops/UpdateShopInputTest.php index 7a17ec02..4ed21ca4 100644 --- a/tests/Unit/App/Actions/Shops/UpdateShopInputTest.php +++ b/tests/Unit/App/Actions/Shops/UpdateShopInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Shops\UpdateShopInput; +use App\Cqs\Actions\Shops\UpdateShopInput; use App\Models\Shop; use Domain\Models\ValueObjects\Coordinates; use Domain\Models\ValueObjects\PhoneNumber; diff --git a/tests/Unit/App/Actions/Shops/UpdateShopPickupExceptionsInputTest.php b/tests/Unit/App/Actions/Shops/UpdateShopPickupExceptionsInputTest.php index 1c00d986..26e57294 100644 --- a/tests/Unit/App/Actions/Shops/UpdateShopPickupExceptionsInputTest.php +++ b/tests/Unit/App/Actions/Shops/UpdateShopPickupExceptionsInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Shops\UpdateShopPickupExceptionsInput; +use App\Cqs\Actions\Shops\UpdateShopPickupExceptionsInput; use App\Models\Shop; describe('UpdateShopPickupExceptionsInput', function () { diff --git a/tests/Unit/App/Actions/Slides/CreateSlideInputTest.php b/tests/Unit/App/Actions/Slides/CreateSlideInputTest.php index 78393926..b52ad42d 100644 --- a/tests/Unit/App/Actions/Slides/CreateSlideInputTest.php +++ b/tests/Unit/App/Actions/Slides/CreateSlideInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Slides\CreateSlideInput; +use App\Cqs\Actions\Slides\CreateSlideInput; use Domain\Models\ValueObjects\DatePeriod; describe('CreateSlideInput', function (): void { diff --git a/tests/Unit/App/Actions/Slides/DeleteSlideInputTest.php b/tests/Unit/App/Actions/Slides/DeleteSlideInputTest.php index b4f26324..93f0688b 100644 --- a/tests/Unit/App/Actions/Slides/DeleteSlideInputTest.php +++ b/tests/Unit/App/Actions/Slides/DeleteSlideInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Slides\DeleteSlideInput; +use App\Cqs\Actions\Slides\DeleteSlideInput; use App\Models\Slide; describe('DeleteSlideInput', function (): void { diff --git a/tests/Unit/App/Actions/Slides/UpdateSlideInputTest.php b/tests/Unit/App/Actions/Slides/UpdateSlideInputTest.php index dd5d605d..43da336a 100644 --- a/tests/Unit/App/Actions/Slides/UpdateSlideInputTest.php +++ b/tests/Unit/App/Actions/Slides/UpdateSlideInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Slides\UpdateSlideInput; +use App\Cqs\Actions\Slides\UpdateSlideInput; use App\Models\Slide; describe('UpdateSlideInput', function (): void { diff --git a/tests/Unit/App/Actions/Tags/CreateTagInputTest.php b/tests/Unit/App/Actions/Tags/CreateTagInputTest.php index 7323ebe1..2f375487 100644 --- a/tests/Unit/App/Actions/Tags/CreateTagInputTest.php +++ b/tests/Unit/App/Actions/Tags/CreateTagInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Tags\CreateTagInput; +use App\Cqs\Actions\Tags\CreateTagInput; describe('CreateTagInput', function (): void { it('can be instantiated with valid data', function (): void { diff --git a/tests/Unit/App/Actions/Tags/DeleteTagInputTest.php b/tests/Unit/App/Actions/Tags/DeleteTagInputTest.php index 6431d855..63af0ae5 100644 --- a/tests/Unit/App/Actions/Tags/DeleteTagInputTest.php +++ b/tests/Unit/App/Actions/Tags/DeleteTagInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Tags\DeleteTagInput; +use App\Cqs\Actions\Tags\DeleteTagInput; use App\Models\Tag; describe('DeleteTagInput', function (): void { diff --git a/tests/Unit/App/Actions/Tags/UpdateTagInputTest.php b/tests/Unit/App/Actions/Tags/UpdateTagInputTest.php index b104861e..3993ce1b 100644 --- a/tests/Unit/App/Actions/Tags/UpdateTagInputTest.php +++ b/tests/Unit/App/Actions/Tags/UpdateTagInputTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Actions\Tags\UpdateTagInput; +use App\Cqs\Actions\Tags\UpdateTagInput; use App\Models\Tag; describe('UpdateTagInput', function (): void { diff --git a/tests/Unit/App/Queries/Orders/GetBasketSummaryQueryTest.php b/tests/Unit/App/Queries/Orders/GetBasketSummaryQueryTest.php index a92df208..10848093 100644 --- a/tests/Unit/App/Queries/Orders/GetBasketSummaryQueryTest.php +++ b/tests/Unit/App/Queries/Orders/GetBasketSummaryQueryTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use App\Queries\Orders\GetBasketSummaryQuery; -use App\Queries\Orders\GetBasketSummaryQueryInput; -use App\Queries\Orders\GetBasketSummaryQueryOutput; +use App\Cqs\Queries\Orders\GetBasketSummaryQuery; +use App\Cqs\Queries\Orders\GetBasketSummaryQueryInput; +use App\Cqs\Queries\Orders\GetBasketSummaryQueryOutput; use Domain\Enums\OrderTunnelStep; use Domain\Models\Entities\Basket; use Domain\Models\ValueObjects\Entities\BasketId; diff --git a/tests/Unit/App/Queries/Orders/GetOrderConfirmationQueryTest.php b/tests/Unit/App/Queries/Orders/GetOrderConfirmationQueryTest.php index bd37aa72..4f22509e 100644 --- a/tests/Unit/App/Queries/Orders/GetOrderConfirmationQueryTest.php +++ b/tests/Unit/App/Queries/Orders/GetOrderConfirmationQueryTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use App\Cqs\Queries\Orders\GetOrderConfirmationQuery; +use App\Cqs\Queries\Orders\GetOrderConfirmationQueryInput; +use App\Cqs\Queries\Orders\GetOrderConfirmationQueryOutput; use App\Dto\ShopDto; -use App\Queries\Orders\GetOrderConfirmationQuery; -use App\Queries\Orders\GetOrderConfirmationQueryInput; -use App\Queries\Orders\GetOrderConfirmationQueryOutput; use Domain\Builders\OrderBuilderCompleted; use Domain\Enums\OrderTunnelStep; use Domain\Models\Entities\Basket; diff --git a/tests/Unit/App/Queries/Orders/GetPickTimeSlotQueryTest.php b/tests/Unit/App/Queries/Orders/GetPickTimeSlotQueryTest.php index f7d824e9..1b6b2c55 100644 --- a/tests/Unit/App/Queries/Orders/GetPickTimeSlotQueryTest.php +++ b/tests/Unit/App/Queries/Orders/GetPickTimeSlotQueryTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use App\Cqs\Queries\Orders\GetPickTimeSlotQuery; +use App\Cqs\Queries\Orders\GetPickTimeSlotQueryInput; +use App\Cqs\Queries\Orders\GetPickTimeSlotQueryOutput; use App\Dto\ShopDto; -use App\Queries\Orders\GetPickTimeSlotQuery; -use App\Queries\Orders\GetPickTimeSlotQueryInput; -use App\Queries\Orders\GetPickTimeSlotQueryOutput; use App\Services\MapUrlService; use Domain\Enums\OrderTunnelStep; use Domain\Models\Entities\Shop; diff --git a/tests/Unit/App/Queries/ProductIncos/GetArcadiaIncoPreviewQueryTest.php b/tests/Unit/App/Queries/ProductIncos/GetArcadiaIncoPreviewQueryTest.php index a1e23d58..f008c8cd 100644 --- a/tests/Unit/App/Queries/ProductIncos/GetArcadiaIncoPreviewQueryTest.php +++ b/tests/Unit/App/Queries/ProductIncos/GetArcadiaIncoPreviewQueryTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Tests\Unit\App\Queries\ProductIncos; +namespace Tests\Unit\App\Cqs\Queries\ProductIncos; +use App\Cqs\Queries\ProductIncos\GetArcadiaIncoPreviewQuery; +use App\Cqs\Queries\ProductIncos\GetArcadiaIncoPreviewQueryInput; use App\Dto\ArcadiaIncoPreviewDto; -use App\Queries\ProductIncos\GetArcadiaIncoPreviewQuery; -use App\Queries\ProductIncos\GetArcadiaIncoPreviewQueryInput; use App\Services\ArcadiaIncoService; describe('GetArcadiaIncoPreviewQuery', function (): void { diff --git a/tests/Unit/App/Queries/Shops/GetShopQueryInputTest.php b/tests/Unit/App/Queries/Shops/GetShopQueryInputTest.php index a34c3c7a..891339f0 100644 --- a/tests/Unit/App/Queries/Shops/GetShopQueryInputTest.php +++ b/tests/Unit/App/Queries/Shops/GetShopQueryInputTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Tests\Unit\App\Queries\Shops; +namespace Tests\Unit\App\Cqs\Queries\Shops; -use App\Queries\Shops\GetShopQueryInput; +use App\Cqs\Queries\Shops\GetShopQueryInput; describe('GetShopQueryInput', function (): void { it('creates an instance of GetShopQueryInput', function (): void { From 2dacdbabd608d255e2f552ef21f1503c05d223ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 10 Nov 2026 15:14:24 +0100 Subject: [PATCH 02/11] refactor(service): reintroduce EmployeeUpsertService and related classes - Moved employee upsert logic to a new service for better separation of concerns. - Updated EmployeeSyncService to utilize the new EmployeeUpsertService. - Added tests for EmployeeUpsertService to ensure correct functionality. --- app/Services/EmployeeSyncService.php | 90 +-------------- app/Services/EmployeeUpsertService.php | 105 ++++++++++++++++++ ...lt.php => EmployeeUpsertServiceResult.php} | 2 +- tests/Architecture/NamingConventionsTest.php | 4 +- .../App/Services/EmployeeSyncServiceTest.php | 51 +++++---- .../Services/EmployeeUpsertServiceTest.php | 73 ++++++++++++ 6 files changed, 214 insertions(+), 111 deletions(-) create mode 100644 app/Services/EmployeeUpsertService.php rename app/Services/{EmployeeSyncServiceResult.php => EmployeeUpsertServiceResult.php} (88%) create mode 100644 tests/Integration/WithApp/App/Services/EmployeeUpsertServiceTest.php diff --git a/app/Services/EmployeeSyncService.php b/app/Services/EmployeeSyncService.php index 8de82f88..6c042ecd 100644 --- a/app/Services/EmployeeSyncService.php +++ b/app/Services/EmployeeSyncService.php @@ -6,11 +6,7 @@ namespace App\Services; use App\Contracts\QueryInputEmpty; use App\Cqs\Queries\Settings\GetSettingsQuery; -use Carbon\CarbonImmutable; use Carbon\CarbonInterface; -use Domain\Models\ValueObjects\EmployeeUpsertData; -use Domain\Models\ValueObjects\Matricule; -use Domain\Ports\Services\EmployeeImportStorageService; use Illuminate\Contracts\Cache\Repository as CacheRepository; use Illuminate\Support\Carbon; use Psr\Log\LoggerInterface; @@ -23,8 +19,7 @@ class EmployeeSyncService private readonly LoggerInterface $logger, private readonly CacheRepository $cacheRepository, private readonly ArcadiaEmployeeService $arcadiaEmployeeService, - private readonly CodeGenerationService $codeService, - private readonly EmployeeImportStorageService $employeeImportStorageService, + private readonly EmployeeUpsertService $employeeUpsertService, private readonly GetSettingsQuery $getSettingsQuery ) { } @@ -73,7 +68,7 @@ class EmployeeSyncService 'count' => count($employees), ]); - $result = $this->upsertEmployees($employees); + $result = $this->employeeUpsertService->upsertEmployees($employees); $totalInserted += $result->insertedCount; $totalUpdated += $result->updatedCount; @@ -114,85 +109,4 @@ class EmployeeSyncService 'timestamp' => $now, ]); } - - /** @param \App\Services\ArcadiaEmployee[] $employeeList */ - private function upsertEmployees(array $employeeList): EmployeeSyncServiceResult - { - $matriculesToInsert = []; - $errors = []; - $upsertData = []; - $importStartTime = CarbonImmutable::now()->subSecond(); - - foreach ($employeeList as $employeeImport) { - $matricule = $employeeImport->matricule->value; - - if (in_array($matricule, $matriculesToInsert, true)) { - $errorMsg = "Duplicate detected in the file: The matricule {$matricule} appears multiple times."; - $errors[] = $errorMsg; - - $this->logger->warning($errorMsg, [ - 'matricule' => $matricule, - ]); - - continue; - } - - $matriculesToInsert[] = $matricule; - - // NOTE: We generate a new code for each row, but only insert it for new records. - $code = $this->codeService->generateFrom(new Matricule($matricule)); - - $upsertData[] = new EmployeeUpsertData( - matricule: $employeeImport->matricule, - firstname: $employeeImport->firstname, - lastname: $employeeImport->lastname, - etablissement: $employeeImport->etablissement, - service: $employeeImport->service, - site: $employeeImport->site, - startDate: $employeeImport->startDate, - endDate: $employeeImport->endDate, - code: $code - ); - } - - if (empty($upsertData) && empty($errors)) { - $errors[] = 'The file contains no valid data.'; - $this->logger->notice('Upsert skipped: No valid employee data found in list.'); - } - - if (! empty($upsertData)) { - $this->logger->debug('Dispatching upsert batch to storage service.', [ - 'batch_size' => count($upsertData), - ]); - - $this->employeeImportStorageService->upsertEmployees($upsertData); - - $result = $this->employeeImportStorageService - ->getImportedAfter( - array_map( - fn ($m) => new Matricule($m), - $matriculesToInsert - ), - $importStartTime - ); - - $insertedCount = $result->insertedCount; - $updatedCount = $result->updatedCount; - - $this->logger->info('Batch upsert completed.', [ - 'inserted' => $insertedCount, - 'updated' => $updatedCount, - 'errors' => count($errors), - ]); - } else { - $insertedCount = 0; - $updatedCount = 0; - } - - return new EmployeeSyncServiceResult( - insertedCount: $insertedCount, - updatedCount: $updatedCount, - errors: $errors, - ); - } } diff --git a/app/Services/EmployeeUpsertService.php b/app/Services/EmployeeUpsertService.php new file mode 100644 index 00000000..38f5e036 --- /dev/null +++ b/app/Services/EmployeeUpsertService.php @@ -0,0 +1,105 @@ +subSecond(); + + foreach ($employeeList as $employeeToImport) { + $matricule = $employeeToImport->matricule->value; + + if (in_array($matricule, $matriculesToInsert, true)) { + $errorMsg = "Duplicate detected in the file: The matricule {$matricule} appears multiple times."; + $errors[] = $errorMsg; + + $this->logger->warning($errorMsg, [ + 'matricule' => $matricule, + ]); + + continue; + } + + $matriculesToInsert[] = $matricule; + + // NOTE: We generate a new code for each row, but only insert it for new records. + $code = $this->codeService->generateFrom(new Matricule($matricule)); + + $upsertData[] = new EmployeeUpsertData( + matricule: $employeeToImport->matricule, + firstname: $employeeToImport->firstname, + lastname: $employeeToImport->lastname, + etablissement: $employeeToImport->etablissement, + service: $employeeToImport->service, + site: $employeeToImport->site, + startDate: $employeeToImport->startDate, + endDate: $employeeToImport->endDate, + code: $code + ); + } + + if (empty($upsertData) && empty($errors)) { + $errors[] = 'The file contains no valid data.'; + $this->logger->notice('Upsert skipped: No valid employee data found in list.'); + } + + if (! empty($upsertData)) { + $this->logger->debug('Dispatching upsert batch to storage service.', [ + 'batch_size' => count($upsertData), + ]); + + $this->employeeImportStorageService->upsertEmployees($upsertData); + + $result = $this->employeeImportStorageService + ->getImportedAfter( + array_map( + fn ($m) => new Matricule($m), + $matriculesToInsert + ), + $importStartTime + ); + + $insertedCount = $result->insertedCount; + $updatedCount = $result->updatedCount; + + $this->logger->info('Batch upsert completed.', [ + 'inserted' => $insertedCount, + 'updated' => $updatedCount, + 'errors' => count($errors), + ]); + } else { + $insertedCount = 0; + $updatedCount = 0; + } + + return new EmployeeUpsertServiceResult( + insertedCount: $insertedCount, + updatedCount: $updatedCount, + errors: $errors, + ); + } +} diff --git a/app/Services/EmployeeSyncServiceResult.php b/app/Services/EmployeeUpsertServiceResult.php similarity index 88% rename from app/Services/EmployeeSyncServiceResult.php rename to app/Services/EmployeeUpsertServiceResult.php index 4f41d902..7c84267a 100644 --- a/app/Services/EmployeeSyncServiceResult.php +++ b/app/Services/EmployeeUpsertServiceResult.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Services; -class EmployeeSyncServiceResult +class EmployeeUpsertServiceResult { public function __construct( public readonly int $insertedCount, diff --git a/tests/Architecture/NamingConventionsTest.php b/tests/Architecture/NamingConventionsTest.php index 0e108688..982e6fd6 100644 --- a/tests/Architecture/NamingConventionsTest.php +++ b/tests/Architecture/NamingConventionsTest.php @@ -4,7 +4,7 @@ declare(strict_types=1); use App\Exceptions\GlobalHandler; use App\Services\ArcadiaEmployee; -use App\Services\EmployeeSyncServiceResult; +use App\Services\EmployeeUpsertServiceResult; use Symfony\Component\Finder\Finder; describe('naming conventions in app', function (): void { @@ -52,7 +52,7 @@ describe('naming conventions in app', function (): void { ->toHaveSuffix('Service') ->ignoring([ ArcadiaEmployee::class, - EmployeeSyncServiceResult::class, + EmployeeUpsertServiceResult::class, ]); arch('queries have Query, QueryInput or QueryOutput suffix', function (): void { diff --git a/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php b/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php index 10f21b3b..f14f8624 100644 --- a/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php +++ b/tests/Integration/WithApp/App/Services/EmployeeSyncServiceTest.php @@ -6,14 +6,14 @@ use App\Cqs\Queries\Settings\GetSettingsQuery; use App\Models\Setting; use App\Services\ArcadiaEmployee; use App\Services\ArcadiaEmployeeService; -use App\Services\CodeGenerationService; use App\Services\EmployeeSyncService; +use App\Services\EmployeeUpsertService; +use App\Services\EmployeeUpsertServiceResult; use Carbon\CarbonImmutable; use Domain\Models\ValueObjects\Matricule; use Domain\Models\ValueObjects\ShopperEstablishmentCode; use Domain\Models\ValueObjects\ShopperServiceCode; use Domain\Models\ValueObjects\ShopperSiteCode; -use Domain\Ports\Services\EmployeeImportStorageService; use Illuminate\Contracts\Cache\Repository as CacheRepository; use Illuminate\Foundation\Testing\RefreshDatabase; use Psr\Log\LoggerInterface; @@ -33,8 +33,7 @@ describe('EmployeeSyncService', function (): void { $logger = app(LoggerInterface::class); $cache = app(CacheRepository::class); - $codeService = app(CodeGenerationService::class); - $storageService = \Mockery::mock(EmployeeImportStorageService::class); + $upsertService = \Mockery::mock(EmployeeUpsertService::class); $employee = new ArcadiaEmployee( matricule: new Matricule('1234567'), @@ -47,19 +46,25 @@ describe('EmployeeSyncService', function (): void { service: new ShopperServiceCode('101') ); - $storageService->shouldReceive('upsertEmployees') - ->once() + $upsertService->shouldReceive('upsertEmployees') ->with(\Mockery::on(static function (array $data): bool { return count($data) === 1 && $data[0]->matricule->value === '1234567'; - })); - - $storageService->shouldReceive('getImportedAfter') + })) ->once() - ->andReturn((object) [ - 'insertedCount' => 1, - 'updatedCount' => 0, - 'matriculesInserted' => [new Matricule('1234567')], - ]); + ->andReturn(new EmployeeUpsertServiceResult( + insertedCount: 1, + updatedCount: 0, + errors: [] + )); + + $upsertService->shouldReceive('upsertEmployees') + ->with(\Mockery::on(static fn (array $data) => empty($data))) + ->once() + ->andReturn(new EmployeeUpsertServiceResult( + insertedCount: 0, + updatedCount: 0, + errors: [] + )); $arcadiaService = \Mockery::mock(ArcadiaEmployeeService::class); $arcadiaService->shouldReceive('getEmployeesOfSiteSince') @@ -75,8 +80,7 @@ describe('EmployeeSyncService', function (): void { $logger, $cache, $arcadiaService, - $codeService, - $storageService, + $upsertService, app(GetSettingsQuery::class) ); @@ -91,8 +95,16 @@ describe('EmployeeSyncService', function (): void { // GIVEN $logger = app(LoggerInterface::class); $cache = app(CacheRepository::class); - $codeService = app(CodeGenerationService::class); - $storageService = \Mockery::mock(EmployeeImportStorageService::class); + $upsertService = \Mockery::mock(EmployeeUpsertService::class); + + $upsertService->shouldReceive('upsertEmployees') + ->with(\Mockery::on(static fn (array $data) => empty($data))) + ->once() + ->andReturn(new EmployeeUpsertServiceResult( + insertedCount: 0, + updatedCount: 0, + errors: [] + )); $arcadiaService = \Mockery::mock(ArcadiaEmployeeService::class); $arcadiaService->shouldReceive('getEmployeesOfSiteSince') @@ -104,8 +116,7 @@ describe('EmployeeSyncService', function (): void { $logger, $cache, $arcadiaService, - $codeService, - $storageService, + $upsertService, app(GetSettingsQuery::class) ); diff --git a/tests/Integration/WithApp/App/Services/EmployeeUpsertServiceTest.php b/tests/Integration/WithApp/App/Services/EmployeeUpsertServiceTest.php new file mode 100644 index 00000000..08d662a2 --- /dev/null +++ b/tests/Integration/WithApp/App/Services/EmployeeUpsertServiceTest.php @@ -0,0 +1,73 @@ +employee_sites = ['PA', 'LY']; + $setting->saveOrFail(); + + $logger = app(LoggerInterface::class); + $codeService = app(CodeGenerationService::class); + $storageService = \Mockery::mock(EmployeeImportStorageService::class); + + $employee = new ArcadiaEmployee( + matricule: new Matricule('1234567'), + lastname: 'Dupont', + firstname: 'Jean', + startDate: CarbonImmutable::parse('2026-01-01'), + endDate: null, + etablissement: new ShopperEstablishmentCode('ETAB'), + site: new ShopperSiteCode('PA'), + service: new ShopperServiceCode('101') + ); + + $storageService->shouldReceive('upsertEmployees') + ->once() + ->with(\Mockery::on(static function (array $data): bool { + return count($data) === 1 && $data[0]->matricule->value === '1234567'; + })); + + $storageService->shouldReceive('getImportedAfter') + ->once() + ->andReturn((object) [ + 'insertedCount' => 1, + 'updatedCount' => 0, + 'matriculesInserted' => [new Matricule('1234567')], + ]); + + $service = new EmployeeUpsertService( + $logger, + $codeService, + $storageService, + ); + + // WHEN + $result = $service->upsertEmployees([$employee]); + + // THEN + expect($result)->toBeInstanceOf(EmployeeUpsertServiceResult::class); + }); +}); From 7a2004637d72a74c1976e6f51a4902645cd01046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 10 Nov 2026 18:08:41 +0100 Subject: [PATCH 03/11] feat(employee): implement employee import functionality - Added EmployeesImportResults class to encapsulate import results. - Created ImportEmployees action to handle CSV import and upsert employees. - Introduced ImportEmployeesInput class for input validation. - Developed EmployeeCsvReaderService for reading and parsing CSV files. - Implemented EmployeeCsvImportLine to map CSV rows to employee data. - Added EnhancedCsvReader for improved CSV handling. - Updated composer.json to include fusonic/csv-reader dependency. - Created tests for the new employee import functionality. --- .../Commands/UpsertEmployeesFormFile.php | 54 ++++++ .../Employee/EmployeesImportResults.php | 23 +++ app/Cqs/Actions/Employee/ImportEmployees.php | 100 +++++++++++ .../Actions/Employee/ImportEmployeesInput.php | 24 +++ app/Lib/EnhancedCsvReader.php | 159 ++++++++++++++++++ app/Services/EmployeeCsvImportLine.php | 86 ++++++++++ app/Services/EmployeeCsvReaderService.php | 108 ++++++++++++ composer.json | 1 + composer.lock | 56 +++++- lang/en.json | 16 +- lang/fr.json | 18 +- lang/fr/validation.php | 2 +- .../Commands/UpsertEmployeesFormFileTest.php | 27 +++ .../Employee/EmployeesImportResultsTest.php | 40 +++++ .../Employee/ImportEmployeesInputTest.php | 50 ++++++ .../Actions/Employee/ImportEmployeesTest.php | 148 ++++++++++++++++ .../Services/EmployeeCsvImportLineTest.php | 45 +++++ .../Services/EmployeeCsvReaderServiceTest.php | 97 +++++++++++ 18 files changed, 1035 insertions(+), 19 deletions(-) create mode 100644 app/Console/Commands/UpsertEmployeesFormFile.php create mode 100644 app/Cqs/Actions/Employee/EmployeesImportResults.php create mode 100644 app/Cqs/Actions/Employee/ImportEmployees.php create mode 100644 app/Cqs/Actions/Employee/ImportEmployeesInput.php create mode 100644 app/Lib/EnhancedCsvReader.php create mode 100644 app/Services/EmployeeCsvImportLine.php create mode 100644 app/Services/EmployeeCsvReaderService.php create mode 100644 tests/Feature/App/Console/Commands/UpsertEmployeesFormFileTest.php create mode 100644 tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php create mode 100644 tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesInputTest.php create mode 100644 tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php create mode 100644 tests/Unit/App/Services/EmployeeCsvImportLineTest.php create mode 100644 tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php diff --git a/app/Console/Commands/UpsertEmployeesFormFile.php b/app/Console/Commands/UpsertEmployeesFormFile.php new file mode 100644 index 00000000..c61de43c --- /dev/null +++ b/app/Console/Commands/UpsertEmployeesFormFile.php @@ -0,0 +1,54 @@ +argument('file'); + + if (! file_exists($file)) { + $this->error("File not found: {$file}"); + + return self::FAILURE; + } + + $this->info('Starting synchronous employee import from CSV...'); + + $stream = fopen($file, 'r'); + + if (! $stream) { + $this->error("Failed to open file: {$file}"); + + return self::FAILURE; + } + + $importResult = $executor->execute($action, new ImportEmployeesInput($stream)); + + $this->info("Successfully inserted {$importResult->insertedCount} employees."); + $this->info("Successfully updated {$importResult->updatedCount} employees."); + + if (! empty($importResult->errors)) { + $this->error('Errors occurred during import:'); + foreach ($importResult->errors as $error) { + $this->error($error); + } + } + + return self::SUCCESS; + } +} diff --git a/app/Cqs/Actions/Employee/EmployeesImportResults.php b/app/Cqs/Actions/Employee/EmployeesImportResults.php new file mode 100644 index 00000000..7e37bf0e --- /dev/null +++ b/app/Cqs/Actions/Employee/EmployeesImportResults.php @@ -0,0 +1,23 @@ + $errors + */ + public function __construct( + public int $insertedCount, + public int $updatedCount, + public array $errors + ) { + Assert::greaterThanEq($insertedCount, 0); + Assert::greaterThanEq($updatedCount, 0); + Assert::allString($errors); + } +} diff --git a/app/Cqs/Actions/Employee/ImportEmployees.php b/app/Cqs/Actions/Employee/ImportEmployees.php new file mode 100644 index 00000000..730fafbf --- /dev/null +++ b/app/Cqs/Actions/Employee/ImportEmployees.php @@ -0,0 +1,100 @@ + + */ +final class ImportEmployees implements Action +{ + public function __construct( + private readonly LoggerInterface $logger, + private readonly EmployeeCsvReaderService $employeeCsvReaderService, + private readonly EmployeeUpsertService $employeeUpsertService, + ) { + } + + /** @param \App\Cqs\Actions\Employee\ImportEmployeesInput $input */ + public function __invoke(ActionInput $input): EmployeesImportResults + { + Assert::isAOf($input, ImportEmployeesInput::class); + + $csvLines = $this->employeeCsvReaderService->importEmployeesFromCsv($input->inputStream); + + $this->logger->debug('Retrieved employees from CSV.', [ + 'count' => count([...$csvLines]), + ]); + + $errors = array_filter( + $csvLines, + fn ($employee) => is_string($employee) + ); + + $importedEmployees = array_map( + fn (ServicesEmployeeCsvImportLine $csvLine) => $this->mapToArcadiaEmployee($csvLine), + array_filter( + $csvLines, + fn ($employee) => $employee instanceof ServicesEmployeeCsvImportLine + ) + ); + + $employees = array_filter( + $importedEmployees, + fn ($employee) => $employee instanceof ArcadiaEmployee + ); + + $errors += array_filter( + $importedEmployees, + fn ($employee) => is_string($employee) + ); + + $result = $this->employeeUpsertService->upsertEmployees($employees); + + $totalInserted = $result->insertedCount; + $totalUpdated = $result->updatedCount; + + $this->logger->info('Employee synchronization completed successfully.', [ + 'total_inserted' => $totalInserted, + 'total_updated' => $totalUpdated, + ]); + + return new EmployeesImportResults( + insertedCount: $totalInserted, + updatedCount: $totalUpdated, + errors: $errors, + ); + } + + private function mapToArcadiaEmployee(ServicesEmployeeCsvImportLine $csvLine): ArcadiaEmployee | string + { + try { + return new ArcadiaEmployee( + matricule: new Matricule($csvLine->matricule), + lastname: $csvLine->lastName, + firstname: $csvLine->firstName, + startDate: $csvLine->startDate, + endDate: $csvLine->endDate, + etablissement: new ShopperEstablishmentCode($csvLine->establishment), + site: new ShopperSiteCode($csvLine->site), + service: new ShopperServiceCode($csvLine->service), + ); + } catch (\Throwable $e) { + return $e->getMessage(); + } + } +} diff --git a/app/Cqs/Actions/Employee/ImportEmployeesInput.php b/app/Cqs/Actions/Employee/ImportEmployeesInput.php new file mode 100644 index 00000000..df9a6cfd --- /dev/null +++ b/app/Cqs/Actions/Employee/ImportEmployeesInput.php @@ -0,0 +1,24 @@ + $className the class which data should be mapped to + * @param ?callable(int, \Throwable): E $callback the callback to handle errors for each row + * @return \Traversable + */ + #[\Override] + public function readObjects(string $className, ?callable $callback = null): iterable + { + $resource = $this->getResource(); + + /** @var int $resourcePosition */ + $resourcePosition = ftell($resource); + + // Skip the BOM + if ($this->options->removeBOM) { + $this->inheritedSkipBom($resource); + } + + // Read header + $header = null; + + if ($this->options->hasHeaderRow) { + $header = fgetcsv( + stream: $resource, + length: 0, + separator: $this->options->delimiter, + enclosure: $this->options->enclosure, + escape: $this->options->escape + ); + + if ($header === false) { + throw new CsvReaderException('Cannot get line from file pointer and parse it for CSV fields.'); + } + } + + // Build mapping + $mappingBuilder = new MappingBuilder(); + $mapping = $mappingBuilder->build($header, $className); + + $line = $this->options->hasHeaderRow ? 1 : 0; + while ( + ($row = fgetcsv( + $resource, + 0, + $this->options->delimiter, + $this->options->enclosure, + $this->options->escape + )) !== false + ) { + try { + Assert::allString($row); + + yield $this->inheritedMap($row, $className, $mapping); + } catch (\Throwable $e) { + if ($callback !== null) { + yield $callback($line, $e); + } + } + $line++; + } + + // Rewind resource to its original position or close it if source was a path + if (\is_resource($this->fileToRead)) { + fseek($this->fileToRead, $resourcePosition); + } else { + fclose($resource); + } + } + + /** @return resource */ + private function getResource(): mixed + { + if (\is_resource($this->fileToRead)) { + return $this->fileToRead; + } + + if (is_string($this->fileToRead)) { + $resource = fopen($this->fileToRead, 'r'); + if ($resource === false) { + throw new CsvReaderException('Cannot open the CSV file.'); + } + + return $resource; + } + + throw new CsvReaderException('Invalid file to read.'); + } + + /** + * @param resource $resource + */ + private function inheritedSkipBom($resource): void + { + $position = ftell($resource); + + if ($position === false) { + throw new CsvReaderException('Cannot read the current position of the file read/write pointer.'); + } + + if (fread($resource, 3) !== \chr(0xEF) . \chr(0xBB) . \chr(0xBF)) { + fseek($resource, $position); + } + } + + /** + * @template T of object + * + * @param array $row + * @param class-string $className + * @param \Fusonic\CsvReader\Mapping\MappingInfo[] $mappings + * @return T + */ + protected function inheritedMap(array $row, string $className, array $mappings): object + { + $object = new $className(); + + foreach ($mappings as $mapping) { + $mapping->setValue( + $object, + $this->options->valueConverter->convert( + $row[$mapping->getIndex()], + $mapping->getType() + ) + ); + } + + return $object; + } +} diff --git a/app/Services/EmployeeCsvImportLine.php b/app/Services/EmployeeCsvImportLine.php new file mode 100644 index 00000000..3bce6e37 --- /dev/null +++ b/app/Services/EmployeeCsvImportLine.php @@ -0,0 +1,86 @@ +startDate = $this->parseMandatoryDate($value); + } + + public \DateTimeImmutable $startDate; + + #[TitleMapping('Date fin')] + public function setEndDate(string $value): void + { + $this->endDate = $this->parseDate($value); + } + + public ?\DateTimeImmutable $endDate; + + #[TitleMapping('Date fin prévue')] + public function setExpectedEndDate(string $value): void + { + $this->expectedEndDate = $this->parseDate($value); + } + + public ?\DateTimeImmutable $expectedEndDate; + + #[TitleMapping('Etablissement')] + public string $establishment; + + #[TitleMapping('Site')] + public string $site; + + #[TitleMapping('Service')] + public function setService(string $value): void + { + // NOTE: Hack in order to remove the site repetition in the service code, e.g., LDCCAV030 -> 030 + $this->service = preg_replace('/^.*?(\d+)$/', '$1', $value) ?? $value; + } + + public string $service; + + private function parseMandatoryDate(string $value): \DateTimeImmutable + { + $date = $this->parseDate($value); + + if ($date === null) { + throw new \InvalidArgumentException("Invalid date format: $value"); + } + + return $date; + } + + private function parseDate(string $value): ?\DateTimeImmutable + { + if (empty($value)) { + return null; + } + + $date = \DateTimeImmutable::createFromFormat(self::DATE_FORMAT, $value); + + if ($date === false) { + throw new \InvalidArgumentException("Invalid date format: $value"); + } + + return $date; + } +} diff --git a/app/Services/EmployeeCsvReaderService.php b/app/Services/EmployeeCsvReaderService.php new file mode 100644 index 00000000..93bf92cc --- /dev/null +++ b/app/Services/EmployeeCsvReaderService.php @@ -0,0 +1,108 @@ + + */ + public function importEmployeesFromCsv($fromStream): array + { + Assert::resource($fromStream); + + $mode = stream_get_meta_data($fromStream)['mode']; + + if ($mode[0] !== 'r') { + $this->logger->error('Input stream is not readable.', [ + 'mode' => $mode, + ]); + throw new \InvalidArgumentException('Input stream must be readable.'); + } + + $this->logger->debug('Input stream is readable.', [ + 'mode' => $mode, + ]); + + try { + $options = new CsvReaderOptions(); + $options->delimiter = ';'; + $this->detectAndConvertEncoding($fromStream); + + $reader = new EnhancedCsvReader($fromStream, $options); + + $items = $reader->readObjects( + EmployeeCsvImportLine::class, + function ($line, $e) { + $this->logger->error('Failed to read line from CSV.', [ + 'line' => $line, + 'exception' => $e, + ]); + + return $e->getMessage(); + } + ); + + return iterator_to_array($items); + } catch (\Throwable $e) { + $this->logger->error('Failed to read employees from CSV.', [ + 'exception' => $e, + ]); + + report($e); + + return []; + } + } + + /** @param resource $fromStream */ + private function detectAndConvertEncoding($fromStream): void + { + $sample = fread($fromStream, 4096); + + if ($sample === false) { + $this->logger->error('Failed to read sample from input stream.'); + throw new \UnexpectedValueException('Failed to read sample from input stream.'); + } + + $safeSample = strlen($sample) === 4096 ? mb_strcut($sample, 0, 4092, 'UTF-8') : $sample; + + // ? Has BOM UTF-8 at the beginning of the sample ? + if (str_starts_with($safeSample, "\xEF\xBB\xBF")) { + rewind($fromStream); + + return; + } + + // * Detect encoding. + $detected = mb_detect_encoding($safeSample, ['UTF-8', 'Windows-1252', 'ISO-8859-1'], true); + + // * Rewind before attaching filter. + rewind($fromStream); + + if ($detected !== false && $detected !== 'UTF-8') { + $this->logger->info('Detected non-UTF-8 encoding, applying conversion filter.', [ + 'detected' => $detected, + ]); + + stream_filter_append( + $fromStream, + "convert.iconv.{$detected}/UTF-8//TRANSLIT", + STREAM_FILTER_READ + ); + } + } +} diff --git a/composer.json b/composer.json index 9a684abd..79d8ba8d 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "php": "^8.5", "axlon/laravel-postal-code-validation": "^3.9", "diglactic/laravel-breadcrumbs": "^10.1", + "fusonic/csv-reader": "^1.0", "kwaadpepper/serial-int-caster": "^2.0", "laravel/framework": "^13.0", "laravel/tinker": "^3.0", diff --git a/composer.lock b/composer.lock index 922b4456..4f668914 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3f044c48be0d10e5c41f0efb0efcbb99", + "content-hash": "c8e35cb5f86dd59bc4a8addb54133ba3", "packages": [ { "name": "axlon/laravel-postal-code-validation", @@ -1081,6 +1081,60 @@ ], "time": "2025-12-03T09:33:47+00:00" }, + { + "name": "fusonic/csv-reader", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/fusonic/php-csv-reader.git", + "reference": "1b3a6f25f66144fffa724a861ef7395a20016f60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fusonic/php-csv-reader/zipball/1b3a6f25f66144fffa724a861ef7395a20016f60", + "reference": "1b3a6f25f66144fffa724a861ef7395a20016f60", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.95", + "infection/infection": "^0.35", + "phpstan/phpstan": "^2.2", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^13.4", + "rector/rector": "^2.6", + "tomasvotruba/type-coverage": "^2.3" + }, + "suggest": { + "ext-intl": "Required to use IntlValueConverter for advanced value conversion." + }, + "type": "library", + "autoload": { + "psr-4": { + "Fusonic\\CsvReader\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fusonic GmbH", + "email": "php@fusonic.net" + } + ], + "description": "Map data from CSV files to typed PHP models.", + "support": { + "issues": "https://github.com/fusonic/php-csv-reader/issues", + "source": "https://github.com/fusonic/php-csv-reader/tree/1.0.0" + }, + "time": "2026-11-04T08:38:29+00:00" + }, { "name": "giggsey/libphonenumber-for-php-lite", "version": "9.0.41", diff --git a/lang/en.json b/lang/en.json index 32a019bd..131a3f6d 100644 --- a/lang/en.json +++ b/lang/en.json @@ -126,6 +126,7 @@ "Choose :name": "Choose :name", "Choose File": "Choose File", "Choose Image": "Choose Image", + "Choose position": "Choose position", "Choose slide": "Choose slide", "Choose your new password.": "Choose your new password.", "City": "City", @@ -418,6 +419,9 @@ "Misdirected Request": "Misdirected Request", "mm": "mm", "Month": "Month", + "Move": "Move", + "Move down": "Move down", + "Move up": "Move up", "Moved Permanently": "Moved Permanently", "Multi-Status": "Multi-Status", "Multiple Choices": "Multiple Choices", @@ -441,6 +445,7 @@ "New order from :firstname :lastname - :appname": "New order from :firstname :lastname - :appname", "New order registered!": "New order registered!", "New password": "New password", + "New position": "New position", "Newsletter unsubscription": "Newsletter unsubscription", "No": "No", "No account was found for this email address": "No account was found for this email address", @@ -870,12 +875,7 @@ "Your password has been changed - :appname": "Your password has been changed - :appname", "Your password has been changed on :appname": "Your password has been changed on :appname", "Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.": "Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.", - "your_message": "your_message", - "Zip code": "Zip code", "Your search": "Your search", - "Choose position": "Choose position", - "Move": "Move", - "Move down": "Move down", - "Move up": "Move up", - "New position": "New position" -} + "your_message": "your_message", + "Zip code": "Zip code" +} \ No newline at end of file diff --git a/lang/fr.json b/lang/fr.json index cf44c934..81e5292d 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -16,8 +16,8 @@ ":title Freshness & Quality :/title :desc Your order is carefully prepared, with strict adherence to the cold chain :/desc": ":title Fraicheur & Qualité :/title :desc Votre commande est préparée avec soin, dans le plus grand respect de la chaîne du froid :/desc", ":title Pick up your order :/title :desc :/desc": ":title Retirez :/title :desc votre commande :/desc", ":title Save money :/title :desc Get even more out of our gourmet products by buying directly :/desc": ":title Des économies :/title :desc Profitez encore plus de nos produits gourmands en achetant en direct :/desc", - ":title Select :/title :desc your products online :/desc": ":title Sélectionnez :/title :desc vos produits en ligne :/desc", ":title Select :/title :desc your pickup day :/desc": ":title Choisissez :/title :desc votre jour de retrait :/desc", + ":title Select :/title :desc your products online :/desc": ":title Sélectionnez :/title :desc vos produits en ligne :/desc", "A confirmation has just been sent to your email address": "Une confirmation vient de vous être envoyée sur votre adresse e-mail", "A decryption key is required.": "Une clé de déchiffrement est requise.", "A fresh verification link has been sent to your email address.": "Un nouveau lien de vérification a été envoyé à votre adresse e-mail.", @@ -125,6 +125,7 @@ "Choose :name": "Choisir :name", "Choose File": "Choisir le fichier", "Choose Image": "Choisir une image", + "Choose position": "Choisir une position", "Choose slide": "Choisir la diapositive", "Choose your new password.": "Choisissez votre nouveau mot de passe.", "City": "Ville", @@ -412,6 +413,9 @@ "Misdirected Request": "Demande mal dirigée", "mm": "mm", "Month": "Mois", + "Move": "Déplacer", + "Move down": "Descendre d'un cran", + "Move up": "Monter d'un cran", "Moved Permanently": "Déplacé de façon permanente", "Multi-Status": "Statut multiple", "Multiple Choices": "Choix multiples", @@ -435,6 +439,7 @@ "New order from :firstname :lastname - :appname": "Nouvelle commande de :firstname :lastname - :appname", "New order registered!": "Nouvelle commande enregistrée !", "New password": "Nouveau mot de passe", + "New position": "Nouvelle position", "Newsletter unsubscription": "Désinscription à la newsletter", "No": "Non", "No account was found for this email address": "Aucun compte n'a été trouvé pour cette adresse e-mail", @@ -857,12 +862,7 @@ "Your password has been changed - :appname": "Votre mot de passe a été changé - :appname", "Your password has been changed on :appname": "Votre mot de passe a été changé sur :appname", "Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.": "Votre mot de passe a été changé. Si vous n'êtes pas à l'origine de ceci, veuillez nous contacter au plus vite en utilisant le formulaire de contact ou en vous rapprochant de votre responsable.", - "your_message": "Votre message", - "Zip code": "Code postal", "Your search": "Votre recherche", - "Choose position": "Choisir une position", - "Move": "Déplacer", - "Move down": "Descendre d'un cran", - "Move up": "Monter d'un cran", - "New position": "Nouvelle position" -} + "your_message": "Votre message", + "Zip code": "Code postal" +} \ No newline at end of file diff --git a/lang/fr/validation.php b/lang/fr/validation.php index a2614ec8..86416c17 100644 --- a/lang/fr/validation.php +++ b/lang/fr/validation.php @@ -370,8 +370,8 @@ return [ 'picture_large_alt' => 'texte alternatif à l\'image large', 'picture_large_title' => 'titre de l\'image large', 'picture_title' => 'titre de l\'image', - 'preparation' => 'Préparation', 'postal_address' => 'adresse postale', + 'preparation' => 'Préparation', 'question' => 'question', 'reference' => 'référence', 'repeat_frequency' => 'fréquence de répétition', diff --git a/tests/Feature/App/Console/Commands/UpsertEmployeesFormFileTest.php b/tests/Feature/App/Console/Commands/UpsertEmployeesFormFileTest.php new file mode 100644 index 00000000..e6117f8b --- /dev/null +++ b/tests/Feature/App/Console/Commands/UpsertEmployeesFormFileTest.php @@ -0,0 +1,27 @@ +artisan('uwil:employees:upsert', [ + 'file' => $filePath, + ]); + + // THEN + $result->assertExitCode(Command::FAILURE); + }); + +}); diff --git a/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php b/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php new file mode 100644 index 00000000..4dc1777b --- /dev/null +++ b/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php @@ -0,0 +1,40 @@ +insertedCount)->toBe(3) + ->and($result->updatedCount)->toBe(4) + ->and($result->errors)->toBe(['Invalid date at line 3']); + }); + + it('throws when inserted count is negative', function (): void { + // GIVEN + WHEN + THEN + expect(fn () => new EmployeesImportResults(-1, 0, [])) + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when updated count is negative', function (): void { + // GIVEN + WHEN + THEN + expect(fn () => new EmployeesImportResults(0, -1, [])) + ->toThrow(\InvalidArgumentException::class); + }); + + it('throws when errors contain non string values', function (): void { + // GIVEN + WHEN + THEN + expect(fn () => new EmployeesImportResults(0, 0, ['ok', 123])) + ->toThrow(\InvalidArgumentException::class); + }); +}); + diff --git a/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesInputTest.php b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesInputTest.php new file mode 100644 index 00000000..81f5b1e5 --- /dev/null +++ b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesInputTest.php @@ -0,0 +1,50 @@ +not->toBeFalse(); + file_put_contents($filePath, 'header'); + + $stream = fopen($filePath, 'r'); + expect($stream)->not->toBeFalse(); + + // WHEN + $input = new ImportEmployeesInput($stream); + + // THEN + expect($input->inputStream)->toBe($stream); + + fclose($stream); + unlink($filePath); + }); + + it('throws when stream is not readable', function (): void { + // GIVEN + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); + expect($filePath)->not->toBeFalse(); + $stream = fopen($filePath, 'w'); + expect($stream)->not->toBeFalse(); + + // WHEN + THEN + expect(fn () => new ImportEmployeesInput($stream)) + ->toThrow(\InvalidArgumentException::class, 'Input stream must be readable.'); + + fclose($stream); + unlink($filePath); + }); + + it('throws when input is not a resource', function (): void { + // GIVEN + $notAStream = 'employees.csv'; + + // WHEN + THEN + expect(fn () => new ImportEmployeesInput($notAStream)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php new file mode 100644 index 00000000..fed87653 --- /dev/null +++ b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php @@ -0,0 +1,148 @@ +shouldReceive('debug')->once(); + $logger->shouldReceive('info')->once(); + + $reader = \Mockery::mock(EmployeeCsvReaderService::class); + $upsert = \Mockery::mock(EmployeeUpsertService::class); + + $line = new EmployeeCsvImportLine(); + $line->matricule = '1234567'; + $line->lastName = 'Dupont'; + $line->firstName = 'Jean'; + $line->setStartDate('01/10/2026'); + $line->setEndDate(''); + $line->establishment = 'ETAB01'; + $line->site = 'PA'; + $line->setService('LDCCAV030'); + + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); + expect($filePath)->not->toBeFalse(); + file_put_contents($filePath, 'header'); + + $stream = fopen($filePath, 'r'); + expect($stream)->not->toBeFalse(); + + $reader->shouldReceive('importEmployeesFromCsv') + ->once() + ->with($stream) + ->andReturn([$line, 'Invalid CSV line at row 3']); + + $upsert->shouldReceive('upsertEmployees') + ->once() + ->with(\Mockery::on(static function (array $employees): bool { + return count($employees) === 1 + && $employees[0] instanceof ArcadiaEmployee + && $employees[0]->matricule->value === '1234567'; + })) + ->andReturn(new EmployeeUpsertServiceResult( + insertedCount: 1, + updatedCount: 2, + errors: [], + )); + + $action = new ImportEmployees($logger, $reader, $upsert); + + // WHEN + $result = $action(new ImportEmployeesInput($stream)); + + // THEN + expect($result)->toBeInstanceOf(EmployeesImportResults::class) + ->and($result->insertedCount)->toBe(1) + ->and($result->updatedCount)->toBe(2) + ->and(array_values($result->errors))->toBe(['Invalid CSV line at row 3']); + + fclose($stream); + unlink($filePath); + }); + + it('returns mapping errors when a CSV line cannot become an Arcadia employee', function (): void { + // GIVEN + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug')->once(); + $logger->shouldReceive('info')->once(); + + $reader = \Mockery::mock(EmployeeCsvReaderService::class); + $upsert = \Mockery::mock(EmployeeUpsertService::class); + + $line = new EmployeeCsvImportLine(); + $line->matricule = '1234567'; + $line->lastName = 'Dupont'; + $line->firstName = 'Jean'; + $line->setStartDate('01/10/2026'); + $line->setEndDate(''); + $line->establishment = 'ETAB01'; + $line->site = 'pa'; + $line->setService('LDCCAV030'); + + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); + expect($filePath)->not->toBeFalse(); + file_put_contents($filePath, 'header'); + + $stream = fopen($filePath, 'r'); + expect($stream)->not->toBeFalse(); + + $reader->shouldReceive('importEmployeesFromCsv') + ->once() + ->with($stream) + ->andReturn([$line]); + + $upsert->shouldReceive('upsertEmployees') + ->once() + ->with([]) + ->andReturn(new EmployeeUpsertServiceResult( + insertedCount: 0, + updatedCount: 0, + errors: [], + )); + + $action = new ImportEmployees($logger, $reader, $upsert); + + // WHEN + $result = $action(new ImportEmployeesInput($stream)); + + // THEN + expect($result->errors)->toHaveCount(1) + ->and($result->errors[0])->toContain('does not match pattern'); + + fclose($stream); + unlink($filePath); + }); + + it('throws when input type is invalid', function (): void { + // GIVEN + $logger = \Mockery::mock(LoggerInterface::class); + $reader = \Mockery::mock(EmployeeCsvReaderService::class); + $upsert = \Mockery::mock(EmployeeUpsertService::class); + $action = new ImportEmployees($logger, $reader, $upsert); + + $invalidInput = new class () implements ActionInput + { + }; + + // WHEN + THEN + expect(fn () => $action($invalidInput)) + ->toThrow(\InvalidArgumentException::class); + }); +}); diff --git a/tests/Unit/App/Services/EmployeeCsvImportLineTest.php b/tests/Unit/App/Services/EmployeeCsvImportLineTest.php new file mode 100644 index 00000000..60cfce14 --- /dev/null +++ b/tests/Unit/App/Services/EmployeeCsvImportLineTest.php @@ -0,0 +1,45 @@ +setStartDate('01/10/2026'); + $line->setEndDate(''); + $line->setExpectedEndDate('15/10/2026'); + $line->setService('LDCCAV030'); + + // THEN + expect($line->startDate)->toBeInstanceOf(\DateTimeImmutable::class) + ->and($line->startDate->format('Y-m-d'))->toBe('2026-10-01') + ->and($line->endDate)->toBeNull() + ->and($line->expectedEndDate)->toBeInstanceOf(\DateTimeImmutable::class) + ->and($line->expectedEndDate?->format('Y-m-d'))->toBe('2026-10-15') + ->and($line->service)->toBe('030'); + }); + + it('throws when mandatory start date has invalid format', function (): void { + // GIVEN + $line = new EmployeeCsvImportLine(); + + // WHEN + THEN + expect(fn () => $line->setStartDate('2026-10-01')) + ->toThrow(\InvalidArgumentException::class, 'Invalid date format: 2026-10-01'); + }); + + it('throws when optional end date has invalid format', function (): void { + // GIVEN + $line = new EmployeeCsvImportLine(); + + // WHEN + THEN + expect(fn () => $line->setEndDate('31-12-2026')) + ->toThrow(\InvalidArgumentException::class, 'Invalid date format: 31-12-2026'); + }); +}); + diff --git a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php new file mode 100644 index 00000000..7379a398 --- /dev/null +++ b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php @@ -0,0 +1,97 @@ +shouldReceive('debug')->once(); + $logger->shouldReceive('error')->never(); + + $service = new EmployeeCsvReaderService($logger); + + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); + expect($filePath)->not->toBeFalse(); + + file_put_contents($filePath, implode("\n", [ + 'Matricule;Nom;Prénom;Date début;Date fin;Date fin prévue;Etablissement;Site;Service', + '1234567;Dupont;Jean;01/10/2026;;;ETAB01;PA;LDCCAV030', + ])); + + $stream = fopen($filePath, 'r'); + expect($stream)->not->toBeFalse(); + + // WHEN + $items = $service->importEmployeesFromCsv($stream); + + // THEN + expect($items)->toHaveCount(1) + ->and($items[0])->toBeInstanceOf(EmployeeCsvImportLine::class) + ->and($items[0]->matricule)->toBe('1234567') + ->and($items[0]->service)->toBe('030'); + + fclose($stream); + unlink($filePath); + }); + + it('returns row-level error when a CSV line cannot be mapped', function (): void { + // GIVEN + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug')->once(); + $logger->shouldReceive('error')->once(); + + $service = new EmployeeCsvReaderService($logger); + + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); + expect($filePath)->not->toBeFalse(); + + file_put_contents($filePath, implode("\n", [ + 'Matricule;Nom;Prénom;Date début;Date fin;Date fin prévue;Etablissement;Site;Service', + '1234567;Dupont;Jean;2026-10-01;;;ETAB01;PA;LDCCAV030', + ])); + + $stream = fopen($filePath, 'r'); + expect($stream)->not->toBeFalse(); + + // WHEN + $items = $service->importEmployeesFromCsv($stream); + + // THEN + expect($items)->toHaveCount(1) + ->and($items[0])->toBeString() + ->and($items[0])->toContain('Invalid date format'); + + fclose($stream); + unlink($filePath); + }); + + it('throws when input stream is not opened in read mode', function (): void { + // GIVEN + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('error')->once(); + + $service = new EmployeeCsvReaderService($logger); + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); + expect($filePath)->not->toBeFalse(); + + $stream = fopen($filePath, 'w'); + + expect($stream)->not->toBeFalse(); + + // WHEN + THEN + expect(fn () => $service->importEmployeesFromCsv($stream)) + ->toThrow(\InvalidArgumentException::class, 'Input stream must be readable.'); + + fclose($stream); + unlink($filePath); + }); +}); From 74ab9b30417e41599e223c9913b9b9580af4c442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 10 Nov 2026 18:15:32 +0100 Subject: [PATCH 04/11] refactor: reorganize imports across multiple controllers and jobs This commit refactors the import statements in various controllers and jobs to improve code organization and readability. Unused imports were removed, and necessary imports were added to ensure proper functionality. --- app/Console/Commands/SyncProductIncosCommand.php | 2 +- app/Http/Controllers/Bo/DashboardController.php | 2 +- app/Http/Controllers/Bo/DiscountsController.php | 10 +++++----- app/Http/Controllers/Bo/FaqsController.php | 6 +++--- app/Http/Controllers/Bo/OrdersController.php | 10 +++++----- app/Http/Controllers/Bo/PageController.php | 2 +- .../Controllers/Bo/PickupExceptionsController.php | 6 +++--- app/Http/Controllers/Bo/ProductIncosController.php | 4 ++-- app/Http/Controllers/Bo/ProductsController.php | 8 ++++---- app/Http/Controllers/Bo/RangesController.php | 6 +++--- app/Http/Controllers/Bo/SettingsController.php | 4 ++-- app/Http/Controllers/Bo/ShopsController.php | 10 +++++----- app/Http/Controllers/Bo/SlidesController.php | 6 +++--- app/Http/Controllers/Bo/TagsController.php | 6 +++--- app/Http/Controllers/Fo/Ajax/BasketController.php | 8 ++++---- app/Http/Controllers/Fo/Ajax/PickupController.php | 4 ++-- app/Http/Controllers/Fo/Ajax/ProductsController.php | 2 +- .../Controllers/Fo/Auth/ForgotPasswordController.php | 2 +- app/Http/Controllers/Fo/Auth/RegisterController.php | 2 +- .../Controllers/Fo/Customers/CustomerController.php | 6 +++--- .../Controllers/Fo/Customers/OrderController.php | 6 +++--- .../Controllers/Fo/Customers/PasswordController.php | 2 +- app/Http/Controllers/Fo/NewsletterController.php | 2 +- app/Http/Controllers/Fo/Pages/ContactController.php | 6 +++--- app/Http/Controllers/Fo/Pages/HomeController.php | 2 +- app/Http/Controllers/Fo/Pages/PageController.php | 4 ++-- app/Http/Controllers/Fo/Pages/ProductsController.php | 4 ++-- app/Http/Controllers/Fo/TunnelController.php | 12 ++++++------ app/Http/Requests/Bo/Orders/IndexOrdersRequest.php | 2 +- .../Requests/Bo/Products/IndexProductRequest.php | 2 +- app/Jobs/FetchAndUpsertArcadiaEmployees.php | 2 +- app/Jobs/FetchAndUpsertArcadiaProductIncos.php | 2 +- app/Traits/Controllers/ChangesModelOrder.php | 2 +- app/Traits/Controllers/HasMassActions.php | 2 +- app/Traits/Controllers/TogglesModelStar.php | 2 +- app/Traits/Controllers/TogglesModelStatus.php | 2 +- .../Console/Commands/UpsertEmployeesFormFileTest.php | 1 - .../Actions/Employee/EmployeesImportResultsTest.php | 1 - .../Unit/App/Services/EmployeeCsvImportLineTest.php | 1 - .../App/Services/EmployeeCsvReaderServiceTest.php | 2 +- 40 files changed, 81 insertions(+), 84 deletions(-) diff --git a/app/Console/Commands/SyncProductIncosCommand.php b/app/Console/Commands/SyncProductIncosCommand.php index 144cbaf2..dd8430d5 100644 --- a/app/Console/Commands/SyncProductIncosCommand.php +++ b/app/Console/Commands/SyncProductIncosCommand.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace App\Console\Commands; -use App\Cqs\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; use App\Contracts\ActionInputEmpty; use App\Contracts\Executor; +use App\Cqs\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; use App\Jobs\FetchAndUpsertArcadiaProductIncos; use Illuminate\Console\Attributes\Description; use Illuminate\Console\Attributes\Signature; diff --git a/app/Http/Controllers/Bo/DashboardController.php b/app/Http/Controllers/Bo/DashboardController.php index 0387b2fd..5834b17b 100644 --- a/app/Http/Controllers/Bo/DashboardController.php +++ b/app/Http/Controllers/Bo/DashboardController.php @@ -5,9 +5,9 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; use App\Contracts\Executor; +use App\Cqs\Queries\Dashboard\GetBoDashboardQuery; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Dashboard\DashboardRequest; -use App\Cqs\Queries\Dashboard\GetBoDashboardQuery; use Illuminate\Contracts\View\View; class DashboardController extends Controller diff --git a/app/Http/Controllers/Bo/DiscountsController.php b/app/Http/Controllers/Bo/DiscountsController.php index b14eae95..1d42b45d 100644 --- a/app/Http/Controllers/Bo/DiscountsController.php +++ b/app/Http/Controllers/Bo/DiscountsController.php @@ -4,20 +4,20 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\Discounts\CreateDiscount; use App\Cqs\Actions\Discounts\DeleteDiscount; use App\Cqs\Actions\Discounts\DeleteDiscountInput; use App\Cqs\Actions\Discounts\UpdateDiscount; -use App\Contracts\Executor; +use App\Cqs\Queries\Discounts\GetDiscountFormDataQuery; +use App\Cqs\Queries\Discounts\GetDiscountFormDataQueryInput; +use App\Cqs\Queries\Discounts\GetPaginatedDiscountsQuery; +use App\Cqs\Queries\Discounts\GetPaginatedDiscountsQueryInput; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Discounts\StoreDiscountRequest; use App\Http\Requests\Bo\Discounts\UpdateDiscountRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Discount; -use App\Cqs\Queries\Discounts\GetDiscountFormDataQuery; -use App\Cqs\Queries\Discounts\GetDiscountFormDataQueryInput; -use App\Cqs\Queries\Discounts\GetPaginatedDiscountsQuery; -use App\Cqs\Queries\Discounts\GetPaginatedDiscountsQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Bo/FaqsController.php b/app/Http/Controllers/Bo/FaqsController.php index 0879bd7e..bf928f6c 100644 --- a/app/Http/Controllers/Bo/FaqsController.php +++ b/app/Http/Controllers/Bo/FaqsController.php @@ -4,18 +4,18 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\Faqs\CreateFaq; use App\Cqs\Actions\Faqs\DeleteFaq; use App\Cqs\Actions\Faqs\DeleteFaqInput; use App\Cqs\Actions\Faqs\UpdateFaq; -use App\Contracts\Executor; +use App\Cqs\Queries\Faqs\GetPaginatedFaqsQuery; +use App\Cqs\Queries\Faqs\GetPaginatedFaqsQueryInput; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Faqs\StoreFaqRequest; use App\Http\Requests\Bo\Faqs\UpdateFaqRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Faq; -use App\Cqs\Queries\Faqs\GetPaginatedFaqsQuery; -use App\Cqs\Queries\Faqs\GetPaginatedFaqsQueryInput; use App\Traits\Controllers\ChangesModelOrder; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/Bo/OrdersController.php b/app/Http/Controllers/Bo/OrdersController.php index 75c5c69f..8143b8a4 100644 --- a/app/Http/Controllers/Bo/OrdersController.php +++ b/app/Http/Controllers/Bo/OrdersController.php @@ -4,18 +4,18 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\Orders\CancelOrder; use App\Cqs\Actions\Orders\CancelOrderInput; -use App\Contracts\Executor; -use App\Http\Controllers\Controller; -use App\Http\Requests\Bo\Orders\IndexOrdersRequest; -use App\Lib\Helpers\RequestHelper; -use App\Models\Order; use App\Cqs\Queries\Orders\GetBoOrderDetailQuery; use App\Cqs\Queries\Orders\GetBoOrderDetailQueryInput; use App\Cqs\Queries\Orders\GetBoPaginatedOrdersQuery; use App\Cqs\Queries\Orders\GetBoTodayOrdersQuery; use App\Cqs\Queries\Orders\GetBoTodayOrdersQueryInput; +use App\Http\Controllers\Controller; +use App\Http\Requests\Bo\Orders\IndexOrdersRequest; +use App\Lib\Helpers\RequestHelper; +use App\Models\Order; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Bo/PageController.php b/app/Http/Controllers/Bo/PageController.php index 80d49a68..54a4e3cf 100644 --- a/app/Http/Controllers/Bo/PageController.php +++ b/app/Http/Controllers/Bo/PageController.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Cqs\Actions\Pages\UpdatePage; use App\Contracts\Executor; +use App\Cqs\Actions\Pages\UpdatePage; use App\Dto\PageDto; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Pages\UpdatePageRequest as PagesUpdatePageRequest; diff --git a/app/Http/Controllers/Bo/PickupExceptionsController.php b/app/Http/Controllers/Bo/PickupExceptionsController.php index e3cc991b..2f88dc5f 100644 --- a/app/Http/Controllers/Bo/PickupExceptionsController.php +++ b/app/Http/Controllers/Bo/PickupExceptionsController.php @@ -4,19 +4,19 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\PickupExceptions\CreatePickupException; use App\Cqs\Actions\PickupExceptions\DeletePickupException; use App\Cqs\Actions\PickupExceptions\DeletePickupExceptionInput; use App\Cqs\Actions\PickupExceptions\UpdatePickupException; -use App\Contracts\Executor; +use App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQuery; +use App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput; use App\Dto\PickupExceptionDto; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\PickupExceptions\StorePickupExceptionRequest; use App\Http\Requests\Bo\PickupExceptions\UpdatePickupExceptionRequest; use App\Lib\Helpers\RequestHelper; use App\Models\PickupException; -use App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQuery; -use App\Cqs\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Bo/ProductIncosController.php b/app/Http/Controllers/Bo/ProductIncosController.php index 2c6a8a53..b4800031 100644 --- a/app/Http/Controllers/Bo/ProductIncosController.php +++ b/app/Http/Controllers/Bo/ProductIncosController.php @@ -4,9 +4,10 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\ProductIncos\AssociateProductInco; use App\Cqs\Actions\ProductIncos\SyncProductInco; -use App\Contracts\Executor; +use App\Cqs\Queries\ProductIncos\GetArcadiaIncoPreviewQuery; use App\Dto\ProductDto; use App\Dto\ProductIncoDto; use App\Http\Controllers\Controller; @@ -15,7 +16,6 @@ use App\Http\Requests\Bo\ProductIncos\PreviewArcadiaIncoRequest; use App\Http\Requests\Bo\ProductIncos\SyncProductIncoRequest; use App\Models\Product; use App\Models\ProductInco; -use App\Cqs\Queries\ProductIncos\GetArcadiaIncoPreviewQuery; use Illuminate\Contracts\View\View; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/Bo/ProductsController.php b/app/Http/Controllers/Bo/ProductsController.php index f6597973..9cee5f75 100644 --- a/app/Http/Controllers/Bo/ProductsController.php +++ b/app/Http/Controllers/Bo/ProductsController.php @@ -4,20 +4,20 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\Products\CreateProduct; use App\Cqs\Actions\Products\DeleteProduct; use App\Cqs\Actions\Products\DeleteProductInput; use App\Cqs\Actions\Products\UpdateProduct; -use App\Contracts\Executor; +use App\Cqs\Queries\Products\GetBoPaginatedProductsQuery; +use App\Cqs\Queries\Products\GetProductFormDataQuery; +use App\Cqs\Queries\Products\GetProductFormDataQueryInput; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Products\IndexProductRequest; use App\Http\Requests\Bo\Products\StoreProductRequest; use App\Http\Requests\Bo\Products\UpdateProductRequest; use App\Interfaces\MassActions; use App\Models\Product; -use App\Cqs\Queries\Products\GetBoPaginatedProductsQuery; -use App\Cqs\Queries\Products\GetProductFormDataQuery; -use App\Cqs\Queries\Products\GetProductFormDataQueryInput; use App\Traits\Controllers\ChangesModelOrder; use App\Traits\Controllers\HasMassActions; use App\Traits\Controllers\TogglesModelStar; diff --git a/app/Http/Controllers/Bo/RangesController.php b/app/Http/Controllers/Bo/RangesController.php index 66545480..fc24a059 100644 --- a/app/Http/Controllers/Bo/RangesController.php +++ b/app/Http/Controllers/Bo/RangesController.php @@ -4,19 +4,19 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\Ranges\CreateRange; use App\Cqs\Actions\Ranges\DeleteRange; use App\Cqs\Actions\Ranges\DeleteRangeInput; use App\Cqs\Actions\Ranges\UpdateRange; -use App\Contracts\Executor; +use App\Cqs\Queries\Ranges\GetPaginatedRangesQuery; +use App\Cqs\Queries\Ranges\GetPaginatedRangesQueryInput; use App\Dto\RangeDto; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Ranges\StoreRangeRequest; use App\Http\Requests\Bo\Ranges\UpdateRangeRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Range; -use App\Cqs\Queries\Ranges\GetPaginatedRangesQuery; -use App\Cqs\Queries\Ranges\GetPaginatedRangesQueryInput; use App\Traits\Controllers\ChangesModelOrder; use App\Traits\Controllers\TogglesModelStatus; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Bo/SettingsController.php b/app/Http/Controllers/Bo/SettingsController.php index cfbed3e2..ac2e252f 100644 --- a/app/Http/Controllers/Bo/SettingsController.php +++ b/app/Http/Controllers/Bo/SettingsController.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; -use App\Cqs\Actions\Settings\UpdateSettings; use App\Contracts\Executor; use App\Contracts\QueryInputEmpty; +use App\Cqs\Actions\Settings\UpdateSettings; +use App\Cqs\Queries\Settings\GetSettingsQuery; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Settings\UpdateSettingsRequest; use App\Models\Setting; -use App\Cqs\Queries\Settings\GetSettingsQuery; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Str; diff --git a/app/Http/Controllers/Bo/ShopsController.php b/app/Http/Controllers/Bo/ShopsController.php index 03f32a42..368f33b5 100644 --- a/app/Http/Controllers/Bo/ShopsController.php +++ b/app/Http/Controllers/Bo/ShopsController.php @@ -4,12 +4,16 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\Shops\CreateShop; use App\Cqs\Actions\Shops\DeleteShop; use App\Cqs\Actions\Shops\DeleteShopInput; use App\Cqs\Actions\Shops\UpdateShop; use App\Cqs\Actions\Shops\UpdateShopPickupExceptions; -use App\Contracts\Executor; +use App\Cqs\Queries\Shops\GetPaginatedShopsQuery; +use App\Cqs\Queries\Shops\GetPaginatedShopsQueryInput; +use App\Cqs\Queries\Shops\GetShopPickupExceptionsQuery; +use App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryInput; use App\Dto\ShopDto; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Shops\IndexShopRequest; @@ -18,10 +22,6 @@ use App\Http\Requests\Bo\Shops\UpdateShopPickupExceptionsRequest; use App\Http\Requests\Bo\Shops\UpdateShopRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Shop; -use App\Cqs\Queries\Shops\GetPaginatedShopsQuery; -use App\Cqs\Queries\Shops\GetPaginatedShopsQueryInput; -use App\Cqs\Queries\Shops\GetShopPickupExceptionsQuery; -use App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Str; diff --git a/app/Http/Controllers/Bo/SlidesController.php b/app/Http/Controllers/Bo/SlidesController.php index 269bf05f..e461bca1 100644 --- a/app/Http/Controllers/Bo/SlidesController.php +++ b/app/Http/Controllers/Bo/SlidesController.php @@ -4,19 +4,19 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\Slides\CreateSlide; use App\Cqs\Actions\Slides\DeleteSlide; use App\Cqs\Actions\Slides\DeleteSlideInput; use App\Cqs\Actions\Slides\UpdateSlide; -use App\Contracts\Executor; +use App\Cqs\Queries\Slides\GetPaginatedSlidesQuery; +use App\Cqs\Queries\Slides\GetPaginatedSlidesQueryInput; use App\Dto\SlideDto; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Slides\StoreSlideRequest; use App\Http\Requests\Bo\Slides\UpdateSlideRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Slide; -use App\Cqs\Queries\Slides\GetPaginatedSlidesQuery; -use App\Cqs\Queries\Slides\GetPaginatedSlidesQueryInput; use App\Traits\Controllers\ChangesModelOrder; use App\Traits\Controllers\TogglesModelStatus; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Bo/TagsController.php b/app/Http/Controllers/Bo/TagsController.php index c7ec0d6b..cdae956a 100644 --- a/app/Http/Controllers/Bo/TagsController.php +++ b/app/Http/Controllers/Bo/TagsController.php @@ -4,18 +4,18 @@ declare(strict_types=1); namespace App\Http\Controllers\Bo; +use App\Contracts\Executor; use App\Cqs\Actions\Tags\CreateTag; use App\Cqs\Actions\Tags\DeleteTag; use App\Cqs\Actions\Tags\DeleteTagInput; use App\Cqs\Actions\Tags\UpdateTag; -use App\Contracts\Executor; +use App\Cqs\Queries\Tags\GetPaginatedTagsQuery; +use App\Cqs\Queries\Tags\GetPaginatedTagsQueryInput; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Tags\StoreTagRequest; use App\Http\Requests\Bo\Tags\UpdateTagRequest; use App\Lib\Helpers\RequestHelper; use App\Models\Tag; -use App\Cqs\Queries\Tags\GetPaginatedTagsQuery; -use App\Cqs\Queries\Tags\GetPaginatedTagsQueryInput; use App\Traits\Controllers\ChangesModelOrder; use App\Traits\Controllers\TogglesModelStatus; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Ajax/BasketController.php b/app/Http/Controllers/Fo/Ajax/BasketController.php index d4123d53..0e14b28d 100644 --- a/app/Http/Controllers/Fo/Ajax/BasketController.php +++ b/app/Http/Controllers/Fo/Ajax/BasketController.php @@ -4,17 +4,17 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Ajax; -use App\Cqs\Actions\Basket\AddToBasket; -use App\Cqs\Actions\Basket\EmptyBasket; -use App\Cqs\Actions\Basket\RemoveFromBasket; use App\Contracts\ActionInputEmpty; use App\Contracts\Executor; use App\Contracts\QueryInputEmpty; +use App\Cqs\Actions\Basket\AddToBasket; +use App\Cqs\Actions\Basket\EmptyBasket; +use App\Cqs\Actions\Basket\RemoveFromBasket; +use App\Cqs\Queries\Basket\GetBasketQuery; use App\Http\Controllers\Controller; use App\Http\Requests\Basket\AddBasketRequest; use App\Http\Requests\Basket\RemoveBasketRequest; use App\Http\Resources\Fo\Ajax\BasketResource; -use App\Cqs\Queries\Basket\GetBasketQuery; use Illuminate\Http\JsonResponse; class BasketController extends Controller diff --git a/app/Http/Controllers/Fo/Ajax/PickupController.php b/app/Http/Controllers/Fo/Ajax/PickupController.php index 01c149b4..d784e2f9 100644 --- a/app/Http/Controllers/Fo/Ajax/PickupController.php +++ b/app/Http/Controllers/Fo/Ajax/PickupController.php @@ -5,11 +5,11 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Ajax; use App\Contracts\Executor; +use App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQuery; +use App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryInput; use App\Http\Controllers\Controller; use App\Http\Resources\Fo\Ajax\TimeSlotResource; use App\Models\Shop; -use App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQuery; -use App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryInput; use Illuminate\Http\JsonResponse; use Illuminate\Http\Resources\Json\AnonymousResourceCollection; diff --git a/app/Http/Controllers/Fo/Ajax/ProductsController.php b/app/Http/Controllers/Fo/Ajax/ProductsController.php index 399a9a6a..6c2d36e4 100644 --- a/app/Http/Controllers/Fo/Ajax/ProductsController.php +++ b/app/Http/Controllers/Fo/Ajax/ProductsController.php @@ -5,10 +5,10 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Ajax; use App\Contracts\Executor; +use App\Cqs\Queries\Products\GetFoFilteredProductsQuery; use App\Http\Controllers\Controller; use App\Http\Requests\Fo\Ajax\FilterProductsRequest; use App\Http\Resources\Fo\Ajax\FilteredProductResource; -use App\Cqs\Queries\Products\GetFoFilteredProductsQuery; use Illuminate\Http\Resources\Json\JsonResource; class ProductsController extends Controller diff --git a/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php b/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php index ac255f7f..407b5c7a 100644 --- a/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Fo/Auth/ForgotPasswordController.php @@ -5,9 +5,9 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Auth; use App\Contracts\Executor; -use App\Exceptions\CustomerNotEmployedException; use App\Cqs\Queries\Customers\GetCustomerByEmailQuery; use App\Cqs\Queries\Customers\GetCustomerByEmailQueryInput; +use App\Exceptions\CustomerNotEmployedException; use Domain\Models\ValueObjects\Email; use Domain\Models\ValueObjects\Entities\ShopperId; use Domain\Services\ShopperService; diff --git a/app/Http/Controllers/Fo/Auth/RegisterController.php b/app/Http/Controllers/Fo/Auth/RegisterController.php index 14c927ba..3eae52c4 100644 --- a/app/Http/Controllers/Fo/Auth/RegisterController.php +++ b/app/Http/Controllers/Fo/Auth/RegisterController.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Auth; -use App\Cqs\Actions\Customers\RegisterCustomer; use App\Contracts\Executor; +use App\Cqs\Actions\Customers\RegisterCustomer; use App\Http\Requests\Fo\Auth\RegisterRequest; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Customers/CustomerController.php b/app/Http/Controllers/Fo/Customers/CustomerController.php index 9b1b9f56..9de97311 100644 --- a/app/Http/Controllers/Fo/Customers/CustomerController.php +++ b/app/Http/Controllers/Fo/Customers/CustomerController.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Customers; -use App\Cqs\Actions\Crm\UpdateCustomer; use App\Contracts\Executor; +use App\Cqs\Actions\Crm\UpdateCustomer; +use App\Cqs\Queries\Crm\GetCrmCustomerQuery; +use App\Cqs\Queries\Crm\GetCrmCustomerQueryInput; use App\Http\Controllers\Controller; use App\Http\Requests\Fo\Customer\UpdateInfosRequest; use App\Models\Customer; -use App\Cqs\Queries\Crm\GetCrmCustomerQuery; -use App\Cqs\Queries\Crm\GetCrmCustomerQueryInput; use Domain\Models\ValueObjects\CrmCustomer; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; diff --git a/app/Http/Controllers/Fo/Customers/OrderController.php b/app/Http/Controllers/Fo/Customers/OrderController.php index a92096e0..e900e96f 100644 --- a/app/Http/Controllers/Fo/Customers/OrderController.php +++ b/app/Http/Controllers/Fo/Customers/OrderController.php @@ -5,13 +5,13 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Customers; use App\Contracts\Executor; -use App\Http\Controllers\Controller; -use App\Lib\Helpers\RequestHelper; -use App\Models\Order; use App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQuery; use App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQueryInput; use App\Cqs\Queries\Orders\GetFoCustomerPaginatedOrdersQuery; use App\Cqs\Queries\Orders\GetFoCustomerPaginatedOrdersQueryInput; +use App\Http\Controllers\Controller; +use App\Lib\Helpers\RequestHelper; +use App\Models\Order; use Illuminate\Contracts\View\View; use Illuminate\Http\Request; use Infrastructure\Adapters\Services\AppCustomerAuthService; diff --git a/app/Http/Controllers/Fo/Customers/PasswordController.php b/app/Http/Controllers/Fo/Customers/PasswordController.php index afbba8d7..bc86eaf3 100644 --- a/app/Http/Controllers/Fo/Customers/PasswordController.php +++ b/app/Http/Controllers/Fo/Customers/PasswordController.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Customers; -use App\Cqs\Actions\Crm\UpdateCustomerPassword; use App\Contracts\Executor; +use App\Cqs\Actions\Crm\UpdateCustomerPassword; use App\Http\Controllers\Controller; use App\Http\Requests\Fo\Customer\UpdatePasswordRequest; use App\Models\Customer; diff --git a/app/Http/Controllers/Fo/NewsletterController.php b/app/Http/Controllers/Fo/NewsletterController.php index 9ca58823..f3f9cdc9 100644 --- a/app/Http/Controllers/Fo/NewsletterController.php +++ b/app/Http/Controllers/Fo/NewsletterController.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo; +use App\Contracts\Executor; use App\Cqs\Actions\Crm\UnsubscribeFromNewsletter; use App\Cqs\Actions\Crm\UnsubscribeFromNewsletterInput; use App\Cqs\Actions\Crm\UnsubscribeFromNewsletterOutput; -use App\Contracts\Executor; use App\Http\Requests\Fo\UnsubscribeNewsletterRequest; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Pages/ContactController.php b/app/Http/Controllers/Fo/Pages/ContactController.php index edcc24b2..28a4982b 100644 --- a/app/Http/Controllers/Fo/Pages/ContactController.php +++ b/app/Http/Controllers/Fo/Pages/ContactController.php @@ -5,13 +5,13 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Pages; use App\Contracts\Executor; -use App\Http\Controllers\Controller; -use App\Http\Requests\Fo\ContactFormRequest; -use App\Mail\SendContactMail; use App\Cqs\Queries\Pages\GetPageQuery; use App\Cqs\Queries\Pages\GetPageQueryInput; use App\Cqs\Queries\Shops\GetShopQuery; use App\Cqs\Queries\Shops\GetShopQueryInput; +use App\Http\Controllers\Controller; +use App\Http\Requests\Fo\ContactFormRequest; +use App\Mail\SendContactMail; use Domain\Enums\StaticPageSlug; use Domain\Models\ValueObjects\Slug; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Pages/HomeController.php b/app/Http/Controllers/Fo/Pages/HomeController.php index 784f7790..8cbf3c11 100644 --- a/app/Http/Controllers/Fo/Pages/HomeController.php +++ b/app/Http/Controllers/Fo/Pages/HomeController.php @@ -5,13 +5,13 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Pages; use App\Contracts\Executor; -use App\Http\Controllers\Controller; use App\Cqs\Queries\Products\GetPaginatedProductsQuery; use App\Cqs\Queries\Products\GetPaginatedProductsQueryInput; use App\Cqs\Queries\Ranges\GetPaginatedRangesQuery; use App\Cqs\Queries\Ranges\GetPaginatedRangesQueryInput; use App\Cqs\Queries\Slides\GetPaginatedSlidesQuery; use App\Cqs\Queries\Slides\GetPaginatedSlidesQueryInput; +use App\Http\Controllers\Controller; use Illuminate\Contracts\View\View; use Infrastructure\Adapters\Services\AppCustomerAuthService; use Shared\Pagination\Pagination; diff --git a/app/Http/Controllers/Fo/Pages/PageController.php b/app/Http/Controllers/Fo/Pages/PageController.php index b619fa90..a5dd84d2 100644 --- a/app/Http/Controllers/Fo/Pages/PageController.php +++ b/app/Http/Controllers/Fo/Pages/PageController.php @@ -6,11 +6,11 @@ namespace App\Http\Controllers\Fo\Pages; use App\Contracts\Executor; use App\Contracts\QueryInputEmpty; -use App\Dto\PageDto; -use App\Http\Controllers\Controller; use App\Cqs\Queries\Faqs\GetFaqsQuery; use App\Cqs\Queries\Pages\GetPageQuery; use App\Cqs\Queries\Pages\GetPageQueryInput; +use App\Dto\PageDto; +use App\Http\Controllers\Controller; use Domain\Enums\StaticPageSlug; use Domain\Models\ValueObjects\Slug; use Illuminate\Contracts\View\View; diff --git a/app/Http/Controllers/Fo/Pages/ProductsController.php b/app/Http/Controllers/Fo/Pages/ProductsController.php index 411d837b..e185efff 100644 --- a/app/Http/Controllers/Fo/Pages/ProductsController.php +++ b/app/Http/Controllers/Fo/Pages/ProductsController.php @@ -5,11 +5,11 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo\Pages; use App\Contracts\Executor; +use App\Cqs\Queries\Products\GetFoProductIndexPageQuery; +use App\Cqs\Queries\Products\GetFoProductIndexPageQueryInput; use App\Dto\ProductWithPricingDto; use App\Http\Controllers\Controller; use App\Http\Resources\Fo\Ajax\FilteredProductResource; -use App\Cqs\Queries\Products\GetFoProductIndexPageQuery; -use App\Cqs\Queries\Products\GetFoProductIndexPageQueryInput; use Illuminate\Contracts\View\View; use Illuminate\Http\Request; use Shared\Pagination\PageSize; diff --git a/app/Http/Controllers/Fo/TunnelController.php b/app/Http/Controllers/Fo/TunnelController.php index 37eb9c1d..040187fb 100644 --- a/app/Http/Controllers/Fo/TunnelController.php +++ b/app/Http/Controllers/Fo/TunnelController.php @@ -4,15 +4,10 @@ declare(strict_types=1); namespace App\Http\Controllers\Fo; +use App\Contracts\Executor; use App\Cqs\Actions\Orders\ApplyPickTimeSlot; use App\Cqs\Actions\Orders\FinalizeOrder; use App\Cqs\Actions\Orders\InitializeOrderTunnel; -use App\Contracts\Executor; -use App\Http\Controllers\Controller; -use App\Http\Requests\Fo\Orders\ConfirmOrderRequest; -use App\Http\Requests\Fo\Orders\PickTimeSlotRequest; -use App\Http\Requests\Fo\Orders\ValidateSummaryRequest; -use App\Models\Order; use App\Cqs\Queries\Orders\GetBasketSummaryQuery; use App\Cqs\Queries\Orders\GetBasketSummaryQueryInput; use App\Cqs\Queries\Orders\GetOrderConfirmationQuery; @@ -21,6 +16,11 @@ use App\Cqs\Queries\Orders\GetPickTimeSlotQuery; use App\Cqs\Queries\Orders\GetPickTimeSlotQueryInput; use App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQuery; use App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryInput; +use App\Http\Controllers\Controller; +use App\Http\Requests\Fo\Orders\ConfirmOrderRequest; +use App\Http\Requests\Fo\Orders\PickTimeSlotRequest; +use App\Http\Requests\Fo\Orders\ValidateSummaryRequest; +use App\Models\Order; use Domain\Enums\OrderTunnelStep; use Domain\Exceptions\OrderTunnel\OrderLimitExceededException; use Domain\Exceptions\OrderTunnel\WeeklyLimitExceededException; diff --git a/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php b/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php index ddd6e321..36ced615 100644 --- a/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php +++ b/app/Http/Requests/Bo/Orders/IndexOrdersRequest.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Orders; -use App\Lib\Helpers\RequestHelper; use App\Cqs\Queries\Orders\GetBoPaginatedOrdersQueryInput; +use App\Lib\Helpers\RequestHelper; use Carbon\CarbonInterface; use Domain\Enums\OrderStatus; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Bo/Products/IndexProductRequest.php b/app/Http/Requests/Bo/Products/IndexProductRequest.php index 8642e550..01eab2a6 100644 --- a/app/Http/Requests/Bo/Products/IndexProductRequest.php +++ b/app/Http/Requests/Bo/Products/IndexProductRequest.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Http\Requests\Bo\Products; -use App\Lib\Helpers\RequestHelper; use App\Cqs\Queries\Products\GetBoPaginatedProductsQueryInput; +use App\Lib\Helpers\RequestHelper; use Illuminate\Contracts\Session\Session; use Illuminate\Foundation\Http\FormRequest; use Infrastructure\Adapters\Services\AppAdminAuthService; diff --git a/app/Jobs/FetchAndUpsertArcadiaEmployees.php b/app/Jobs/FetchAndUpsertArcadiaEmployees.php index 453c56f2..02d72a22 100644 --- a/app/Jobs/FetchAndUpsertArcadiaEmployees.php +++ b/app/Jobs/FetchAndUpsertArcadiaEmployees.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace App\Jobs; -use App\Cqs\Actions\Employee\SynchronizeEmployeesWithArcadiaApi; use App\Contracts\ActionInputEmpty; use App\Contracts\Executor; +use App\Cqs\Actions\Employee\SynchronizeEmployeesWithArcadiaApi; use Illuminate\Contracts\Queue\ShouldBeUnique; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Queue\Queueable; diff --git a/app/Jobs/FetchAndUpsertArcadiaProductIncos.php b/app/Jobs/FetchAndUpsertArcadiaProductIncos.php index 6c990c58..438964d2 100644 --- a/app/Jobs/FetchAndUpsertArcadiaProductIncos.php +++ b/app/Jobs/FetchAndUpsertArcadiaProductIncos.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace App\Jobs; -use App\Cqs\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; use App\Contracts\ActionInputEmpty; use App\Contracts\Executor; +use App\Cqs\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi; use Illuminate\Contracts\Queue\ShouldBeUnique; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Queue\Queueable; diff --git a/app/Traits/Controllers/ChangesModelOrder.php b/app/Traits/Controllers/ChangesModelOrder.php index 4066fd62..628b5be7 100644 --- a/app/Traits/Controllers/ChangesModelOrder.php +++ b/app/Traits/Controllers/ChangesModelOrder.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace App\Traits\Controllers; +use App\Contracts\Executor; use App\Cqs\Actions\Common\ChangeModelOrder; use App\Cqs\Actions\Common\ChangeModelOrderInput; use App\Cqs\Actions\Common\ChangeModelOrderPosition; -use App\Contracts\Executor; use App\Http\Requests\Bo\ChangeOrderRequest; use App\Http\Requests\Bo\ChangeSelectedOrderRequest; use App\Interfaces\ModelWithOrder; diff --git a/app/Traits/Controllers/HasMassActions.php b/app/Traits/Controllers/HasMassActions.php index 5ade3a83..7d6bc9e4 100644 --- a/app/Traits/Controllers/HasMassActions.php +++ b/app/Traits/Controllers/HasMassActions.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Traits\Controllers; -use App\Cqs\Actions\Common\ExecuteMassAction; use App\Contracts\Executor; +use App\Cqs\Actions\Common\ExecuteMassAction; use App\Enums\MassActionType; use App\Http\Requests\Bo\MassActionRequest; use Illuminate\Http\RedirectResponse; diff --git a/app/Traits/Controllers/TogglesModelStar.php b/app/Traits/Controllers/TogglesModelStar.php index d569c64e..f52e4f86 100644 --- a/app/Traits/Controllers/TogglesModelStar.php +++ b/app/Traits/Controllers/TogglesModelStar.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace App\Traits\Controllers; +use App\Contracts\Executor; use App\Cqs\Actions\Common\ToggleModelStar; use App\Cqs\Actions\Common\ToggleModelStarInput; -use App\Contracts\Executor; use App\Interfaces\ModelWithStar; use Illuminate\Database\Eloquent\Model; use Illuminate\Http\RedirectResponse; diff --git a/app/Traits/Controllers/TogglesModelStatus.php b/app/Traits/Controllers/TogglesModelStatus.php index d708886b..a2224b64 100644 --- a/app/Traits/Controllers/TogglesModelStatus.php +++ b/app/Traits/Controllers/TogglesModelStatus.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace App\Traits\Controllers; +use App\Contracts\Executor; use App\Cqs\Actions\Common\ToggleModelStatus; use App\Cqs\Actions\Common\ToggleModelStatusInput; -use App\Contracts\Executor; use App\Interfaces\ModelWithStatus; use Illuminate\Database\Eloquent\Model; use Illuminate\Http\RedirectResponse; diff --git a/tests/Feature/App/Console/Commands/UpsertEmployeesFormFileTest.php b/tests/Feature/App/Console/Commands/UpsertEmployeesFormFileTest.php index e6117f8b..e3c0b898 100644 --- a/tests/Feature/App/Console/Commands/UpsertEmployeesFormFileTest.php +++ b/tests/Feature/App/Console/Commands/UpsertEmployeesFormFileTest.php @@ -2,7 +2,6 @@ declare(strict_types=1); -use App\Contracts\Executor; use Illuminate\Console\Command; afterEach(function (): void { diff --git a/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php b/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php index 4dc1777b..49b75a88 100644 --- a/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php +++ b/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php @@ -37,4 +37,3 @@ describe('EmployeesImportResults', function (): void { ->toThrow(\InvalidArgumentException::class); }); }); - diff --git a/tests/Unit/App/Services/EmployeeCsvImportLineTest.php b/tests/Unit/App/Services/EmployeeCsvImportLineTest.php index 60cfce14..79df9061 100644 --- a/tests/Unit/App/Services/EmployeeCsvImportLineTest.php +++ b/tests/Unit/App/Services/EmployeeCsvImportLineTest.php @@ -42,4 +42,3 @@ describe('EmployeeCsvImportLine', function (): void { ->toThrow(\InvalidArgumentException::class, 'Invalid date format: 31-12-2026'); }); }); - diff --git a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php index 7379a398..07d5a5c6 100644 --- a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php +++ b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php @@ -79,7 +79,7 @@ describe('EmployeeCsvReaderService', function (): void { $logger = \Mockery::mock(LoggerInterface::class); $logger->shouldReceive('error')->once(); - $service = new EmployeeCsvReaderService($logger); + $service = new EmployeeCsvReaderService($logger); $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); expect($filePath)->not->toBeFalse(); From 454695928bc3272fb48332267f5f812cff0207e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 10 Nov 2026 18:17:04 +0100 Subject: [PATCH 05/11] refactor: format PHPDoc for query implementations Improves readability of PHPDoc annotations across multiple query classes. --- app/Cqs/Actions/Common/ToggleModelStatus.php | 5 ++++- app/Cqs/Queries/Discounts/GetDiscountFormDataQuery.php | 5 ++++- app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQuery.php | 5 ++++- app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQuery.php | 5 ++++- app/Cqs/Queries/Products/GetBoPaginatedProductsQuery.php | 5 ++++- app/Cqs/Queries/Products/GetFoProductIndexPageQuery.php | 5 ++++- app/Cqs/Queries/Shops/GetShopPickupExceptionsQuery.php | 5 ++++- app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQuery.php | 5 ++++- 8 files changed, 32 insertions(+), 8 deletions(-) diff --git a/app/Cqs/Actions/Common/ToggleModelStatus.php b/app/Cqs/Actions/Common/ToggleModelStatus.php index acf003ee..38103266 100644 --- a/app/Cqs/Actions/Common/ToggleModelStatus.php +++ b/app/Cqs/Actions/Common/ToggleModelStatus.php @@ -11,7 +11,10 @@ use Illuminate\Database\Eloquent\Model; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ToggleModelStatusInput, \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStatus> + * @implements \App\Contracts\Action< + * \App\Cqs\Actions\Common\ToggleModelStatusInput, + * \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStatus + * > */ final class ToggleModelStatus implements Action { diff --git a/app/Cqs/Queries/Discounts/GetDiscountFormDataQuery.php b/app/Cqs/Queries/Discounts/GetDiscountFormDataQuery.php index 4a9c67a6..4bd2c9fd 100644 --- a/app/Cqs/Queries/Discounts/GetDiscountFormDataQuery.php +++ b/app/Cqs/Queries/Discounts/GetDiscountFormDataQuery.php @@ -13,7 +13,10 @@ use Domain\Enums\DiscountType; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Cqs\Queries\Discounts\GetDiscountFormDataQueryInput, \App\Cqs\Queries\Discounts\GetDiscountFormDataQueryOutput> + * @implements \App\Contracts\Query< + * \App\Cqs\Queries\Discounts\GetDiscountFormDataQueryInput, + * \App\Cqs\Queries\Discounts\GetDiscountFormDataQueryOutput + * > */ final readonly class GetDiscountFormDataQuery implements Query { diff --git a/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQuery.php b/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQuery.php index 51212192..8712e2d5 100644 --- a/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQuery.php +++ b/app/Cqs/Queries/Orders/GetFoCustomerOrderDetailQuery.php @@ -11,7 +11,10 @@ use App\Services\MapUrlService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQueryInput, \App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQueryOutput> + * @implements \App\Contracts\Query< + * \App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQueryInput, + * \App\Cqs\Queries\Orders\GetFoCustomerOrderDetailQueryOutput + * > */ final readonly class GetFoCustomerOrderDetailQuery implements Query { diff --git a/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQuery.php b/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQuery.php index 595314c1..eeba5476 100644 --- a/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQuery.php +++ b/app/Cqs/Queries/Orders/GetTunnelOrderConfirmedQuery.php @@ -13,7 +13,10 @@ use Domain\Enums\OrderTunnelStep; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryInput, \App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryOutput> + * @implements \App\Contracts\Query< + * \App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryInput, + * \App\Cqs\Queries\Orders\GetTunnelOrderConfirmedQueryOutput + * > */ final readonly class GetTunnelOrderConfirmedQuery implements Query { diff --git a/app/Cqs/Queries/Products/GetBoPaginatedProductsQuery.php b/app/Cqs/Queries/Products/GetBoPaginatedProductsQuery.php index 2008f14b..c8d66e11 100644 --- a/app/Cqs/Queries/Products/GetBoPaginatedProductsQuery.php +++ b/app/Cqs/Queries/Products/GetBoPaginatedProductsQuery.php @@ -18,7 +18,10 @@ use Money\Formatter\IntlMoneyFormatter; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Cqs\Queries\Products\GetBoPaginatedProductsQueryInput, \App\Cqs\Queries\Products\GetBoPaginatedProductsQueryOutput> + * @implements \App\Contracts\Query< + * \App\Cqs\Queries\Products\GetBoPaginatedProductsQueryInput, + * \App\Cqs\Queries\Products\GetBoPaginatedProductsQueryOutput + * > */ final readonly class GetBoPaginatedProductsQuery implements Query { diff --git a/app/Cqs/Queries/Products/GetFoProductIndexPageQuery.php b/app/Cqs/Queries/Products/GetFoProductIndexPageQuery.php index b0626398..3fa74e09 100644 --- a/app/Cqs/Queries/Products/GetFoProductIndexPageQuery.php +++ b/app/Cqs/Queries/Products/GetFoProductIndexPageQuery.php @@ -19,7 +19,10 @@ use SortDirection; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Cqs\Queries\Products\GetFoProductIndexPageQueryInput, \App\Cqs\Queries\Products\GetFoProductIndexPageQueryOutput> + * @implements \App\Contracts\Query< + * \App\Cqs\Queries\Products\GetFoProductIndexPageQueryInput, + * \App\Cqs\Queries\Products\GetFoProductIndexPageQueryOutput + * > */ final readonly class GetFoProductIndexPageQuery implements Query { diff --git a/app/Cqs/Queries/Shops/GetShopPickupExceptionsQuery.php b/app/Cqs/Queries/Shops/GetShopPickupExceptionsQuery.php index ec907b4c..e97b14de 100644 --- a/app/Cqs/Queries/Shops/GetShopPickupExceptionsQuery.php +++ b/app/Cqs/Queries/Shops/GetShopPickupExceptionsQuery.php @@ -13,7 +13,10 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryInput, \App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryOutput> + * @implements \App\Contracts\Query< + * \App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryInput, + * \App\Cqs\Queries\Shops\GetShopPickupExceptionsQueryOutput + * > */ final readonly class GetShopPickupExceptionsQuery implements Query { diff --git a/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQuery.php b/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQuery.php index 890f1c91..be16767e 100644 --- a/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQuery.php +++ b/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQuery.php @@ -13,7 +13,10 @@ use Domain\Services\PickupSchedulingService; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Query<\App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryInput, \App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryOutput> + * @implements \App\Contracts\Query< + * \App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryInput, + * \App\Cqs\Queries\Timeslots\GetAvailableTimeslotsQueryOutput + * > */ final readonly class GetAvailableTimeslotsQuery implements Query { From b2989b4967827444f2e3b61b64456bc456591b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 10 Nov 2026 19:29:20 +0100 Subject: [PATCH 06/11] refactor(employee): update import handling and output structure - Replaced resource handling with SplFileObject for better readability. - Introduced ImportEmployeesOutput class for structured results. - Updated related services and tests to accommodate new structures. --- .../Commands/UpsertEmployeesFormFile.php | 4 +- app/Cqs/Actions/Employee/ImportEmployees.php | 8 +- .../Actions/Employee/ImportEmployeesInput.php | 10 +- ...tResults.php => ImportEmployeesOutput.php} | 2 +- app/Lib/EnhancedCsvReader.php | 102 ++++++++++++------ ...e.php => EmployeeCsvImportLineService.php} | 2 +- app/Services/EmployeeCsvReaderService.php | 61 +++++------ .../Employee/ImportEmployeesInputTest.php | 30 +++--- ...Test.php => ImportEmployeesOutputTest.php} | 12 +-- .../Actions/Employee/ImportEmployeesTest.php | 37 ++++--- .../Services/EmployeeCsvImportLineTest.php | 10 +- .../Services/EmployeeCsvReaderServiceTest.php | 47 ++++---- 12 files changed, 173 insertions(+), 152 deletions(-) rename app/Cqs/Actions/Employee/{EmployeesImportResults.php => ImportEmployeesOutput.php} (90%) rename app/Services/{EmployeeCsvImportLine.php => EmployeeCsvImportLineService.php} (98%) rename tests/Unit/App/Cqs/Actions/Employee/{EmployeesImportResultsTest.php => ImportEmployeesOutputTest.php} (71%) diff --git a/app/Console/Commands/UpsertEmployeesFormFile.php b/app/Console/Commands/UpsertEmployeesFormFile.php index c61de43c..fc9b3242 100644 --- a/app/Console/Commands/UpsertEmployeesFormFile.php +++ b/app/Console/Commands/UpsertEmployeesFormFile.php @@ -29,9 +29,9 @@ class UpsertEmployeesFormFile extends Command $this->info('Starting synchronous employee import from CSV...'); - $stream = fopen($file, 'r'); + $stream = new \SplFileObject($file, 'r'); - if (! $stream) { + if (! $stream->isReadable()) { $this->error("Failed to open file: {$file}"); return self::FAILURE; diff --git a/app/Cqs/Actions/Employee/ImportEmployees.php b/app/Cqs/Actions/Employee/ImportEmployees.php index 730fafbf..fd1e0b03 100644 --- a/app/Cqs/Actions/Employee/ImportEmployees.php +++ b/app/Cqs/Actions/Employee/ImportEmployees.php @@ -7,7 +7,7 @@ namespace App\Cqs\Actions\Employee; use App\Contracts\Action; use App\Contracts\ActionInput; use App\Services\ArcadiaEmployee; -use App\Services\EmployeeCsvImportLine as ServicesEmployeeCsvImportLine; +use App\Services\EmployeeCsvImportLineService as ServicesEmployeeCsvImportLine; use App\Services\EmployeeCsvReaderService; use App\Services\EmployeeUpsertService; use Domain\Models\ValueObjects\Matricule; @@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface; use Webmozart\Assert\Assert; /** - * @implements \App\Contracts\Action<\App\Cqs\Actions\Employee\ImportEmployeesInput, \App\Cqs\Actions\Employee\EmployeesImportResults> + * @implements \App\Contracts\Action<\App\Cqs\Actions\Employee\ImportEmployeesInput, \App\Cqs\Actions\Employee\ImportEmployeesOutput> */ final class ImportEmployees implements Action { @@ -30,7 +30,7 @@ final class ImportEmployees implements Action } /** @param \App\Cqs\Actions\Employee\ImportEmployeesInput $input */ - public function __invoke(ActionInput $input): EmployeesImportResults + public function __invoke(ActionInput $input): ImportEmployeesOutput { Assert::isAOf($input, ImportEmployeesInput::class); @@ -73,7 +73,7 @@ final class ImportEmployees implements Action 'total_updated' => $totalUpdated, ]); - return new EmployeesImportResults( + return new ImportEmployeesOutput( insertedCount: $totalInserted, updatedCount: $totalUpdated, errors: $errors, diff --git a/app/Cqs/Actions/Employee/ImportEmployeesInput.php b/app/Cqs/Actions/Employee/ImportEmployeesInput.php index df9a6cfd..4e00e42c 100644 --- a/app/Cqs/Actions/Employee/ImportEmployeesInput.php +++ b/app/Cqs/Actions/Employee/ImportEmployeesInput.php @@ -5,19 +5,13 @@ declare(strict_types=1); namespace App\Cqs\Actions\Employee; use App\Contracts\ActionInput; -use Webmozart\Assert\Assert; final readonly class ImportEmployeesInput implements ActionInput { - /** - * @param resource $inputStream - */ public function __construct( - public mixed $inputStream + public \SplFileObject $inputStream ) { - Assert::resource($inputStream); - - if (stream_get_meta_data($inputStream)['mode'][0] !== 'r') { + if (! $inputStream->isReadable()) { throw new \InvalidArgumentException('Input stream must be readable.'); } } diff --git a/app/Cqs/Actions/Employee/EmployeesImportResults.php b/app/Cqs/Actions/Employee/ImportEmployeesOutput.php similarity index 90% rename from app/Cqs/Actions/Employee/EmployeesImportResults.php rename to app/Cqs/Actions/Employee/ImportEmployeesOutput.php index 7e37bf0e..3e0c075f 100644 --- a/app/Cqs/Actions/Employee/EmployeesImportResults.php +++ b/app/Cqs/Actions/Employee/ImportEmployeesOutput.php @@ -6,7 +6,7 @@ namespace App\Cqs\Actions\Employee; use Webmozart\Assert\Assert; -final readonly class EmployeesImportResults +final readonly class ImportEmployeesOutput { /** * @param array $errors diff --git a/app/Lib/EnhancedCsvReader.php b/app/Lib/EnhancedCsvReader.php index 3db091bc..30fc9760 100644 --- a/app/Lib/EnhancedCsvReader.php +++ b/app/Lib/EnhancedCsvReader.php @@ -15,10 +15,15 @@ class EnhancedCsvReader extends CsvReader public function __construct( protected mixed $fileToRead, private CsvReaderOptions $options = new CsvReaderOptions(), + private ?string $sourceEncoding = null, ) { - if (! \is_string($fileToRead) && ! \is_resource($fileToRead)) { + if (! \is_string($fileToRead) && ! ($fileToRead instanceof \SplFileObject)) { throw new \TypeError( - 'Fusonic\\CsvReader\\CsvReader::__construct(): Argument #1 ($fileToRead) must be of type string or resource.' + sprintf( + '%s::__construct(): Argument #1 ($fileToRead) must be of type string or SplFileObject, %s given.', + self::class, + get_debug_type($fileToRead) + ) ); } } @@ -31,7 +36,7 @@ class EnhancedCsvReader extends CsvReader * * @param class-string $className the class which data should be mapped to * @param ?callable(int, \Throwable): E $callback the callback to handle errors for each row - * @return \Traversable + * @return \Traversable */ #[\Override] public function readObjects(string $className, ?callable $callback = null): iterable @@ -39,7 +44,7 @@ class EnhancedCsvReader extends CsvReader $resource = $this->getResource(); /** @var int $resourcePosition */ - $resourcePosition = ftell($resource); + $resourcePosition = $resource->ftell(); // Skip the BOM if ($this->options->removeBOM) { @@ -50,63 +55,91 @@ class EnhancedCsvReader extends CsvReader $header = null; if ($this->options->hasHeaderRow) { - $header = fgetcsv( - stream: $resource, - length: 0, + $header = $resource->fgetcsv( separator: $this->options->delimiter, enclosure: $this->options->enclosure, escape: $this->options->escape ); - if ($header === false) { + if ($header === false || $header === [null]) { throw new CsvReaderException('Cannot get line from file pointer and parse it for CSV fields.'); } + + Assert::allString($header); + $header = $this->convertRowEncoding($header); } // Build mapping $mappingBuilder = new MappingBuilder(); $mapping = $mappingBuilder->build($header, $className); - $line = $this->options->hasHeaderRow ? 1 : 0; - while ( - ($row = fgetcsv( - $resource, - 0, - $this->options->delimiter, - $this->options->enclosure, - $this->options->escape - )) !== false - ) { + $line = $this->options->hasHeaderRow ? 2 : 1; + + while (! $resource->eof()) { + $row = $resource->fgetcsv( + separator: $this->options->delimiter, + enclosure: $this->options->enclosure, + escape: $this->options->escape + ); + + if ($row === false || $row === [null]) { + $line++; + + continue; + } + try { Assert::allString($row); + $row = $this->convertRowEncoding($row); yield $this->inheritedMap($row, $className, $mapping); } catch (\Throwable $e) { if ($callback !== null) { yield $callback($line, $e); + } else { + throw $e; } } $line++; } // Rewind resource to its original position or close it if source was a path - if (\is_resource($this->fileToRead)) { - fseek($this->fileToRead, $resourcePosition); + if ($this->fileToRead instanceof \SplFileObject) { + $this->fileToRead->fseek($resourcePosition); } else { - fclose($resource); + $resource = null; } } - /** @return resource */ - private function getResource(): mixed + /** + * @param array $row + * @return array + */ + private function convertRowEncoding(array $row): array { - if (\is_resource($this->fileToRead)) { + if ($this->sourceEncoding === null || $this->sourceEncoding === 'UTF-8') { + return $row; + } + + return array_map( + fn (string $value): string => mb_convert_encoding( + $value, + 'UTF-8', + $this->sourceEncoding + ) ?: $value, + $row + ); + } + + private function getResource(): \SplFileObject + { + if ($this->fileToRead instanceof \SplFileObject) { return $this->fileToRead; } - if (is_string($this->fileToRead)) { - $resource = fopen($this->fileToRead, 'r'); - if ($resource === false) { + if (\is_string($this->fileToRead)) { + $resource = new \SplFileObject($this->fileToRead, 'r'); + if (! $resource->isReadable()) { throw new CsvReaderException('Cannot open the CSV file.'); } @@ -116,19 +149,16 @@ class EnhancedCsvReader extends CsvReader throw new CsvReaderException('Invalid file to read.'); } - /** - * @param resource $resource - */ - private function inheritedSkipBom($resource): void + private function inheritedSkipBom(\SplFileObject $resource): void { - $position = ftell($resource); + $position = $resource->ftell(); if ($position === false) { throw new CsvReaderException('Cannot read the current position of the file read/write pointer.'); } - if (fread($resource, 3) !== \chr(0xEF) . \chr(0xBB) . \chr(0xBF)) { - fseek($resource, $position); + if ($resource->fread(3) !== \chr(0xEF) . \chr(0xBB) . \chr(0xBF)) { + $resource->fseek($position); } } @@ -145,6 +175,10 @@ class EnhancedCsvReader extends CsvReader $object = new $className(); foreach ($mappings as $mapping) { + if (! array_key_exists($mapping->getIndex(), $row)) { + throw new CsvReaderException("Column index {$mapping->getIndex()} does not exist in CSV row."); + } + $mapping->setValue( $object, $this->options->valueConverter->convert( diff --git a/app/Services/EmployeeCsvImportLine.php b/app/Services/EmployeeCsvImportLineService.php similarity index 98% rename from app/Services/EmployeeCsvImportLine.php rename to app/Services/EmployeeCsvImportLineService.php index 3bce6e37..514f976f 100644 --- a/app/Services/EmployeeCsvImportLine.php +++ b/app/Services/EmployeeCsvImportLineService.php @@ -6,7 +6,7 @@ namespace App\Services; use Fusonic\CsvReader\Attributes\TitleMapping; -class EmployeeCsvImportLine +class EmployeeCsvImportLineService { private const DATE_FORMAT = 'd/m/Y'; diff --git a/app/Services/EmployeeCsvReaderService.php b/app/Services/EmployeeCsvReaderService.php index 93bf92cc..d26fd77a 100644 --- a/app/Services/EmployeeCsvReaderService.php +++ b/app/Services/EmployeeCsvReaderService.php @@ -7,7 +7,6 @@ namespace App\Services; use App\Lib\EnhancedCsvReader; use Fusonic\CsvReader\CsvReaderOptions; use Psr\Log\LoggerInterface; -use Webmozart\Assert\Assert; class EmployeeCsvReaderService { @@ -17,36 +16,28 @@ class EmployeeCsvReaderService } /** - * @param resource $fromStream - * @return array + * @return array */ - public function importEmployeesFromCsv($fromStream): array + public function importEmployeesFromCsv(\SplFileObject $fromStream): array { - Assert::resource($fromStream); - - $mode = stream_get_meta_data($fromStream)['mode']; - - if ($mode[0] !== 'r') { - $this->logger->error('Input stream is not readable.', [ - 'mode' => $mode, - ]); + if (! $fromStream->isReadable()) { + $this->logger->error('Input stream is not readable.'); throw new \InvalidArgumentException('Input stream must be readable.'); } - $this->logger->debug('Input stream is readable.', [ - 'mode' => $mode, - ]); + $this->logger->debug('Input stream is readable.'); try { $options = new CsvReaderOptions(); $options->delimiter = ';'; - $this->detectAndConvertEncoding($fromStream); - $reader = new EnhancedCsvReader($fromStream, $options); + $sourceEncoding = $this->detectEncoding($fromStream); + + $reader = new EnhancedCsvReader($fromStream, $options, $sourceEncoding); $items = $reader->readObjects( - EmployeeCsvImportLine::class, - function ($line, $e) { + EmployeeCsvImportLineService::class, + function (int $line, \Throwable $e): string { $this->logger->error('Failed to read line from CSV.', [ 'line' => $line, 'exception' => $e, @@ -56,7 +47,7 @@ class EmployeeCsvReaderService } ); - return iterator_to_array($items); + return iterator_to_array($items, false); } catch (\Throwable $e) { $this->logger->error('Failed to read employees from CSV.', [ 'exception' => $e, @@ -68,41 +59,39 @@ class EmployeeCsvReaderService } } - /** @param resource $fromStream */ - private function detectAndConvertEncoding($fromStream): void + private function detectEncoding(\SplFileObject $fromStream): ?string { - $sample = fread($fromStream, 4096); + $fromStream->rewind(); + $sample = $fromStream->fread(4096); if ($sample === false) { $this->logger->error('Failed to read sample from input stream.'); throw new \UnexpectedValueException('Failed to read sample from input stream.'); } - $safeSample = strlen($sample) === 4096 ? mb_strcut($sample, 0, 4092, 'UTF-8') : $sample; - // ? Has BOM UTF-8 at the beginning of the sample ? - if (str_starts_with($safeSample, "\xEF\xBB\xBF")) { - rewind($fromStream); + if (str_starts_with($sample, "\xEF\xBB\xBF")) { + $fromStream->rewind(); - return; + return 'UTF-8'; } + $safeSample = strlen($sample) === 4096 ? mb_strcut($sample, 0, 4092, 'UTF-8') : $sample; + // * Detect encoding. $detected = mb_detect_encoding($safeSample, ['UTF-8', 'Windows-1252', 'ISO-8859-1'], true); - // * Rewind before attaching filter. - rewind($fromStream); + // * Rewind before reading with EnhancedCsvReader. + $fromStream->rewind(); if ($detected !== false && $detected !== 'UTF-8') { - $this->logger->info('Detected non-UTF-8 encoding, applying conversion filter.', [ + $this->logger->info('Detected non-UTF-8 encoding, applying conversion.', [ 'detected' => $detected, ]); - stream_filter_append( - $fromStream, - "convert.iconv.{$detected}/UTF-8//TRANSLIT", - STREAM_FILTER_READ - ); + return $detected; } + + return null; } } diff --git a/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesInputTest.php b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesInputTest.php index 81f5b1e5..d5a66597 100644 --- a/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesInputTest.php +++ b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesInputTest.php @@ -11,40 +11,38 @@ describe('ImportEmployeesInput', function (): void { expect($filePath)->not->toBeFalse(); file_put_contents($filePath, 'header'); - $stream = fopen($filePath, 'r'); - expect($stream)->not->toBeFalse(); + $fileObject = new \SplFileObject($filePath, 'r'); // WHEN - $input = new ImportEmployeesInput($stream); + $input = new ImportEmployeesInput($fileObject); // THEN - expect($input->inputStream)->toBe($stream); + expect($input->inputStream)->toBe($fileObject); - fclose($stream); unlink($filePath); }); it('throws when stream is not readable', function (): void { // GIVEN - $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); - expect($filePath)->not->toBeFalse(); - $stream = fopen($filePath, 'w'); - expect($stream)->not->toBeFalse(); + $unreadable = new class ('/dev/null', 'r') extends \SplFileObject + { + public function isReadable(): bool + { + return false; + } + }; // WHEN + THEN - expect(fn () => new ImportEmployeesInput($stream)) + expect(fn () => new ImportEmployeesInput($unreadable)) ->toThrow(\InvalidArgumentException::class, 'Input stream must be readable.'); - - fclose($stream); - unlink($filePath); }); - it('throws when input is not a resource', function (): void { + it('throws when input is not a SplFileObject', function (): void { // GIVEN $notAStream = 'employees.csv'; // WHEN + THEN - expect(fn () => new ImportEmployeesInput($notAStream)) - ->toThrow(\InvalidArgumentException::class); + expect(fn () => new ImportEmployeesInput($notAStream)) // @phpstan-ignore argument.type + ->toThrow(\TypeError::class); }); }); diff --git a/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesOutputTest.php similarity index 71% rename from tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php rename to tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesOutputTest.php index 49b75a88..c1d46b69 100644 --- a/tests/Unit/App/Cqs/Actions/Employee/EmployeesImportResultsTest.php +++ b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesOutputTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -use App\Cqs\Actions\Employee\EmployeesImportResults; +use App\Cqs\Actions\Employee\ImportEmployeesOutput; -describe('EmployeesImportResults', function (): void { +describe('ImportEmployeesOutput', function (): void { it('stores valid counters and errors', function (): void { // GIVEN + WHEN - $result = new EmployeesImportResults( + $result = new ImportEmployeesOutput( insertedCount: 3, updatedCount: 4, errors: ['Invalid date at line 3'], @@ -21,19 +21,19 @@ describe('EmployeesImportResults', function (): void { it('throws when inserted count is negative', function (): void { // GIVEN + WHEN + THEN - expect(fn () => new EmployeesImportResults(-1, 0, [])) + expect(fn () => new ImportEmployeesOutput(-1, 0, [])) ->toThrow(\InvalidArgumentException::class); }); it('throws when updated count is negative', function (): void { // GIVEN + WHEN + THEN - expect(fn () => new EmployeesImportResults(0, -1, [])) + expect(fn () => new ImportEmployeesOutput(0, -1, [])) ->toThrow(\InvalidArgumentException::class); }); it('throws when errors contain non string values', function (): void { // GIVEN + WHEN + THEN - expect(fn () => new EmployeesImportResults(0, 0, ['ok', 123])) + expect(fn () => new ImportEmployeesOutput(0, 0, ['ok', 123])) // @phpstan-ignore argument.type ->toThrow(\InvalidArgumentException::class); }); }); diff --git a/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php index fed87653..9485286f 100644 --- a/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php +++ b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php @@ -3,11 +3,11 @@ declare(strict_types=1); use App\Contracts\ActionInput; -use App\Cqs\Actions\Employee\EmployeesImportResults; use App\Cqs\Actions\Employee\ImportEmployees; use App\Cqs\Actions\Employee\ImportEmployeesInput; +use App\Cqs\Actions\Employee\ImportEmployeesOutput; use App\Services\ArcadiaEmployee; -use App\Services\EmployeeCsvImportLine; +use App\Services\EmployeeCsvImportLineService; use App\Services\EmployeeCsvReaderService; use App\Services\EmployeeUpsertService; use App\Services\EmployeeUpsertServiceResult; @@ -20,14 +20,17 @@ afterEach(function (): void { describe('ImportEmployees action', function (): void { it('imports valid employees and aggregates CSV errors', function (): void { // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ $logger = \Mockery::mock(LoggerInterface::class); $logger->shouldReceive('debug')->once(); $logger->shouldReceive('info')->once(); + /** @var \App\Services\EmployeeCsvReaderService&\Mockery\MockInterface $reader */ $reader = \Mockery::mock(EmployeeCsvReaderService::class); + /** @var \App\Services\EmployeeUpsertService&\Mockery\MockInterface $upsert */ $upsert = \Mockery::mock(EmployeeUpsertService::class); - $line = new EmployeeCsvImportLine(); + $line = new EmployeeCsvImportLineService(); $line->matricule = '1234567'; $line->lastName = 'Dupont'; $line->firstName = 'Jean'; @@ -41,12 +44,11 @@ describe('ImportEmployees action', function (): void { expect($filePath)->not->toBeFalse(); file_put_contents($filePath, 'header'); - $stream = fopen($filePath, 'r'); - expect($stream)->not->toBeFalse(); + $fileObject = new \SplFileObject($filePath, 'r'); $reader->shouldReceive('importEmployeesFromCsv') ->once() - ->with($stream) + ->with($fileObject) ->andReturn([$line, 'Invalid CSV line at row 3']); $upsert->shouldReceive('upsertEmployees') @@ -65,28 +67,30 @@ describe('ImportEmployees action', function (): void { $action = new ImportEmployees($logger, $reader, $upsert); // WHEN - $result = $action(new ImportEmployeesInput($stream)); + $result = $action(new ImportEmployeesInput($fileObject)); // THEN - expect($result)->toBeInstanceOf(EmployeesImportResults::class) + expect($result)->toBeInstanceOf(ImportEmployeesOutput::class) ->and($result->insertedCount)->toBe(1) ->and($result->updatedCount)->toBe(2) ->and(array_values($result->errors))->toBe(['Invalid CSV line at row 3']); - fclose($stream); unlink($filePath); }); it('returns mapping errors when a CSV line cannot become an Arcadia employee', function (): void { // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ $logger = \Mockery::mock(LoggerInterface::class); $logger->shouldReceive('debug')->once(); $logger->shouldReceive('info')->once(); + /** @var \App\Services\EmployeeCsvReaderService&\Mockery\MockInterface $reader */ $reader = \Mockery::mock(EmployeeCsvReaderService::class); + /** @var \App\Services\EmployeeUpsertService&\Mockery\MockInterface $upsert */ $upsert = \Mockery::mock(EmployeeUpsertService::class); - $line = new EmployeeCsvImportLine(); + $line = new EmployeeCsvImportLineService(); $line->matricule = '1234567'; $line->lastName = 'Dupont'; $line->firstName = 'Jean'; @@ -100,12 +104,11 @@ describe('ImportEmployees action', function (): void { expect($filePath)->not->toBeFalse(); file_put_contents($filePath, 'header'); - $stream = fopen($filePath, 'r'); - expect($stream)->not->toBeFalse(); + $fileObject = new \SplFileObject($filePath, 'r'); $reader->shouldReceive('importEmployeesFromCsv') ->once() - ->with($stream) + ->with($fileObject) ->andReturn([$line]); $upsert->shouldReceive('upsertEmployees') @@ -120,20 +123,22 @@ describe('ImportEmployees action', function (): void { $action = new ImportEmployees($logger, $reader, $upsert); // WHEN - $result = $action(new ImportEmployeesInput($stream)); + $result = $action(new ImportEmployeesInput($fileObject)); // THEN expect($result->errors)->toHaveCount(1) ->and($result->errors[0])->toContain('does not match pattern'); - fclose($stream); unlink($filePath); }); it('throws when input type is invalid', function (): void { // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ $logger = \Mockery::mock(LoggerInterface::class); + /** @var \App\Services\EmployeeCsvReaderService&\Mockery\MockInterface $reader */ $reader = \Mockery::mock(EmployeeCsvReaderService::class); + /** @var \App\Services\EmployeeUpsertService&\Mockery\MockInterface $upsert */ $upsert = \Mockery::mock(EmployeeUpsertService::class); $action = new ImportEmployees($logger, $reader, $upsert); @@ -142,7 +147,7 @@ describe('ImportEmployees action', function (): void { }; // WHEN + THEN - expect(fn () => $action($invalidInput)) + expect(fn () => $action($invalidInput)) // @phpstan-ignore argument.type ->toThrow(\InvalidArgumentException::class); }); }); diff --git a/tests/Unit/App/Services/EmployeeCsvImportLineTest.php b/tests/Unit/App/Services/EmployeeCsvImportLineTest.php index 79df9061..85c2942f 100644 --- a/tests/Unit/App/Services/EmployeeCsvImportLineTest.php +++ b/tests/Unit/App/Services/EmployeeCsvImportLineTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -use App\Services\EmployeeCsvImportLine; +use App\Services\EmployeeCsvImportLineService; -describe('EmployeeCsvImportLine', function (): void { +describe('EmployeeCsvImportLineService', function (): void { it('parses dates and normalizes service code', function (): void { // GIVEN - $line = new EmployeeCsvImportLine(); + $line = new EmployeeCsvImportLineService(); // WHEN $line->setStartDate('01/10/2026'); @@ -26,7 +26,7 @@ describe('EmployeeCsvImportLine', function (): void { it('throws when mandatory start date has invalid format', function (): void { // GIVEN - $line = new EmployeeCsvImportLine(); + $line = new EmployeeCsvImportLineService(); // WHEN + THEN expect(fn () => $line->setStartDate('2026-10-01')) @@ -35,7 +35,7 @@ describe('EmployeeCsvImportLine', function (): void { it('throws when optional end date has invalid format', function (): void { // GIVEN - $line = new EmployeeCsvImportLine(); + $line = new EmployeeCsvImportLineService(); // WHEN + THEN expect(fn () => $line->setEndDate('31-12-2026')) diff --git a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php index 07d5a5c6..2851ead8 100644 --- a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php +++ b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\Services\EmployeeCsvImportLine; +use App\Services\EmployeeCsvImportLineService; use App\Services\EmployeeCsvReaderService; use Psr\Log\LoggerInterface; @@ -13,6 +13,7 @@ afterEach(function (): void { describe('EmployeeCsvReaderService', function (): void { it('imports employees from a readable CSV stream', function (): void { // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ $logger = \Mockery::mock(LoggerInterface::class); $logger->shouldReceive('debug')->once(); $logger->shouldReceive('error')->never(); @@ -27,24 +28,26 @@ describe('EmployeeCsvReaderService', function (): void { '1234567;Dupont;Jean;01/10/2026;;;ETAB01;PA;LDCCAV030', ])); - $stream = fopen($filePath, 'r'); - expect($stream)->not->toBeFalse(); + $fileObject = new \SplFileObject($filePath, 'r'); // WHEN - $items = $service->importEmployeesFromCsv($stream); + $items = $service->importEmployeesFromCsv($fileObject); // THEN - expect($items)->toHaveCount(1) - ->and($items[0])->toBeInstanceOf(EmployeeCsvImportLine::class) - ->and($items[0]->matricule)->toBe('1234567') - ->and($items[0]->service)->toBe('030'); + $firstItem = $items[0]; + assert($firstItem instanceof EmployeeCsvImportLineService); + + expect($items)->toHaveCount(1) + ->and($firstItem)->toBeInstanceOf(EmployeeCsvImportLineService::class) + ->and($firstItem->matricule)->toBe('1234567') + ->and($firstItem->service)->toBe('030'); - fclose($stream); unlink($filePath); }); it('returns row-level error when a CSV line cannot be mapped', function (): void { // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ $logger = \Mockery::mock(LoggerInterface::class); $logger->shouldReceive('debug')->once(); $logger->shouldReceive('error')->once(); @@ -59,39 +62,37 @@ describe('EmployeeCsvReaderService', function (): void { '1234567;Dupont;Jean;2026-10-01;;;ETAB01;PA;LDCCAV030', ])); - $stream = fopen($filePath, 'r'); - expect($stream)->not->toBeFalse(); + $fileObject = new \SplFileObject($filePath, 'r'); // WHEN - $items = $service->importEmployeesFromCsv($stream); + $items = $service->importEmployeesFromCsv($fileObject); // THEN expect($items)->toHaveCount(1) ->and($items[0])->toBeString() ->and($items[0])->toContain('Invalid date format'); - fclose($stream); unlink($filePath); }); it('throws when input stream is not opened in read mode', function (): void { // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ $logger = \Mockery::mock(LoggerInterface::class); $logger->shouldReceive('error')->once(); - $service = new EmployeeCsvReaderService($logger); - $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); - expect($filePath)->not->toBeFalse(); + $service = new EmployeeCsvReaderService($logger); - $stream = fopen($filePath, 'w'); - - expect($stream)->not->toBeFalse(); + $unreadable = new class ('/dev/null', 'r') extends \SplFileObject + { + public function isReadable(): bool + { + return false; + } + }; // WHEN + THEN - expect(fn () => $service->importEmployeesFromCsv($stream)) + expect(fn () => $service->importEmployeesFromCsv($unreadable)) ->toThrow(\InvalidArgumentException::class, 'Input stream must be readable.'); - - fclose($stream); - unlink($filePath); }); }); From 87136fcc422f8b2e00484b9c360d9294de72a0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 10 Nov 2026 19:48:29 +0100 Subject: [PATCH 07/11] refactor(test): update query path for naming conventions Adjusted the path for query tests to reflect the new directory structure. --- tests/Architecture/NamingConventionsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Architecture/NamingConventionsTest.php b/tests/Architecture/NamingConventionsTest.php index 982e6fd6..647d95b4 100644 --- a/tests/Architecture/NamingConventionsTest.php +++ b/tests/Architecture/NamingConventionsTest.php @@ -56,7 +56,7 @@ describe('naming conventions in app', function (): void { ]); arch('queries have Query, QueryInput or QueryOutput suffix', function (): void { - $path = __DIR__ . '/../../app/Queries'; + $path = __DIR__ . '/../../app/Cqs/Queries'; $files = (new Finder())->files()->in($path)->name('*.php'); foreach ($files as $file) { From 552d220b698d94c13a7e9ec90c8f7d52ac672282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Sat, 14 Nov 2026 08:25:50 +0100 Subject: [PATCH 08/11] refactor(csv): replace Fusonic CSV reader with League CSV Updated the CSV reading implementation to use the League CSV library, enhancing flexibility and maintainability. Removed the EnhancedCsvReader class and adjusted the EmployeeCsvReaderService accordingly. --- app/Lib/EnhancedCsvReader.php | 193 ------------------ app/Services/EmployeeCsvImportLineService.php | 70 ++++--- app/Services/EmployeeCsvReaderService.php | 56 +++-- composer.json | 2 +- composer.lock | 151 +++++++++----- .../Services/EmployeeCsvReaderServiceTest.php | 2 + 6 files changed, 177 insertions(+), 297 deletions(-) delete mode 100644 app/Lib/EnhancedCsvReader.php diff --git a/app/Lib/EnhancedCsvReader.php b/app/Lib/EnhancedCsvReader.php deleted file mode 100644 index 30fc9760..00000000 --- a/app/Lib/EnhancedCsvReader.php +++ /dev/null @@ -1,193 +0,0 @@ - $className the class which data should be mapped to - * @param ?callable(int, \Throwable): E $callback the callback to handle errors for each row - * @return \Traversable - */ - #[\Override] - public function readObjects(string $className, ?callable $callback = null): iterable - { - $resource = $this->getResource(); - - /** @var int $resourcePosition */ - $resourcePosition = $resource->ftell(); - - // Skip the BOM - if ($this->options->removeBOM) { - $this->inheritedSkipBom($resource); - } - - // Read header - $header = null; - - if ($this->options->hasHeaderRow) { - $header = $resource->fgetcsv( - separator: $this->options->delimiter, - enclosure: $this->options->enclosure, - escape: $this->options->escape - ); - - if ($header === false || $header === [null]) { - throw new CsvReaderException('Cannot get line from file pointer and parse it for CSV fields.'); - } - - Assert::allString($header); - $header = $this->convertRowEncoding($header); - } - - // Build mapping - $mappingBuilder = new MappingBuilder(); - $mapping = $mappingBuilder->build($header, $className); - - $line = $this->options->hasHeaderRow ? 2 : 1; - - while (! $resource->eof()) { - $row = $resource->fgetcsv( - separator: $this->options->delimiter, - enclosure: $this->options->enclosure, - escape: $this->options->escape - ); - - if ($row === false || $row === [null]) { - $line++; - - continue; - } - - try { - Assert::allString($row); - $row = $this->convertRowEncoding($row); - - yield $this->inheritedMap($row, $className, $mapping); - } catch (\Throwable $e) { - if ($callback !== null) { - yield $callback($line, $e); - } else { - throw $e; - } - } - $line++; - } - - // Rewind resource to its original position or close it if source was a path - if ($this->fileToRead instanceof \SplFileObject) { - $this->fileToRead->fseek($resourcePosition); - } else { - $resource = null; - } - } - - /** - * @param array $row - * @return array - */ - private function convertRowEncoding(array $row): array - { - if ($this->sourceEncoding === null || $this->sourceEncoding === 'UTF-8') { - return $row; - } - - return array_map( - fn (string $value): string => mb_convert_encoding( - $value, - 'UTF-8', - $this->sourceEncoding - ) ?: $value, - $row - ); - } - - private function getResource(): \SplFileObject - { - if ($this->fileToRead instanceof \SplFileObject) { - return $this->fileToRead; - } - - if (\is_string($this->fileToRead)) { - $resource = new \SplFileObject($this->fileToRead, 'r'); - if (! $resource->isReadable()) { - throw new CsvReaderException('Cannot open the CSV file.'); - } - - return $resource; - } - - throw new CsvReaderException('Invalid file to read.'); - } - - private function inheritedSkipBom(\SplFileObject $resource): void - { - $position = $resource->ftell(); - - if ($position === false) { - throw new CsvReaderException('Cannot read the current position of the file read/write pointer.'); - } - - if ($resource->fread(3) !== \chr(0xEF) . \chr(0xBB) . \chr(0xBF)) { - $resource->fseek($position); - } - } - - /** - * @template T of object - * - * @param array $row - * @param class-string $className - * @param \Fusonic\CsvReader\Mapping\MappingInfo[] $mappings - * @return T - */ - protected function inheritedMap(array $row, string $className, array $mappings): object - { - $object = new $className(); - - foreach ($mappings as $mapping) { - if (! array_key_exists($mapping->getIndex(), $row)) { - throw new CsvReaderException("Column index {$mapping->getIndex()} does not exist in CSV row."); - } - - $mapping->setValue( - $object, - $this->options->valueConverter->convert( - $row[$mapping->getIndex()], - $mapping->getType() - ) - ); - } - - return $object; - } -} diff --git a/app/Services/EmployeeCsvImportLineService.php b/app/Services/EmployeeCsvImportLineService.php index 514f976f..ce5a0120 100644 --- a/app/Services/EmployeeCsvImportLineService.php +++ b/app/Services/EmployeeCsvImportLineService.php @@ -4,61 +4,62 @@ declare(strict_types=1); namespace App\Services; -use Fusonic\CsvReader\Attributes\TitleMapping; +use League\Csv\Serializer\MapCell; class EmployeeCsvImportLineService { - private const DATE_FORMAT = 'd/m/Y'; + private const array SUPPORTED_DATE_FORMATS = ['!d/m/Y', '!d-m-Y']; - #[TitleMapping('Matricule')] + #[MapCell(column: 'Matricule')] public string $matricule; - #[TitleMapping('Nom')] + #[MapCell(column: 'Nom')] public string $lastName; - #[TitleMapping('Prénom')] + #[MapCell(column: 'Prénom')] public string $firstName; - #[TitleMapping('Date début')] - public function setStartDate(string $value): void + public \DateTimeImmutable $startDate; + + public ?\DateTimeImmutable $endDate = null; + + public ?\DateTimeImmutable $expectedEndDate = null; + + #[MapCell(column: 'Etablissement')] + public string $establishment; + + #[MapCell(column: 'Site')] + public string $site; + + public string $service; + + #[MapCell(column: 'Date début')] + public function setStartDate(?string $value): void { $this->startDate = $this->parseMandatoryDate($value); } - public \DateTimeImmutable $startDate; - - #[TitleMapping('Date fin')] - public function setEndDate(string $value): void + #[MapCell(column: 'Date fin')] + public function setEndDate(?string $value): void { $this->endDate = $this->parseDate($value); } - public ?\DateTimeImmutable $endDate; - - #[TitleMapping('Date fin prévue')] - public function setExpectedEndDate(string $value): void + #[MapCell(column: 'Date fin prévue')] + public function setExpectedEndDate(?string $value): void { $this->expectedEndDate = $this->parseDate($value); } - public ?\DateTimeImmutable $expectedEndDate; - - #[TitleMapping('Etablissement')] - public string $establishment; - - #[TitleMapping('Site')] - public string $site; - - #[TitleMapping('Service')] - public function setService(string $value): void + #[MapCell(column: 'Service')] + public function setService(?string $value): void { + $value ??= ''; // NOTE: Hack in order to remove the site repetition in the service code, e.g., LDCCAV030 -> 030 $this->service = preg_replace('/^.*?(\d+)$/', '$1', $value) ?? $value; } - public string $service; - - private function parseMandatoryDate(string $value): \DateTimeImmutable + private function parseMandatoryDate(?string $value): \DateTimeImmutable { $date = $this->parseDate($value); @@ -69,18 +70,19 @@ class EmployeeCsvImportLineService return $date; } - private function parseDate(string $value): ?\DateTimeImmutable + private function parseDate(?string $value): ?\DateTimeImmutable { if (empty($value)) { return null; } - $date = \DateTimeImmutable::createFromFormat(self::DATE_FORMAT, $value); - - if ($date === false) { - throw new \InvalidArgumentException("Invalid date format: $value"); + foreach (self::SUPPORTED_DATE_FORMATS as $format) { + $date = \DateTimeImmutable::createFromFormat($format, $value); + if ($date !== false) { + return $date; + } } - return $date; + throw new \InvalidArgumentException("Invalid date format: $value"); } } diff --git a/app/Services/EmployeeCsvReaderService.php b/app/Services/EmployeeCsvReaderService.php index d26fd77a..b060b766 100644 --- a/app/Services/EmployeeCsvReaderService.php +++ b/app/Services/EmployeeCsvReaderService.php @@ -4,12 +4,18 @@ declare(strict_types=1); namespace App\Services; -use App\Lib\EnhancedCsvReader; -use Fusonic\CsvReader\CsvReaderOptions; +use League\Csv\CharsetConverter; +use League\Csv\Reader; +use League\Csv\Serializer\Denormalizer; use Psr\Log\LoggerInterface; +use Webmozart\Assert\Assert; class EmployeeCsvReaderService { + private const string CSV_ESCAPE = ''; + + private const string CSV_DELIMITER = ';'; + public function __construct( private readonly LoggerInterface $logger ) { @@ -28,32 +34,54 @@ class EmployeeCsvReaderService $this->logger->debug('Input stream is readable.'); try { - $options = new CsvReaderOptions(); - $options->delimiter = ';'; - $sourceEncoding = $this->detectEncoding($fromStream); - $reader = new EnhancedCsvReader($fromStream, $options, $sourceEncoding); + $csv = Reader::from($fromStream); + $csv->setHeaderOffset(0); + $csv->setEscape(self::CSV_ESCAPE); + $csv->setDelimiter(self::CSV_DELIMITER); - $items = $reader->readObjects( - EmployeeCsvImportLineService::class, - function (int $line, \Throwable $e): string { + if ($sourceEncoding !== null) { + CharsetConverter::addTo($csv, $sourceEncoding, 'UTF-8'); + } + + // * Trim lines. + $csv->addFormatter(static fn (array $row): array => array_map( + static fn (?string $value): ?string => $value !== null ? mb_trim($value) : null, + $row + )); + + $results = []; + $headers = array_map(trim(...), $csv->getHeader()); + $denormalizer = new Denormalizer(EmployeeCsvImportLineService::class, $headers); + + foreach ($csv->getRecords() as $offset => $record) { + try { + $mappedObject = $denormalizer->denormalize($record); + + Assert::isInstanceOf($mappedObject, EmployeeCsvImportLineService::class); + + $results[] = $mappedObject; + } catch (\Throwable $e) { + $line = $offset + 1; $this->logger->error('Failed to read line from CSV.', [ 'line' => $line, 'exception' => $e, ]); - return $e->getMessage(); + $results[] = $e->getMessage(); } - ); + } - return iterator_to_array($items, false); + return $results; } catch (\Throwable $e) { $this->logger->error('Failed to read employees from CSV.', [ 'exception' => $e, ]); - report($e); + if (function_exists('report')) { + report($e); + } return []; } @@ -73,7 +101,7 @@ class EmployeeCsvReaderService if (str_starts_with($sample, "\xEF\xBB\xBF")) { $fromStream->rewind(); - return 'UTF-8'; + return null; } $safeSample = strlen($sample) === 4096 ? mb_strcut($sample, 0, 4092, 'UTF-8') : $sample; diff --git a/composer.json b/composer.json index 79d8ba8d..8496325d 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,12 @@ "php": "^8.5", "axlon/laravel-postal-code-validation": "^3.9", "diglactic/laravel-breadcrumbs": "^10.1", - "fusonic/csv-reader": "^1.0", "kwaadpepper/serial-int-caster": "^2.0", "laravel/framework": "^13.0", "laravel/tinker": "^3.0", "laravel/ui": "^4.6", "ldc/ldccrmv4client": "^4.0", + "league/csv": "*", "maatwebsite/excel": "4.x-dev", "mews/purifier": "^3.3", "moneyphp/money": "^4.9", diff --git a/composer.lock b/composer.lock index 4f668914..4a7eac48 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c8e35cb5f86dd59bc4a8addb54133ba3", + "content-hash": "3b4525dc0f29aff6e84ff0aebf6f015a", "packages": [ { "name": "axlon/laravel-postal-code-validation", @@ -1081,60 +1081,6 @@ ], "time": "2025-12-03T09:33:47+00:00" }, - { - "name": "fusonic/csv-reader", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/fusonic/php-csv-reader.git", - "reference": "1b3a6f25f66144fffa724a861ef7395a20016f60" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fusonic/php-csv-reader/zipball/1b3a6f25f66144fffa724a861ef7395a20016f60", - "reference": "1b3a6f25f66144fffa724a861ef7395a20016f60", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.95", - "infection/infection": "^0.35", - "phpstan/phpstan": "^2.2", - "phpstan/phpstan-deprecation-rules": "^2.0", - "phpstan/phpstan-phpunit": "^2.0", - "phpstan/phpstan-strict-rules": "^2.0", - "phpunit/phpunit": "^13.4", - "rector/rector": "^2.6", - "tomasvotruba/type-coverage": "^2.3" - }, - "suggest": { - "ext-intl": "Required to use IntlValueConverter for advanced value conversion." - }, - "type": "library", - "autoload": { - "psr-4": { - "Fusonic\\CsvReader\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fusonic GmbH", - "email": "php@fusonic.net" - } - ], - "description": "Map data from CSV files to typed PHP models.", - "support": { - "issues": "https://github.com/fusonic/php-csv-reader/issues", - "source": "https://github.com/fusonic/php-csv-reader/tree/1.0.0" - }, - "time": "2026-11-04T08:38:29+00:00" - }, { "name": "giggsey/libphonenumber-for-php-lite", "version": "9.0.41", @@ -2521,6 +2467,101 @@ ], "time": "2022-12-11T20:36:23+00:00" }, + { + "name": "league/csv", + "version": "9.29.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/csv.git", + "reference": "13d5600d2c935c8785707e7d1d44ca1f2a22d6f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/13d5600d2c935c8785707e7d1d44ca1f2a22d6f4", + "reference": "13d5600d2c935c8785707e7d1d44ca1f2a22d6f4", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^8.2.0" + }, + "require-dev": { + "ext-dom": "*", + "ext-xdebug": "*", + "friendsofphp/php-cs-fixer": "^3.92.3", + "phpbench/phpbench": "^1.4.3", + "phpstan/phpstan": "^2.2.8", + "phpstan/phpstan-deprecation-rules": "^2.0.5", + "phpstan/phpstan-phpunit": "^2.0.18", + "phpstan/phpstan-strict-rules": "^2.0.12", + "phpunit/phpunit": "^11.5.22 || ^12.5.4 || ^13.3.1", + "rector/rector": "^2.6.3", + "symfony/var-dumper": "^6.4.8 || ^7.4.0 || ^8.0" + }, + "suggest": { + "ext-dom": "Required to use the XMLConverter and the HTMLConverter classes", + "ext-iconv": "Needed to ease transcoding CSV using iconv stream filters", + "ext-mbstring": "Needed to ease transcoding CSV using mb stream filters", + "ext-mysqli": "Requiered to use the package with the MySQLi extension", + "ext-pdo": "Required to use the package with the PDO extension", + "ext-pgsql": "Requiered to use the package with the PgSQL extension", + "ext-sqlite3": "Required to use the package with the SQLite3 extension" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "League\\Csv\\": "src" + }, + "classmap": [ + "polyfill" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://github.com/nyamsprod/", + "role": "Developer" + } + ], + "description": "CSV data manipulation made easy in PHP", + "homepage": "https://csv.thephpleague.com", + "keywords": [ + "convert", + "csv", + "export", + "filter", + "import", + "read", + "transform", + "write" + ], + "support": { + "docs": "https://csv.thephpleague.com", + "issues": "https://github.com/thephpleague/csv/issues", + "rss": "https://github.com/thephpleague/csv/releases.atom", + "source": "https://github.com/thephpleague/csv" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-10-28T08:56:24+00:00" + }, { "name": "league/flysystem", "version": "3.36.0", diff --git a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php index 2851ead8..cca4d72f 100644 --- a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php +++ b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php @@ -6,6 +6,8 @@ use App\Services\EmployeeCsvImportLineService; use App\Services\EmployeeCsvReaderService; use Psr\Log\LoggerInterface; +covers(EmployeeCsvReaderService::class); + afterEach(function (): void { \Mockery::close(); }); From 083357f7467f341efa93c253991b406edea8cffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Sat, 14 Nov 2026 08:47:52 +0100 Subject: [PATCH 09/11] test(EmployeeCsvImportLineService): fix end date format in test Updated the expected end date format in the test to match the correct 'Y-m-d' format. --- tests/Unit/App/Services/EmployeeCsvImportLineTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Unit/App/Services/EmployeeCsvImportLineTest.php b/tests/Unit/App/Services/EmployeeCsvImportLineTest.php index 85c2942f..07502b08 100644 --- a/tests/Unit/App/Services/EmployeeCsvImportLineTest.php +++ b/tests/Unit/App/Services/EmployeeCsvImportLineTest.php @@ -38,7 +38,7 @@ describe('EmployeeCsvImportLineService', function (): void { $line = new EmployeeCsvImportLineService(); // WHEN + THEN - expect(fn () => $line->setEndDate('31-12-2026')) - ->toThrow(\InvalidArgumentException::class, 'Invalid date format: 31-12-2026'); + expect(fn () => $line->setEndDate('2026-12-31')) + ->toThrow(\InvalidArgumentException::class, 'Invalid date format: 2026-12-31'); }); }); From aaf7d442b3468b834097659ea5f62023dfac47e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Sun, 15 Nov 2026 16:44:54 +0100 Subject: [PATCH 10/11] fix(employee): handle expected end date, upsert errors, and employee persistence --- app/Cqs/Actions/Employee/ImportEmployees.php | 12 ++- .../EloquentShopperRepository.php | 3 +- .../EloquentShopperRepositoryTest.php | 60 ++++++++++++ .../Actions/Employee/ImportEmployeesTest.php | 92 +++++++++++++++++++ 4 files changed, 163 insertions(+), 4 deletions(-) diff --git a/app/Cqs/Actions/Employee/ImportEmployees.php b/app/Cqs/Actions/Employee/ImportEmployees.php index fd1e0b03..0dae3362 100644 --- a/app/Cqs/Actions/Employee/ImportEmployees.php +++ b/app/Cqs/Actions/Employee/ImportEmployees.php @@ -40,7 +40,7 @@ final class ImportEmployees implements Action 'count' => count([...$csvLines]), ]); - $errors = array_filter( + $csvErrors = array_filter( $csvLines, fn ($employee) => is_string($employee) ); @@ -58,7 +58,7 @@ final class ImportEmployees implements Action fn ($employee) => $employee instanceof ArcadiaEmployee ); - $errors += array_filter( + $mappingErrors = array_filter( $importedEmployees, fn ($employee) => is_string($employee) ); @@ -67,10 +67,16 @@ final class ImportEmployees implements Action $totalInserted = $result->insertedCount; $totalUpdated = $result->updatedCount; + $errors = array_values([ + ...$csvErrors, + ...$mappingErrors, + ...$result->errors, + ]); $this->logger->info('Employee synchronization completed successfully.', [ 'total_inserted' => $totalInserted, 'total_updated' => $totalUpdated, + 'errors_count' => count($errors), ]); return new ImportEmployeesOutput( @@ -88,7 +94,7 @@ final class ImportEmployees implements Action lastname: $csvLine->lastName, firstname: $csvLine->firstName, startDate: $csvLine->startDate, - endDate: $csvLine->endDate, + endDate: $csvLine->endDate ?? $csvLine->expectedEndDate, etablissement: new ShopperEstablishmentCode($csvLine->establishment), site: new ShopperSiteCode($csvLine->site), service: new ShopperServiceCode($csvLine->service), diff --git a/infra/Adapters/Repositories/EloquentShopperRepository.php b/infra/Adapters/Repositories/EloquentShopperRepository.php index 671de995..98f9d5f7 100644 --- a/infra/Adapters/Repositories/EloquentShopperRepository.php +++ b/infra/Adapters/Repositories/EloquentShopperRepository.php @@ -33,6 +33,7 @@ class EloquentShopperRepository implements ShopperRepository public function persist(Shopper $entity): void { $customer = Customer::query() + ->with('employee') ->where('id', $entity->id()->value) ->firstOrNew(); @@ -57,7 +58,7 @@ class EloquentShopperRepository implements ShopperRepository $customer->employee->site = $entity->site; $customer->employee->service = $entity->service; - $customer->save(); + $customer->push(); } #[\Override] diff --git a/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopperRepositoryTest.php b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopperRepositoryTest.php index a13bb24c..d527e4e7 100644 --- a/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopperRepositoryTest.php +++ b/tests/Integration/WithApp/Infra/Adapters/Repositories/EloquentShopperRepositoryTest.php @@ -4,11 +4,15 @@ declare(strict_types=1); use App\Models\Customer; use App\Models\Employee; +use Carbon\CarbonImmutable; use Domain\Models\Entities\Shopper; use Domain\Models\ValueObjects\Code; use Domain\Models\ValueObjects\Email; use Domain\Models\ValueObjects\Entities\ShopperId; use Domain\Models\ValueObjects\Matricule; +use Domain\Models\ValueObjects\ShopperEstablishmentCode; +use Domain\Models\ValueObjects\ShopperServiceCode; +use Domain\Models\ValueObjects\ShopperSiteCode; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; @@ -147,3 +151,59 @@ it('throws exception if shopper not found in getByIdOrFail', function () { // THEN expect($action)->toThrow(\DomainException::class, "Shopper with id '{$id->toString()}' not found or is not linked to any employee."); }); + +it('persists updates to both customer and associated employee', function () { + // GIVEN + $uuid = Uuid::uuid7()->toString(); + $shopperId = new ShopperId(Uuid::fromString($uuid)); + + Customer::forceCreate([ + 'id' => $uuid, + 'email' => new Email('before@example.com'), + 'hashcode' => Uuid::uuid4()->toString(), + ]); + + Employee::forceCreate([ + 'customer_id' => $uuid, + 'matricule' => new Matricule('1234567'), + 'nom' => 'Doe', + 'prenom' => 'John', + 'start_date' => '2026-01-01', + 'end_date' => null, + 'etablissement' => 'ETAB01', + 'site' => 'SITE', + 'service' => '101', + 'code' => new Code('ABCDEFGH'), + ]); + + $repo = new EloquentShopperRepository(); + $updatedShopper = new Shopper( + id: $shopperId, + email: new Email('after@example.com'), + matricule: new Matricule('7654321'), + nom: 'Martin', + prenom: 'Claire', + startDate: CarbonImmutable::parse('2026-02-01'), + endDate: CarbonImmutable::parse('2026-12-31'), + etablissement: new ShopperEstablishmentCode('ETAB02'), + site: new ShopperSiteCode('PA'), + service: new ShopperServiceCode('202'), + ); + + // WHEN + $repo->persist($updatedShopper); + + // THEN + $reloaded = $repo->find($shopperId); + + expect($reloaded)->toBeInstanceOf(Shopper::class) + ->and($reloaded?->email->value)->toBe('after@example.com') + ->and($reloaded?->matricule->value)->toBe('7654321') + ->and($reloaded?->nom)->toBe('Martin') + ->and($reloaded?->prenom)->toBe('Claire') + ->and($reloaded?->startDate->format('Y-m-d'))->toBe('2026-02-01') + ->and($reloaded?->endDate?->format('Y-m-d'))->toBe('2026-12-31') + ->and($reloaded?->etablissement->value)->toBe('ETAB02') + ->and($reloaded?->site->value)->toBe('PA') + ->and($reloaded?->service->value)->toBe('202'); +}); diff --git a/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php index 9485286f..3f2ded1a 100644 --- a/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php +++ b/tests/Unit/App/Cqs/Actions/Employee/ImportEmployeesTest.php @@ -132,6 +132,98 @@ describe('ImportEmployees action', function (): void { unlink($filePath); }); + it('uses expectedEndDate as fallback when endDate is null and aggregates upsert errors without key collisions', function (): void { + // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug')->once(); + $logger->shouldReceive('info')->once(); + + /** @var \App\Services\EmployeeCsvReaderService&\Mockery\MockInterface $reader */ + $reader = \Mockery::mock(EmployeeCsvReaderService::class); + /** @var \App\Services\EmployeeUpsertService&\Mockery\MockInterface $upsert */ + $upsert = \Mockery::mock(EmployeeUpsertService::class); + + $lineWithExpectedEndDate = new EmployeeCsvImportLineService(); + $lineWithExpectedEndDate->matricule = '1234567'; + $lineWithExpectedEndDate->lastName = 'Dupont'; + $lineWithExpectedEndDate->firstName = 'Jean'; + $lineWithExpectedEndDate->setStartDate('01/10/2026'); + $lineWithExpectedEndDate->setEndDate(''); + $lineWithExpectedEndDate->setExpectedEndDate('31/12/2026'); + $lineWithExpectedEndDate->establishment = 'ETAB01'; + $lineWithExpectedEndDate->site = 'PA'; + $lineWithExpectedEndDate->setService('LDCCAV030'); + + $lineWithBothEndDates = new EmployeeCsvImportLineService(); + $lineWithBothEndDates->matricule = '7654321'; + $lineWithBothEndDates->lastName = 'Martin'; + $lineWithBothEndDates->firstName = 'Claire'; + $lineWithBothEndDates->setStartDate('01/10/2026'); + $lineWithBothEndDates->setEndDate('15/11/2026'); + $lineWithBothEndDates->setExpectedEndDate('31/12/2026'); + $lineWithBothEndDates->establishment = 'ETAB01'; + $lineWithBothEndDates->site = 'PA'; + $lineWithBothEndDates->setService('LDCCAV030'); + + $invalidMappingLine = new EmployeeCsvImportLineService(); + $invalidMappingLine->matricule = '9999999'; + $invalidMappingLine->lastName = 'Durand'; + $invalidMappingLine->firstName = 'Paul'; + $invalidMappingLine->setStartDate('01/10/2026'); + $invalidMappingLine->setEndDate(''); + $invalidMappingLine->establishment = 'ETAB01'; + $invalidMappingLine->site = 'pa'; + $invalidMappingLine->setService('LDCCAV030'); + + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-'); + expect($filePath)->not->toBeFalse(); + file_put_contents($filePath, 'header'); + + $fileObject = new \SplFileObject($filePath, 'r'); + + // CSV error at key 0 collides with mapping error key 0 if union operator (+) is used + $reader->shouldReceive('importEmployeesFromCsv') + ->once() + ->with($fileObject) + ->andReturn([ + 'CSV parse error on row 2', + $lineWithExpectedEndDate, + $lineWithBothEndDates, + $invalidMappingLine, + ]); + + $upsert->shouldReceive('upsertEmployees') + ->once() + ->with(\Mockery::on(static function (array $employees): bool { + $values = array_values($employees); + + return count($values) === 2 + && $values[0] instanceof ArcadiaEmployee + && $values[0]->endDate?->format('Y-m-d') === '2026-12-31' + && $values[1] instanceof ArcadiaEmployee + && $values[1]->endDate?->format('Y-m-d') === '2026-11-15'; + })) + ->andReturn(new EmployeeUpsertServiceResult( + insertedCount: 1, + updatedCount: 1, + errors: ['Duplicate detected in the file: The matricule 1234567 appears multiple times.'], + )); + + $action = new ImportEmployees($logger, $reader, $upsert); + + // WHEN + $result = $action(new ImportEmployeesInput($fileObject)); + + // THEN + expect($result->errors)->toHaveCount(3) + ->and($result->errors[0])->toBe('CSV parse error on row 2') + ->and($result->errors[1])->toContain('does not match pattern') + ->and($result->errors[2])->toBe('Duplicate detected in the file: The matricule 1234567 appears multiple times.'); + + unlink($filePath); + }); + it('throws when input type is invalid', function (): void { // GIVEN /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ From b6c5660d5e8b25a94319563bb1bb8ce1d17bafe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 17 Nov 2026 09:46:05 +0100 Subject: [PATCH 11/11] feat(EmployeeCsvReaderService): refactor CSV reader creation Updated the importEmployeesFromCsv method to use a dedicated createCsvReader method for better encoding handling and improved readability. --- app/Services/EmployeeCsvReaderService.php | 30 ++++- .../Services/EmployeeCsvReaderServiceTest.php | 109 ++++++++++++++++++ 2 files changed, 138 insertions(+), 1 deletion(-) diff --git a/app/Services/EmployeeCsvReaderService.php b/app/Services/EmployeeCsvReaderService.php index b060b766..624d5617 100644 --- a/app/Services/EmployeeCsvReaderService.php +++ b/app/Services/EmployeeCsvReaderService.php @@ -35,8 +35,8 @@ class EmployeeCsvReaderService try { $sourceEncoding = $this->detectEncoding($fromStream); + $csv = $this->createCsvReader($fromStream); - $csv = Reader::from($fromStream); $csv->setHeaderOffset(0); $csv->setEscape(self::CSV_ESCAPE); $csv->setDelimiter(self::CSV_DELIMITER); @@ -87,6 +87,34 @@ class EmployeeCsvReaderService } } + /** + * League\Csv stream filters (used by CharsetConverter) require a PHP stream resource + * rather than an SplFileObject instance. + * + * @return \League\Csv\Reader> + */ + private function createCsvReader(\SplFileObject $fromStream): Reader + { + $realPath = $fromStream->getRealPath(); + if ($realPath !== false && is_file($realPath)) { + return Reader::fromPath($realPath); + } + + $fromStream->rewind(); + $content = ''; + while (! $fromStream->eof()) { + $chunk = $fromStream->fread(8192); + if ($chunk === false) { + throw new \UnexpectedValueException('Failed to read from input stream.'); + } + $content .= $chunk; + } + + $fromStream->rewind(); + + return Reader::fromString($content); + } + private function detectEncoding(\SplFileObject $fromStream): ?string { $fromStream->rewind(); diff --git a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php index cca4d72f..322e80f6 100644 --- a/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php +++ b/tests/Unit/App/Services/EmployeeCsvReaderServiceTest.php @@ -97,4 +97,113 @@ describe('EmployeeCsvReaderService', function (): void { expect(fn () => $service->importEmployeesFromCsv($unreadable)) ->toThrow(\InvalidArgumentException::class, 'Input stream must be readable.'); }); + + it('imports employees from a Windows-1252 encoded CSV file', function (): void { + // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug')->once(); + $logger->shouldReceive('info')->once(); + $logger->shouldReceive('error')->never(); + + $service = new EmployeeCsvReaderService($logger); + + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-win1252-'); + expect($filePath)->not->toBeFalse(); + + $utf8Csv = implode("\n", [ + 'Matricule;Nom;Prénom;Date début;Date fin;Date fin prévue;Etablissement;Site;Service', + '1234567;François;Éric;01/10/2026;;;ETAB01;PA;LDCCAV030', + ]); + $win1252Csv = mb_convert_encoding($utf8Csv, 'Windows-1252', 'UTF-8'); + file_put_contents($filePath, $win1252Csv); + + $fileObject = new \SplFileObject($filePath, 'r'); + + // WHEN + $items = $service->importEmployeesFromCsv($fileObject); + + // THEN + $firstItem = $items[0]; + assert($firstItem instanceof EmployeeCsvImportLineService); + + expect($items)->toHaveCount(1) + ->and($firstItem->matricule)->toBe('1234567') + ->and($firstItem->lastName)->toBe('François') + ->and($firstItem->firstName)->toBe('Éric') + ->and($firstItem->service)->toBe('030'); + + unlink($filePath); + }); + + it('imports employees from a UTF-8 BOM CSV file', function (): void { + // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug')->once(); + $logger->shouldReceive('error')->never(); + + $service = new EmployeeCsvReaderService($logger); + + $filePath = tempnam(sys_get_temp_dir(), 'employees-csv-bom-'); + expect($filePath)->not->toBeFalse(); + + $csvWithBom = "\xEF\xBB\xBF" . implode("\n", [ + 'Matricule;Nom;Prénom;Date début;Date fin;Date fin prévue;Etablissement;Site;Service', + '1234567;Dupont;Hélène;01/10/2026;;;ETAB01;PA;LDCCAV030', + ]); + file_put_contents($filePath, $csvWithBom); + + $fileObject = new \SplFileObject($filePath, 'r'); + + // WHEN + $items = $service->importEmployeesFromCsv($fileObject); + + // THEN + $firstItem = $items[0]; + assert($firstItem instanceof EmployeeCsvImportLineService); + + expect($items)->toHaveCount(1) + ->and($firstItem->firstName)->toBe('Hélène'); + + unlink($filePath); + }); + + it('imports employees from a Windows-1252 encoded SplTempFileObject', function (): void { + // GIVEN + /** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $logger */ + $logger = \Mockery::mock(LoggerInterface::class); + $logger->shouldReceive('debug')->once(); + $logger->shouldReceive('info')->once(); + $logger->shouldReceive('error')->never(); + + $service = new EmployeeCsvReaderService($logger); + + $utf8Csv = implode("\n", [ + 'Matricule;Nom;Prénom;Date début;Date fin;Date fin prévue;Etablissement;Site;Service', + '1234567;Noël;Céline;01/10/2026;;;ETAB01;PA;LDCCAV030', + ]); + $win1252Csv = mb_convert_encoding($utf8Csv, 'Windows-1252', 'UTF-8'); + + $tempFile = new class () extends \SplTempFileObject + { + public function isReadable(): bool + { + return true; + } + }; + $tempFile->fwrite($win1252Csv); + $tempFile->rewind(); + + // WHEN + $items = $service->importEmployeesFromCsv($tempFile); + + // THEN + $firstItem = $items[0]; + assert($firstItem instanceof EmployeeCsvImportLineService); + + expect($items)->toHaveCount(1) + ->and($firstItem->lastName)->toBe('Noël') + ->and($firstItem->firstName)->toBe('Céline'); + }); });