apc-unb / apc-api

MIT License
4 stars 0 forks source link

Resend Project #44

Closed VerasThiago closed 4 years ago

VerasThiago commented 4 years ago

Based on #21

Project work flow:

1. Check if user have already submitted a file to that current project.

POST localhost:8080/project/check
{
    "StudentID": "5db31b89241de02e187c63fa",
    "ProjectTypeID": "5db31b89241de02e187c6400"
}

1.1 This request will return STATUS 200 OK if the project have a previous submission

{
    "filename": "160146682.zip",
    "monitorEmail": "email.do.monitor@gmail.com",
    "monitorName": "Monitor Monitorado",
    "monitorid": "5db31b89241de02e187c63fd",
    "projectid": "5db31b8a241de02e187c6403",
    "status": "Created",
    "updatedat": "0000-12-31T21:00:00-03:00"
}

1.2 This request will return STATUS 404 Not Found if the project don't have a previous submission

{
    "error": "Project not found"
}

2. According to the first step, the front need to alert the user that have already a submission to that project type and ask if he wants to overwrite the current submission (show submission info and handle the project status if needed)

2.1 In case that don't have a submission to that file

POST localhost:8080/project
{
    "studentid"     :   ObjectID,
    "projecttypeid" :   ObjectID,
    "classid"       :   ObjectId,
    "filename"      :   String
}

2.2 In case that have a submission to that file

PUT localhost:8080/project
"id": ObjectID,
"filename": String

PS: The PUT localhost:8080/project request change the Status to Updated

Gguidini commented 4 years ago

I like the workflow, it's a good ideal. I just want to clarify one thing:

Updated projects are delivered to the same monitor that received the submission of the original project?

VerasThiago commented 4 years ago

I like the workflow, it's a good ideal. I just want to clarify one thing:

Updated projects are delivered to the same monitor that received the submission of the original project?

Yes and you got the monitor info in the POST localhost:8080/project/check request, so you can email the user project to the same monitor.