Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.49 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. const panelist1 = 'e20e2642-a78f-40fb-b455-a8c48b522ea4';
  12.  
  13. // 3 qualification attempts approved: ['mobileTOL', 'desktopTOL', 'desktopApp'] (SOURCE OF TRUTH)
  14. const panelist1QualificationAttempts = {
  15. "_id" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  16. "qualifications" : {
  17. "mobileTOL" : "approved",
  18. "desktopTOL" : "approved",
  19. "desktopApp" : "approved"
  20. }
  21. };
  22.  
  23. // 2 qualifications as a panelist: ['mobileTOL', 'desktopTOL'], missing 1: 'desktopApp'
  24. let panelistQualifications = {
  25. "_id" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  26. "qualifications" : [
  27. "mobileTOL",
  28. "desktopTOL"
  29. ]
  30. };
  31.  
  32. // 2 qualifications in demographics: ['mobileTOL', 'desktopTOL'], missing 1: 'desktopApp'
  33. let panelistDemographics = {
  34. "panelistId" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  35. "__meta__" : {
  36. "panelist" : {
  37. "qualifications" : [
  38. {
  39. "grantor" : "kadachi@userzoom.com",
  40. "key" : "desktopTOL"
  41. },
  42. {
  43. "key" : "mobileTOL",
  44. "grantor" : "sdada@userzoom.com"
  45. }
  46. ]
  47. }
  48. }
  49. };
  50.  
  51. // 1 qualification in profile: 'mobileTOL', missing 2: ['desktopApp', 'desktopTOL']
  52. let panelistProfile = {
  53. "_id" : "d9d5f944-3e1d-4d97-acf1-05858cb8545f",
  54. "panelistId" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  55. "qualifications" : [
  56. {
  57. "key" : "mobileTOL",
  58. "status" : "approved"
  59. }
  60. ]
  61. };
  62.  
  63.  
  64. /***** RUN MIGRATION *****/
  65.  
  66.  
  67. // All 3 qualifications present as a panelist present (added: 'desktopApp')
  68. panelistQualifications = {
  69. "_id" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  70. "qualifications" : [
  71. "desktopApp",
  72. "mobileTOL",
  73. "desktopTOL"
  74. ]
  75. };
  76.  
  77. // All 3 qualifications present as a panelist present (added: 'desktopApp')
  78. panelistDemographics = {
  79. "panelistId" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  80. "__meta__" : {
  81. "panelist" : {
  82. "qualifications" : [
  83. {
  84. "grantor" : "kadachi@userzoom.com",
  85. "key" : "desktopTOL"
  86. },
  87. {
  88. "key" : "mobileTOL",
  89. "grantor" : "sdada@userzoom.com"
  90. },
  91. {
  92. "key" : "desktopApp",
  93. "reason" : "syncQualifications",
  94. "grantor" : "dbMigration",
  95. "createdAt" : "2019-06-06T12:40:43.794Z",
  96. "updatedAt" : "2019-06-06T12:40:43.794Z"
  97. }
  98. ]
  99. }
  100. }
  101. };
  102.  
  103. // All 3 qualifications present in the profile (added both: ['desktopApp', 'desktopTOL'])
  104. panelistProfile = {
  105. "_id" : "d9d5f944-3e1d-4d97-acf1-05858cb8545f",
  106. "panelistId" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  107. "qualifications" : [
  108. {
  109. "key" : "mobileTOL",
  110. "status" : "approved"
  111. },
  112. {
  113. "key" : "desktopTOL",
  114. "status" : "approved"
  115. },
  116. {
  117. "key" : "desktopApp",
  118. "status" : "approved"
  119. }
  120. ]
  121. };
  122. </script>
  123.  
  124.  
  125.  
  126. <script id="jsbin-source-javascript" type="text/javascript">const panelist1 = 'e20e2642-a78f-40fb-b455-a8c48b522ea4';
  127.  
  128. // 3 qualification attempts approved: ['mobileTOL', 'desktopTOL', 'desktopApp'] (SOURCE OF TRUTH)
  129. const panelist1QualificationAttempts = {
  130. "_id" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  131. "qualifications" : {
  132. "mobileTOL" : "approved",
  133. "desktopTOL" : "approved",
  134. "desktopApp" : "approved"
  135. }
  136. };
  137.  
  138. // 2 qualifications as a panelist: ['mobileTOL', 'desktopTOL'], missing 1: 'desktopApp'
  139. let panelistQualifications = {
  140. "_id" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  141. "qualifications" : [
  142. "mobileTOL",
  143. "desktopTOL"
  144. ]
  145. };
  146.  
  147. // 2 qualifications in demographics: ['mobileTOL', 'desktopTOL'], missing 1: 'desktopApp'
  148. let panelistDemographics = {
  149. "panelistId" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  150. "__meta__" : {
  151. "panelist" : {
  152. "qualifications" : [
  153. {
  154. "grantor" : "kadachi@userzoom.com",
  155. "key" : "desktopTOL"
  156. },
  157. {
  158. "key" : "mobileTOL",
  159. "grantor" : "sdada@userzoom.com"
  160. }
  161. ]
  162. }
  163. }
  164. };
  165.  
  166. // 1 qualification in profile: 'mobileTOL', missing 2: ['desktopApp', 'desktopTOL']
  167. let panelistProfile = {
  168. "_id" : "d9d5f944-3e1d-4d97-acf1-05858cb8545f",
  169. "panelistId" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  170. "qualifications" : [
  171. {
  172. "key" : "mobileTOL",
  173. "status" : "approved"
  174. }
  175. ]
  176. };
  177.  
  178.  
  179. /***** RUN MIGRATION *****/
  180.  
  181.  
  182. // All 3 qualifications present as a panelist present (added: 'desktopApp')
  183. panelistQualifications = {
  184. "_id" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  185. "qualifications" : [
  186. "desktopApp",
  187. "mobileTOL",
  188. "desktopTOL"
  189. ]
  190. };
  191.  
  192. // All 3 qualifications present as a panelist present (added: 'desktopApp')
  193. panelistDemographics = {
  194. "panelistId" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  195. "__meta__" : {
  196. "panelist" : {
  197. "qualifications" : [
  198. {
  199. "grantor" : "kadachi@userzoom.com",
  200. "key" : "desktopTOL"
  201. },
  202. {
  203. "key" : "mobileTOL",
  204. "grantor" : "sdada@userzoom.com"
  205. },
  206. {
  207. "key" : "desktopApp",
  208. "reason" : "syncQualifications",
  209. "grantor" : "dbMigration",
  210. "createdAt" : "2019-06-06T12:40:43.794Z",
  211. "updatedAt" : "2019-06-06T12:40:43.794Z"
  212. }
  213. ]
  214. }
  215. }
  216. };
  217.  
  218. // All 3 qualifications present in the profile (added both: ['desktopApp', 'desktopTOL'])
  219. panelistProfile = {
  220. "_id" : "d9d5f944-3e1d-4d97-acf1-05858cb8545f",
  221. "panelistId" : "e20e2642-a78f-40fb-b455-a8c48b522ea4",
  222. "qualifications" : [
  223. {
  224. "key" : "mobileTOL",
  225. "status" : "approved"
  226. },
  227. {
  228. "key" : "desktopTOL",
  229. "status" : "approved"
  230. },
  231. {
  232. "key" : "desktopApp",
  233. "status" : "approved"
  234. }
  235. ]
  236. };
  237. </script></body>
  238. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement