Skip to content

Instantly share code, notes, and snippets.

@svngoku
Created December 3, 2019 16:34
Show Gist options
  • Save svngoku/d56aa215aa4f8e0ed41628aae38cefd7 to your computer and use it in GitHub Desktop.
Save svngoku/d56aa215aa4f8e0ed41628aae38cefd7 to your computer and use it in GitHub Desktop.
workflow
const choice = ['Aléatoire','Permanent','Quotidien','Inconnue'];
const priority = ['Urgent', 'Modéré', "Demande dinformation"];
const status = ['A TRAITER', 'EN COURS', 'COMPLEMENT INFOS', 'A REPRENDRE', 'CLOS'];
let actualStatusState = [];
let demande = prompt('Status: ');
function Workflow() {
if(demande === 'A TRAITER') {
console.log('Statut: ', demande);
status.forEach((s) => {
if(s !== demande && s !== "A REPRENDRE") {
actualStatusState.push(s)
}
})
} else if(demande === "EN COURS") {
console.log('Statut: ', demande);
status.forEach((s) => {
if(s !== demande && (s !== "A TRAITER" && s!== "COMPLEMENT INFOS")) {
actualStatusState.push(s);
}
})
} else if(demande === "COMPLEMENT INFOS") {
console.log('Statut: ', demande);
status.forEach((s) => {
if(s !== demande && s !== "A TRAITER" && s !== "A REPRENDRE" ) {
console.log(s);
}
})
} else if(demande === "A REPRENDRE") {
console.log('Statut: ', demande);
status.forEach((s) => {
if(s !== demande && s !== "A TRAITER") {
actualStatusState.push(s);
}
})
} else {
console.log('Statut: ', demande);
status.forEach((s) => {
if(s !== demande) {
actualStatusState.push(s);
}
});
}
return actualStatusState;
}
Workflow();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment