mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
[PM-18870] Convert Organization to Business Unit (#14131)
* Add setupBusinessUnit to OrganizationBillingApiService * Add setup-business-unit.component * Updated designs and cleanup work * Update existing logos for Provider Portal and Admin Console * Fix broken test
This commit is contained in:
@@ -1,19 +1,27 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import {
|
||||
BillingInvoiceResponse,
|
||||
BillingTransactionResponse,
|
||||
} from "../../models/response/billing.response";
|
||||
|
||||
export class OrganizationBillingApiServiceAbstraction {
|
||||
getBillingInvoices: (
|
||||
export abstract class OrganizationBillingApiServiceAbstraction {
|
||||
abstract getBillingInvoices: (
|
||||
id: string,
|
||||
status?: string,
|
||||
startAfter?: string,
|
||||
) => Promise<BillingInvoiceResponse[]>;
|
||||
|
||||
getBillingTransactions: (
|
||||
abstract getBillingTransactions: (
|
||||
id: string,
|
||||
startAfter?: string,
|
||||
) => Promise<BillingTransactionResponse[]>;
|
||||
|
||||
abstract setupBusinessUnit: (
|
||||
id: string,
|
||||
request: {
|
||||
userId: string;
|
||||
token: string;
|
||||
providerKey: string;
|
||||
organizationKey: string;
|
||||
},
|
||||
) => Promise<string>;
|
||||
}
|
||||
|
||||
@@ -49,4 +49,24 @@ export class OrganizationBillingApiService implements OrganizationBillingApiServ
|
||||
);
|
||||
return r?.map((i: any) => new BillingTransactionResponse(i)) || [];
|
||||
}
|
||||
|
||||
async setupBusinessUnit(
|
||||
id: string,
|
||||
request: {
|
||||
userId: string;
|
||||
token: string;
|
||||
providerKey: string;
|
||||
organizationKey: string;
|
||||
},
|
||||
): Promise<string> {
|
||||
const response = await this.apiService.send(
|
||||
"POST",
|
||||
`/organizations/${id}/billing/setup-business-unit`,
|
||||
request,
|
||||
true,
|
||||
true,
|
||||
);
|
||||
|
||||
return response as string;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user