INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Contract Number', '(contract\s?(number|#|num))', '^\d+\d$', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Name', '(cust(omer)?\s?name)', '(\w+\s?)+', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Phone Number', '(phone\s?(num(ber)?|#)?)', '(\+?\d-?)?\s?\(?\d{3}\)?-?\s?\d{3}-?\s?\d{4}', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Tax-ID', '((tax-?id)|(TIN)|(EIN))', '(\d{2}-?\d{7})|((\d{3}){2}\d{3})|(\d{3}-?\d{2}-?\d{4})', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Physical Address 1', '(cust(omers?)?\s?\w*\s?add(ress)?(\s?1)?)', '(\w+\s?)+', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Physical Address 2', '(cust(omers?)?\s?\w*\s?add(ress)?\s2)', 1, 1, 1, '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Physical City', '(cust(omers?)?\s?\w*\s?city)', '(\w+\s?)+', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Physical State', '(cust(omers?)?\s?\w*\s?state)', '\w+', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Physical Zip', '(cust(omers?)?\s?\w*\s?zip\s?(code)?)', '\d{5}-?(\d{4})?', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Date Booked', '(date\s?booked)', '[1-2]?\d\/\d{1,2}\/(20)?\d{2}', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Term (Months)', '(term\s?(\(?months\)?)?)', '\d{1,3}', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Payment Amount', '(pa?yme?n?t\s?am(oun)?t)', '(\d{1,2},?)*\d+(.\d{2})?', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Financed Amount', '(financed\s?am(oun)?t)', '(\d{1,2},?)*\d+(.\d{2})?', 0, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Receivable balance', '(rec(eivable)?\s?bal(ance)?)', '(\d{1,2},?)*\d+(.\d{2})?', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Asset Description', '(asset\sdesc(ription)?)', '(\w+\s?)+', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Serial Number/VIN', '(serial\s?num(ber)?|VIN)', '\d{8}', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Business Type', '((business|biz)\s?type)', '(\w+\s?)+', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG Name', '((pg|guarantor)\s?name)', '(\w+\s?)+', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG Address 1', '((pg|guarantor)\s?add(ress)?(\s?1))', '(\w+\s?)+', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG Address 2', '((pg|guarantor)\s?add(ress)?(\s?2))', '(\w+\s?)+', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG City', '((pg|guarantor)\s?city)', '(\w+\s?)+', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG State', '((pg|guarantor)\s?state)', '\d{5}-?(\d{4})?', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG Zip', '((pg|guarantor)\s?zip)', '\d{3}-?\d{2}-?\d{3}', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG SSN', '((pg|guarantor)\s?ssn)', '[0-2]?\d\/\d{1,2}\/(19|20)?\d{2}', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('DOB', '(dob|date of birth)', '\d{3}', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG1 FICO', '(pg\d?\s?FICO)', '(\d{1,2},?)*\d+(.\d{2})?', 1, 1, 1);
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Schedule Number', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Number', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Billing Street', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Billing City', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Billing State', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Customer Billing Zip', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Direct/InDirect Channel', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Days Delinquent', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Times 30 Days Delinq', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Times 60 Days Delinq', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Times 90+ Days Delinq', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('DBA Name', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Asset Equipment Address 1', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Asset Equipment Address 2', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Asset Equipment City', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Asset Equipment State', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Asset Equipment Zip', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Assumption', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Resturcture', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Bankruptcy', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Residual Type-To', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('CSC/True', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Commencement Date', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Maturity Date', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Paid Thru Date', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Next Due Date', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Last Payment Date', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Date income suspended', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Termination Date', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Remaining Months (Cash)', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Payment Type', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Residual Amount', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Security Deposit', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('SIC Code', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Asset Type', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Years in Business', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Vendor name', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 Name', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 Address 1', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 Address 2', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 City', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 State', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 Zip', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 SSN', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 DOB', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('PG2 FICO', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('CG Name', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('CG Address 1', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('CG Address 2', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('CG City', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('CG State', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('CG Zip', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Next Due', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('# of Days', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Per Diem', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('Total Net Funding', 0, 1, '', '', '');
INSERT INTO LEAFHeaders (LEAFHeader, HeaderRegex, ValueRegex, Nullable, Required, Version) VALUES ('NPV', 0, 1, '', '', '');
GO
-- LEAF Company
INSERT INTO PortfolioPortalTest.dbo.Company
(CompanyName, State)
VALUES('LEAF', 'PA');
-- Auth
INSERT INTO PortfolioPortalTest.dbo.AuthLevels
(AuthLevel, Description)
VALUES('ADMIN','Admin account with no limitations.');
GO
-- My user
INSERT INTO PortfolioPortalTest.dbo.Users (Username, Email, PasswordHash, Created, Updated, CompanyID)
    VALUES('glott', 'glott@leafnow.com', '$argon2i$v=19$m=65536,t=6,p=3$CAteY16ifJBZHtVjNLu/hA$plypuMy1aPww8ZfY2uGwnYk2Vzy7NvhvJy7TvgtpcPw', getdate(), getdate(), 1);
INSERT INTO PortfolioPortalTest.dbo.Users (Username, Email, PasswordHash, Created, Updated, CompanyID)
    VALUES('pmolchan', 'pmolchan@leafnow.com', '$argon2i$v=19$m=65536,t=6,p=3$gE140D569YZvi+/CZbEZsg$+qunnN3wTfZx9PK++0Nv6AisvSWJ0f6lfT/UUDBzKTU', getdate(), getdate(), 1);

-- Auth my user
INSERT INTO PortfolioPortalTest.dbo.Auths (UserID, AuthLevelID)
    VALUES(1, 1);