MCPcopy Index your code
hub / github.com/codecombat/codecombat / prepaidNumericalCourses

Method prepaidNumericalCourses

app/models/User.js:906–914  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

904 }
905
906 prepaidNumericalCourses () {
907 const courseProducts = this.activeProducts('course')
908 if (!courseProducts.length) { return utils.courseNumericalStatus.NO_ACCESS }
909 if (_.some(courseProducts, p => (p.productOptions?.includedCourseIDs == null))) { return utils.courseNumericalStatus.FULL_ACCESS }
910 const union = (res, prepaid) => _.union(res, prepaid.productOptions?.includedCourseIDs != null ? prepaid.productOptions?.includedCourseIDs : [])
911 const courses = _.reduce(courseProducts, union, [])
912 const fun = (s, k) => s + utils.courseNumericalStatus[k]
913 return _.reduce(courses, fun, 0)
914 }
915
916 prepaidType (includeCourseIDs) {
917 const courseProducts = this.activeProducts('course')

Callers 3

applySpecificLicensesFunction · 0.80
enrolledUsersMethod · 0.80
unenrolledUsersMethod · 0.80

Calls 1

activeProductsMethod · 0.95

Tested by

no test coverage detected