﻿CREATE TABLE [dbo].[ClientInformation] (
    [Id]                     UNIQUEIDENTIFIER CONSTRAINT [DF_ClientInformation_Id2] DEFAULT (newid()) NOT NULL,
    [ClientName]             NVARCHAR (100)   NOT NULL,
    [InstanceUrl]            NVARCHAR (255)   NOT NULL,
    [SubscriptionGroupId]    UNIQUEIDENTIFIER NULL,
    [SubscriptionStartDate]  DATETIME         NOT NULL,
    [SubscriptionEndDate]    DATETIME         NOT NULL,
    [BillingFrequency]       INT              NOT NULL,
    [BillingType]            INT              NOT NULL,
    [IsActive]               INT              NOT NULL,
    [ApiToken]               NVARCHAR (50)    NULL,
    [PrimaryContactName]     NVARCHAR (100)   NOT NULL,
    [PrimaryContactDept]     NVARCHAR (100)   NULL,
    [PrimaryContactTitle]    NVARCHAR (100)   NULL,
    [PrimaryContactAddress1] NVARCHAR (100)   NULL,
    [PrimaryContactAddress2] NVARCHAR (100)   NULL,
    [PrimaryContactCity]     NVARCHAR (100)   NULL,
    [PrimaryContactState]    NVARCHAR (100)   NULL,
    [PrimaryContactZip]      NVARCHAR (25)    NULL,
    [PrimaryContactCountry]  NVARCHAR (100)   NULL,
    [PrimaryContactPhone]    NVARCHAR (25)    NOT NULL,
    [PrimaryContactFax]      NVARCHAR (25)    NULL,
    [PrimaryContactEmail]    NVARCHAR (255)   NOT NULL,
    [BillingContactName]     NVARCHAR (100)   NOT NULL,
    [BillingContactDept]     NVARCHAR (100)   NULL,
    [BillingContactTitle]    NVARCHAR (100)   NULL,
    [BillingContactAddress1] NVARCHAR (100)   NULL,
    [BillingContactAddress2] NVARCHAR (100)   NULL,
    [BillingContactCity]     NVARCHAR (100)   NULL,
    [BillingContactState]    NVARCHAR (100)   NULL,
    [BillingContactZip]      NVARCHAR (25)    NULL,
    [BillingContactCountry]  NVARCHAR (100)   NULL,
    [BillingContactPhone]    NVARCHAR (25)    NOT NULL,
    [BillingContactFax]      NVARCHAR (25)    NULL,
    [BillingContactEmail]    NVARCHAR (255)   NOT NULL,
    CONSTRAINT [PK_ClientInformation] PRIMARY KEY CLUSTERED ([Id] ASC)
);




GO



GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Name of the Client.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'ClientName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Unique URL assigned to the Client, e.g. - [client].prevuplan.com.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'InstanceUrl';


GO



GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Date the current subscription starts.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'SubscriptionStartDate';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Date the current subscription ends.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'SubscriptionEndDate';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Determines how often the Client is billed.  Values: 1=monthly, 2=quarterly, 3=annually.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingFrequency';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Determines the type of billing for the client.  Values: 1=invoice, 2=CC, 3=PayPal.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Determines if the specific Client is active.  Values: 0=inactive, 1=active.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'IsActive';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'PREVU™ platform-generated hash token to authenticate authorized API users.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'ApiToken';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Name of the Client''s Primary Contact.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Department for the Client''s Primary Contact (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactDept';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Title for the Client''s Primary Contact (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactTitle';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact address (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactAddress1';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact address (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactAddress2';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact city (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactCity';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact state or province (optional). ', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactState';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact zip or location code (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactZip';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact country (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactCountry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact phone number.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactPhone';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact fax number (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactFax';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Primary Contact email address.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'PrimaryContactEmail';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Name of the Client''s Billing Contact.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Department for the Client''s Billing Contact (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactDept';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Title for the Client''s Billing Contact (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactTitle';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact address (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactAddress1';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact address (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactAddress2';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact city (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactCity';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact state or province (optional). ', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactState';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact zip or location code (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactZip';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact country (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactCountry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact phone number.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactPhone';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact fax number (optional).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactFax';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Client''s Billing Contact email address.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ClientInformation', @level2type = N'COLUMN', @level2name = N'BillingContactEmail';

