Skip to content

Commit

Permalink
CUR-4179 add ms teams fileds in organizations (#1336)
Browse files Browse the repository at this point in the history
* CUR-4179 add ms teams fileds in organizations

* CUR-4179- pr review changes

* CUR-4179- pr review changes

* CUR-4179- pr review changes
  • Loading branch information
shaheen7890 authored Sep 29, 2022
1 parent ea95ecb commit d0c04ba
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 3 deletions.
8 changes: 8 additions & 0 deletions app/Http/Controllers/Api/V1/SuborganizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ public function uploadFavicon(SuborganizationUploadFaviconRequest $suborganizati
* @bodyParam tertiary_color string primary font color Example: #515151
* @bodyParam primary_font_family string primary font color Example: Open Sans
* @bodyParam secondary_font_family string primary font color Example: Open Sans
* @bodyParam msteam_client_id uuid Client id Example: 123e4567-e89b-12d3-a456-426614174000
* @bodyParam msteam_secret_id uuid Secret id Example: 123e4567-e89b-12d3-a456-426614174000
* @bodyParam msteam_tenant_id uuid Tenant id Example: 123e4567-e89b-12d3-a456-426614174000
* @bodyParam msteam_secret_id_expiry date Secret expiry date Example: 2022-09-29
*
* @responseFile 201 responses/organization/suborganization.json
*
Expand Down Expand Up @@ -267,6 +271,10 @@ public function show(Organization $suborganization)
* @bodyParam tertiary_color string primary font color Example: #515151
* @bodyParam primary_font_family string primary font color Example: Open Sans
* @bodyParam secondary_font_family string primary font color Example: Open Sans
* @bodyParam msteam_client_id uuid Client id Example: 123e4567-e89b-12d3-a456-426614174000
* @bodyParam msteam_secret_id uuid Secret id Example: 123e4567-e89b-12d3-a456-426614174000
* @bodyParam msteam_tenant_id uuid Tenant id Example: 123e4567-e89b-12d3-a456-426614174000
* @bodyParam msteam_secret_id_expiry date Secret expiry date Example: 2022-09-29
*
* @responseFile responses/organization/suborganization.json
*
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Requests/V1/SuborganizationSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public function rules()
'tertiary_color' => 'string|nullable|max:255',
'primary_font_family' => 'string|nullable|max:255',
'secondary_font_family' => 'string|nullable|max:255',
'msteam_client_id' => 'uuid|nullable|max:255',
'msteam_secret_id' => 'uuid|nullable|max:255',
'msteam_tenant_id' => 'uuid|nullable|max:255',
'msteam_secret_id_expiry' => 'date|nullable',
];
}

Expand Down
4 changes: 4 additions & 0 deletions app/Http/Requests/V1/SuborganizationUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public function rules()
'tertiary_color' => 'string|nullable|max:255',
'primary_font_family' => 'string|nullable|max:255',
'secondary_font_family' => 'string|nullable|max:255',
'msteam_client_id' => 'uuid|nullable|max:255',
'msteam_secret_id' => 'uuid|nullable|max:255',
'msteam_tenant_id' => 'uuid|nullable|max:255',
'msteam_secret_id_expiry' => 'date|nullable',
];
}

Expand Down
6 changes: 5 additions & 1 deletion app/Http/Resources/V1/OrganizationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ public function toArray($request)
'primary_font_family' => $this->primary_font_family,
'secondary_font_family' => $this->secondary_font_family,
],
'allowed_visibility_type_id' => OrganizationVisibilityTypeResource::collection($this->allowedVisibilityTypes)
'allowed_visibility_type_id' => OrganizationVisibilityTypeResource::collection($this->allowedVisibilityTypes),
'msteam_client_id' => $this->msteam_client_id,
'msteam_secret_id' => $this->msteam_secret_id,
'msteam_tenant_id' => $this->msteam_tenant_id,
'msteam_secret_id_expiry' => $this->msteam_secret_id_expiry
];
}
}
6 changes: 5 additions & 1 deletion app/Models/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class Organization extends Model
'secondary_color',
'tertiary_color',
'primary_font_family',
'secondary_font_family'
'secondary_font_family',
'msteam_client_id',
'msteam_secret_id',
'msteam_tenant_id',
'msteam_secret_id_expiry'
];

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddMsTeamAppKeysToOrganizationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('organizations', function (Blueprint $table) {
$table->string('msteam_client_id')->after('gcr_activity_visibility')->nullable()->default(null);
$table->string('msteam_secret_id')->after('gcr_activity_visibility')->nullable()->default(null);
$table->string('msteam_tenant_id')->after('gcr_activity_visibility')->nullable()->default(null);
$table->date('msteam_secret_id_expiry')->nullable()->default(null);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('organizations', function (Blueprint $table) {
$table->dropColumn(['msteam_client_id', 'msteam_secret_id', 'msteam_tenant_id', 'msteam_secret_id_expiry']);
});
}
}
6 changes: 5 additions & 1 deletion storage/responses/organization/suborganization.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
"name": "global",
"display_name": "My Org + Parent and Child Org"
}
]
],
"msteam_client_id" : null,
"msteam_secret_id" : null,
"msteam_tenant_id" : null,
"msteam_secret_id_expiry": null
}
}

0 comments on commit d0c04ba

Please sign in to comment.