Add data vis certification

This commit is contained in:
Berkeley Martinez
2016-01-11 15:58:37 -08:00
parent f8e06fb2bc
commit a7f04cdc11
8 changed files with 120 additions and 80 deletions

View File

@ -8,7 +8,13 @@ const debug = debugFactory('freecc:utils/commit');
export { commitGoals };
export function completeCommitment$(user) {
const { isFrontEndCert, isFullStackCert } = user;
const {
isFrontEndCert,
isDataVisCert,
isBackEndCert,
isFullStackCert
} = user;
return Observable.fromNodeCallback(user.pledge, user)()
.flatMap(pledge => {
if (!pledge) {
@ -18,8 +24,10 @@ export function completeCommitment$(user) {
const { goal } = pledge;
if (
isFrontEndCert && goal === commitGoals.frontEndCert ||
isFullStackCert && goal === commitGoals.fullStackCert
(isFrontEndCert && goal === commitGoals.frontEndCert) ||
(isDataVisCert && goal === commitGoals.dataVisCert) ||
(isBackEndCert && goal === commitGoals.backEndCert) ||
(isFullStackCert && goal === commitGoals.fullStackCert)
) {
debug('marking goal complete');
pledge.isCompleted = true;