Basic implementation of payment methods
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user