CREATE TABLE [dbo].[LoanRequest] (
	[Id]               INT           IDENTITY (1000, 1) NOT NULL,
	[RequestedDate]    DATETIME NOT NULL DEFAULT GETDATE(),
	[BorrowerId]       INT           NOT NULL,
	[Amount]           FLOAT (53)    NOT NULL,
	[Term]             INT           NOT NULL,
	[TermTypeId]         INT NOT NULL,
	[FirstPaymentDate] DATETIME      NOT NULL,
	[ReferenceNumber] NVARCHAR(50) NULL, 
	[LoanRequestStatusId] INT NOT NULL, 
	CONSTRAINT [PK_LoanRequest] PRIMARY KEY CLUSTERED ([Id] ASC),
	--CONSTRAINT [FK_LoanRequest_Profile] FOREIGN KEY ([BorrowerId]) REFERENCES [dbo].[Profile] ([Id]),
	CONSTRAINT [FK_LoanRequest_Borrower] FOREIGN KEY ([BorrowerId]) REFERENCES [dbo].[Borrower] ([Id]),
	CONSTRAINT [FK_LoanRequest_LoanRequestStatus] FOREIGN KEY ([LoanRequestStatusId]) REFERENCES [dbo].[LoanRequestStatus] ([Id]), 
	CONSTRAINT [FK_LoanRequest_TermType] FOREIGN KEY ([TermTypeId]) REFERENCES [TermType]([Id])
);

