Skip to content

Commit b720083

Browse files
authored
[PM-25182] Improve Swagger OperationIDs for Billing (#6238)
* Improve Swagger OperationIDs for Billing * Fix typo
1 parent 353b596 commit b720083

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ public async Task<OrganizationSponsorshipSyncResponseModel> Sync([FromBody] Orga
208208

209209
[Authorize("Application")]
210210
[HttpDelete("{sponsoringOrganizationId}")]
211-
[HttpPost("{sponsoringOrganizationId}/delete")]
212211
[SelfHosted(NotSelfHostedOnly = true)]
213212
public async Task RevokeSponsorship(Guid sponsoringOrganizationId)
214213
{
@@ -225,6 +224,15 @@ public async Task RevokeSponsorship(Guid sponsoringOrganizationId)
225224
await _revokeSponsorshipCommand.RevokeSponsorshipAsync(existingOrgSponsorship);
226225
}
227226

227+
[Authorize("Application")]
228+
[HttpPost("{sponsoringOrganizationId}/delete")]
229+
[Obsolete("This endpoint is deprecated. Use DELETE /{sponsoringOrganizationId} instead.")]
230+
[SelfHosted(NotSelfHostedOnly = true)]
231+
public async Task PostRevokeSponsorship(Guid sponsoringOrganizationId)
232+
{
233+
await RevokeSponsorship(sponsoringOrganizationId);
234+
}
235+
228236
[Authorize("Application")]
229237
[HttpDelete("{sponsoringOrgId}/{sponsoredFriendlyName}/revoke")]
230238
[SelfHosted(NotSelfHostedOnly = true)]
@@ -241,7 +249,6 @@ public async Task AdminInitiatedRevokeSponsorshipAsync(Guid sponsoringOrgId, str
241249

242250
[Authorize("Application")]
243251
[HttpDelete("sponsored/{sponsoredOrgId}")]
244-
[HttpPost("sponsored/{sponsoredOrgId}/remove")]
245252
[SelfHosted(NotSelfHostedOnly = true)]
246253
public async Task RemoveSponsorship(Guid sponsoredOrgId)
247254
{
@@ -257,6 +264,15 @@ public async Task RemoveSponsorship(Guid sponsoredOrgId)
257264
await _removeSponsorshipCommand.RemoveSponsorshipAsync(existingOrgSponsorship);
258265
}
259266

267+
[Authorize("Application")]
268+
[HttpPost("sponsored/{sponsoredOrgId}/remove")]
269+
[Obsolete("This endpoint is deprecated. Use DELETE /sponsored/{sponsoredOrgId} instead.")]
270+
[SelfHosted(NotSelfHostedOnly = true)]
271+
public async Task PostRemoveSponsorship(Guid sponsoredOrgId)
272+
{
273+
await RemoveSponsorship(sponsoredOrgId);
274+
}
275+
260276
[HttpGet("{sponsoringOrgId}/sync-status")]
261277
public async Task<object> GetSyncStatus(Guid sponsoringOrgId)
262278
{

src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public SelfHostedOrganizationLicensesController(
5353
}
5454

5555
[HttpPost("")]
56-
public async Task<OrganizationResponseModel> PostLicenseAsync(OrganizationCreateLicenseRequestModel model)
56+
public async Task<OrganizationResponseModel> CreateLicenseAsync(OrganizationCreateLicenseRequestModel model)
5757
{
5858
var user = await _userService.GetUserByPrincipalAsync(User);
5959
if (user == null)
@@ -74,7 +74,7 @@ public async Task<OrganizationResponseModel> PostLicenseAsync(OrganizationCreate
7474
}
7575

7676
[HttpPost("{id}")]
77-
public async Task PostLicenseAsync(string id, LicenseRequestModel model)
77+
public async Task UpdateLicenseAsync(string id, LicenseRequestModel model)
7878
{
7979
var orgIdGuid = new Guid(id);
8080
if (!await _currentContext.OrganizationOwner(orgIdGuid))

src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ await _organizationUserRepository.GetByOrganizationAsync(sponsoringOrgId, _curre
7979
}
8080

8181
[HttpDelete("{sponsoringOrgId}")]
82-
[HttpPost("{sponsoringOrgId}/delete")]
8382
public async Task RevokeSponsorship(Guid sponsoringOrgId)
8483
{
8584
var orgUser = await _organizationUserRepository.GetByOrganizationAsync(sponsoringOrgId, _currentContext.UserId ?? default);
@@ -95,6 +94,13 @@ public async Task RevokeSponsorship(Guid sponsoringOrgId)
9594
await _revokeSponsorshipCommand.RevokeSponsorshipAsync(existingOrgSponsorship);
9695
}
9796

97+
[HttpPost("{sponsoringOrgId}/delete")]
98+
[Obsolete("This endpoint is deprecated. Use DELETE /{sponsoringOrgId} instead.")]
99+
public async Task PostRevokeSponsorship(Guid sponsoringOrgId)
100+
{
101+
await RevokeSponsorship(sponsoringOrgId);
102+
}
103+
98104
[HttpDelete("{sponsoringOrgId}/{sponsoredFriendlyName}/revoke")]
99105
public async Task AdminInitiatedRevokeSponsorshipAsync(Guid sponsoringOrgId, string sponsoredFriendlyName)
100106
{

0 commit comments

Comments
 (0)