CREATE VIEW [dbo].[OrganizationView]
AS
SELECT
    [Id],
    [Identifier],
    [Name],
    [BusinessName],
    [BusinessAddress1],
    [BusinessAddress2],
    [BusinessAddress3],
    [BusinessCountry],
    [BusinessTaxNumber],
    [BillingEmail],
    [Plan],
    [PlanType],
    [Seats],
    [MaxCollections],
    [UsePolicies],
    [UseSso],
    [UseGroups],
    [UseDirectory],
    [UseEvents],
    [UseTotp],
    [Use2fa],
    [UseApi],
    [UseResetPassword],
    [SelfHost],
    [UsersGetPremium],
    [Storage],
    COALESCE([MaxStorageGbIncreased], [MaxStorageGb]) AS [MaxStorageGb],
    [Gateway],
    [GatewayCustomerId],
    [GatewaySubscriptionId],
    [ReferenceData],
    [Enabled],
    [LicenseKey],
    [PublicKey],
    [PrivateKey],
    [TwoFactorProviders],
    [ExpirationDate],
    [CreationDate],
    [RevisionDate],
    [OwnersNotifiedOfAutoscaling],
    [MaxAutoscaleSeats],
    [UseKeyConnector],
    [UseScim],
    [UseCustomPermissions],
    [UseSecretsManager],
    [Status],
    [UsePasswordManager],
    [SmSeats],
    [SmServiceAccounts],
    [MaxAutoscaleSmSeats],
    [MaxAutoscaleSmServiceAccounts],
    [SecretsManagerBeta],
    [LimitCollectionCreation],
    [LimitCollectionDeletion],
    [LimitItemDeletion],
    [AllowAdminAccessToAllCollectionItems],
    [UseRiskInsights],
    [UseOrganizationDomains],
    [UseAdminSponsoredFamilies],
    [SyncSeats],
    [UseAutomaticUserConfirmation],
    [UsePhishingBlocker]
FROM
    [dbo].[Organization]
