Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

362 lines
4.2 KiB

  1. INSERT INTO address
  2. (full_address, street, city, region, country, zip)
  3. VALUES
  4. (
  5. '443 Rideau Street K1N 2B8, Ottawa, Ontario, Canada',
  6. '443 Rideau Street',
  7. 'Ottawa',
  8. 'Ontario',
  9. 'Canada',
  10. 'K1N 2B8'
  11. ),
  12. (
  13. '221 Mountainview Parkway K1N 2B8, Mountainview, San Francisco, USA',
  14. '221 Mountainview Parkway',
  15. 'Mountainview',
  16. 'San Francisco',
  17. 'USA',
  18. 'K1N 2B8'
  19. );
  20. INSERT IGNORE INTO branch
  21. (type, num, address )
  22. VALUES
  23. ('NMLS', 'abc123idk', 1),
  24. ('FSRA', 'another branch', 1);
  25. INSERT IGNORE INTO user (
  26. first_name,
  27. last_name,
  28. password,
  29. address,
  30. phone,
  31. branch_id,
  32. country,
  33. title,
  34. email,
  35. verified,
  36. role,
  37. status
  38. ) VALUES
  39. (
  40. 'Blue',
  41. 'Coltrane',
  42. sha2('test123', 256),
  43. 1,
  44. '9059991111',
  45. (SELECT id FROM branch LIMIT 1),
  46. 'Canada',
  47. 'Loan Officer',
  48. 'test@example.com',
  49. true,
  50. 'User',
  51. 'Free'
  52. ),
  53. (
  54. 'Giant',
  55. 'Coltrane',
  56. sha2('test123', 256),
  57. 1,
  58. '9054441111',
  59. 0,
  60. 'USA',
  61. 'Mortgage Broker',
  62. 'unverified@example.com',
  63. false,
  64. 'User',
  65. 'Free'
  66. ),
  67. (
  68. 'Jeru',
  69. 'Mulligan',
  70. sha2('test123', 256),
  71. 1,
  72. '9054441111',
  73. (SELECT id FROM branch LIMIT 1),
  74. 'USA',
  75. 'Branch Manager',
  76. 'manager@example.com',
  77. true,
  78. 'Manager',
  79. 'Free'
  80. );
  81. INSERT IGNORE INTO license (
  82. user_id,
  83. type,
  84. num
  85. ) VALUES
  86. (
  87. (SELECT id FROM user WHERE email = 'test@example.com' LIMIT 1),
  88. 'NMLS',
  89. 'randomnml523s'
  90. ),
  91. (
  92. (SELECT id FROM user WHERE email = 'manager@example.com' LIMIT 1),
  93. 'FSRA',
  94. '5234gsdf'
  95. );
  96. INSERT IGNORE INTO loan_type (
  97. branch_id,
  98. user_id,
  99. name
  100. ) VALUES
  101. (
  102. (SELECT id FROM branch LIMIT 1),
  103. 0,
  104. 'testType'
  105. ),
  106. (
  107. 0,
  108. (SELECT id FROM user WHERE email="manager@example.com" LIMIT 1),
  109. 'manager idea'
  110. );
  111. INSERT IGNORE INTO fee_template (
  112. user_id,
  113. branch_id,
  114. amount,
  115. perc,
  116. type,
  117. auto,
  118. name
  119. ) VALUES
  120. (
  121. 0,
  122. (SELECT id FROM branch LIMIT 1),
  123. 0,
  124. 200,
  125. 'Title',
  126. true,
  127. "LenderS's Title Insurance"
  128. ),
  129. (
  130. (SELECT id FROM user WHERE email="manager@example.com" LIMIT 1),
  131. (SELECT id FROM branch LIMIT 1),
  132. 5250,
  133. 0,
  134. 'Required',
  135. true,
  136. "Appraisal"
  137. ),
  138. (
  139. (SELECT id FROM user WHERE email="test@example.com" LIMIT 1),
  140. 0,
  141. 9900,
  142. 0,
  143. "Government",
  144. false,
  145. "Recording Charges"
  146. ),
  147. (
  148. (SELECT id FROM user WHERE email="test@example.com" LIMIT 1),
  149. 0,
  150. 0,
  151. 400,
  152. 'Lender',
  153. true,
  154. "Processing fee"
  155. );
  156. INSERT IGNORE INTO loan_type (
  157. user_id,
  158. branch_id,
  159. name
  160. ) VALUES
  161. (
  162. 0,
  163. 0,
  164. "Conventional"
  165. ),
  166. (
  167. 0,
  168. 0,
  169. "FHA"
  170. ),
  171. (
  172. 0,
  173. 0,
  174. "VA"
  175. ),
  176. (
  177. 0,
  178. 0,
  179. "USDA"
  180. ),
  181. (
  182. 0,
  183. (SELECT id FROM branch LIMIT 1),
  184. "Test"
  185. );
  186. INSERT IGNORE INTO borrower (
  187. credit_score,
  188. monthly_income,
  189. num
  190. ) VALUES
  191. (
  192. 740,
  193. 500000,
  194. 1
  195. );
  196. INSERT INTO estimate (
  197. user_id,
  198. borrower_id,
  199. transaction,
  200. price,
  201. property,
  202. occupancy,
  203. zip,
  204. pud
  205. ) VALUES
  206. (
  207. (SELECT id FROM user WHERE email="test@example.com" LIMIT 1),
  208. (SELECT id FROM borrower ORDER BY id DESC LIMIT 1),
  209. 'Purchase',
  210. 100000000,
  211. 1,
  212. 1,
  213. '95051',
  214. false
  215. ),
  216. (
  217. (SELECT id FROM user WHERE email="manager@example.com" LIMIT 1),
  218. (SELECT id FROM borrower ORDER BY id DESC LIMIT 1),
  219. 'Purchase',
  220. 25000000,
  221. 2,
  222. 1,
  223. '95051',
  224. false
  225. ),
  226. (
  227. (SELECT id FROM user WHERE email="test@example.com" LIMIT 1),
  228. (SELECT id FROM borrower ORDER BY id DESC LIMIT 1),
  229. 'Refinance',
  230. 50000000,
  231. 3,
  232. 2,
  233. '95051',
  234. false
  235. );
  236. INSERT INTO loan (
  237. estimate_id,
  238. type_id,
  239. amount,
  240. term,
  241. interest,
  242. ltv,
  243. dti,
  244. hoi,
  245. name
  246. ) VALUES
  247. (
  248. 1,
  249. (SELECT id FROM loan_type WHERE name="Conventional"),
  250. 3300000,
  251. 30,
  252. 3.75,
  253. 88.00,
  254. 5.00,
  255. 0,
  256. "For client 1"
  257. ),
  258. (
  259. 1,
  260. (SELECT id FROM loan_type WHERE name="FHA"),
  261. 2510000,
  262. 30,
  263. 3,
  264. 90.00,
  265. 6.70,
  266. 0,
  267. "For client 2"
  268. ),
  269. (
  270. 3,
  271. (SELECT id FROM loan_type WHERE name="FHA"),
  272. 2510000,
  273. 1.8,
  274. 300,
  275. 90.00,
  276. 6.70,
  277. 0,
  278. "For client 2"
  279. ),
  280. (
  281. 2,
  282. (SELECT id FROM loan_type WHERE name="USDA"),
  283. 8000000,
  284. 1.1,
  285. 125,
  286. 95.00,
  287. 4.90,
  288. 0,
  289. "Random name"
  290. );
  291. INSERT INTO mi (
  292. loan_id,
  293. type,
  294. label,
  295. lender,
  296. rate,
  297. premium,
  298. upfront,
  299. five_year_total,
  300. initial_premium,
  301. initial_rate
  302. ) VALUES
  303. (
  304. 1,
  305. "BPM",
  306. "National MI test loan",
  307. "National MI",
  308. 28,
  309. 77000,
  310. 0,
  311. 4620000,
  312. 77000,
  313. 28
  314. );
  315. INSERT INTO estimate_result (
  316. loan_id,
  317. loan_payment,
  318. total_monthly,
  319. total_fees,
  320. total_credits,
  321. cash_to_close
  322. ) VALUES
  323. (
  324. 1,
  325. 258060,
  326. 311500,
  327. 87211,
  328. -15089,
  329. 411822
  330. ),
  331. (
  332. 2,
  333. 198060,
  334. 241500,
  335. 54400,
  336. -10089,
  337. 310022
  338. ),
  339. (
  340. 3,
  341. 118000,
  342. 350000,
  343. 54400,
  344. -70089,
  345. 411699
  346. );