Skip to content

Commit 3f82932

Browse files
committed
feat: added summit.speakers_support_email field
Change-Id: I5837a7f72b4301cded9e63a3a8ea7236d656da9c
1 parent a1bdc30 commit 3f82932

5 files changed

Lines changed: 79 additions & 0 deletions

File tree

app/Http/Controllers/Apis/Protected/Summit/Factories/SummitValidationRulesFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public static function buildForAdd(array $payload = []): array
9191
'marketing_site_oauth2_client_id' => 'nullable|string',
9292
'marketing_site_oauth2_client_scopes' => 'nullable|string',
9393
'support_email' => 'nullable|email',
94+
'speakers_support_email' => 'nullable|email',
9495
'registration_send_qr_as_image_attachment_on_ticket_email' => 'sometimes|boolean',
9596
'registration_send_ticket_as_pdf_attachment_on_ticket_email' => 'sometimes|boolean',
9697
'registration_send_ticket_email_automatically' => 'sometimes|boolean',
@@ -173,6 +174,7 @@ public static function buildForUpdate(array $payload = []): array
173174
'marketing_site_oauth2_client_id' => 'nullable|string',
174175
'marketing_site_oauth2_client_scopes' => 'nullable|string',
175176
'support_email' => 'nullable|email',
177+
'speakers_support_email' => 'nullable|email',
176178
'registration_send_qr_as_image_attachment_on_ticket_email' => 'sometimes|boolean',
177179
'registration_send_ticket_as_pdf_attachment_on_ticket_email' => 'sometimes|boolean',
178180
'registration_send_ticket_email_automatically' => 'sometimes|boolean',

app/ModelSerializers/Summit/SummitSerializer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class SummitSerializer extends SilverStripeSerializer
8686
'VirtualSiteUrl' => 'virtual_site_url:json_string',
8787
'MarketingSiteUrl' => 'marketing_site_url:json_string',
8888
'SupportEmail' => 'support_email:json_string',
89+
'SpeakersSupportEmail' => 'speakers_support_email:json_string',
8990
'RegistrationSendQrAsImageAttachmentOnTicketEmail' => 'registration_send_qr_as_image_attachment_on_ticket_email:json_boolean',
9091
'RegistrationSendTicketAsPdfAttachmentOnTicketEmail' => 'registration_send_ticket_as_pdf_attachment_on_ticket_email:json_boolean',
9192
'RegistrationSendTicketEmailAutomatically' => 'registration_send_ticket_email_automatically:json_boolean',

app/Models/Foundation/Summit/Factories/SummitFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,10 @@ public static function populate(Summit $summit, array $data){
472472
$summit->setSupportEmail(trim($data['support_email']));
473473
}
474474

475+
if(isset($data['speakers_support_email']) ){
476+
$summit->setSpeakersSupportEmail(trim($data['speakers_support_email']));
477+
}
478+
475479
if(isset($data['registration_slug_prefix'])){
476480
$summit->setRegistrationSlugPrefix(trim($data['registration_slug_prefix']));
477481
}

app/Models/Foundation/Summit/Summit.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,12 @@ public function setMarketingSiteOauth2ClientScopes(string $marketing_site_oauth2
470470
*/
471471
private $support_email;
472472

473+
/**
474+
* @ORM\Column(name="SpeakersSupportEmail", type="string")
475+
* @var string
476+
*/
477+
private $speakers_support_email;
478+
473479
/**
474480
* @ORM\Column(name="RegistrationAllowUpdateAttendeeExtraQuestions", type="boolean")
475481
* @var bool
@@ -5700,6 +5706,22 @@ public function setSupportEmail(?string $support_email): void
57005706
$this->support_email = $support_email;
57015707
}
57025708

5709+
/**
5710+
* @return string|null
5711+
*/
5712+
public function getSpeakersSupportEmail(): ?string
5713+
{
5714+
return $this->speakers_support_email;
5715+
}
5716+
5717+
/**
5718+
* @param string $speakers_support_email
5719+
*/
5720+
public function setSpeakersSupportEmail(?string $speakers_support_email): void
5721+
{
5722+
$this->speakers_support_email = $speakers_support_email;
5723+
}
5724+
57035725
/**
57045726
* @return ArrayCollection|FeaturedSpeaker[]
57055727
*/
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php namespace Database\Migrations\Model;
2+
/**
3+
* Copyright 2023 OpenStack Foundation
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
**/
14+
use Doctrine\Migrations\AbstractMigration;
15+
use Doctrine\DBAL\Schema\Schema as Schema;
16+
use LaravelDoctrine\Migrations\Schema\Builder;
17+
use LaravelDoctrine\Migrations\Schema\Table;
18+
19+
/**
20+
* Class Version20231215172115
21+
* @package Database\Migrations\Model
22+
*/
23+
final class Version20231215172115 extends AbstractMigration
24+
{
25+
/**
26+
* @param Schema $schema
27+
*/
28+
public function up(Schema $schema): void
29+
{
30+
$builder = new Builder($schema);
31+
if($schema->hasTable("Summit") && !$builder->hasColumn("Summit", "SpeakersSupportEmail")) {
32+
$builder->table('Summit', function (Table $table) {
33+
$table->string("SpeakersSupportEmail")->setNotnull(false)->setDefault(null);
34+
});
35+
}
36+
}
37+
38+
/**
39+
* @param Schema $schema
40+
*/
41+
public function down(Schema $schema): void
42+
{
43+
$builder = new Builder($schema);
44+
if($schema->hasTable("Summit") && $builder->hasColumn("Summit", "SpeakersSupportEmail")) {
45+
$builder->table('Summit', function (Table $table) {
46+
$table->dropColumn("SpeakersSupportEmail");
47+
});
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)