(price, subCount, personalSub)
| 847 | } |
| 848 | |
| 849 | const getSponsoredSubsAmount = function (price, subCount, personalSub) { |
| 850 | // 1 100% |
| 851 | // 2-11 80% |
| 852 | // 12+ 60% |
| 853 | // TODO: make this less confusing |
| 854 | if (price == null) { price = 999 } |
| 855 | if (subCount == null) { subCount = 0 } |
| 856 | if (personalSub == null) { personalSub = false } |
| 857 | if (!(subCount > 0)) { return 0 } |
| 858 | const offset = personalSub ? 1 : 0 |
| 859 | if (subCount <= (1 - offset)) { |
| 860 | return price |
| 861 | } else if (subCount <= (11 - offset)) { |
| 862 | return Math.round(((1 - offset) * price) + (((subCount - 1) + offset) * price * 0.8)) |
| 863 | } else { |
| 864 | return Math.round(((1 - offset) * price) + (10 * price * 0.8) + (((subCount - 11) + offset) * price * 0.6)) |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | const getCourseBundlePrice = function (coursePrices, seats) { |
| 869 | let pricePerSeat |
nothing calls this directly
no outgoing calls
no test coverage detected