This commit is contained in:
Zeeshaun
2026-03-17 08:54:34 -05:00
parent 64856c640e
commit cdcba54aa4
330 changed files with 54110 additions and 0 deletions
@@ -0,0 +1,9 @@
CREATE TABLE [dbo].[Dealer]
(
[DealerCode] VARCHAR(4) NULL,
[Name] VARCHAR(40) NULL,
[DealerAccountNumber] VARCHAR(20) NULL,
[DealerOrganizationNumber] VARCHAR(20) NOT NULL,
[DealerGroupCode] VARCHAR(10) NULL,
CONSTRAINT [PK_Dealer] PRIMARY KEY (DealerOrganizationNumber)
)
@@ -0,0 +1,17 @@
/*
Do not change the database path or name variables.
Any sqlcmd variables will be properly substituted during
build and deployment.
*/
CREATE TABLE [dbo].[Import](
[ImportId] int NOT NULL IDENTITY,
[StartDate] DATETIME2 NOT NULL,
[EndDate] DATETIME2 NULL,
[RecordCount] [int] NOT NULL DEFAULT 0,
[RecordsSaved] [int] NOT NULL DEFAULT 0,
[Success] [bit] NOT NULL,
[FileName] [varchar](50) NULL,
[ImportType] [varchar](10) NULL
CONSTRAINT [PK_Import] PRIMARY KEY (ImportId)
)
@@ -0,0 +1,41 @@
CREATE TABLE [dbo].[Loan](
[LoanId] int NOT NULL IDENTITY,
[ImportId] [int] NOT NULL,
[MemberNumber] [varchar](13) NULL,
[LoanNumber] [varchar](20) NOT NULL,
[MemberLastName] [varchar](60) NULL,
[MemberFirstName] [varchar](20) NULL,
[MemberInitial] [char](1) NULL,
[DealerOrganizationNumber] [varchar](20) NOT NULL,
[LoanDate] [smalldatetime] NOT NULL,
[FirstPmtdate] [smalldatetime] NOT NULL,
[FinalPmtDate] [smalldatetime] NOT NULL,
[PostedDate] [smalldatetime] NOT NULL,
[LoanAmount] [money] NOT NULL,
[BuyRate] [decimal](5, 3) NOT NULL,
[ContractRate] [decimal](5, 3) NOT NULL,
[MonthlyPmt] [decimal](20, 4) NOT NULL,
[LoanTypeId] [char](2) NULL,
[Term] [int] NOT NULL DEFAULT 0,
[ReserveAmount] [money] NOT NULL DEFAULT 0,
[FlatFeePaid] [bit] NOT NULL,
[Chargeback] [money] NULL,
[PaidLoanDate] [smalldatetime] NULL,
[ReserveMessage] [varchar](100) NOT NULL,
[ChargebackMessage] [varchar](100) NULL,
[ActionRequired] [bit] NOT NULL DEFAULT 0,
[StatementDate] [smalldatetime] NULL,
[Adjustment] [money] NULL,
[LoanStatus] [varchar](25) NULL,
[ExportedReserveDate] [datetime2] NULL,
[ExportedChargebackDate] [datetime2] NULL,
[ApplicationId] VARCHAR(20) NULL,
[Warranty] BIT NOT NULL DEFAULT 0,
[GAP] BIT NOT NULL DEFAULT 0,
[CreditLife] BIT NOT NULL DEFAULT 0,
[CreditDisability] BIT NOT NULL DEFAULT 0,
[MBP] BIT NOT NULL DEFAULT 0,
[RemainingMonthsAtClose] TINYINT NULL,
[AccountType] VARCHAR(4) NULL,
CONSTRAINT [PK_Loan] PRIMARY KEY (LoanId)
)
@@ -0,0 +1,13 @@
CREATE TABLE [dbo].[LoanAudit](
[AuditId] int NOT NULL IDENTITY,
[LoanId] int NULL,
[MemberNumber] VARCHAR(13) NULL,
[LoanNumber] VARCHAR(20) NULL,
[ModifiedBy] [varchar](50) NOT NULL,
[ModifiedDate] [smalldatetime] NOT NULL,
[OldValue] [varchar](MAX) NULL,
[NewValue] [varchar](MAX) NULL,
[ActivityType][varchar](20) NULL,
[AuditDescription] [varchar] (255) NULL,
CONSTRAINT [PK_LoanAudit] PRIMARY KEY (AuditId),
)
@@ -0,0 +1,11 @@
CREATE TABLE [dbo].[LoanType](
[LoanTypeId] [char](2) NOT NULL,
[LoanComment] [varchar](70) NOT NULL,
[ChargebackMethod] [char](1) NOT NULL,
[NoChargebackDays] [smallint] NOT NULL,
[NoChargebackPayments] [smallint] NOT NULL,
[ReserveDiscount] [decimal](4,2) NOT NULL,
[FlatFeePercent] [decimal](4,2) NOT NULL,
[NoReserveThreshold] [decimal](4,2) NOT NULL,
CONSTRAINT [PK_LoanType] PRIMARY KEY ([LoanTypeId])
)
@@ -0,0 +1,11 @@
/*
Do not change the database path or name variables.
Any sqlcmd variables will be properly substituted during
build and deployment.
*/
CREATE TABLE [dbo].[MinorAccountType](
[MinorAccountTypeId] int NOT NULL IDENTITY,
[AccountType] [varchar](4) NULL,
[GeneralLedgerAccountNumber] [varchar](20) NULL
CONSTRAINT [PK_MinorAccountType] PRIMARY KEY (MinorAccountTypeId)
)
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Operations Version="1.0" xmlns="http://schemas.microsoft.com/sqlserver/dac/Serialization/2012/02">
<Operation Name="Rename Refactor" Key="69fc61bd-1b0d-4310-ab5f-4e3fccb9c3df" ChangeDateTime="05/13/2021 15:21:43">
<Property Name="ElementName" Value="[dbo].[Dealer].[Id]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[Dealer]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="DealerCode" />
</Operation>
<Operation Name="Rename Refactor" Key="0a110887-6676-4aca-9942-f330f30f704f" ChangeDateTime="05/19/2021 21:46:24">
<Property Name="ElementName" Value="[dbo].[Loan].[LoanType]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[Loan]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="LoanTypeId" />
</Operation>
<Operation Name="Rename Refactor" Key="23eba713-18fa-44bb-a71e-04e955a9b20a" ChangeDateTime="08/13/2021 21:40:09">
<Property Name="ElementName" Value="[dbo].[Dealer].[DealerGroup]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[Dealer]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="DealerGroupCode" />
</Operation>
<Operation Name="Rename Refactor" Key="e3d400fd-ceec-4ff6-9557-c2403be5fd00" ChangeDateTime="08/13/2021 21:52:38">
<Property Name="ElementName" Value="[dbo].[Loan].[DealerCode]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[Loan]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="DealerOrg" />
</Operation>
<Operation Name="Rename Refactor" Key="79da7c58-8312-4cea-b111-4ff27f87ad19" ChangeDateTime="08/13/2021 21:53:00">
<Property Name="ElementName" Value="[dbo].[Loan].[DealerOrg]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[Loan]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="DealerOrganizationNumber" />
</Operation>
</Operations>
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Name>ReserveManagementSystemApi.Sql</Name>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>4.1</ProjectVersion>
<ProjectGuid>{5a41c8dc-6f4d-4fd2-b03d-d0b2d8b363df}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
<OutputType>Database</OutputType>
<RootPath>
</RootPath>
<RootNamespace>ReserveManagementSystemApi.Sql</RootNamespace>
<AssemblyName>ReserveManagementSystemApi.Sql</AssemblyName>
<ModelCollation>1033, CI</ModelCollation>
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
<DeployToDatabase>True</DeployToDatabase>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetLanguage>CS</TargetLanguage>
<AppDesignerFolder>Properties</AppDesignerFolder>
<SqlServerVerification>False</SqlServerVerification>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseSet>True</TargetDatabaseSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<ItemGroup>
<Folder Include="Properties" />
</ItemGroup>
<ItemGroup>
<Build Include="Loan.sql" />
<Build Include="LoanAudit.sql" />
<Build Include="LoanType.sql" />
<Build Include="Import.sql" />
<Build Include="Dealer.sql" />
<Build Include="Vehicle.sql" />
<Build Include="MinorAccountType.sql" />
</ItemGroup>
<ItemGroup>
<None Include="ReserveManagementSystem.publish.xml" />
</ItemGroup>
<ItemGroup>
<PostDeploy Include="Script.PostDeploymentPopulateLoanTypeTable.sql" />
</ItemGroup>
<ItemGroup>
<PreDeploy Include="Script.PreDeploymentTruncateLoanTypes.sql" />
</ItemGroup>
<ItemGroup>
<RefactorLog Include="ReserveManagementSystemApi.Sql.refactorlog" />
</ItemGroup>
</Project>
@@ -0,0 +1,20 @@
/*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
Use SQLCMD syntax to reference a variable in the post-deployment script.
Example: :setvar TableName MyTable
SELECT * FROM [$(TableName)]
--------------------------------------------------------------------------------------
*/
USE [ReserveManagementSystem]
GO
INSERT INTO [dbo].[LoanType] (LoanTypeId, LoanComment, ChargebackMethod, NoChargebackDays, NoChargebackPayments, ReserveDiscount, FlatFeePercent, NoReserveThreshold) VALUES ('BB', 'Standard Loan', 'S', 0, 0, 0.00, 1.00, 0.25)
INSERT INTO [dbo].[LoanType] (LoanTypeId, LoanComment, ChargebackMethod, NoChargebackDays, NoChargebackPayments, ReserveDiscount, FlatFeePercent, NoReserveThreshold) VALUES ('NC', '75% Reserve Paid - No charge back- after 90 Days', 'N', 90, 3, 25.00, 1.00, 0.25)
INSERT INTO [dbo].[LoanType] (LoanTypeId, LoanComment, ChargebackMethod, NoChargebackDays, NoChargebackPayments, ReserveDiscount, FlatFeePercent, NoReserveThreshold) VALUES ('NR', 'No reserve to be paid', 'N', 0, 0, 0.00, 0.00, 0.25)
@@ -0,0 +1,6 @@
USE [ReserveManagementSystem]
GO
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'LoanType')
BEGIN
TRUNCATE TABLE [dbo].[LoanType];
END
@@ -0,0 +1,12 @@
CREATE TABLE [dbo].[Vehicle]
(
[VehicleId] INT NOT NULL IDENTITY,
[LoanId] INT NULL,
[VINNumber] VARCHAR(30) NULL,
[Make] VARCHAR(30) NULL,
[Model] VARCHAR(30) NULL,
[Year] VARCHAR(4) NULL,
[Mileage] FLOAT NULL,
[Color] VARCHAR(30) NULL,
CONSTRAINT [PK_Vehicle] PRIMARY KEY (VehicleId)
)