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

Method status

app/models/Prepaid.js:55–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 }
54
55 status () {
56 const endDate = this.get('endDate')
57 if (endDate && (new Date(endDate) < new Date())) {
58 return 'expired'
59 }
60
61 const startDate = this.get('startDate')
62 if (startDate && (new Date(startDate) > new Date())) {
63 return 'pending'
64 }
65
66 if (this.openSpots() <= 0) {
67 return 'empty'
68 }
69
70 return 'available'
71 }
72
73 typeDescription () {
74 const type = this.get('type')

Callers 13

setupJavascript404sFunction · 0.80
server_setup.jsFile · 0.80
setupProxyMiddlewareFunction · 0.80
assignCourseMethod · 0.80
onLoadedMethod · 0.80
redeemUsersMethod · 0.80
updatePrepaidGroupsMethod · 0.80
onLoadedMethod · 0.80
redeemUsersMethod · 0.80
gotPrepaidsMethod · 0.80
onLoadedMethod · 0.80

Calls 2

openSpotsMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected