Skip to content

Commit

Permalink
Merge pull request #1008 from OneCommunityGlobal/revert-946-Shereen_P…
Browse files Browse the repository at this point in the history
…urchase_Equipment

Revert "Shereen purchase equipment"
  • Loading branch information
one-community authored Jun 29, 2024
2 parents ffda0b9 + b60e77f commit a2d126e
Show file tree
Hide file tree
Showing 92 changed files with 4,809 additions and 1,534 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions requirements/badgeController/deleteBadge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Check mark: ✅
Cross Mark: ❌

# Post Badge

> ## Positive case
1. ❌ Receives a POST request in the **/api/userProfile** route
2. ✅ Returns 200 if the badge is successfully removed and all instances of the badge are removed from user profiles.
3. ✅ Clears cache if cache exists.

> ## Negative case
1. ❌ Returns error 404 if the API does not exist
2. ✅ Returns 403 if the user does not have permission to delete badges
3. ✅ Returns 400 if an no badge is found
4. ✅ Returns 500 if the removeBadgeFromProfile fails.
5. ✅ Returns 500 if the remove method fails.

> ## Edge case
19 changes: 19 additions & 0 deletions requirements/badgeController/putBadge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Check mark: ✅
Cross Mark: ❌

# Post Badge

> ## Positive case
1. ❌ Receives a POST request in the **/api/userProfile** route
2. ✅ Returns 200 if all is successful
3. ✅ Removes `allBadges` from cache if all is successful and the cache is not empty

> ## Negative case
1. ❌ Returns error 404 if the API does not exist
2. ✅ Returns 403 if the user is not authorized
3. ✅ Returns 400 if an error occurs in `findById`
4. ✅ Returns 400 if no badge is found

> ## Edge case
11 changes: 11 additions & 0 deletions requirements/mouseoverTextController/createMouseoverText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Check mark: ✅
Cross Mark: ❌

# createMouseoverText

> ## Positive case
1. ✅ Return 201 if create new mouseoverText successfully.

> ## Negative case
1. ✅ Returns error 500 if any error when saving the new mouseoverText
> ## Edge case
11 changes: 11 additions & 0 deletions requirements/mouseoverTextController/getMouseoverText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Check mark: ✅
Cross Mark: ❌

# getMouseoverText

> ## Positive case
1. ✅ Return 200 if find mouseoverText successfully.

> ## Negative case
1. ✅ Returns error 404 if any error when finding the mouseoverText
> ## Edge case
12 changes: 12 additions & 0 deletions requirements/mouseoverTextController/updateMouseoverText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Check mark: ✅
Cross Mark: ❌

# updateMouseoverText

> ## Positive case
1. ✅ Return 201 if updating mouseoverText successfully.

> ## Negative case
1. ✅ Returns error 500 if any error when finding the mouseoverText by Id
2. ✅ Returns error 400 if any error when saving the mouseoverText
> ## Edge case
18 changes: 18 additions & 0 deletions requirements/rolePresetsController/createNewPresets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Check mark: ✅
Cross Mark: ❌

# createNewPreset

> ## Positive case
1. ✅ Receives a POST request in the **/api/rolePreset** route
2. ✅ Return 201 if create New Presets successfully.

> ## Negative case
1. ✅ Returns error 403 if user doesn't have permissions for putRole
2. ✅ Returns 400 if missing presetName
3. ✅ Returns 400 if missing roleName
4. ✅ Returns 400 if missing premissions
5. ✅ Returns error 400 when saving new presets

> ## Edge case
17 changes: 17 additions & 0 deletions requirements/rolePresetsController/deletePresetById.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Check mark: ✅
Cross Mark: ❌

# deletePresetById

> ## Positive case
1. ✅ Return 200 if removing preset by id successfully.

> ## Negative case
1. ✅ Returns error 403 if user doesn't have permissions for putRole
2. ✅ Returns 400 if error in finding by id
3. ✅ Returns 400 if the route doesn't exist
4. ✅ Returns 400 if any error when removing results

> ## Edge case
15 changes: 15 additions & 0 deletions requirements/rolePresetsController/getPresetsByRole.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Check mark: ✅
Cross Mark: ❌

# getPresetsByRole

> ## Positive case
1. ✅ Receives a GET request in the **/api/rolePreset** route
2. ✅ Return 200 if get Presets by roleName successfully.

> ## Negative case
1. ✅ Returns error 403 if user doesn't have permissions for putRole
2. ✅ Returns 400 when catching any error in finding roleName

> ## Edge case
17 changes: 17 additions & 0 deletions requirements/rolePresetsController/updatePresetById.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Check mark: ✅
Cross Mark: ❌

# updatePresetById

> ## Positive case
1. ✅ Return 200 if update preset by id successfully.

> ## Negative case
1. ✅ Returns error 403 if user doesn't have permissions for putRole
2. ✅ Returns 400 if the router doesn't exist
3. ✅ Returns 400 if error in finding by id
3. ✅ Returns 400 if any error when saving results

> ## Edge case
18 changes: 18 additions & 0 deletions requirements/userProfileController/deleteWBS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Check mark: ✅
Cross Mark: ❌

# Get User Profiles

> ## Positive case
1. ✅ Receives a GET request in the **/api/userProfile** route
2. ✅ Returns 200 if all is successful

> ## Negative case
1. ✅ Returns error 404 if the API does not exist
2. ✅ Returns 403 if the user does not have permission
3. ✅ Returns 400 if and error occurs when querying DB
4. ✅ returns 400 if an error occurs when removing the WBS

> ## Edge case
20 changes: 0 additions & 20 deletions requirements/userProfileController/getUserProfiles-usecase.md

This file was deleted.

16 changes: 16 additions & 0 deletions requirements/userProfileController/getWBS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Check mark: ✅
Cross Mark: ❌

# Get User Profiles

> ## Positive case
1. ✅ Receives a GET request in the **/api/userProfile** route
2. ✅ Returns 200 if all is successful

> ## Negative case
1. ✅ Returns error 404 if the API does not exist
2. ✅ Returns 500 if any errors occur when finding all WBS

> ## Edge case
16 changes: 16 additions & 0 deletions requirements/userProfileController/getWBSByUserId.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Check mark: ✅
Cross Mark: ❌

# Get User Profiles

> ## Positive case
1. ✅ Receives a GET request in the **/api/userProfile** route
2. ✅ Returns 200 if all is successful

> ## Negative case
1. ✅ Returns error 404 if the API does not exist
2. ✅ Returns 404 if an error occurs in the aggregation query

> ## Edge case
31 changes: 0 additions & 31 deletions requirements/userProfileController/postUserProfile-usecase.md

This file was deleted.

16 changes: 16 additions & 0 deletions requirements/wbsController/getAllWBS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Check mark: ✅
Cross Mark: ❌

# Get User Profiles

> ## Positive case
1. ✅ Receives a GET request in the **/api/userProfile** route
2. ✅ Returns 200 if all is successful

> ## Negative case
1. ✅ Returns error 404 if the API does not exist
2. ✅ Returns 404 if an error occurs when querying the database.

> ## Edge case
18 changes: 18 additions & 0 deletions requirements/wbsController/postWBS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Check mark: ✅
Cross Mark: ❌

# Get User Profiles

> ## Positive case
1. ✅ Receives a GET request in the **/api/userProfile** route
2. ✅ Returns 201 if all is successful

> ## Negative case
1. ✅ Returns error 404 if the API does not exist
2. ✅ Returns 403 if the user does not have permission
3. ✅ Returns 400 if `req.body` does not contain `wbsName` or `isActive`
4. ✅ returns 500 if an error occurs when saving

> ## Edge case
17 changes: 11 additions & 6 deletions src/constants/eventTypes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const eventtypes = {
ActionCreated: 'Action Created',
ActionEdited: 'Action Edited',
ActionDeleted: 'Action Deleted',
};
/**
* Unused legacy code. Commented out to avoid confusion.
* Commented by: Shengwei Peng
* Date: 2024-03-22
*/
// const eventtypes = {
// ActionCreated: 'Action Created',
// ActionEdited: 'Action Edited',
// ActionDeleted: 'Action Deleted',
// };

module.exports = eventtypes;
// module.exports = eventtypes;
25 changes: 15 additions & 10 deletions src/constants/message.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
export const URL_TO_BLUE_SQUARE_PAGE =
const URL_TO_BLUE_SQUARE_PAGE =
'https://www.onecommunityglobal.org/hands-off-administration-policy';

// Since the notification banner is blue background, added white color for hyperlink style.
export const NEW_USER_BLUE_SQUARE_NOTIFICATION_MESSAGE = `
<p> Welcome as one of our newest members to the One Community team and family!
Heads up we’ve removed a <a href=${URL_TO_BLUE_SQUARE_PAGE}>“blue square”</a> that
was issued due to not completing your hours and/or summary this past week. The reason we removed
this blue square is because you didn’t have the full week available to complete your volunteer
const NEW_USER_BLUE_SQUARE_NOTIFICATION_MESSAGE = `
<p> Welcome as one of our newest members to the One Community team and family!
Heads up we’ve removed a <a href=${URL_TO_BLUE_SQUARE_PAGE}>“blue square”</a> that
was issued due to not completing your hours and/or summary this past week. The reason we removed
this blue square is because you didn’t have the full week available to complete your volunteer
time with us. </p>
<p> If you’d like to learn more about this policy and/or blue squares, click here:
<a href=${URL_TO_BLUE_SQUARE_PAGE}> “Blue Square FAQ”</a>
<p> If you’d like to learn more about this policy and/or blue squares, click here:
<a href=${URL_TO_BLUE_SQUARE_PAGE}> “Blue Square FAQ”</a>
</p>
<p>Welcome again, we’re glad to have you joining us! </p>
<p>With Gratitude,</br>One Community </p>
`;

module.exports = {
NEW_USER_BLUE_SQUARE_NOTIFICATION_MESSAGE,
URL_TO_BLUE_SQUARE_PAGE,
};
Loading

0 comments on commit a2d126e

Please sign in to comment.