Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

359 řádky
4.0 KiB

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