Skip to content

Commit 69d6079

Browse files
authored
Merge pull request #98 from MammutAlex/main
Add google meet and microsoft teams to event
2 parents 77dcd2f + 08813dc commit 69d6079

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/Components/Event.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ class Event extends Component implements HasTimezones
4444

4545
private ?string $addressName = null;
4646

47+
private ?string $googleConference = null;
48+
49+
private ?string $microsoftTeams = null;
50+
4751
private ?float $lat = null;
4852

4953
private ?float $lng = null;
@@ -164,6 +168,20 @@ public function addressName(string $name): Event
164168
return $this;
165169
}
166170

171+
public function googleConference(string $googleConference): Event
172+
{
173+
$this->googleConference = $googleConference;
174+
175+
return $this;
176+
}
177+
178+
public function microsoftTeams(string $microsoftTeams): Event
179+
{
180+
$this->microsoftTeams = $microsoftTeams;
181+
182+
return $this;
183+
}
184+
167185
public function coordinates(float $lat, float $lng): Event
168186
{
169187
$this->lat = $lat;
@@ -393,6 +411,14 @@ private function resolveProperties(ComponentPayload $payload): self
393411
$this->status,
394412
fn () => TextProperty::createFromEnum('STATUS', $this->status)
395413
)
414+
->optional(
415+
$this->googleConference,
416+
fn () => TextProperty::create('X-GOOGLE-CONFERENCE', $this->googleConference)
417+
)
418+
->optional(
419+
$this->microsoftTeams,
420+
fn () => TextProperty::create('X-MICROSOFT-SKYPETEAMSMEETINGURL', $this->microsoftTeams)
421+
)
396422
->optional(
397423
$this->transparent,
398424
fn () => TextProperty::create('TRANSP', 'TRANSPARENT')

tests/Components/EventTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,22 @@ public function it_can_set_properties_on_an_event()
4848
->endsAt($dateEnds)
4949
->address('Antwerp')
5050
->addressName('Spatie')
51+
->googleConference('Spatie')
52+
->googleConference('https://meet.google.com/aaa-aaa-aaa')
53+
->microsoftTeams('https://teams.microsoft.com/l/meetup-join/aaa-aaa-aaa')
5154
->resolvePayload();
5255

5356
PayloadExpectation::create($payload)
54-
->expectPropertyCount(8)
57+
->expectPropertyCount(10)
5558
->expectPropertyValue('SUMMARY', 'An introduction into event sourcing')
5659
->expectPropertyValue('DESCRIPTION', 'By Freek Murze')
5760
->expectPropertyValue('DTSTAMP', $dateCreated)
5861
->expectPropertyValue('DTSTART', $dateStarts)
5962
->expectPropertyValue('DTEND', $dateEnds)
6063
->expectPropertyValue('LOCATION', 'Antwerp')
6164
->expectPropertyValue('UID', 'Identifier here')
65+
->expectPropertyValue('X-GOOGLE-CONFERENCE', 'https://meet.google.com/aaa-aaa-aaa')
66+
->expectPropertyValue('X-MICROSOFT-SKYPETEAMSMEETINGURL', 'https://teams.microsoft.com/l/meetup-join/aaa-aaa-aaa')
6267
->expectPropertyValue('URL', 'http://example.com/pub/calendars/jsmith/mytime.ics');
6368
}
6469

0 commit comments

Comments
 (0)