Skip to content

Commit

Permalink
Merge pull request #946 from OneCommunityGlobal/Shereen_Purchase_Equi…
Browse files Browse the repository at this point in the history
…pment

Shereen purchase equipment
  • Loading branch information
one-community authored Jun 28, 2024
2 parents 7e23df9 + 8cf6787 commit ffda0b9
Show file tree
Hide file tree
Showing 92 changed files with 1,534 additions and 4,809 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: 0 additions & 20 deletions requirements/badgeController/deleteBadge.md

This file was deleted.

19 changes: 0 additions & 19 deletions requirements/badgeController/putBadge.md

This file was deleted.

11 changes: 0 additions & 11 deletions requirements/mouseoverTextController/createMouseoverText.md

This file was deleted.

11 changes: 0 additions & 11 deletions requirements/mouseoverTextController/getMouseoverText.md

This file was deleted.

12 changes: 0 additions & 12 deletions requirements/mouseoverTextController/updateMouseoverText.md

This file was deleted.

18 changes: 0 additions & 18 deletions requirements/rolePresetsController/createNewPresets.md

This file was deleted.

17 changes: 0 additions & 17 deletions requirements/rolePresetsController/deletePresetById.md

This file was deleted.

15 changes: 0 additions & 15 deletions requirements/rolePresetsController/getPresetsByRole.md

This file was deleted.

17 changes: 0 additions & 17 deletions requirements/rolePresetsController/updatePresetById.md

This file was deleted.

18 changes: 0 additions & 18 deletions requirements/userProfileController/deleteWBS.md

This file was deleted.

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

# Get User Profiles

> ## Positive case
1. ✅ Receives a GET request in the **/api/userProfile** route
2. ✅ Returns 200 if there are no users in the database and the allusers key exists in NodeCache.
3. ✅ Returns 200 if there are users in the database

> ## Negative case
1. ✅ Returns error 404 if the API does not exist
2. ✅ Returns 400 if the user doesn't have
getUserProfiles permission
3. ✅ Returns 500 if there are no users in the database and the allusers key doesn't exist in NodeCache
4. ✅ Returns 404 if any error occurs while getting all user profiles

> ## Edge case
16 changes: 0 additions & 16 deletions requirements/userProfileController/getWBS.md

This file was deleted.

16 changes: 0 additions & 16 deletions requirements/userProfileController/getWBSByUserId.md

This file was deleted.

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

# Post User Profile

> ## Positive case
1. ✅ Receives a POST request in the **/api/userProfile** route
2. ✅ check if user has permissions for **postUserProfile**
3. ✅ check if user has permissions for **addDeleteEditOwners** or if the user role is **owner**
4. ✅ verify if the email address is already in use
5. ✅ check if environment is not dev environment **hgnData_dev**
6. ✅ check if firstname and lastname exist
7. ✅ Save user profile
8. ✅ Returns **200**, with the id of userProfile created

> ## Negative case
1. ✅ Returns error 404 if the API does not exist
2. ✅ Returns error 403 if the user doesn't have permissions for **postUserProfile**
3. ✅ Returns error 403 if the user doesn't have permissions for **addDeleteEditOwners** and if the user role is an **owner**
4. ✅ Returns error 400 if the email address is already in use
5. ✅ Returns error 400 if in dev environment, the role is owner or administrator and the actual email or password are incorrect
6. ✅ Returns 400 if the firstname and lastname already exist and if no duplicate name is allowed
7. ✅ Returns error 501 if there is an error when trying to create the userProfile

> ## Edge case
1. ❌ Returns 400 if email is invalid
2. ❌ Returns 400 if password is invalid
3. ❌ Returns 400 if teamcode is invalid
16 changes: 0 additions & 16 deletions requirements/wbsController/getAllWBS.md

This file was deleted.

18 changes: 0 additions & 18 deletions requirements/wbsController/postWBS.md

This file was deleted.

17 changes: 6 additions & 11 deletions src/constants/eventTypes.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/**
* 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',
// };
const eventtypes = {
ActionCreated: 'Action Created',
ActionEdited: 'Action Edited',
ActionDeleted: 'Action Deleted',
};

// module.exports = eventtypes;
module.exports = eventtypes;
25 changes: 10 additions & 15 deletions src/constants/message.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
const URL_TO_BLUE_SQUARE_PAGE =
export 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.
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
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
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 ffda0b9

Please sign in to comment.