Basic implementation of payment methods

This commit is contained in:
2026-07-28 15:50:58 +02:00
parent afc91545a9
commit 6c9281516e
39 changed files with 749 additions and 24 deletions
@@ -3,10 +3,12 @@
namespace App\Domains\Event\Actions\CreateEvent;
use App\Enumerations\EatingHabit;
use App\Models\AvailablePaymentMethod;
use App\Models\Event;
use App\Models\Tenant;
use App\RelationModels\EventEatingHabits;
use App\RelationModels\EventLocalGroups;
use App\RelationModels\EventPaymentMethods;
use Illuminate\Support\Str;
class CreateEventCommand {
@@ -41,7 +43,7 @@ class CreateEventCommand {
'account_iban' => $this->request->accountIban,
'participation_fee_type' => $this->request->participationFeeType->slug,
'pay_per_day' => $this->request->payPerDay,
'pay_direct' => $this->request->payDirect,
'pay_direct' => false,
'total_max_amount' => 0,
'support_per_person' => 0,
'support_flat' => 0,
@@ -58,6 +60,13 @@ class CreateEventCommand {
'eating_habit_id' => EatingHabit::where('slug', EatingHabit::EATING_HABIT_VEGETARIAN)->first()->id,
]);
foreach (AvailablePaymentMethod::where('active', true)->get() as $availablePaymentMethod) {
EventPaymentMethods::create([
'event_id' => $event->id,
'available_payment_method_id' => $availablePaymentMethod->id,
]);
}
if (app('tenant')->slug === 'lv') {
foreach(Tenant::where(['is_active_local_group' => true])->get() as $tenant) {
EventLocalGroups::create(['event_id' => $event->id, 'local_group_id' => $tenant->id]);
@@ -19,9 +19,8 @@ class CreateEventRequest {
public string $accountOwner;
public string $accountIban;
public bool $payPerDay;
public bool $payDirect;
public function __construct(string $name, string $location, string $postalCode, string $email, DateTime $begin, DateTime $end, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $earlyBirdEndAmountIncrease, ParticipationFeeType $participationFeeType, string $accountOwner, string $accountIban, bool $payPerDay, bool $payDirect) {
public function __construct(string $name, string $location, string $postalCode, string $email, DateTime $begin, DateTime $end, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $earlyBirdEndAmountIncrease, ParticipationFeeType $participationFeeType, string $accountOwner, string $accountIban, bool $payPerDay) {
$this->name = $name;
$this->location = $location;
$this->postalCode = $postalCode;
@@ -35,6 +34,5 @@ class CreateEventRequest {
$this->accountOwner = $accountOwner;
$this->accountIban = $accountIban;
$this->payPerDay = $payPerDay;
$this->payDirect = $payDirect;
}
}