Skip to content

Commit

Permalink
Feature/connect-all-task-fe (#59)
Browse files Browse the repository at this point in the history
* feat(SingleTask.tsx): Added route functionality

* feat(SingleTask.tsx): Implemented entirety of v4 of lofi with additional logic

* style(Task.tsx): Updated svgs and got rid of TaskInfo type

* test: fix backend go tests for tasks

* feat(navigation-between-calendar-and-task-list-screen): navigation between calendar and task list screen

* fix: some fixes towards calendar task list connection

* refactor: move label call into render method for tasks

* feat: task connenction and group role user routes

* fix: fix delete test to actually utilize db connection

* test: user tests

* fix: separate assigned from task by task id

* fix: general fixes to code and remove refetch interval bc ngrok limits to 120 rpm

---------
Co-authored-by: narayansharma-21 <[email protected]>
Co-authored-by: oliviaseds <[email protected]>
Co-authored-by: wyattchris <[email protected]>
Co-authored-by: Chris <[email protected]>
  • Loading branch information
MattCMcCoy authored Mar 25, 2024
1 parent dd9547c commit e1a3312
Show file tree
Hide file tree
Showing 43 changed files with 1,349 additions and 158 deletions.
1 change: 1 addition & 0 deletions backend/db/migrations/1.user.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ VALUES
('8Sy7xBkGiGQv4ZKphcQfY8PxAqw1', 'Narayan', 'Sharma', '[email protected]', '', ''),
('iL7PnjS4axQffmlPceobjUUZ9DF2', 'Caitlin', 'Flynn', '[email protected]', '', ''),
('5JgN2PQxCRM9VoCiiFPlQPNqkL32', 'Linwood', 'Blaisdell', '[email protected]', '', ''),
('P03ggWcw63N0RSY7ltbkeBoR6bd2', 'Chris', 'Wyatt', '[email protected]', '', ''),
('9rIMSUo6qNf8ToTABkCfNqnByRv1', 'Haley', 'Martin', '[email protected]', '', '')

-- End Care-Wallet Team
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrations/2.group.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ VALUES
(5, 'onrQs8HVGBVMPNz4Fk1uE94bSxg1', 'SECONDARY'),
(5, '8Sy7xBkGiGQv4ZKphcQfY8PxAqw1', 'SECONDARY'),
(5, 'iL7PnjS4axQffmlPceobjUUZ9DF2', 'SECONDARY'),
(5, 'P03ggWcw63N0RSY7ltbkeBoR6bd2', 'SECONDARY'),
(5, '9rIMSUo6qNf8ToTABkCfNqnByRv1', 'SECONDARY')

-- End Care-Wallet Team
;
5 changes: 4 additions & 1 deletion backend/db/migrations/3.task.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ VALUES
('task 2', 2, 'user3', '2024-02-20 23:59:59', '2024-02-10 14:30:00', NULL, 'Schedule doctor appointment', 'INCOMPLETE', 'other', FALSE),
('task 3', 3, 'user4', '2020-02-05 11:00:00', NULL, '2024-02-20 23:59:59', 'Submit insurance claim', 'PARTIAL', 'financial', FALSE),
('task 4', 4, 'user1', '2006-01-02 15:04:05', NULL, NULL, 'Refill water pitcher', 'COMPLETE', 'other', TRUE),
('task 1 - NO LABEL', 1, 'user2', '2024-02-03 10:45:00', '2024-02-05 10:00:00', '2024-02-05 11:00:00', 'Pick up medication from pharmacy', 'INCOMPLETE', 'med_mgmt', FALSE),
('task 5', 5, 'user1', '2024-03-19 11:00:00', '2024-03-19 15:00:00', '2024-03-19 19:00:00', 'Get medications', 'INCOMPLETE', 'dr_appt', TRUE),
('task 6', 5, 'user2', '2024-03-19 11:00:00', '2024-03-19 11:00:00', '2024-03-19 13:00:00', 'File Papers', 'INCOMPLETE', 'med_mgmt', TRUE),
('task 7', 5, 'user3', '2024-03-19 11:00:00', '2024-03-19 07:00:00', '2024-03-19 09:00:00', 'Send check to Drs', 'INCOMPLETE', 'financial', TRUE),
('task 8', 5, 'user1', '2024-03-19 11:00:00', '2024-03-19 15:00:00', '2024-03-19 19:00:00', 'Get medications', 'INCOMPLETE', 'dr_appt', FALSE),
('task 9', 5, 'user2', '2024-03-19 11:00:00', '2024-03-19 11:00:00', '2024-03-19 13:00:00', 'File Papers', 'INCOMPLETE', 'med_mgmt', FALSE),
('task 10', 5, 'user3', '2024-03-19 11:00:00', '2024-03-19 07:00:00', '2024-03-19 09:00:00', 'Send check to Drs', 'INCOMPLETE', 'financial', FALSE)
('task 10', 5, 'user3', '2024-03-19 11:00:00', '2024-03-19 07:00:00', '2024-03-19 09:00:00', 'Send check to Drs', 'INCOMPLETE', 'financial', FALSE),
('test tile', 5, 'P03ggWcw63N0RSY7ltbkeBoR6bd2', '2020-02-05 11:00:00', NULL, '2024-02-20 23:59:59', 'Submit insurance claim', 'PARTIAL', 'financial', FALSE),
('test tile', 5, 'P03ggWcw63N0RSY7ltbkeBoR6bd2', '2024-02-20 23:59:59', '2024-02-10 14:30:00', NULL, 'Schedule doctor appointment', 'INCOMPLETE', 'med_mgmt', FALSE)
;

INSERT INTO task_assignees (task_id, user_id, assignment_status, assigned_by, assigned_date)
Expand Down
8 changes: 6 additions & 2 deletions backend/db/migrations/4.label.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ VALUES
(2, 'Appointments', 'green'),
(3, 'Financial', 'orange'),
(4, 'Household', 'purple'),
(1, 'Household', 'purple')
(1, 'Household', 'purple'),
(5, 'Financial', 'orange'),
(5, 'Appointments', 'green')
;

INSERT INTO task_labels (task_id, group_id, label_name)
VALUES
(1, 1, 'Medication'),
(2, 2, 'Appointments'),
(3, 3, 'Financial'),
(4, 4, 'Household')
(4, 4, 'Household'),
(6, 5, 'Financial'),
(7, 5, 'Appointments')
;
129 changes: 129 additions & 0 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,135 @@ const docTemplate = `{
}
}
},
"/group/{groupId}/{uid}": {
"delete": {
"description": "removes a user from a group given a group id and user id",
"tags": [
"group"
],
"summary": "Remove a user from a group",
"parameters": [
{
"type": "string",
"description": "groupId",
"name": "groupId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "userId",
"name": "uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GroupRole"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/group/{groupId}/{uid}/{role}": {
"put": {
"description": "add a user to a group given a user id and group id and role",
"tags": [
"group"
],
"summary": "Add a user to a group",
"parameters": [
{
"type": "string",
"description": "groupId",
"name": "groupId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "userId",
"name": "uid",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Group\tRole",
"name": "role",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GroupRole"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
},
"patch": {
"description": "Change a user group role based off of group id and user id and role",
"tags": [
"group"
],
"summary": "Change a user group role",
"parameters": [
{
"type": "string",
"description": "groupId",
"name": "groupId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "userId",
"name": "uid",
"in": "path",
"required": true
},
{
"type": "string",
"description": "New User Group Role",
"name": "role",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/medications": {
"get": {
"description": "get all user medications",
Expand Down
129 changes: 129 additions & 0 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,135 @@
}
}
},
"/group/{groupId}/{uid}": {
"delete": {
"description": "removes a user from a group given a group id and user id",
"tags": [
"group"
],
"summary": "Remove a user from a group",
"parameters": [
{
"type": "string",
"description": "groupId",
"name": "groupId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "userId",
"name": "uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GroupRole"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/group/{groupId}/{uid}/{role}": {
"put": {
"description": "add a user to a group given a user id and group id and role",
"tags": [
"group"
],
"summary": "Add a user to a group",
"parameters": [
{
"type": "string",
"description": "groupId",
"name": "groupId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "userId",
"name": "uid",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Group\tRole",
"name": "role",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GroupRole"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
},
"patch": {
"description": "Change a user group role based off of group id and user id and role",
"tags": [
"group"
],
"summary": "Change a user group role",
"parameters": [
{
"type": "string",
"description": "groupId",
"name": "groupId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "userId",
"name": "uid",
"in": "path",
"required": true
},
{
"type": "string",
"description": "New User Group Role",
"name": "role",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/medications": {
"get": {
"description": "get all user medications",
Expand Down
Loading

0 comments on commit e1a3312

Please sign in to comment.