diff --git a/.env.example b/.env.example index 5912807..89766b0 100644 --- a/.env.example +++ b/.env.example @@ -74,6 +74,7 @@ MEET_API_KEY_FRONTDESK= MEET_API_KEY_HR= MEET_API_KEY_SUPPORT= MEET_API_KEY_INVOICE= +# Same secret on both apps: MEET_API_KEY_SALES_CENTRE here and in ladill (.env MEET_API_KEY_SALES_CENTRE). MEET_API_KEY_SALES_CENTRE= # --- Ladill Events (registration for webinars & conferences) --- diff --git a/tests/Feature/MeetWebTest.php b/tests/Feature/MeetWebTest.php index 00e6fd5..0e70879 100644 --- a/tests/Feature/MeetWebTest.php +++ b/tests/Feature/MeetWebTest.php @@ -513,6 +513,23 @@ class MeetWebTest extends TestCase ->assertJsonPath('room.title', 'Invoice review'); } + public function test_service_api_can_create_room_for_sales_centre_app(): void + { + \Illuminate\Support\Facades\Http::fake(); + config(['meet.service_api_keys.sales_centre' => 'test-sales-centre-key']); + + $this->postJson('/api/service/v1/rooms', [ + 'owner_ref' => $this->user->public_id, + 'host_user_ref' => $this->user->public_id, + 'title' => 'Ladill demo with Prospect', + 'type' => 'instant', + 'source' => ['app' => 'sales_centre', 'entity_type' => 'sales_lead', 'entity_id' => '42'], + 'invite_emails' => ['prospect@demo.test'], + ], ['Authorization' => 'Bearer test-sales-centre-key']) + ->assertCreated() + ->assertJsonPath('room.title', 'Ladill demo with Prospect'); + } + public function test_service_api_can_create_town_hall_room(): void { \Illuminate\Support\Facades\Http::fake();