(course)
| 943 | } |
| 944 | |
| 945 | prepaidIncludesCourse (course) { |
| 946 | const courseProducts = this.activeProducts('course') |
| 947 | if (!courseProducts.length) { return false } |
| 948 | // NOTE: Full licenses implicitly include all courses |
| 949 | if (_.any(courseProducts, p => (p.productOptions?.includedCourseIDs == null))) { return true } |
| 950 | const union = (res, prepaid) => _.union(res, prepaid.productOptions?.includedCourseIDs != null ? prepaid.productOptions?.includedCourseIDs : []) |
| 951 | const includedCourseIDs = _.reduce(courseProducts, union, []) |
| 952 | const courseID = course.id || course |
| 953 | return includedCourseIDs.includes(courseID) |
| 954 | } |
| 955 | |
| 956 | findCourseProduct (prepaidId) { |
| 957 | return _.find(this.activeProducts('course'), p => (p.prepaid + '') === (prepaidId + '')) |
no test coverage detected