1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

[AC-1911] Clients: Create components to manage client organization seat allocation (#8505)

* implementing the clients changes

* resolve pr comments on message.json

* moved the method to billing-api.service

* move the request and response files to billing folder

* remove the adding existing orgs

* resolve the routing issue

* resolving the pr comments

* code owner changes

* fix the assignedseat

* resolve the warning message

* resolve the error on update

* passing the right id

* resolve the unassign value

* removed unused logservice

* Adding the loader on submit button
This commit is contained in:
cyprain-okeke
2024-04-02 17:04:02 +01:00
committed by GitHub
parent b9771c1e42
commit 9956f020e7
16 changed files with 575 additions and 9 deletions

View File

@@ -2,6 +2,8 @@ import { ApiService } from "../../abstractions/api.service";
import { BillingApiServiceAbstraction } from "../../billing/abstractions/billilng-api.service.abstraction";
import { SubscriptionCancellationRequest } from "../../billing/models/request/subscription-cancellation.request";
import { OrganizationBillingStatusResponse } from "../../billing/models/response/organization-billing-status.response";
import { ProviderSubscriptionUpdateRequest } from "../models/request/provider-subscription-update.request";
import { ProviderSubscriptionResponse } from "../models/response/provider-subscription-response";
export class BillingApiService implements BillingApiServiceAbstraction {
constructor(private apiService: ApiService) {}
@@ -34,4 +36,29 @@ export class BillingApiService implements BillingApiServiceAbstraction {
return new OrganizationBillingStatusResponse(r);
}
async getProviderClientSubscriptions(providerId: string): Promise<ProviderSubscriptionResponse> {
const r = await this.apiService.send(
"GET",
"/providers/" + providerId + "/billing/subscription",
null,
true,
true,
);
return new ProviderSubscriptionResponse(r);
}
async putProviderClientSubscriptions(
providerId: string,
organizationId: string,
request: ProviderSubscriptionUpdateRequest,
): Promise<any> {
return await this.apiService.send(
"PUT",
"/providers/" + providerId + "/organizations/" + organizationId,
request,
true,
false,
);
}
}