@byu-oit/vue-decision-processing-components 8.35.8 → 8.35.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/.github/CODEOWNERS +1 -0
  2. package/.github/workflows/deploy.yml +40 -50
  3. package/.repo-meta.yml +55 -55
  4. package/AdmitPeriodConfig.vue +115 -115
  5. package/ApiCallButton.vue +91 -91
  6. package/ApplicantInfo.vue +100 -100
  7. package/AssignmentBulkDialog.vue +153 -153
  8. package/AssignmentDialog.vue +117 -117
  9. package/AssignmentSummary.vue +75 -75
  10. package/BackgroundBadge.vue +83 -83
  11. package/BackgroundDetailCrime.vue +78 -78
  12. package/BackgroundDetailPluralMarriage.vue +43 -43
  13. package/BackgroundDetailSexRegistry.vue +43 -43
  14. package/BackgroundDetailUniversity.vue +37 -37
  15. package/CHANGELOG.md +676 -676
  16. package/Dashboard.vue +201 -201
  17. package/DashboardApplicationList.vue +50 -50
  18. package/DecisionDialog.vue +178 -178
  19. package/Details.vue +124 -124
  20. package/DetailsActivity.vue +59 -59
  21. package/DetailsBackground.vue +143 -143
  22. package/DetailsBackgroundDetail.vue +47 -47
  23. package/DetailsBackgroundSummary.vue +66 -66
  24. package/DetailsCesHold.vue +107 -107
  25. package/DetailsCollege.vue +93 -93
  26. package/DetailsContact.vue +65 -65
  27. package/DetailsDecision.vue +183 -183
  28. package/DetailsDecisionHistory.vue +56 -56
  29. package/DetailsEndorsement.vue +74 -74
  30. package/DetailsEssay.vue +59 -59
  31. package/DetailsFilenote.vue +62 -62
  32. package/DetailsFilenoteList.vue +109 -109
  33. package/DetailsFlagSection.vue +176 -176
  34. package/DetailsHeader.vue +263 -263
  35. package/DetailsHighSchool.vue +99 -99
  36. package/DetailsHsTranscript.vue +100 -100
  37. package/DetailsInstitute.vue +90 -90
  38. package/DetailsMission.vue +88 -88
  39. package/DetailsNewAppHistory.vue +50 -50
  40. package/DetailsNotes.vue +83 -83
  41. package/DetailsPathway.vue +45 -45
  42. package/DetailsScoringSection.vue +128 -128
  43. package/DetailsSection.vue +116 -116
  44. package/DetailsSeminary.vue +184 -184
  45. package/DetailsSrs.vue +52 -52
  46. package/DetailsSubnav.vue +54 -54
  47. package/DetailsTestScores.vue +131 -131
  48. package/ExpandIndicator.vue +75 -75
  49. package/ExternalLink.vue +34 -34
  50. package/FilterBreadcrumb.vue +85 -85
  51. package/FilterButton.vue +86 -86
  52. package/FilterButtonAdmitPeriod.vue +104 -104
  53. package/FilterButtonAppType.vue +103 -103
  54. package/FilterButtonAssignedTo.vue +96 -96
  55. package/FilterButtonClearFilters.vue +65 -65
  56. package/FilterButtonSex.vue +105 -105
  57. package/FlagButton.vue +59 -59
  58. package/FlagDialog.vue +129 -129
  59. package/Footer.vue +432 -432
  60. package/Header.vue +132 -132
  61. package/HighSchoolSummary.vue +60 -60
  62. package/InternationalIndicator.vue +44 -44
  63. package/InternationalStatus.vue +48 -48
  64. package/LICENSE +201 -201
  65. package/LoadingBadge.vue +58 -58
  66. package/ManageAssignments.vue +123 -123
  67. package/NoAuth.vue +14 -14
  68. package/NoteDialog.vue +106 -106
  69. package/ObjectViewer.vue +49 -49
  70. package/Queues.vue +278 -268
  71. package/QuickLinks.vue +25 -25
  72. package/README.md +2 -2
  73. package/RecentApplications.vue +53 -53
  74. package/Report.vue +340 -340
  75. package/ReportDetail.vue +279 -279
  76. package/ReportList.vue +87 -87
  77. package/ReportPhotos.vue +65 -65
  78. package/ReportSvg.vue +78 -78
  79. package/ReportViewer.vue +165 -165
  80. package/RequestAccess.vue +14 -14
  81. package/RequestAccessList.vue +45 -45
  82. package/RoleSelector.vue +29 -29
  83. package/Search.vue +22 -22
  84. package/ShowApplicantIds.vue +100 -100
  85. package/SortableHeader.vue +53 -53
  86. package/Spinner.vue +34 -34
  87. package/StarredIndicator.vue +36 -36
  88. package/StatBox.vue +73 -73
  89. package/StatCharts.vue +196 -196
  90. package/SupportDialog.vue +172 -172
  91. package/UserInfo.vue +52 -52
  92. package/YesNoIndicator.vue +48 -48
  93. package/dateTimeFormat.js +67 -67
  94. package/gpaCalculation.js +162 -162
  95. package/gpaFilter.js +5 -5
  96. package/hsSummary.json +2019 -2019
  97. package/package.json +37 -36
  98. package/parsers/application.js +396 -396
  99. package/parsers/decisionHistory.js +27 -27
  100. package/parsers/filenotes.js +27 -27
  101. package/parsers/notes.js +49 -49
  102. package/parsers/packet.js +88 -88
  103. package/parsers/packetList.js +57 -57
  104. package/parsers/reports.js +13 -13
  105. package/sat2Act.js +46 -46
  106. package/test.js +48 -48
  107. package/themes/ByuiFooter.vue +38 -38
  108. package/themes/ByuiHeader.vue +96 -96
  109. package/themes/LdsbcFooter.vue +38 -38
  110. package/themes/LdsbcHeader.vue +100 -100
  111. package/vuexModules/application/activity.js +32 -32
  112. package/vuexModules/application/applicationList.js +71 -71
  113. package/vuexModules/application/background.js +47 -47
  114. package/vuexModules/application/bio.js +38 -38
  115. package/vuexModules/application/citizenship.js +30 -30
  116. package/vuexModules/application/collegeSummaries.js +32 -32
  117. package/vuexModules/application/essay.js +26 -26
  118. package/vuexModules/application/highSchoolSummaries.js +40 -40
  119. package/vuexModules/application/index.js +157 -157
  120. package/vuexModules/application/institute.js +30 -30
  121. package/vuexModules/application/mission.js +48 -48
  122. package/vuexModules/application/personalRecords.js +24 -24
  123. package/vuexModules/application/questions.js +23 -23
  124. package/vuexModules/application/seminary.js +39 -39
  125. package/vuexModules/application/testScores.js +26 -26
  126. package/vuexModules/notes/index.js +22 -22
  127. package/vuexModules/packet/decision.js +43 -43
  128. package/vuexModules/packet/decisionHistory.js +28 -28
  129. package/vuexModules/packet/flags.js +174 -174
  130. package/vuexModules/packet/index.js +52 -52
  131. package/vuexModules/packet/packetList.js +127 -127
  132. package/vuexModules/packet/processes.js +28 -28
  133. package/vuexModules/reports/index.js +32 -32
  134. package/vuexModules/ui/index.js +56 -56
  135. package/vuexModules/users/index.js +46 -46
  136. package/yyyyMmFilter.js +7 -7
@@ -1,27 +1,27 @@
1
- import get from 'lodash.get'
2
-
3
- const parseData = packet => {
4
- const admitPeriod = get(packet, 'admit_period', '')
5
- const applicantType = get(packet, 'applicant_type', '')
6
- const date = get(packet, 'date', '')
7
- const decision = get(packet, 'decision', '')
8
- const level = get(packet, 'decision_level', '')
9
- const note = get(packet, 'note', '')
10
- const officer = get(packet, 'officer', '')
11
- const qualifier = get(packet, 'qualifier', '')
12
- return {
13
- admitPeriod,
14
- applicantType,
15
- date,
16
- decision,
17
- level,
18
- note,
19
- officer,
20
- qualifier
21
- }
22
- }
23
-
24
- export default decisionHistory => {
25
- const values = get(decisionHistory, 'values', [])
26
- return values.map(parseData)
27
- }
1
+ import get from 'lodash.get'
2
+
3
+ const parseData = packet => {
4
+ const admitPeriod = get(packet, 'admit_period', '')
5
+ const applicantType = get(packet, 'applicant_type', '')
6
+ const date = get(packet, 'date', '')
7
+ const decision = get(packet, 'decision', '')
8
+ const level = get(packet, 'decision_level', '')
9
+ const note = get(packet, 'note', '')
10
+ const officer = get(packet, 'officer', '')
11
+ const qualifier = get(packet, 'qualifier', '')
12
+ return {
13
+ admitPeriod,
14
+ applicantType,
15
+ date,
16
+ decision,
17
+ level,
18
+ note,
19
+ officer,
20
+ qualifier
21
+ }
22
+ }
23
+
24
+ export default decisionHistory => {
25
+ const values = get(decisionHistory, 'values', [])
26
+ return values.map(parseData)
27
+ }
@@ -1,27 +1,27 @@
1
- const parseId = (c = []) => c.id
2
- const parseCategories = (c = []) => cc.category_name
3
- const parseSubcategories = (c = []) => c.subcategory_name
4
- const parseDetails = (d = []) => d.detail
5
- const parseUpdatedDateTime = (t = []) => t.updated_date_time
6
- const parseName = (n) => n.employee_name
7
-
8
- const parseFilenote = note => {
9
- const id = parseId(note)
10
- const categories = parseCategories(note)
11
- const subcategories = parseSubcategories(note)
12
- const details = parseDetails(note)
13
- const updatedOn = parseUpdatedDateTime(note)
14
- const author = parseName(note)
15
- return {
16
- id,
17
- categories,
18
- subcategories,
19
- details,
20
- updatedOn,
21
- author
22
- }
23
- }
24
-
25
- export default (values = []) => {
26
- return parseFilenote(values)
27
- }
1
+ const parseId = (c = []) => c.id
2
+ const parseCategories = (c = []) => cc.category_name
3
+ const parseSubcategories = (c = []) => c.subcategory_name
4
+ const parseDetails = (d = []) => d.detail
5
+ const parseUpdatedDateTime = (t = []) => t.updated_date_time
6
+ const parseName = (n) => n.employee_name
7
+
8
+ const parseFilenote = note => {
9
+ const id = parseId(note)
10
+ const categories = parseCategories(note)
11
+ const subcategories = parseSubcategories(note)
12
+ const details = parseDetails(note)
13
+ const updatedOn = parseUpdatedDateTime(note)
14
+ const author = parseName(note)
15
+ return {
16
+ id,
17
+ categories,
18
+ subcategories,
19
+ details,
20
+ updatedOn,
21
+ author
22
+ }
23
+ }
24
+
25
+ export default (values = []) => {
26
+ return parseFilenote(values)
27
+ }
package/parsers/notes.js CHANGED
@@ -1,49 +1,49 @@
1
- import get from 'lodash.get'
2
- import { dateTimeFormat } from '../dateTimeFormat'
3
-
4
- const parsePacketNote = packet => {
5
- const createdBy = get(packet, 'id_created_by.description', '')
6
- const dateTimeCreated = dateTimeFormat(get(packet, 'date_time_created.value', new Date()))
7
- const note = get(packet, 'action.value', '')
8
- const qualifier = get(packet, 'qualifier.value', '')
9
- const reference = get(packet, 'reference.value', '')
10
- const type = get(packet, 'type.value', '')
11
- const visibility = get(packet, 'visibility.value', '')
12
- return {
13
- createdBy,
14
- dateTimeCreated,
15
- note,
16
- qualifier,
17
- reference,
18
- type,
19
- visibility
20
- }
21
- }
22
-
23
- export const parsePacketNotes = (packet = {}) => {
24
- const values = get(packet, 'actions.values', [])
25
- return values.map(parsePacketNote)
26
- }
27
-
28
- const parseApplicationNote = action => {
29
- const rawNote = get(action, 'action_message.value', '')
30
- const note = rawNote.charAt(0) === '{'
31
- ? JSON.parse(rawNote)
32
- : rawNote
33
- const dateTimeCreated = dateTimeFormat(get(action, 'action_date_time.value', new Date()))
34
- const createdBy = get(action, 'action_by_id.description')
35
- const reference = get(action, 'deliverable_id.value')
36
- const type = get(action, 'action.value')
37
- return {
38
- note,
39
- dateTimeCreated,
40
- createdBy,
41
- reference,
42
- type
43
- }
44
- }
45
-
46
- export const parseApplicationNotes = (application = {}) => {
47
- const values = get(application, 'actions.values', [])
48
- return values.map(parseApplicationNote)
49
- }
1
+ import get from 'lodash.get'
2
+ import { dateTimeFormat } from '../dateTimeFormat'
3
+
4
+ const parsePacketNote = packet => {
5
+ const createdBy = get(packet, 'id_created_by.description', '')
6
+ const dateTimeCreated = dateTimeFormat(get(packet, 'date_time_created.value', new Date()))
7
+ const note = get(packet, 'action.value', '')
8
+ const qualifier = get(packet, 'qualifier.value', '')
9
+ const reference = get(packet, 'reference.value', '')
10
+ const type = get(packet, 'type.value', '')
11
+ const visibility = get(packet, 'visibility.value', '')
12
+ return {
13
+ createdBy,
14
+ dateTimeCreated,
15
+ note,
16
+ qualifier,
17
+ reference,
18
+ type,
19
+ visibility
20
+ }
21
+ }
22
+
23
+ export const parsePacketNotes = (packet = {}) => {
24
+ const values = get(packet, 'actions.values', [])
25
+ return values.map(parsePacketNote)
26
+ }
27
+
28
+ const parseApplicationNote = action => {
29
+ const rawNote = get(action, 'action_message.value', '')
30
+ const note = rawNote.charAt(0) === '{'
31
+ ? JSON.parse(rawNote)
32
+ : rawNote
33
+ const dateTimeCreated = dateTimeFormat(get(action, 'action_date_time.value', new Date()))
34
+ const createdBy = get(action, 'action_by_id.description')
35
+ const reference = get(action, 'deliverable_id.value')
36
+ const type = get(action, 'action.value')
37
+ return {
38
+ note,
39
+ dateTimeCreated,
40
+ createdBy,
41
+ reference,
42
+ type
43
+ }
44
+ }
45
+
46
+ export const parseApplicationNotes = (application = {}) => {
47
+ const values = get(application, 'actions.values', [])
48
+ return values.map(parseApplicationNote)
49
+ }
package/parsers/packet.js CHANGED
@@ -1,88 +1,88 @@
1
- import { parsePacketNotes } from './notes'
2
- import parseDecisionHistory from './decisionHistory'
3
- import get from 'lodash.get'
4
-
5
- export const parseFlag = f => {
6
- const dateTimeCleared = get(f, 'date_time_cleared.value')
7
- const setBy = get(f, 'id_set_by.description')
8
- const setById = get(f, 'id_set_by.value')
9
- const name = get(f, 'name.value')
10
- const value = get(f, 'value.value')
11
- const dateTimeSet = get(f, 'date_time_set.value')
12
- const clearedBy = get(f, 'id_cleared_by.description')
13
- const clearedById = get(f, 'id_cleared_by.value')
14
- const type = get(f, 'type.value')
15
- return {
16
- dateTimeCleared,
17
- setBy,
18
- setById,
19
- name,
20
- value,
21
- dateTimeSet,
22
- clearedBy,
23
- clearedById,
24
- type
25
- }
26
- }
27
-
28
- export const parseFlags = (f = {}) => {
29
- const values = get(f, 'values', [])
30
- return values.map(parseFlag)
31
- }
32
-
33
- export const parseDecision = (d = {}) => {
34
- const dateTimeUpdated = get(d, 'date_time_updated.value')
35
- const explanation = get(d, 'explanation.value')
36
- const model = get(d, 'model.value')
37
- const reason = get(d, 'reason.value')
38
- const updatedBy = get(d, 'id_updated_by.description')
39
- const updatedById = get(d, 'id_updated_by.value')
40
- const value = get(d, 'value.value')
41
-
42
- return {
43
- dateTimeUpdated,
44
- explanation,
45
- model,
46
- reason,
47
- updatedBy,
48
- updatedById,
49
- value
50
- }
51
- }
52
-
53
- export const parseProcess = (p) => {
54
- return {
55
- dateTimeCleared: get(p, 'date_time_cleared.value'),
56
- dateTimeSet: get(p, 'date_time_set.value'),
57
- name: get(p, 'name.value'),
58
- setBy: get(p, 'id_set_by.description'),
59
- setById: get(p, 'id_set_by.value'),
60
- status: get(p, 'status.value')
61
- }
62
- }
63
-
64
- export const parseProcesses = (processes = {}) => {
65
- const values = get(processes, 'values', [])
66
- return values.map(parseProcess)
67
- }
68
-
69
- export const parsePacket = (packet) => {
70
- if (!packet) return { flags: [], notes: [] }
71
- const notes = parsePacketNotes(get(packet, 'packet'))
72
- const flags = parseFlags(get(packet, 'flags', {}))
73
- const decisionHistory = parseDecisionHistory(get(packet, 'history', {}))
74
- return {
75
- institution: get(packet, 'basic.institution.value'),
76
- admitPeriod: get(packet, 'basic.admit_period.value'),
77
- applicantId: get(packet, 'basic.applicant_id.value'),
78
- applicantMajor: get(packet, 'basic.applicant_major.value'),
79
- applicantName: get(packet, 'basic.applicant_name.value'),
80
- applicantType: get(packet, 'basic.applicant_type.value'),
81
- hasFlags: packet.flags.values.length > 0,
82
- flags,
83
- decision: parseDecision(packet.decision),
84
- decisionHistory,
85
- notes,
86
- processes: parseProcesses(packet.processes)
87
- }
88
- }
1
+ import { parsePacketNotes } from './notes'
2
+ import parseDecisionHistory from './decisionHistory'
3
+ import get from 'lodash.get'
4
+
5
+ export const parseFlag = f => {
6
+ const dateTimeCleared = get(f, 'date_time_cleared.value')
7
+ const setBy = get(f, 'id_set_by.description')
8
+ const setById = get(f, 'id_set_by.value')
9
+ const name = get(f, 'name.value')
10
+ const value = get(f, 'value.value')
11
+ const dateTimeSet = get(f, 'date_time_set.value')
12
+ const clearedBy = get(f, 'id_cleared_by.description')
13
+ const clearedById = get(f, 'id_cleared_by.value')
14
+ const type = get(f, 'type.value')
15
+ return {
16
+ dateTimeCleared,
17
+ setBy,
18
+ setById,
19
+ name,
20
+ value,
21
+ dateTimeSet,
22
+ clearedBy,
23
+ clearedById,
24
+ type
25
+ }
26
+ }
27
+
28
+ export const parseFlags = (f = {}) => {
29
+ const values = get(f, 'values', [])
30
+ return values.map(parseFlag)
31
+ }
32
+
33
+ export const parseDecision = (d = {}) => {
34
+ const dateTimeUpdated = get(d, 'date_time_updated.value')
35
+ const explanation = get(d, 'explanation.value')
36
+ const model = get(d, 'model.value')
37
+ const reason = get(d, 'reason.value')
38
+ const updatedBy = get(d, 'id_updated_by.description')
39
+ const updatedById = get(d, 'id_updated_by.value')
40
+ const value = get(d, 'value.value')
41
+
42
+ return {
43
+ dateTimeUpdated,
44
+ explanation,
45
+ model,
46
+ reason,
47
+ updatedBy,
48
+ updatedById,
49
+ value
50
+ }
51
+ }
52
+
53
+ export const parseProcess = (p) => {
54
+ return {
55
+ dateTimeCleared: get(p, 'date_time_cleared.value'),
56
+ dateTimeSet: get(p, 'date_time_set.value'),
57
+ name: get(p, 'name.value'),
58
+ setBy: get(p, 'id_set_by.description'),
59
+ setById: get(p, 'id_set_by.value'),
60
+ status: get(p, 'status.value')
61
+ }
62
+ }
63
+
64
+ export const parseProcesses = (processes = {}) => {
65
+ const values = get(processes, 'values', [])
66
+ return values.map(parseProcess)
67
+ }
68
+
69
+ export const parsePacket = (packet) => {
70
+ if (!packet) return { flags: [], notes: [] }
71
+ const notes = parsePacketNotes(get(packet, 'packet'))
72
+ const flags = parseFlags(get(packet, 'flags', {}))
73
+ const decisionHistory = parseDecisionHistory(get(packet, 'history', {}))
74
+ return {
75
+ institution: get(packet, 'basic.institution.value'),
76
+ admitPeriod: get(packet, 'basic.admit_period.value'),
77
+ applicantId: get(packet, 'basic.applicant_id.value'),
78
+ applicantMajor: get(packet, 'basic.applicant_major.value'),
79
+ applicantName: get(packet, 'basic.applicant_name.value'),
80
+ applicantType: get(packet, 'basic.applicant_type.value'),
81
+ hasFlags: packet.flags.values.length > 0,
82
+ flags,
83
+ decision: parseDecision(packet.decision),
84
+ decisionHistory,
85
+ notes,
86
+ processes: parseProcesses(packet.processes)
87
+ }
88
+ }
@@ -1,57 +1,57 @@
1
- import get from 'lodash.get'
2
-
3
- const parsePacket = packet => {
4
- const basic = get(packet, 'basic', {})
5
- const flags = get(packet, 'basic.flags', [])
6
- const assignedTo = flags.filter(f => /^[0-9]{9}$/.test(f))[0]
7
- const population = get(basic, 'applicant_population.value', '')
8
- return {
9
- admit_period: get(basic, 'admit_period.value'),
10
- applicant_id: get(basic, 'applicant_id.value'),
11
- applicant_major: get(basic, 'applicant_major.value'),
12
- applicant_name: get(basic, 'applicant_name.value'),
13
- applicant_type: get(basic, 'applicant_type.value'),
14
- application_uuid: get(basic, 'application_uuid.value'),
15
- applicant_sex: get(basic, 'applicant_sex.value'),
16
- applicant_birth_date: get(basic, 'applicant_birth_date.value'),
17
- applicant_net_id: get(basic, 'net_id.value'),
18
- applicant_gpa: get(basic, 'applicant_gpa.value'),
19
- cumulative_college_gpa: get(basic, 'cumulative_college_gpa.value'),
20
- applicant_act: get(basic, 'applicant_act.value'),
21
- assigned_to: assignedTo,
22
- created_date_time: get(basic, 'created_date_time.value'),
23
- institution: get(basic, 'institution.value'),
24
- is_hawaii: population === 'HI',
25
- is_international: population === 'IA',
26
- next_action_date: get(basic, 'next_action.value'),
27
- set_flags: flags
28
- }
29
- }
30
-
31
- const parseValues = json => {
32
- const values = get(json, 'values', [])
33
- return values.map(parsePacket)
34
- }
35
-
36
- const parseTotal = json => {
37
- const metadata = get(json, 'metadata', [])
38
- return get(metadata, 'collection_size', 0)
39
- }
40
-
41
- const parseStats = json => {
42
- const stats = get(json, 'stats', [])
43
- console.log(`api/packetList::parseStats::stats=${JSON.stringify(stats)}`)
44
- const admitPeriods = stats.map(s => s.key).filter(s => /^[0-9]{5}$/.test(s))
45
- return stats.reduce((acc, curr) => {
46
- const { key, value } = curr
47
- return Object.assign(acc, { [key]: Math.floor(value) })
48
- }, { admitPeriods })
49
- }
50
-
51
- export default (json) => {
52
- const data = parseValues(json)
53
- const total = parseTotal(json)
54
- const stats = parseStats(json)
55
- console.log(`api/packetList::parseResponse::stats=${JSON.stringify(stats)}`)
56
- return { data, total, stats }
57
- }
1
+ import get from 'lodash.get'
2
+
3
+ const parsePacket = packet => {
4
+ const basic = get(packet, 'basic', {})
5
+ const flags = get(packet, 'basic.flags', [])
6
+ const assignedTo = flags.filter(f => /^[0-9]{9}$/.test(f))[0]
7
+ const population = get(basic, 'applicant_population.value', '')
8
+ return {
9
+ admit_period: get(basic, 'admit_period.value'),
10
+ applicant_id: get(basic, 'applicant_id.value'),
11
+ applicant_major: get(basic, 'applicant_major.value'),
12
+ applicant_name: get(basic, 'applicant_name.value'),
13
+ applicant_type: get(basic, 'applicant_type.value'),
14
+ application_uuid: get(basic, 'application_uuid.value'),
15
+ applicant_sex: get(basic, 'applicant_sex.value'),
16
+ applicant_birth_date: get(basic, 'applicant_birth_date.value'),
17
+ applicant_net_id: get(basic, 'net_id.value'),
18
+ applicant_gpa: get(basic, 'applicant_gpa.value'),
19
+ cumulative_college_gpa: get(basic, 'cumulative_college_gpa.value'),
20
+ applicant_act: get(basic, 'applicant_act.value'),
21
+ assigned_to: assignedTo,
22
+ created_date_time: get(basic, 'created_date_time.value'),
23
+ institution: get(basic, 'institution.value'),
24
+ is_hawaii: population === 'HI',
25
+ is_international: population === 'IA',
26
+ next_action_date: get(basic, 'next_action.value'),
27
+ set_flags: flags
28
+ }
29
+ }
30
+
31
+ const parseValues = json => {
32
+ const values = get(json, 'values', [])
33
+ return values.map(parsePacket)
34
+ }
35
+
36
+ const parseTotal = json => {
37
+ const metadata = get(json, 'metadata', [])
38
+ return get(metadata, 'collection_size', 0)
39
+ }
40
+
41
+ const parseStats = json => {
42
+ const stats = get(json, 'stats', [])
43
+ console.log(`api/packetList::parseStats::stats=${JSON.stringify(stats)}`)
44
+ const admitPeriods = stats.map(s => s.key).filter(s => /^[0-9]{5}$/.test(s))
45
+ return stats.reduce((acc, curr) => {
46
+ const { key, value } = curr
47
+ return Object.assign(acc, { [key]: Math.floor(value) })
48
+ }, { admitPeriods })
49
+ }
50
+
51
+ export default (json) => {
52
+ const data = parseValues(json)
53
+ const total = parseTotal(json)
54
+ const stats = parseStats(json)
55
+ console.log(`api/packetList::parseResponse::stats=${JSON.stringify(stats)}`)
56
+ return { data, total, stats }
57
+ }
@@ -1,13 +1,13 @@
1
- 'use strict'
2
- /*
3
- * Add a field to each report metadata item that remembers if it's part
4
- * of the application service (so that we can call the right service
5
- * when we retrieve the report data)
6
- */
7
- export default function parse (reportMetadata, appService = false, proxy = false) {
8
- reportMetadata.values.forEach(function (element) {
9
- element.appService = appService
10
- element.proxy = proxy
11
- })
12
- return reportMetadata.values
13
- }
1
+ 'use strict'
2
+ /*
3
+ * Add a field to each report metadata item that remembers if it's part
4
+ * of the application service (so that we can call the right service
5
+ * when we retrieve the report data)
6
+ */
7
+ export default function parse (reportMetadata, appService = false, proxy = false) {
8
+ reportMetadata.values.forEach(function (element) {
9
+ element.appService = appService
10
+ element.proxy = proxy
11
+ })
12
+ return reportMetadata.values
13
+ }
package/sat2Act.js CHANGED
@@ -1,46 +1,46 @@
1
- const convTable = [
2
- [ 1570, 36 ],
3
- [ 1530, 35 ],
4
- [ 1490, 34 ],
5
- [ 1450, 33 ],
6
- [ 1420, 32 ],
7
- [ 1390, 31 ],
8
- [ 1360, 30 ],
9
- [ 1330, 29 ],
10
- [ 1300, 28 ],
11
- [ 1260, 27 ],
12
- [ 1230, 26 ],
13
- [ 1200, 25 ],
14
- [ 1160, 24 ],
15
- [ 1130, 23 ],
16
- [ 1100, 22 ],
17
- [ 1060, 21 ],
18
- [ 1030, 20 ],
19
- [ 990, 19 ],
20
- [ 960, 18 ],
21
- [ 920, 17 ],
22
- [ 880, 16 ],
23
- [ 830, 15 ],
24
- [ 780, 14 ],
25
- [ 730, 13 ],
26
- [ 690, 12 ],
27
- [ 650, 11 ],
28
- [ 620, 10 ],
29
- [ 590, 9 ]
30
- ]
31
-
32
- export function sat2Act (score) {
33
- if (!score) return undefined
34
- const asNum = Number(score)
35
- if (!Number.isInteger(asNum)) return undefined
36
- if (Number.isNaN(asNum)) return undefined
37
- if (asNum < 590) return undefined
38
- return convTable.find(([sat, act]) => score >= sat)[1]
39
- }
40
-
41
- export function sat2ActFilter (value) {
42
- if (!value) return value
43
- const converted = sat2Act(value)
44
- if (converted === undefined) return '?'
45
- return converted
46
- }
1
+ const convTable = [
2
+ [ 1570, 36 ],
3
+ [ 1530, 35 ],
4
+ [ 1490, 34 ],
5
+ [ 1450, 33 ],
6
+ [ 1420, 32 ],
7
+ [ 1390, 31 ],
8
+ [ 1360, 30 ],
9
+ [ 1330, 29 ],
10
+ [ 1300, 28 ],
11
+ [ 1260, 27 ],
12
+ [ 1230, 26 ],
13
+ [ 1200, 25 ],
14
+ [ 1160, 24 ],
15
+ [ 1130, 23 ],
16
+ [ 1100, 22 ],
17
+ [ 1060, 21 ],
18
+ [ 1030, 20 ],
19
+ [ 990, 19 ],
20
+ [ 960, 18 ],
21
+ [ 920, 17 ],
22
+ [ 880, 16 ],
23
+ [ 830, 15 ],
24
+ [ 780, 14 ],
25
+ [ 730, 13 ],
26
+ [ 690, 12 ],
27
+ [ 650, 11 ],
28
+ [ 620, 10 ],
29
+ [ 590, 9 ]
30
+ ]
31
+
32
+ export function sat2Act (score) {
33
+ if (!score) return undefined
34
+ const asNum = Number(score)
35
+ if (!Number.isInteger(asNum)) return undefined
36
+ if (Number.isNaN(asNum)) return undefined
37
+ if (asNum < 590) return undefined
38
+ return convTable.find(([sat, act]) => score >= sat)[1]
39
+ }
40
+
41
+ export function sat2ActFilter (value) {
42
+ if (!value) return value
43
+ const converted = sat2Act(value)
44
+ if (converted === undefined) return '?'
45
+ return converted
46
+ }