You've already forked isop-mirror
feat: add function for getting possible new internship statuses based on current one
This commit is contained in:
@@ -33,3 +33,20 @@ export function prettyInternshipStatus(status: InternshipStatus) {
|
|||||||
throw new Error("Unknown status");
|
throw new Error("Unknown status");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function possibleNextStates(status: InternshipStatus) {
|
||||||
|
switch (status) {
|
||||||
|
case InternshipStatus.SUBMITTED:
|
||||||
|
return [InternshipStatus.CONFIRMED, InternshipStatus.DENIED];
|
||||||
|
case InternshipStatus.CONFIRMED:
|
||||||
|
return [InternshipStatus.SUBMITTED, InternshipStatus.DENIED, InternshipStatus.DEFENDED, InternshipStatus.NOT_DEFENDED];
|
||||||
|
case InternshipStatus.DENIED:
|
||||||
|
return [InternshipStatus.SUBMITTED, InternshipStatus.CONFIRMED];
|
||||||
|
case InternshipStatus.DEFENDED:
|
||||||
|
return [];
|
||||||
|
case InternshipStatus.NOT_DEFENDED:
|
||||||
|
return [];
|
||||||
|
default:
|
||||||
|
throw new Error("Unknown status");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user