Skip to content

Commit d0c04ba

Browse files
authored
CUR-4179 add ms teams fileds in organizations (#1336)
* CUR-4179 add ms teams fileds in organizations * CUR-4179- pr review changes * CUR-4179- pr review changes * CUR-4179- pr review changes
1 parent ea95ecb commit d0c04ba

File tree

7 files changed

+66
-3
lines changed

7 files changed

+66
-3
lines changed

app/Http/Controllers/Api/V1/SuborganizationController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ public function uploadFavicon(SuborganizationUploadFaviconRequest $suborganizati
184184
* @bodyParam tertiary_color string primary font color Example: #515151
185185
* @bodyParam primary_font_family string primary font color Example: Open Sans
186186
* @bodyParam secondary_font_family string primary font color Example: Open Sans
187+
* @bodyParam msteam_client_id uuid Client id Example: 123e4567-e89b-12d3-a456-426614174000
188+
* @bodyParam msteam_secret_id uuid Secret id Example: 123e4567-e89b-12d3-a456-426614174000
189+
* @bodyParam msteam_tenant_id uuid Tenant id Example: 123e4567-e89b-12d3-a456-426614174000
190+
* @bodyParam msteam_secret_id_expiry date Secret expiry date Example: 2022-09-29
187191
*
188192
* @responseFile 201 responses/organization/suborganization.json
189193
*
@@ -267,6 +271,10 @@ public function show(Organization $suborganization)
267271
* @bodyParam tertiary_color string primary font color Example: #515151
268272
* @bodyParam primary_font_family string primary font color Example: Open Sans
269273
* @bodyParam secondary_font_family string primary font color Example: Open Sans
274+
* @bodyParam msteam_client_id uuid Client id Example: 123e4567-e89b-12d3-a456-426614174000
275+
* @bodyParam msteam_secret_id uuid Secret id Example: 123e4567-e89b-12d3-a456-426614174000
276+
* @bodyParam msteam_tenant_id uuid Tenant id Example: 123e4567-e89b-12d3-a456-426614174000
277+
* @bodyParam msteam_secret_id_expiry date Secret expiry date Example: 2022-09-29
270278
*
271279
* @responseFile responses/organization/suborganization.json
272280
*

app/Http/Requests/V1/SuborganizationSave.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public function rules()
5656
'tertiary_color' => 'string|nullable|max:255',
5757
'primary_font_family' => 'string|nullable|max:255',
5858
'secondary_font_family' => 'string|nullable|max:255',
59+
'msteam_client_id' => 'uuid|nullable|max:255',
60+
'msteam_secret_id' => 'uuid|nullable|max:255',
61+
'msteam_tenant_id' => 'uuid|nullable|max:255',
62+
'msteam_secret_id_expiry' => 'date|nullable',
5963
];
6064
}
6165

app/Http/Requests/V1/SuborganizationUpdate.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ public function rules()
6464
'tertiary_color' => 'string|nullable|max:255',
6565
'primary_font_family' => 'string|nullable|max:255',
6666
'secondary_font_family' => 'string|nullable|max:255',
67+
'msteam_client_id' => 'uuid|nullable|max:255',
68+
'msteam_secret_id' => 'uuid|nullable|max:255',
69+
'msteam_tenant_id' => 'uuid|nullable|max:255',
70+
'msteam_secret_id_expiry' => 'date|nullable',
6771
];
6872
}
6973

app/Http/Resources/V1/OrganizationResource.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ public function toArray($request)
9393
'primary_font_family' => $this->primary_font_family,
9494
'secondary_font_family' => $this->secondary_font_family,
9595
],
96-
'allowed_visibility_type_id' => OrganizationVisibilityTypeResource::collection($this->allowedVisibilityTypes)
96+
'allowed_visibility_type_id' => OrganizationVisibilityTypeResource::collection($this->allowedVisibilityTypes),
97+
'msteam_client_id' => $this->msteam_client_id,
98+
'msteam_secret_id' => $this->msteam_secret_id,
99+
'msteam_tenant_id' => $this->msteam_tenant_id,
100+
'msteam_secret_id_expiry' => $this->msteam_secret_id_expiry
97101
];
98102
}
99103
}

app/Models/Organization.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ class Organization extends Model
4444
'secondary_color',
4545
'tertiary_color',
4646
'primary_font_family',
47-
'secondary_font_family'
47+
'secondary_font_family',
48+
'msteam_client_id',
49+
'msteam_secret_id',
50+
'msteam_tenant_id',
51+
'msteam_secret_id_expiry'
4852
];
4953

5054
/**
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class AddMsTeamAppKeysToOrganizationsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('organizations', function (Blueprint $table) {
17+
$table->string('msteam_client_id')->after('gcr_activity_visibility')->nullable()->default(null);
18+
$table->string('msteam_secret_id')->after('gcr_activity_visibility')->nullable()->default(null);
19+
$table->string('msteam_tenant_id')->after('gcr_activity_visibility')->nullable()->default(null);
20+
$table->date('msteam_secret_id_expiry')->nullable()->default(null);
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*
27+
* @return void
28+
*/
29+
public function down()
30+
{
31+
Schema::table('organizations', function (Blueprint $table) {
32+
$table->dropColumn(['msteam_client_id', 'msteam_secret_id', 'msteam_tenant_id', 'msteam_secret_id_expiry']);
33+
});
34+
}
35+
}

storage/responses/organization/suborganization.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
"name": "global",
4747
"display_name": "My Org + Parent and Child Org"
4848
}
49-
]
49+
],
50+
"msteam_client_id" : null,
51+
"msteam_secret_id" : null,
52+
"msteam_tenant_id" : null,
53+
"msteam_secret_id_expiry": null
5054
}
5155
}

0 commit comments

Comments
 (0)