Skip to content
Merged

Dev #3027

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Http/Controllers/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function store(EventRequest $request): JsonResponse

$user->save();

/** @var Event $event */
$event = EventsQuery::store($request);

$event->notifyAmbassadors();
Expand Down
1 change: 1 addition & 0 deletions app/Imports/AppleEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw23-apple-eu',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/AvandeEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw25-avande-eu',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => (!empty($row['latitude']) && !empty($row['longitude'])) ? $row['latitude'] . ',' . $row['longitude'] : '',
Expand Down
1 change: 1 addition & 0 deletions app/Imports/BulgariaEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw19-bulgaria',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/CoderDojoEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw20-coderdojo-eu',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($row['start_date']),
'end_date' => \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($row['end_date']),
'geoposition' => (!empty($row['latitude']) && !empty($row['longitude'])) ? $row['latitude'] . ',' . $row['longitude'] : '',
Expand Down
3 changes: 2 additions & 1 deletion app/Imports/CodingActivitiesEUCodeWeekSiteImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public function model(array $row): ?Model
'pub_date' => now(),
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => '',
'codeweek_for_all_participation_code' => $row['codeweek_for_all_participation_code'] ?? '',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/DutchDanceEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw21-CodeWeekNL',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['longitude'].','.$row['latitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/DutchMoorlagEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'NL-Moorlag-001',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['longitude'].','.$row['latitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/DutchSimoneEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw23-CodeWeekNL',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/EventiEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw20-coderdojo-eu',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($row['start_date']),
'end_date' => \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($row['end_date']),
'geoposition' => (!empty($row['latitude']) && !empty($row['longitude'])) ? $row['latitude'] . ',' . $row['longitude'] : '',
Expand Down
3 changes: 2 additions & 1 deletion app/Imports/EventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public function model(array $row): ?Model
'pub_date' => now(),
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => '',
'codeweek_for_all_participation_code' => $row['codeweek_for_all_participation_code'] ?? '',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => Carbon::parse($this->parseDate($row['start_date']))->toDateTimeString(),
'end_date' => Carbon::parse($this->parseDate($row['end_date']))->toDateTimeString(),
'geoposition' => $row['latitude'] . ',' . $row['longitude'],
Expand Down
2 changes: 2 additions & 0 deletions app/Imports/GenericEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'recurring_event' => $this->parseBool($row['recurring_event'] ?? ''),
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'codeweek_for_all_participation_code' => $row['codeweek_for_all_participation_code'] ?? '',
];

// 5) optional counts & booleans
Expand Down
1 change: 1 addition & 0 deletions app/Imports/HamburgEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw19-hamburg',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
3 changes: 2 additions & 1 deletion app/Imports/IrelandDreamSpaceImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public function model(array $row): ?Model
'pub_date' => now(),
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => '',
'codeweek_for_all_participation_code' => $row['codeweek_for_all_participation_code'] ?? '',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['date']),
'end_date' => $this->parseDate($row['date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/IrelandEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw23-ireland',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/LuxembourgEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw22-luxembourg',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/MagentaEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw20-magenta',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/ReportedEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'NL-Deursen-001',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/TelerikEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw19-telerik',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/UKDigitAllCharityEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw23-DigitAll',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
1 change: 1 addition & 0 deletions app/Imports/UKDigitAllEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function model(array $row): ?Model
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw23-DigitAll',
'leading_teacher_tag' => $row['leading_teacher_tag'] ?? null,
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'].','.$row['longitude'],
Expand Down
13 changes: 0 additions & 13 deletions app/Queries/EventsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@

class EventsQuery
{
private static function getRandomString($n)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';

for ($i = 0; $i < $n; $i++) {
$index = rand(0, strlen($characters) - 1);
$randomString .= $characters[$index];
}

return $randomString;
}

public static function store(Request $request)
{

Expand Down

Large diffs are not rendered by default.

Loading
Loading