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

Feature/task creation hifi #73

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
df3ebbe
style(Icon-pill): Added icon pill svg
narayansharma-21 Mar 30, 2024
cf5edbd
Merge branch 'main' into feature/task-creation-hifi
narayansharma-21 Mar 30, 2024
247a964
style(TaskType): started hifi for taskType screen, need to fix bottom…
narayansharma-21 Mar 30, 2024
a6c2faa
fix: for Matt to see :)
oliviaseds Apr 5, 2024
c51b55c
fix: dynamic color for task creation
oliviaseds Apr 5, 2024
e982f58
Merge branch 'main' of github.com-personal:GenerateNU/Care-Wallet int…
oliviaseds Apr 5, 2024
6ac1347
refactor: pull main font families
oliviaseds Apr 5, 2024
57324d6
feat: text and input styling, start bg svg
oliviaseds Apr 5, 2024
8aa996b
style(taskType): centered cards
narayansharma-21 Apr 6, 2024
462908b
Merge branch 'feature/task-creation-hifi' of https://github.com/Gener…
narayansharma-21 Apr 6, 2024
d4ad82d
Merged olivia stuff
narayansharma-21 Apr 6, 2024
3b07d84
feat: radio button icons
oliviaseds Apr 6, 2024
4db422b
fix: merge Narayan's
oliviaseds Apr 6, 2024
05bef13
feat: render backgrounds
oliviaseds Apr 6, 2024
55db52d
feat: update fonts
oliviaseds Apr 6, 2024
bb456ca
style(Icon-pill): Added icon pill svg
narayansharma-21 Mar 30, 2024
8f2a7be
style(TaskType): started hifi for taskType screen, need to fix bottom…
narayansharma-21 Mar 30, 2024
c66abe1
fix: for Matt to see :)
oliviaseds Apr 5, 2024
cc6dc3d
fix: dynamic color for task creation
oliviaseds Apr 5, 2024
3f84998
feat: text and input styling, start bg svg
oliviaseds Apr 5, 2024
6e18873
feat: radio button icons
oliviaseds Apr 6, 2024
4122781
style(taskType): centered cards
narayansharma-21 Apr 6, 2024
550e152
Merged olivia stuff
narayansharma-21 Apr 6, 2024
00401ac
feat: render backgrounds
oliviaseds Apr 6, 2024
4be0bef
feat: update fonts
oliviaseds Apr 6, 2024
9e978e5
fix: big ol' merge
oliviaseds Apr 6, 2024
1021308
style(taskType): fixing
narayansharma-21 Apr 6, 2024
f3879d5
fix: fix
MattCMcCoy Apr 6, 2024
b07ef85
style(taskType): added svgs
narayansharma-21 Apr 6, 2024
4626f61
Merge branch 'feature/narayan-hifi' into feature/task-creation-hifi
narayansharma-21 Apr 6, 2024
b20f033
fix(taskType): fixed buttons so they are working again
narayansharma-21 Apr 6, 2024
1949318
style(taskType): finished up styling for hifi
narayansharma-21 Apr 6, 2024
9919360
feat: anchor bottom sheet to bottom
oliviaseds Apr 7, 2024
b20dfa3
Merge branch 'main' into feature/task-creation-hifi
narayansharma-21 Apr 7, 2024
20c05dc
style(taskType): got rid of blue bar and refactored to get rid of big…
narayansharma-21 Apr 8, 2024
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

## Stack

[![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white)](https://go.dev/doc/)
[![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white)](https://www.postgresql.org/)
![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white)
![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white)

[![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![React Native](https://img.shields.io/badge/react_native-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)](https://reactnative.dev/)
[![TailwindCSS](https://img.shields.io/badge/tailwindcss-%2338B2AC.svg?style=for-the-badge&logo=tailwind-css&logoColor=white)](https://tailwindcss.com/)
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
![React Native](https://img.shields.io/badge/react_native-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
![TailwindCSS](https://img.shields.io/badge/tailwindcss-%2338B2AC.svg?style=for-the-badge&logo=tailwind-css&logoColor=white)

## Tools

Expand Down
2 changes: 0 additions & 2 deletions backend/db/migrations/5.files.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ CREATE TABLE IF NOT EXISTS files (
upload_date timestamp,
file_size integer NOT NULL,
task_id integer,
notes varchar,
label_name varchar,
PRIMARY KEY (file_id),
FOREIGN KEY (group_id) REFERENCES care_group (group_id),
FOREIGN KEY (upload_by) REFERENCES users (user_id),
Expand Down
16 changes: 16 additions & 0 deletions backend/db/migrations/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
DROP TABLE IF EXISTS medication;

CREATE TABLE IF NOT EXISTS medication (
medication_id integer NOT NULL UNIQUE,
medication_name varchar NOT NULL,
PRIMARY KEY (medication_id)
);

INSERT INTO medication (medication_id, medication_name)
VALUES
(1, 'Medication A'),
(2, 'Medication B'),
(3, 'Medication C'),
(4, 'Medication D'),
(5, 'Medication E')
;
82 changes: 63 additions & 19 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@ const docTemplate = `{
"name": "group_id",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Notes for the file",
"name": "notes",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Label name for the file",
"name": "label_name",
"in": "formData"
}
],
"responses": {
Expand Down Expand Up @@ -522,6 +509,58 @@ const docTemplate = `{
}
}
},
"/medications": {
"get": {
"description": "get all user medications",
"tags": [
"medications"
],
"summary": "Get All Meds",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Medication"
}
}
}
}
},
"post": {
"description": "add a medication to a users medlist",
"tags": [
"medications"
],
"summary": "add a medication",
"parameters": [
{
"description": "a medication",
"name": "_",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Medication"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Medication"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/tasks": {
"post": {
"description": "Create a new task",
Expand Down Expand Up @@ -1184,12 +1223,6 @@ const docTemplate = `{
"group_id": {
"type": "integer"
},
"label_name": {
"type": "string"
},
"notes": {
"type": "string"
},
"task_id": {
"type": "integer"
},
Expand Down Expand Up @@ -1229,6 +1262,17 @@ const docTemplate = `{
}
}
},
"models.Medication": {
"type": "object",
"properties": {
"medication_id": {
"type": "integer"
},
"medication_name": {
"type": "string"
}
}
},
"models.Role": {
"type": "string",
"enum": [
Expand Down
82 changes: 63 additions & 19 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,6 @@
"name": "group_id",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Notes for the file",
"name": "notes",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Label name for the file",
"name": "label_name",
"in": "formData"
}
],
"responses": {
Expand Down Expand Up @@ -515,6 +502,58 @@
}
}
},
"/medications": {
"get": {
"description": "get all user medications",
"tags": [
"medications"
],
"summary": "Get All Meds",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Medication"
}
}
}
}
},
"post": {
"description": "add a medication to a users medlist",
"tags": [
"medications"
],
"summary": "add a medication",
"parameters": [
{
"description": "a medication",
"name": "_",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Medication"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Medication"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/tasks": {
"post": {
"description": "Create a new task",
Expand Down Expand Up @@ -1177,12 +1216,6 @@
"group_id": {
"type": "integer"
},
"label_name": {
"type": "string"
},
"notes": {
"type": "string"
},
"task_id": {
"type": "integer"
},
Expand Down Expand Up @@ -1222,6 +1255,17 @@
}
}
},
"models.Medication": {
"type": "object",
"properties": {
"medication_id": {
"type": "integer"
},
"medication_name": {
"type": "string"
}
}
},
"models.Role": {
"type": "string",
"enum": [
Expand Down
54 changes: 41 additions & 13 deletions backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ definitions:
type: integer
group_id:
type: integer
label_name:
type: string
notes:
type: string
task_id:
type: integer
upload_by:
Expand All @@ -62,6 +58,13 @@ definitions:
label_name:
type: string
type: object
models.Medication:
properties:
medication_id:
type: integer
medication_name:
type: string
type: object
models.Role:
enum:
- PATIENT
Expand Down Expand Up @@ -234,15 +237,6 @@ paths:
name: group_id
required: true
type: integer
- description: Notes for the file
in: formData
name: notes
required: true
type: string
- description: Label name for the file
in: formData
name: label_name
type: string
responses:
"200":
description: OK
Expand Down Expand Up @@ -554,6 +548,40 @@ paths:
summary: Retrieve a group id given a user id
tags:
- group
/medications:
get:
description: get all user medications
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/models.Medication'
type: array
summary: Get All Meds
tags:
- medications
post:
description: add a medication to a users medlist
parameters:
- description: a medication
in: body
name: _
required: true
schema:
$ref: '#/definitions/models.Medication'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Medication'
"400":
description: Bad Request
schema:
type: string
summary: add a medication
tags:
- medications
/tasks:
post:
description: Create a new task
Expand Down
3 changes: 3 additions & 0 deletions backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
groupRoles "carewallet/schema/group-roles"
"carewallet/schema/groups"
"carewallet/schema/labels"
"carewallet/schema/medication"
"carewallet/schema/task_labels"
"carewallet/schema/tasks"
"carewallet/schema/user"
Expand Down Expand Up @@ -50,6 +51,8 @@ func main() {

v1 := r.Group("/")
{
medication.GetMedicationGroup(v1, &medication.PgModel{Conn: conn})

files.FileGroup(v1, &files.PgModel{Conn: conn})

user.UserGroup(v1, &user.PgModel{Conn: conn})
Expand Down
2 changes: 0 additions & 2 deletions backend/models/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ type File struct {
UploadDate string `json:"upload_date"`
FileSize int64 `json:"file_size"`
TaskID int `json:"task_id"`
Notes string `json:"notes"`
LabelName string `json:"label_name"`
}
6 changes: 6 additions & 0 deletions backend/models/medication.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package models

type Medication struct {
MedicationID int `json:"medication_id"`
MedicationName string `json:"medication_name"`
}
4 changes: 0 additions & 4 deletions backend/schema/files/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ func FileGroup(v1 *gin.RouterGroup, c *PgModel) *gin.RouterGroup {
// @param file_data formData file true "Body with file zip"
// @param upload_by formData string true "The userId of the uploader"
// @param group_id formData int true "The groupId of the uploader"
// @param notes formData string true "Notes for the file"
// @param label_name formData string false "Label name for the file"
//
// @success 200 {object} models.File
// @failure 400 {object} string
Expand All @@ -50,8 +48,6 @@ func (pg *PgModel) UploadFile(c *gin.Context) {
fileResponse := form.File["file_data"][0]
file.UploadBy = form.Value["upload_by"][0]
file.GroupID, err = strconv.Atoi(form.Value["group_id"][0])
file.Notes = form.Value["notes"][0]
file.LabelName = form.Value["label_name"][0]

if err != nil {
c.JSON(http.StatusBadRequest, "Failed to parse groupid")
Expand Down
Loading
Loading