diff --git a/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts b/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts index fdad689d982..57fe212fa65 100644 --- a/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts +++ b/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts @@ -43,6 +43,8 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy { value.plan = PlanType.FamiliesAnnually; value.productTier = ProductTierType.Families; value.acceptingSponsorship = true; + value.planSponsorshipType = PlanSponsorshipType.FamiliesForEnterprise; + // eslint-disable-next-line rxjs-angular/prefer-takeuntil value.onSuccess.subscribe(this.onOrganizationCreateSuccess.bind(this)); } diff --git a/apps/web/src/app/billing/organizations/organization-plans.component.ts b/apps/web/src/app/billing/organizations/organization-plans.component.ts index fc7d6793a85..59f8dd34c37 100644 --- a/apps/web/src/app/billing/organizations/organization-plans.component.ts +++ b/apps/web/src/app/billing/organizations/organization-plans.component.ts @@ -34,7 +34,12 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv import { getUserId } from "@bitwarden/common/auth/services/account.service"; import { BillingApiServiceAbstraction } from "@bitwarden/common/billing/abstractions"; import { TaxServiceAbstraction } from "@bitwarden/common/billing/abstractions/tax.service.abstraction"; -import { PaymentMethodType, PlanType, ProductTierType } from "@bitwarden/common/billing/enums"; +import { + PaymentMethodType, + PlanSponsorshipType, + PlanType, + ProductTierType, +} from "@bitwarden/common/billing/enums"; import { TaxInformation } from "@bitwarden/common/billing/models/domain"; import { ExpandedTaxInfoUpdateRequest } from "@bitwarden/common/billing/models/request/expanded-tax-info-update.request"; import { PreviewOrganizationInvoiceRequest } from "@bitwarden/common/billing/models/request/preview-organization-invoice.request"; @@ -83,6 +88,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy { @Input() showFree = true; @Input() showCancel = false; @Input() acceptingSponsorship = false; + @Input() planSponsorshipType?: PlanSponsorshipType; @Input() currentPlan: PlanResponse; selectedFile: File; @@ -682,11 +688,6 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy { } private refreshSalesTax(): void { - if (this.formGroup.controls.plan.value == PlanType.Free) { - this.estimatedTax = 0; - return; - } - if (!this.taxComponent.validate()) { return; } @@ -696,6 +697,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy { passwordManager: { additionalStorage: this.formGroup.controls.additionalStorage.value, plan: this.formGroup.controls.plan.value, + sponsoredPlan: this.planSponsorshipType, seats: this.formGroup.controls.additionalSeats.value, }, taxInformation: { diff --git a/libs/common/src/billing/models/request/preview-organization-invoice.request.ts b/libs/common/src/billing/models/request/preview-organization-invoice.request.ts index 40d8db03d3b..bfeecb4eb23 100644 --- a/libs/common/src/billing/models/request/preview-organization-invoice.request.ts +++ b/libs/common/src/billing/models/request/preview-organization-invoice.request.ts @@ -1,4 +1,4 @@ -import { PlanType } from "../../enums"; +import { PlanSponsorshipType, PlanType } from "../../enums"; export class PreviewOrganizationInvoiceRequest { organizationId?: string; @@ -21,6 +21,7 @@ export class PreviewOrganizationInvoiceRequest { class PasswordManager { plan: PlanType; + sponsoredPlan?: PlanSponsorshipType; seats: number; additionalStorage: number;