From fcf41c5d13db9609b234617ea88d7a3ecafa0cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Mon, 16 Feb 2026 21:59:21 +0100 Subject: [PATCH] Creation and editing of events --- app/Casts/AmountCast.php | 34 + .../CreateCostUnit/CreateCostUnitCommand.php | 7 +- .../CreateCostUnit/CreateCostUnitResponse.php | 10 +- .../CostUnit/Controllers/OpenController.php | 5 +- app/Domains/CostUnit/Views/Open.vue | 14 +- .../CreateEvent/CreateEventCommand.php | 74 ++ .../CreateEvent/CreateEventRequest.php | 40 + .../CreateEvent/CreateEventResponse.php | 15 + .../SetCostUnit/SetCostUnitCommand.php | 18 + .../SetCostUnit/SetCostUnitRequest.php | 16 + .../SetCostUnit/SetCostUnitResponse.php | 11 + .../SetParticipationFeesCommand.php | 82 +++ .../SetParticipationFeesRequest.php | 24 + .../SetParticipationFeesResponse.php | 11 + .../UpdateEvent/UpdateEventCommand.php | 41 ++ .../UpdateEvent/UpdateEventRequest.php | 41 ++ .../UpdateEvent/UpdateEventResponse.php | 12 + .../UpdateManagers/UpdateManagersCommand.php | 25 + .../UpdateManagers/UpdateManagersRequest.php | 15 + .../UpdateManagers/UpdateManagersResponse.php | 11 + .../Event/Controllers/CreateController.php | 100 +++ .../Event/Controllers/DetailsController.php | 118 +++ app/Domains/Event/Routes/api.php | 31 + app/Domains/Event/Routes/web.php | 15 + app/Domains/Event/Views/Create.vue | 294 ++++++++ app/Domains/Event/Views/Details.vue | 60 ++ .../Event/Views/Partials/CommonSettings.vue | 258 +++++++ .../Event/Views/Partials/EventManagement.vue | 63 ++ app/Domains/Event/Views/Partials/Overview.vue | 113 +++ .../Views/Partials/ParticipationFees.vue | 231 ++++++ .../Views/Partials/ParticipationSummary.vue | 125 ++++ app/Enumerations/ParticipationFeeType.php | 15 + app/Enumerations/ParticipationType.php | 18 + app/Installer/DevelopmentDataSeeder.php | 4 +- app/Installer/ProductionDataSeeder.php | 33 +- app/Models/Event.php | 167 +++++ app/Providers/GlobalDataProvider.php | 23 + app/RelationModels/EventEatingHabits.php | 11 + app/RelationModels/EventLocalGroups.php | 10 + app/RelationModels/EventManagers.php | 11 + app/RelationModels/EventParticipationFee.php | 25 + app/Repositories/CostUnitRepository.php | 20 + app/Repositories/EventRepository.php | 56 ++ app/Resources/CostUnitResource.php | 11 + app/Resources/EatingHabitResource.php | 22 + app/Resources/EventResource.php | 109 +++ app/Resources/LocalGroupResource.php | 24 + app/Scopes/CommonController.php | 3 + app/ValueObjects/Amount.php | 7 + app/Views/Components/ErrorText.vue | 2 +- .../2026_01_30_140002_create_users_table.php | 3 +- .../2026_01_30_140010_create_cost_units.php | 1 + .../2026_02_14_140010_create_events.php | 102 +++ ..._02_14_140011_create_event_localgroups.php | 25 + package-lock.json | 695 +++++++++--------- package.json | 7 +- public/css/dimensions.css | 16 + public/css/elements.css | 2 + resources/js/components/HttpClient.js | 41 ++ resources/js/layouts/AppLayout.vue | 2 +- routes/web.php | 3 + 61 files changed, 3002 insertions(+), 380 deletions(-) create mode 100644 app/Casts/AmountCast.php create mode 100644 app/Domains/Event/Actions/CreateEvent/CreateEventCommand.php create mode 100644 app/Domains/Event/Actions/CreateEvent/CreateEventRequest.php create mode 100644 app/Domains/Event/Actions/CreateEvent/CreateEventResponse.php create mode 100644 app/Domains/Event/Actions/SetCostUnit/SetCostUnitCommand.php create mode 100644 app/Domains/Event/Actions/SetCostUnit/SetCostUnitRequest.php create mode 100644 app/Domains/Event/Actions/SetCostUnit/SetCostUnitResponse.php create mode 100644 app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php create mode 100644 app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesRequest.php create mode 100644 app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesResponse.php create mode 100644 app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php create mode 100644 app/Domains/Event/Actions/UpdateEvent/UpdateEventRequest.php create mode 100644 app/Domains/Event/Actions/UpdateEvent/UpdateEventResponse.php create mode 100644 app/Domains/Event/Actions/UpdateManagers/UpdateManagersCommand.php create mode 100644 app/Domains/Event/Actions/UpdateManagers/UpdateManagersRequest.php create mode 100644 app/Domains/Event/Actions/UpdateManagers/UpdateManagersResponse.php create mode 100644 app/Domains/Event/Controllers/CreateController.php create mode 100644 app/Domains/Event/Controllers/DetailsController.php create mode 100644 app/Domains/Event/Routes/api.php create mode 100644 app/Domains/Event/Routes/web.php create mode 100644 app/Domains/Event/Views/Create.vue create mode 100644 app/Domains/Event/Views/Details.vue create mode 100644 app/Domains/Event/Views/Partials/CommonSettings.vue create mode 100644 app/Domains/Event/Views/Partials/EventManagement.vue create mode 100644 app/Domains/Event/Views/Partials/Overview.vue create mode 100644 app/Domains/Event/Views/Partials/ParticipationFees.vue create mode 100644 app/Domains/Event/Views/Partials/ParticipationSummary.vue create mode 100644 app/Enumerations/ParticipationFeeType.php create mode 100644 app/Enumerations/ParticipationType.php create mode 100644 app/Models/Event.php create mode 100644 app/RelationModels/EventEatingHabits.php create mode 100644 app/RelationModels/EventLocalGroups.php create mode 100644 app/RelationModels/EventManagers.php create mode 100644 app/RelationModels/EventParticipationFee.php create mode 100644 app/Repositories/EventRepository.php create mode 100644 app/Resources/EatingHabitResource.php create mode 100644 app/Resources/EventResource.php create mode 100644 app/Resources/LocalGroupResource.php create mode 100644 database/migrations/2026_02_14_140010_create_events.php create mode 100644 database/migrations/2026_02_14_140011_create_event_localgroups.php create mode 100644 resources/js/components/HttpClient.js diff --git a/app/Casts/AmountCast.php b/app/Casts/AmountCast.php new file mode 100644 index 0000000..cda19ca --- /dev/null +++ b/app/Casts/AmountCast.php @@ -0,0 +1,34 @@ +getAmount(); + } + + return (float) $value; + } +} diff --git a/app/Domains/CostUnit/Actions/CreateCostUnit/CreateCostUnitCommand.php b/app/Domains/CostUnit/Actions/CreateCostUnit/CreateCostUnitCommand.php index 319193e..35bef58 100644 --- a/app/Domains/CostUnit/Actions/CreateCostUnit/CreateCostUnitCommand.php +++ b/app/Domains/CostUnit/Actions/CreateCostUnit/CreateCostUnitCommand.php @@ -22,8 +22,13 @@ class CreateCostUnitCommand { 'mail_on_new' => $this->request->mailOnNew, 'allow_new' => true, 'archived' => false, - ]); + + if (null !== $costUnit) { + $response->costUnit = $costUnit; + $response->success = true; + } + return $response; } } diff --git a/app/Domains/CostUnit/Actions/CreateCostUnit/CreateCostUnitResponse.php b/app/Domains/CostUnit/Actions/CreateCostUnit/CreateCostUnitResponse.php index c58891d..3a44e14 100644 --- a/app/Domains/CostUnit/Actions/CreateCostUnit/CreateCostUnitResponse.php +++ b/app/Domains/CostUnit/Actions/CreateCostUnit/CreateCostUnitResponse.php @@ -2,6 +2,14 @@ namespace App\Domains\CostUnit\Actions\CreateCostUnit; -class CreateCostUnitResponse { +use App\Models\CostUnit; +class CreateCostUnitResponse { + public bool $success; + public ?CostUnit $costUnit; + + public function __construct() { + $this->success = false; + $this->costUnit = null; + } } diff --git a/app/Domains/CostUnit/Controllers/OpenController.php b/app/Domains/CostUnit/Controllers/OpenController.php index a72567f..8f3ada2 100644 --- a/app/Domains/CostUnit/Controllers/OpenController.php +++ b/app/Domains/CostUnit/Controllers/OpenController.php @@ -8,8 +8,11 @@ use Illuminate\Http\JsonResponse; class OpenController extends CommonController { public function __invoke(int $costUnitId) { + $costUnit = $this->costUnits->getById($costUnitId); + + $inertiaProvider = new InertiaProvider('CostUnit/Open', [ - 'costUnitId' => $costUnitId + 'costUnit' => $costUnit ]); return $inertiaProvider->render(); } diff --git a/app/Domains/CostUnit/Views/Open.vue b/app/Domains/CostUnit/Views/Open.vue index 77d4f04..4a28351 100644 --- a/app/Domains/CostUnit/Views/Open.vue +++ b/app/Domains/CostUnit/Views/Open.vue @@ -8,11 +8,11 @@ import ListInvoices from "./Partials/ListInvoices.vue"; const props = defineProps({ - costUnitId: Number + costUnit: Object }) const urlParams = new URLSearchParams(window.location.search) - const initialCostUnitId = props.cost_unit_id + const initialCostUnitId = props.costUnit.id const initialInvoiceId = props.invoice_id @@ -22,7 +22,7 @@ { title: 'Neue Abrechnungen', component: ListInvoices, - endpoint: "/api/v1/cost-unit/" + props.costUnitId + "/invoice-list/new", + endpoint: "/api/v1/cost-unit/" + props.costUnit.id + "/invoice-list/new", deep_jump_id: initialCostUnitId, deep_jump_id_sub: initialInvoiceId, @@ -30,21 +30,21 @@ { title: 'Nichtexportierte Abrechnungen', component: ListInvoices, - endpoint: "/api/v1/cost-unit/" + props.costUnitId + "/invoice-list/approved", + endpoint: "/api/v1/cost-unit/" + props.costUnit.id + "/invoice-list/approved", deep_jump_id: initialCostUnitId, deep_jump_id_sub: initialInvoiceId, }, { title: 'Exportierte Abrechnungen', component: ListInvoices, - endpoint: "/api/v1/cost-unit/" + props.costUnitId + "/invoice-list/exported", + endpoint: "/api/v1/cost-unit/" + props.costUnit.id + "/invoice-list/exported", deep_jump_id: initialCostUnitId, deep_jump_id_sub: initialInvoiceId, }, { title: 'Abgelehnte Abrechnungen', component: ListInvoices, - endpoint: "/api/v1/cost-unit/" + props.costUnitId + "/invoice-list/denied", + endpoint: "/api/v1/cost-unit/" + props.costUnit.id + "/invoice-list/denied", deep_jump_id: initialCostUnitId, deep_jump_id_sub: initialInvoiceId, }, @@ -58,7 +58,7 @@