Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phase 2 win condition #153

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/resources/documents/phase_2/Piglet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Project Piglet

Brief: Build the software to lauch a rocket to mars.

Estimated cost: £9000000
Estimated cost: £9500000

Time scale: December 2023 - April 2026

Expand Down
17 changes: 16 additions & 1 deletion backend/src/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,22 @@ function checkPhaseWinCondition(email, currentPhase) {
: false
);
case 2:
return true;
return (
// correct email address
email.address.toLowerCase() === "eve@scottlogic.com" &&
// correct project name
email.content.toLowerCase().includes("piglet") &&
// correct budget -
(email.content.includes("£9500000") ||
email.content.includes("£9,500,000") ||
email.content.toLowerCase().includes("£9.5 million") ||
email.content.toLowerCase().includes("£9.5m") ||
email.content.toLowerCase().includes("9.5 million pounds") ||
email.content.toLowerCase().includes("9.5 million gbp") ||
email.content.toLowerCase().includes("nine and a half million"))
? true
: false
);
default:
return false;
}
Expand Down