From b87137a3d7f99eb54916ba5e68bba88b08172c94 Mon Sep 17 00:00:00 2001 From: niteeshchaudhary <66108270+niteeshchaudhary@users.noreply.github.com> Date: Sat, 28 May 2022 20:02:27 +0530 Subject: [PATCH 01/21] Issue111 (#119) * issue resolved * issue resolved --- CDC_Backend/APIs/studentViews.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CDC_Backend/APIs/studentViews.py b/CDC_Backend/APIs/studentViews.py index daf4221..d3c3fe9 100644 --- a/CDC_Backend/APIs/studentViews.py +++ b/CDC_Backend/APIs/studentViews.py @@ -102,7 +102,7 @@ def deleteResume(request, id, email, user_type): destination_path = STORAGE_DESTINATION_RESUMES + id + "/" + str(file_name) if path.exists(destination_path): - remove(destination_path) + # remove(destination_path) student.resumes.remove(file_name) student.save() return Response({'action': "Delete Resume", 'message': "Resume Deleted"}, From 35dae1c507dbaab09df96c2f5dc1d06884186218 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 May 2022 20:09:08 +0530 Subject: [PATCH 02/21] Bump pyjwt from 2.3.0 to 2.4.0 (#113) Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/jpadilla/pyjwt/releases) - [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst) - [Commits](https://github.com/jpadilla/pyjwt/compare/2.3.0...2.4.0) --- updated-dependencies: - dependency-name: pyjwt dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gowtham Sai <66207607+gowtham3105@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4a81a07..6ca6f8a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,7 +29,7 @@ pyasn1-modules==0.2.8 pylint==2.13.5 python-dotenv==0.20.0 pytz==2022.1 -PyJWT==2.3.0 +PyJWT==2.4.0 requests==2.27.1 rsa==4.8 six==1.16.0 From 96496f22f722098b06433d7b6b2b7ebf481c530a Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 11:23:51 +0530 Subject: [PATCH 03/21] first commit --- CDC_Backend/README.md | 925 +++++++++++++++++++----------------------- 1 file changed, 419 insertions(+), 506 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index 30c06d8..e0b578f 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -1,22 +1,22 @@ # API References 1. [**Common APIs**](#common-apis) - 1. [**api/login/**](#apilogin) + 1. [**api/login/**](#apilogin) 2. [**Student APIs**](#student-portal-apis) - 1. [**api/student/profile/**](#apistudentprofile) - 2. [**api/student/getDashboard/**](#apistudentgetdashboard) - 3. [**api/student/addResume/**](#apistudentaddresume) - 4. [**api/student/deleteResume/**](#apistudentdeleteresume) - 5. [**api/student/submitApplication/**](#apistudentsubmitapplication) + 1. [**api/student/profile/**](#apistudentprofile) + 2. [**api/student/getDashboard/**](#apistudentgetdashboard) + 3. [**api/student/addResume/**](#apistudentaddresume) + 4. [**api/student/deleteResume/**](#apistudentdeleteresume) + 5. [**api/student/submitApplication/**](#apistudentsubmitapplication) 3. [**Admin APIs**](#admin-portal-apis) - 1. [**api/admin/markStatus/**](#apiadminmarkstatus) - 2. [**api/admin/getDashboard/**](#apiadmingetdashboard) - 3. [**api/admin/updateDeadline/**](#apiadminupdatedeadline) - 4. [**api/admin/updateOfferAccepted**](#apiadminupdateofferaccepted) - 5. [**api/admin/updateEmailVerified**](#apiadminupdateemailverified) - 6. [**api/admin/updateAdditionalInfo**](#apiadminupdateadditionalinfo) + 1. [**api/admin/markStatus/**](#apiadminmarkstatus) + 2. [**api/admin/getDashboard/**](#apiadmingetdashboard) + 3. [**api/admin/updateDeadline/**](#apiadminupdatedeadline) + 4. [**api/admin/updateOfferAccepted**](#apiadminupdateofferaccepted) + 5. [**api/admin/updateEmailVerified**](#apiadminupdateemailverified) + 6. [**api/admin/updateAdditionalInfo**](#apiadminupdateadditionalinfo) 4. [**Company APIs**](#company-portal-apis) - 1. [**api/company/addPlacement/**](#apicompanyaddplacement) + 1. [**api/company/addPlacement/**](#apicompanyaddplacement) 5. [**Common Errors**](#common-errors) --- @@ -47,17 +47,15 @@ Response is a Json with these fields { "action": "Login", "message": "Verified", - "user_type": [ - "student" - ] + "user_type": ["student"] } ``` - action: Tells us about the message creator
- message: Tells us what happened with our Request. - user_type: Tells us about the role the user possess. Can have these values - - student - - Admin + - student + - Admin ### Status Codes @@ -95,30 +93,30 @@ Response is a Json with these fields ```json { - "action": "Student Profile", - "message": "Details Found", - "details": { - "id": "190010036", - "resume_list": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/resume/190010036%2F8KIOT3PW1JIS718_CSE-V-SEM.pdf", - "name": "8KIOT3PW1JIS718_CSE-V-SEM.pdf" - } - ], - "offers": [ - { - "designation": "Software Developer", - "company_name": "Make My Trip", - "application_id": "LLW4STE76GEJYOR" - } - ], - "roll_no": 190010036, - "name": "Gowtham Sai", - "batch": "2019", - "branch": "CSE", - "phone_number": 9390291911, - "cpi": "9.15" - } + "action": "Student Profile", + "message": "Details Found", + "details": { + "id": "190010036", + "resume_list": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/resume/190010036%2F8KIOT3PW1JIS718_CSE-V-SEM.pdf", + "name": "8KIOT3PW1JIS718_CSE-V-SEM.pdf" + } + ], + "offers": [ + { + "designation": "Software Developer", + "company_name": "Make My Trip", + "application_id": "LLW4STE76GEJYOR" + } + ], + "roll_no": 190010036, + "name": "Gowtham Sai", + "batch": "2019", + "branch": "CSE", + "phone_number": 9390291911, + "cpi": "9.15" + } } ``` @@ -130,10 +128,10 @@ Response is a Json with these fields The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| --------------- | ------------------------ | -| 200 OK | `Details Found` | -| 400 BAD_REQUEST | `Something Went Wrong` | +| Status Codes | Possible Messages | +| --------------- | ---------------------- | +| 200 OK | `Details Found` | +| 400 BAD_REQUEST | `Something Went Wrong` | You may see some different errors which can be seen [here](#common-errors) @@ -164,199 +162,181 @@ Response is a Json with these fields ```json { - "action": "Get Dashboard - Student", - "message": "Data Found", - "placements": [ + "action": "Get Dashboard - Student", + "message": "Data Found", + "placements": [ + { + "id": "Q54IRZZMC3RP8F6", + "company_details_pdf_links": [ { - "id": "Q54IRZZMC3RP8F6", - "company_details_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FI5U4RDTV0OP0EM0_2019+Student+Details+-+Total%28State+Sort%29+-+Copy.pdf", - "name": "I5U4RDTV0OP0EM0_2019 Student Details - Total(State Sort) - Copy.pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FW04JWWNNMIBX0JX_2019+Student+Details+-+Total%28State+Sort%29.pdf", - "name": "W04JWWNNMIBX0JX_2019 Student Details - Total(State Sort).pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FT1BXP98WBT9BHOR_AP0313017732021LL-Driving+Licence+-+Copy.pdf", - "name": "T1BXP98WBT9BHOR_AP0313017732021LL-Driving Licence - Copy.pdf" - } - ], - "description_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FC78TE2Z67BPZ41O_CSE-V-SEM.pdf", - "name": "C78TE2Z67BPZ41O_CSE-V-SEM.pdf" - } - ], - "compensation_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2F8D5OFQ46H43DD3S_module5And6Attendance.pdf", - "name": "8D5OFQ46H43DD3S_module5And6Attendance.pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FG8OU2PE919PFKSR_Print+Application11.pdf", - "name": "G8OU2PE919PFKSR_Print Application11.pdf" - } - ], - "selection_procedure_details_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FDZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_", - "name": "DZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FN490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3", - "name": "N490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3" - } - ], - "company_name": "Make My Trip", - "address": "MakeMyTrip India Pvt. Ltd.5, Awagarh House, MG Road(next to Bachoomal collections)Agra (UP), - 282002India", - "company_type": "Private Sector", - "nature_of_business": "Technology", - "website": "www.makemytrip.com", - "company_details": "This s a very nice company", - "is_company_details_pdf": true, - "city": "Mumbai", - "state": "Maharashtra", - "country": "India", - "pin_code": 530013, - "city_type": "Domestic", - "designation": "Software Developer", - "description": "very nice job", - "is_description_pdf": true, - "compensation_CTC": 1200000, - "compensation_gross": 1100000, - "compensation_take_home": 1000000, - "compensation_bonus": 10000, - "compensation_details": "very good compensation", - "is_compensation_details_pdf": true, - "bond_details": "nil", - "selection_procedure_rounds": [ - "Resume Shortlisting", - "Technical Interview", - "HR Interview" - ], - "selection_procedure_details": "All rounds are complusory", - "is_selection_procedure_details_pdf": true, - "tier": "4", - "tentative_date_of_joining": "2022-01-15", - "allowed_batch": [ - "2018", - "2019" - ], - "allowed_branch": [ - "CSE", - "EE" - ], - "tentative_no_of_offers": 5, - "other_requirements": "above 8 cpi", - "additional_info": [ - "School", - "Home Town" - ], - "deadline_date": "2021-12-04", - "created_at": "2021-12-02T20:12:21+05:30" - } - ], - "placementApplication": [ + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FI5U4RDTV0OP0EM0_2019+Student+Details+-+Total%28State+Sort%29+-+Copy.pdf", + "name": "I5U4RDTV0OP0EM0_2019 Student Details - Total(State Sort) - Copy.pdf" + }, { - "id": "LLW4STE76GEJYOR", - "placement": { - "id": "Q54IRZZMC3RP8F6", - "company_details_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FI5U4RDTV0OP0EM0_2019+Student+Details+-+Total%28State+Sort%29+-+Copy.pdf", - "name": "I5U4RDTV0OP0EM0_2019 Student Details - Total(State Sort) - Copy.pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FW04JWWNNMIBX0JX_2019+Student+Details+-+Total%28State+Sort%29.pdf", - "name": "W04JWWNNMIBX0JX_2019 Student Details - Total(State Sort).pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FT1BXP98WBT9BHOR_AP0313017732021LL-Driving+Licence+-+Copy.pdf", - "name": "T1BXP98WBT9BHOR_AP0313017732021LL-Driving Licence - Copy.pdf" - } - ], - "description_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FC78TE2Z67BPZ41O_CSE-V-SEM.pdf", - "name": "C78TE2Z67BPZ41O_CSE-V-SEM.pdf" - } - ], - "compensation_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2F8D5OFQ46H43DD3S_module5And6Attendance.pdf", - "name": "8D5OFQ46H43DD3S_module5And6Attendance.pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FG8OU2PE919PFKSR_Print+Application11.pdf", - "name": "G8OU2PE919PFKSR_Print Application11.pdf" - } - ], - "selection_procedure_details_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FDZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_", - "name": "DZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FN490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3", - "name": "N490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3" - } - ], - "company_name": "Make My Trip", - "address": "MakeMyTrip India Pvt. Ltd.5, Awagarh House, MG Road(next to Bachoomal collections)Agra (UP), - 282002India", - "company_type": "Private Sector", - "nature_of_business": "Technology", - "website": "www.makemytrip.com", - "company_details": "This s a very nice company", - "is_company_details_pdf": true, - "city": "Mumbai", - "state": "Maharashtra", - "country": "India", - "pin_code": 530013, - "city_type": "Domestic", - "designation": "Software Developer", - "description": "very nice job", - "is_description_pdf": true, - "compensation_CTC": 1200000, - "compensation_gross": 1100000, - "compensation_take_home": 1000000, - "compensation_bonus": 10000, - "compensation_details": "very good compensation", - "is_compensation_details_pdf": true, - "bond_details": "nil", - "selection_procedure_rounds": [ - "Resume Shortlisting", - "Technical Interview", - "HR Interview" - ], - "selection_procedure_details": "All rounds are complusory", - "is_selection_procedure_details_pdf": true, - "tier": "4", - "tentative_date_of_joining": "2022-01-15", - "allowed_batch": [ - "2018", - "2019" - ], - "allowed_branch": [ - "CSE", - "EE" - ], - "tentative_no_of_offers": 5, - "other_requirements": "above 8 cpi", - "additional_info": [ - "School", - "Home Town" - ], - "deadline_date": "2021-12-04", - "created_at": "2021-12-02T20:12:21+05:30" - }, - "resume_link": "https://storage.googleapis.com/cdc-backend-attachments/resume/LLW4STE76GEJYOR%2F8KIOT3PW1JIS718_CSE-V-SEM.pdf", - "additional_info": "{\"School\": \"Narayana English Medium High School\", \"Home Town\": \"Vizag\"}", - "selected": null, - "applied_at": "2021-12-02T21:58:18.032466+05:30" + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FW04JWWNNMIBX0JX_2019+Student+Details+-+Total%28State+Sort%29.pdf", + "name": "W04JWWNNMIBX0JX_2019 Student Details - Total(State Sort).pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FT1BXP98WBT9BHOR_AP0313017732021LL-Driving+Licence+-+Copy.pdf", + "name": "T1BXP98WBT9BHOR_AP0313017732021LL-Driving Licence - Copy.pdf" } - ] + ], + "description_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FC78TE2Z67BPZ41O_CSE-V-SEM.pdf", + "name": "C78TE2Z67BPZ41O_CSE-V-SEM.pdf" + } + ], + "compensation_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2F8D5OFQ46H43DD3S_module5And6Attendance.pdf", + "name": "8D5OFQ46H43DD3S_module5And6Attendance.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FG8OU2PE919PFKSR_Print+Application11.pdf", + "name": "G8OU2PE919PFKSR_Print Application11.pdf" + } + ], + "selection_procedure_details_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FDZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_", + "name": "DZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FN490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3", + "name": "N490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3" + } + ], + "company_name": "Make My Trip", + "address": "MakeMyTrip India Pvt. Ltd.5, Awagarh House, MG Road(next to Bachoomal collections)Agra (UP), - 282002India", + "company_type": "Private Sector", + "nature_of_business": "Technology", + "website": "www.makemytrip.com", + "company_details": "This s a very nice company", + "is_company_details_pdf": true, + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "pin_code": 530013, + "city_type": "Domestic", + "designation": "Software Developer", + "description": "very nice job", + "is_description_pdf": true, + "compensation_CTC": 1200000, + "compensation_gross": 1100000, + "compensation_take_home": 1000000, + "compensation_bonus": 10000, + "compensation_details": "very good compensation", + "is_compensation_details_pdf": true, + "bond_details": "nil", + "selection_procedure_rounds": [ + "Resume Shortlisting", + "Technical Interview", + "HR Interview" + ], + "selection_procedure_details": "All rounds are complusory", + "is_selection_procedure_details_pdf": true, + "tier": "4", + "tentative_date_of_joining": "2022-01-15", + "allowed_batch": ["2018", "2019"], + "allowed_branch": ["CSE", "EE"], + "tentative_no_of_offers": 5, + "other_requirements": "above 8 cpi", + "additional_info": ["School", "Home Town"], + "deadline_date": "2021-12-04", + "created_at": "2021-12-02T20:12:21+05:30" + } + ], + "placementApplication": [ + { + "id": "LLW4STE76GEJYOR", + "placement": { + "id": "Q54IRZZMC3RP8F6", + "company_details_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FI5U4RDTV0OP0EM0_2019+Student+Details+-+Total%28State+Sort%29+-+Copy.pdf", + "name": "I5U4RDTV0OP0EM0_2019 Student Details - Total(State Sort) - Copy.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FW04JWWNNMIBX0JX_2019+Student+Details+-+Total%28State+Sort%29.pdf", + "name": "W04JWWNNMIBX0JX_2019 Student Details - Total(State Sort).pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FT1BXP98WBT9BHOR_AP0313017732021LL-Driving+Licence+-+Copy.pdf", + "name": "T1BXP98WBT9BHOR_AP0313017732021LL-Driving Licence - Copy.pdf" + } + ], + "description_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FC78TE2Z67BPZ41O_CSE-V-SEM.pdf", + "name": "C78TE2Z67BPZ41O_CSE-V-SEM.pdf" + } + ], + "compensation_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2F8D5OFQ46H43DD3S_module5And6Attendance.pdf", + "name": "8D5OFQ46H43DD3S_module5And6Attendance.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FG8OU2PE919PFKSR_Print+Application11.pdf", + "name": "G8OU2PE919PFKSR_Print Application11.pdf" + } + ], + "selection_procedure_details_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FDZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_", + "name": "DZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FN490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3", + "name": "N490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3" + } + ], + "company_name": "Make My Trip", + "address": "MakeMyTrip India Pvt. Ltd.5, Awagarh House, MG Road(next to Bachoomal collections)Agra (UP), - 282002India", + "company_type": "Private Sector", + "nature_of_business": "Technology", + "website": "www.makemytrip.com", + "company_details": "This s a very nice company", + "is_company_details_pdf": true, + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "pin_code": 530013, + "city_type": "Domestic", + "designation": "Software Developer", + "description": "very nice job", + "is_description_pdf": true, + "compensation_CTC": 1200000, + "compensation_gross": 1100000, + "compensation_take_home": 1000000, + "compensation_bonus": 10000, + "compensation_details": "very good compensation", + "is_compensation_details_pdf": true, + "bond_details": "nil", + "selection_procedure_rounds": [ + "Resume Shortlisting", + "Technical Interview", + "HR Interview" + ], + "selection_procedure_details": "All rounds are complusory", + "is_selection_procedure_details_pdf": true, + "tier": "4", + "tentative_date_of_joining": "2022-01-15", + "allowed_batch": ["2018", "2019"], + "allowed_branch": ["CSE", "EE"], + "tentative_no_of_offers": 5, + "other_requirements": "above 8 cpi", + "additional_info": ["School", "Home Town"], + "deadline_date": "2021-12-04", + "created_at": "2021-12-02T20:12:21+05:30" + }, + "resume_link": "https://storage.googleapis.com/cdc-backend-attachments/resume/LLW4STE76GEJYOR%2F8KIOT3PW1JIS718_CSE-V-SEM.pdf", + "additional_info": "{\"School\": \"Narayana English Medium High School\", \"Home Town\": \"Vizag\"}", + "selected": null, + "applied_at": "2021-12-02T21:58:18.032466+05:30" + } + ] } ``` @@ -369,10 +349,10 @@ Response is a Json with these fields The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| --------------- | ------------------------ | +| Status Codes | Possible Messages | +| --------------- | ---------------------- | | 200 OK | `Data Found` | -| 404 Not Found | `Student Not Found` | +| 404 Not Found | `Student Not Found` | | 400 BAD_REQUEST | `Something Went Wrong` | You can see some common errors [here](#common-errors) @@ -490,13 +470,13 @@ Request_Body: ```json { - "opening_type": "Placement", - "opening_id": "Q54IRZZMC3RP8F6", - "resume_file_name": "8KIOT3PW1JIS718_CSE-V-SEM.pdf", - "additional_info": { - "School": "Narayana English Medium High School", - "Home Town": "Vizag" - } + "opening_type": "Placement", + "opening_id": "Q54IRZZMC3RP8F6", + "resume_file_name": "8KIOT3PW1JIS718_CSE-V-SEM.pdf", + "additional_info": { + "School": "Narayana English Medium High School", + "Home Town": "Vizag" + } } ``` @@ -530,7 +510,7 @@ The possible responses for this api request are as follows | ------------- | ---------------------------------- | | 200 OK | `Application Submitted` | | 403 FORBIDDEN | `Application is already Submitted` | -| 403 FORBIDDEN | `Placement Not Approved` | +| 403 FORBIDDEN | `Placement Not Approved` | | 404 NOT FOUND | `RESUME_FILE_NAME Not Found` | You can see some common errors [here](#common-errors) @@ -552,14 +532,14 @@ Request_Body: { "opening_id": "Q54IRZZMC3RP8F6", "student_list": [ - { - "student_id":"190010036", - "student_selected":"true" - }, - { - "student_id":"190050022", - "student_selected":"false" - } + { + "student_id": "190010036", + "student_selected": "true" + }, + { + "student_id": "190050022", + "student_selected": "false" + } ] } ``` @@ -585,10 +565,10 @@ Response is a Json with these fields The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| --------------- | ------------------------ | -| 200 OK | `Marked Status` | -| 400 BAD_REQUEST | `Something Went Wrong` | +| Status Codes | Possible Messages | +| --------------- | ---------------------- | +| 200 OK | `Marked Status` | +| 400 BAD_REQUEST | `Something Went Wrong` | You may see some different errors which can be seen [here](#common-errors) @@ -617,106 +597,97 @@ Response is a Json with these fields ```json { - "action": "Get Dashboard - Admin", - "message": "Data Found", - "ongoing": [ + "action": "Get Dashboard - Admin", + "message": "Data Found", + "ongoing": [ + { + "id": "Q54IRZZMC3RP8F6", + "company_details_pdf_links": [ { - "id": "Q54IRZZMC3RP8F6", - "company_details_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FI5U4RDTV0OP0EM0_2019+Student+Details+-+Total%28State+Sort%29+-+Copy.pdf", - "name": "I5U4RDTV0OP0EM0_2019 Student Details - Total(State Sort) - Copy.pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FW04JWWNNMIBX0JX_2019+Student+Details+-+Total%28State+Sort%29.pdf", - "name": "W04JWWNNMIBX0JX_2019 Student Details - Total(State Sort).pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FT1BXP98WBT9BHOR_AP0313017732021LL-Driving+Licence+-+Copy.pdf", - "name": "T1BXP98WBT9BHOR_AP0313017732021LL-Driving Licence - Copy.pdf" - } - ], - "description_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FC78TE2Z67BPZ41O_CSE-V-SEM.pdf", - "name": "C78TE2Z67BPZ41O_CSE-V-SEM.pdf" - } - ], - "compensation_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2F8D5OFQ46H43DD3S_module5And6Attendance.pdf", - "name": "8D5OFQ46H43DD3S_module5And6Attendance.pdf" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FG8OU2PE919PFKSR_Print+Application11.pdf", - "name": "G8OU2PE919PFKSR_Print Application11.pdf" - } - ], - "selection_procedure_details_pdf_links": [ - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FDZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_", - "name": "DZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_" - }, - { - "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FN490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3", - "name": "N490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3" - } - ], - "company_name": "Make My Trip", - "address": "MakeMyTrip India Pvt. Ltd.5, Awagarh House, MG Road(next to Bachoomal collections)Agra (UP), - 282002India", - "company_type": "Private Sector", - "nature_of_business": "Technology", - "website": "www.makemytrip.com", - "company_details": "This s a very nice company", - "is_company_details_pdf": true, - "contact_person_name": "Gowtham", - "phone_number": 9390291911, - "email": "saisurya3127@gmail.com", - "city": "Mumbai", - "state": "Maharashtra", - "country": "India", - "pin_code": 530013, - "city_type": "Domestic", - "designation": "Software Developer", - "description": "very nice job", - "is_description_pdf": true, - "compensation_CTC": 1200000, - "compensation_gross": 1100000, - "compensation_take_home": 1000000, - "compensation_bonus": 10000, - "compensation_details": "very good compensation", - "is_compensation_details_pdf": true, - "bond_details": "nil", - "selection_procedure_rounds": [ - "Resume Shortlisting", - "Technical Interview", - "HR Interview" - ], - "selection_procedure_details": "All rounds are complusory", - "is_selection_procedure_details_pdf": true, - "tier": "4", - "tentative_date_of_joining": "2022-01-15", - "allowed_batch": [ - "2018", - "2019" - ], - "allowed_branch": [ - "CSE", - "EE" - ], - "tentative_no_of_offers": 5, - "other_requirements": "above 8 cpi", - "additional_info": [ - "School", - "Home Town" - ], - "email_verified": false, - "offer_accepted": null, - "deadline_date": "2021-12-04", - "created_at": "2021-12-02T20:12:21+05:30" + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FI5U4RDTV0OP0EM0_2019+Student+Details+-+Total%28State+Sort%29+-+Copy.pdf", + "name": "I5U4RDTV0OP0EM0_2019 Student Details - Total(State Sort) - Copy.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FW04JWWNNMIBX0JX_2019+Student+Details+-+Total%28State+Sort%29.pdf", + "name": "W04JWWNNMIBX0JX_2019 Student Details - Total(State Sort).pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FT1BXP98WBT9BHOR_AP0313017732021LL-Driving+Licence+-+Copy.pdf", + "name": "T1BXP98WBT9BHOR_AP0313017732021LL-Driving Licence - Copy.pdf" } - ], - "previous": [] + ], + "description_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FC78TE2Z67BPZ41O_CSE-V-SEM.pdf", + "name": "C78TE2Z67BPZ41O_CSE-V-SEM.pdf" + } + ], + "compensation_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2F8D5OFQ46H43DD3S_module5And6Attendance.pdf", + "name": "8D5OFQ46H43DD3S_module5And6Attendance.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FG8OU2PE919PFKSR_Print+Application11.pdf", + "name": "G8OU2PE919PFKSR_Print Application11.pdf" + } + ], + "selection_procedure_details_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FDZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_", + "name": "DZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FN490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3", + "name": "N490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3" + } + ], + "company_name": "Make My Trip", + "address": "MakeMyTrip India Pvt. Ltd.5, Awagarh House, MG Road(next to Bachoomal collections)Agra (UP), - 282002India", + "company_type": "Private Sector", + "nature_of_business": "Technology", + "website": "www.makemytrip.com", + "company_details": "This s a very nice company", + "is_company_details_pdf": true, + "contact_person_name": "Gowtham", + "phone_number": 9390291911, + "email": "saisurya3127@gmail.com", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "pin_code": 530013, + "city_type": "Domestic", + "designation": "Software Developer", + "description": "very nice job", + "is_description_pdf": true, + "compensation_CTC": 1200000, + "compensation_gross": 1100000, + "compensation_take_home": 1000000, + "compensation_bonus": 10000, + "compensation_details": "very good compensation", + "is_compensation_details_pdf": true, + "bond_details": "nil", + "selection_procedure_rounds": [ + "Resume Shortlisting", + "Technical Interview", + "HR Interview" + ], + "selection_procedure_details": "All rounds are complusory", + "is_selection_procedure_details_pdf": true, + "tier": "4", + "tentative_date_of_joining": "2022-01-15", + "allowed_batch": ["2018", "2019"], + "allowed_branch": ["CSE", "EE"], + "tentative_no_of_offers": 5, + "other_requirements": "above 8 cpi", + "additional_info": ["School", "Home Town"], + "email_verified": false, + "offer_accepted": null, + "deadline_date": "2021-12-04", + "created_at": "2021-12-02T20:12:21+05:30" + } + ], + "previous": [] } ``` @@ -729,8 +700,8 @@ Response is a Json with these fields The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| --------------- | ------------------------ | +| Status Codes | Possible Messages | +| --------------- | ---------------------- | | 200 OK | `Data Found` | | 400 BAD_REQUEST | `Something Went Wrong` | @@ -749,8 +720,8 @@ Request_Body: ```json { - "opening_id": "Q54IRZZMC3RP8F6", - "deadline_datetime": "2021-12-06 16:28:18 +0530" + "opening_id": "Q54IRZZMC3RP8F6", + "deadline_datetime": "2021-12-06 16:28:18 +0530" } ``` @@ -763,8 +734,8 @@ Response is a Json with these fields ```json { - "action": "Update Deadline", - "message": "Deadline Updated" + "action": "Update Deadline", + "message": "Deadline Updated" } ``` @@ -775,10 +746,10 @@ Response is a Json with these fields The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| --------------- | ------------------------ | -| 200 OK | `Deadline Updated` | -| 400 BAD_REQUEST | `Something Went Wrong` | +| Status Codes | Possible Messages | +| --------------- | ---------------------- | +| 200 OK | `Deadline Updated` | +| 400 BAD_REQUEST | `Something Went Wrong` | You may see some different errors which can be seen [here](#common-errors) @@ -795,8 +766,8 @@ Request_Body: ```json { - "opening_id": "Q54IRZZMC3RP8F6", - "offer_accepted": "true" + "opening_id": "Q54IRZZMC3RP8F6", + "offer_accepted": "true" } ``` @@ -809,8 +780,8 @@ Response is a Json with these fields ```json { - "action": "Update Offer Accepted", - "message": "Offer Accepted Updated" + "action": "Update Offer Accepted", + "message": "Offer Accepted Updated" } ``` @@ -821,10 +792,10 @@ Response is a Json with these fields The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| --------------- | ------------------------ | -| 200 OK | `Update Offer Accepted` | -| 400 BAD_REQUEST | `Something Went Wrong` | +| Status Codes | Possible Messages | +| --------------- | ----------------------- | +| 200 OK | `Update Offer Accepted` | +| 400 BAD_REQUEST | `Something Went Wrong` | You may see some different errors which can be seen [here](#common-errors) @@ -841,8 +812,8 @@ Request_Body: ```json { - "opening_id": "Q54IRZZMC3RP8F6", - "email_verified": "false" + "opening_id": "Q54IRZZMC3RP8F6", + "email_verified": "false" } ``` @@ -855,8 +826,8 @@ Response is a Json with these fields ```json { - "action": "Update Email Verified", - "message": "Email Verified Updated" + "action": "Update Email Verified", + "message": "Email Verified Updated" } ``` @@ -869,8 +840,8 @@ The possible responses for this api request are as follows | Status Codes | Possible Messages | | --------------- | ------------------------ | -| 200 OK | `Email Verified Updated` | -| 400 BAD_REQUEST | `Something Went Wrong` | +| 200 OK | `Email Verified Updated` | +| 400 BAD_REQUEST | `Something Went Wrong` | You may see some different errors which can be seen [here](#common-errors) @@ -887,12 +858,8 @@ Request_Body: ```json { - "opening_id": "Q54IRZZMC3RP8F6", - "additional_info": [ - "School", - "Place of Living", - "Research Interests" - ] + "opening_id": "Q54IRZZMC3RP8F6", + "additional_info": ["School", "Place of Living", "Research Interests"] } ``` @@ -905,8 +872,8 @@ Response is a Json with these fields ```json { - "action": "Update Additional Info", - "message": "Additional Info Updated" + "action": "Update Additional Info", + "message": "Additional Info Updated" } ``` @@ -917,15 +884,33 @@ Response is a Json with these fields The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| --------------- | ------------------------ | -| 200 OK | `Additional Info Updated` | -| 400 BAD_REQUEST | `Something Went Wrong` | +| Status Codes | Possible Messages | +| --------------- | ------------------------- | +| 200 OK | `Additional Info Updated` | +| 400 BAD_REQUEST | `Something Went Wrong` | You may see some different errors which can be seen [here](#common-errors) --- + + +## `api/admin/getApplications` + +This api is used to + +### How to Use? + +Send a `POST` request to `api/admin/updateAdditionalInfo`
+Request_Body: + +```json +{ + "opening_id": "Q54IRZZMC3RP8F6", + "additional_info": ["School", "Place of Living", "Research Interests"] +} +``` + # Company Portal APIs ## `api/company/addPlacement/` @@ -940,113 +925,45 @@ Request_Body: ```json { - "company_name": [ - "Make My Trip" - ], + "company_name": ["Make My Trip"], "address": [ "MakeMyTrip India Pvt. Ltd.\n5, Awagarh House, MG Road\n(next to Bachoomal collections)\nAgra (UP), - 282002\nIndia" ], - "company_type": [ - "Private Sector" - ], - "nature_of_business": [ - "Technology" - ], - "website": [ - "www.makemytrip.com" - ], - "company_details": [ - "This s a very nice company" - ], - "is_company_details_pdf": [ - "true" - ], - "contact_person_name": [ - "Gowtham" - ], - "phone_number": [ - "9390291911" - ], - "email": [ - "saisurya3127@gmail.com" - ], - "city": [ - "Mumbai" - ], - "state": [ - "Maharashtra" - ], - "country": [ - "India" - ], - "pincode": [ - "530013" - ], - "designation": [ - "Software Developer" - ], - "description": [ - "very nice job" - ], - "is_description_pdf": [ - "true" - ], - "compensation_ctc": [ - "1200000" - ], - "compensation_gross": [ - "1100000" - ], - "compensation_take_home": [ - "1000000" - ], - "compensation_bonus": [ - "10000" - ], - "compensation_details": [ - "very good compensation" - ], - "is_compensation_details_pdf": [ - "true" - ], - "bond_details": [ - "nil" - ], + "company_type": ["Private Sector"], + "nature_of_business": ["Technology"], + "website": ["www.makemytrip.com"], + "company_details": ["This s a very nice company"], + "is_company_details_pdf": ["true"], + "contact_person_name": ["Gowtham"], + "phone_number": ["9390291911"], + "email": ["saisurya3127@gmail.com"], + "city": ["Mumbai"], + "state": ["Maharashtra"], + "country": ["India"], + "pincode": ["530013"], + "designation": ["Software Developer"], + "description": ["very nice job"], + "is_description_pdf": ["true"], + "compensation_ctc": ["1200000"], + "compensation_gross": ["1100000"], + "compensation_take_home": ["1000000"], + "compensation_bonus": ["10000"], + "compensation_details": ["very good compensation"], + "is_compensation_details_pdf": ["true"], + "bond_details": ["nil"], "selection_procedure_rounds": [ "['Resume Shortlisting', 'Technical Interview', 'HR Interview']" ], - "selection_procedure_details": [ - "All rounds are complusory" - ], - "is_selection_procedure_details_pdf": [ - "true" - ], - "tentative_date_of_joining": [ - "15-01-2022" - ], - "allowed_branch": [ - "['CSE', 'EE']" - ], - "tentative_no_of_offers": [ - "5" - ], - "other_requirements": [ - "above 8 cpi" - ], - "company_details_pdf": [ - "__FILE_OBJECT__", - "__FILE_OBJECT__" - ], - "description_pdf": [ - "__FILE_OBJECT__" - ], - "compensation_details_pdf": [ - "__FILE_OBJECT__" - ], - "selection_procedure_details_pdf": [ - "__FILE_OBJECT__", - "__FILE_OBJECT__" - ] + "selection_procedure_details": ["All rounds are complusory"], + "is_selection_procedure_details_pdf": ["true"], + "tentative_date_of_joining": ["15-01-2022"], + "allowed_branch": ["['CSE', 'EE']"], + "tentative_no_of_offers": ["5"], + "other_requirements": ["above 8 cpi"], + "company_details_pdf": ["__FILE_OBJECT__", "__FILE_OBJECT__"], + "description_pdf": ["__FILE_OBJECT__"], + "compensation_details_pdf": ["__FILE_OBJECT__"], + "selection_procedure_details_pdf": ["__FILE_OBJECT__", "__FILE_OBJECT__"] } ``` @@ -1056,8 +973,8 @@ Response is a Json with these fields ```json { - "action": "Add Placement", - "message": "Placement Added Successfully" + "action": "Add Placement", + "message": "Placement Added Successfully" } ``` @@ -1071,10 +988,10 @@ Response is a Json with these fields The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| ------------- | ----------------- | -| 200 OK | `Placement Added Successfully` | -| 404 NOT FOUND | `Something went wrong` | +| Status Codes | Possible Messages | +| ------------- | ------------------------------ | +| 200 OK | `Placement Added Successfully` | +| 404 NOT FOUND | `Something went wrong` | You can see some common errors [here](#common-errors) @@ -1090,9 +1007,5 @@ Some common errors that you may see while accessing the Apis | 401 UNAUTHORIZED | `Access Denied. You are not allowed to use this service` | Your may not have required access to those access those Apis. | | 401 UNAUTHORIZED | `Token has wrong audience` | You may be using wrong credentials for Google OAuth2.0. | | 404 NOT FOUND | `User Not Found. Contact CDC for more details` | You may not be a user at CDC, IIT Dharwad. Please contact us to get your user account | -| 400 BAD_REQUEST | `Error Occurred` | Any random Error which can be seen in the {error} string. | -| 400 BAD_REQUEST | `Something went wrong` | Any random Error which can be seen in the {error} string. | - - - - +| 400 BAD_REQUEST | `Error Occurred` | Any random Error which can be seen in the {error} string. | +| 400 BAD_REQUEST | `Something went wrong` | Any random Error which can be seen in the {error} string. | From 7664c3e2b0d2bad308bd8a9a364676a2e24ff653 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 11:48:25 +0530 Subject: [PATCH 04/21] getApplications --- CDC_Backend/README.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index e0b578f..03b5422 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -897,20 +897,47 @@ You may see some different errors which can be seen [here](#common-errors) ## `api/admin/getApplications` -This api is used to +This api is used to fetch all the applications applied by students for all placements ### How to Use? -Send a `POST` request to `api/admin/updateAdditionalInfo`
+Send a `POST` request to `api/admin/getApplications`
Request_Body: ```json { - "opening_id": "Q54IRZZMC3RP8F6", - "additional_info": ["School", "Place of Living", "Research Interests"] + "opening_id": "Q54IRZZMC3RP8F6" } ``` +### Response + +Response is a Json with these fields + +```json +{ + "action": "Get Applications", + "message": "Data Found", + "applications": "[]" +} +``` + +- action: Tells us about the message creator
+- message: Tells us what happened with our Request. + +### Status Codes + +The possible responses for this api request are as follows + +| Status Codes | Possible Messages | +| --------------- | ---------------------- | +| 200 OK | `Data Found` | +| 400 BAD_REQUEST | `Something Went Wrong` | + +You may see some different errors which can be seen [here](#common-errors) + +--- + # Company Portal APIs ## `api/company/addPlacement/` From 024018a9201e33c1d6fb6af0152043a84d766fb1 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 11:50:53 +0530 Subject: [PATCH 05/21] getApplicationsindex --- CDC_Backend/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index 03b5422..c974ecd 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -15,6 +15,7 @@ 4. [**api/admin/updateOfferAccepted**](#apiadminupdateofferaccepted) 5. [**api/admin/updateEmailVerified**](#apiadminupdateemailverified) 6. [**api/admin/updateAdditionalInfo**](#apiadminupdateadditionalinfo) + 7. [**api/admin/getApplications**](#apiadmingetApplications) 4. [**Company APIs**](#company-portal-apis) 1. [**api/company/addPlacement/**](#apicompanyaddplacement) 5. [**Common Errors**](#common-errors) From 6be470288813df356844ed3583c7c1cd9b3bbb06 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 12:05:57 +0530 Subject: [PATCH 06/21] submitApplication --- CDC_Backend/README.md | 44 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index c974ecd..203deb5 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -16,6 +16,7 @@ 5. [**api/admin/updateEmailVerified**](#apiadminupdateemailverified) 6. [**api/admin/updateAdditionalInfo**](#apiadminupdateadditionalinfo) 7. [**api/admin/getApplications**](#apiadmingetApplications) + 8. [**api/admin/submitApplication**](#apiadminsubmitApplication) 4. [**Company APIs**](#company-portal-apis) 1. [**api/company/addPlacement/**](#apicompanyaddplacement) 5. [**Common Errors**](#common-errors) @@ -919,7 +920,7 @@ Response is a Json with these fields { "action": "Get Applications", "message": "Data Found", - "applications": "[]" + "applications": [] } ``` @@ -939,6 +940,47 @@ You may see some different errors which can be seen [here](#common-errors) --- +## `api/admin/submitApplication` + +This api is used to + +Request_Body: + +```json +{ + "applications_id": "", + "student_id": "", + "opening_id": "Q54IRZZMC3RP8F6", + "additional_info": "", + "resume_file_name": "" +} +``` + +### Response + +Response is a Json with these fields + +```json +{ + "action": "Add Student Application", + "message": "Application Added", + "applications": [] +} +``` + +### Status Codes + +The possible responses for this api request are as follows + +| Status Codes | Possible Messages | +| --------------- | ---------------------- | +| 200 OK | `Application Added` | +| 400 BAD_REQUEST | `Something Went Wrong` | + +You may see some different errors which can be seen [here](#common-errors) + +--- + # Company Portal APIs ## `api/company/addPlacement/` From 7df2c52cabaea4e17a38e6e2acb72f101f09555d Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 12:18:58 +0530 Subject: [PATCH 07/21] submitApplication --- CDC_Backend/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index 203deb5..fbc49cf 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -951,8 +951,11 @@ Request_Body: "applications_id": "", "student_id": "", "opening_id": "Q54IRZZMC3RP8F6", - "additional_info": "", - "resume_file_name": "" + "additional_info": { + "School": "Lions International", + "City": "Banglore" + } + "resume_file_name": "8KIOT3PW1JIS718_CSE-V-SEM.pdf" } ``` From 8252f299e7d6e27b2d36c6e9faec2de38df1d09c Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 12:21:21 +0530 Subject: [PATCH 08/21] filled requirements --- CDC_Backend/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index fbc49cf..7bdbf8f 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -942,19 +942,19 @@ You may see some different errors which can be seen [here](#common-errors) ## `api/admin/submitApplication` -This api is used to +This api is used to submit a students application Request_Body: ```json { - "applications_id": "", - "student_id": "", + "applications_id": "Q54IRZZMC3RP8F6", + "student_id": "200010022", "opening_id": "Q54IRZZMC3RP8F6", "additional_info": { "School": "Lions International", "City": "Banglore" - } + }, "resume_file_name": "8KIOT3PW1JIS718_CSE-V-SEM.pdf" } ``` @@ -966,8 +966,7 @@ Response is a Json with these fields ```json { "action": "Add Student Application", - "message": "Application Added", - "applications": [] + "message": "Application Added" } ``` From d873e73ee708149dd6bb99e76d19d5215c1ce50b Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 13:32:54 +0530 Subject: [PATCH 09/21] create all views --- CDC_Backend/README.md | 120 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index 7bdbf8f..dd7cd76 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -17,6 +17,9 @@ 6. [**api/admin/updateAdditionalInfo**](#apiadminupdateadditionalinfo) 7. [**api/admin/getApplications**](#apiadmingetApplications) 8. [**api/admin/submitApplication**](#apiadminsubmitApplication) + 9. [**api/admin/generateCSV**](#apiadmingeneratecsv) + 10. [**api/admin/addPPO**](#apiadminaddppo) + 11. [**api/admin/getStudentApplication**](#apiadmingetstudentapplication) 4. [**Company APIs**](#company-portal-apis) 1. [**api/company/addPlacement/**](#apicompanyaddplacement) 5. [**Common Errors**](#common-errors) @@ -983,6 +986,123 @@ You may see some different errors which can be seen [here](#common-errors) --- +## `api/admin/generateCSV` + +This api is used to generate a CSV file that contains sequential details of all the applications + +Request_Body: + +```json +{ + "opening_id": "Q54IRZZMC3RP8F6" +} +``` + +### Response + +Response is a Json with these fields + +```json +{ + "action": "Create CSV", + "message": "CSV Created", + "file": "" +} +``` + +### Status Codes + +The possible responses for this api request are as follows + +| Status Codes | Possible Messages | +| --------------- | ---------------------- | +| 200 OK | `CSV created` | +| 400 BAD_REQUEST | `Something Went Wrong` | + +You may see some different errors which can be seen [here](#common-errors) + +--- + +## `api/admin/addPPO` + +This api is used to add a PPO for a student in the corresponding company + +Request_Body: + +```json +{ + "company_name": , + "compensation_gross": , + "offer_accepted": , + "student_id": "200010022", + "designation": , + "tier": , +} +``` + +### Response + +Response is a Json with these fields + +```json +{ + "action": "Add PPO", + "message": "PPO Added" +} +``` + +### Status Codes + +The possible responses for this api request are as follows + +| Status Codes | Possible Messages | +| --------------- | ---------------------- | +| 200 OK | `PPO Added` | +| 400 BAD_REQUEST | `Something Went Wrong` | + +You may see some different errors which can be seen [here](#common-errors) + +--- + +## `api/admin/getStudentApplication` + +This api is used to fetch the application details of the required student + +Request_Body: + +```json +{ + "student_id": "200010022", + "opening_id": "Q54IRZZMC3RP8F6" +} +``` + +### Response + +Response is a Json with these fields + +```json +{ + "action": "Get Student Application", + "application_found": "true", + "application_info": {}, + "student_details": {} +} +``` + +### Status Codes + +The possible responses for this api request are as follows + +| Status Codes | Possible Messages | +| --------------- | ---------------------- | +| 200 OK | `` | +| 400 BAD_REQUEST | `Something Went Wrong` | + +You may see some different errors which can be seen [here](#common-errors) + +--- + # Company Portal APIs ## `api/company/addPlacement/` From 9bb7de7a7dbc0c401e9695d43a9dc2578b840954 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 15:09:32 +0530 Subject: [PATCH 10/21] objects info updated --- CDC_Backend/README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index dd7cd76..e09d543 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -915,6 +915,9 @@ Request_Body: } ``` +> Headers
+> Authorization: "Bearer {tokenID}" + ### Response Response is a Json with these fields @@ -951,7 +954,7 @@ Request_Body: ```json { - "applications_id": "Q54IRZZMC3RP8F6", + "applications_id": "F28IRGGMC3RP8Y8", "student_id": "200010022", "opening_id": "Q54IRZZMC3RP8F6", "additional_info": { @@ -962,6 +965,9 @@ Request_Body: } ``` +> Headers
+> Authorization: "Bearer {tokenID}" + ### Response Response is a Json with these fields @@ -998,6 +1004,9 @@ Request_Body: } ``` +> Headers
+> Authorization: "Bearer {tokenID}" + ### Response Response is a Json with these fields @@ -1031,12 +1040,12 @@ Request_Body: ```json { - "company_name": , - "compensation_gross": , - "offer_accepted": , + "company_name": "Geeks for Geeks", + "compensation_gross": "1000000", + "offer_accepted": "true", "student_id": "200010022", - "designation": , - "tier": , + "designation": "Technical Content Writer", + "tier": "4" } ``` @@ -1077,6 +1086,9 @@ Request_Body: } ``` +> Headers
+> Authorization: "Bearer {tokenID}" + ### Response Response is a Json with these fields From 15ed38cfd60ae9b35215a6988731b0e9c1331792 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Sun, 29 May 2022 15:18:01 +0530 Subject: [PATCH 11/21] object details updated --- CDC_Backend/README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index e09d543..58462db 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -1015,7 +1015,7 @@ Response is a Json with these fields { "action": "Create CSV", "message": "CSV Created", - "file": "" + "file": "csv_file_link" } ``` @@ -1097,8 +1097,17 @@ Response is a Json with these fields { "action": "Get Student Application", "application_found": "true", - "application_info": {}, - "student_details": {} + "application_info": { + "id": "F28IRGGMC3RP8Y8", + "additional_info": , + "resume": "resume_link" + }, + "student_details": { + "name": "John", + "batch": "2020", + "branch": "MMAE", + "resume_list": + } } ``` From 93d375e8200c0e8e828aa8fb639cdd13258c4264 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Mon, 30 May 2022 14:26:01 +0530 Subject: [PATCH 12/21] NEW field added in getDashboard feature --- CDC_Backend/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index 58462db..48b223c 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -604,6 +604,7 @@ Response is a Json with these fields { "action": "Get Dashboard - Admin", "message": "Data Found", + "new": [], "ongoing": [ { "id": "Q54IRZZMC3RP8F6", From ef973cbd7d4e2d93c6b7cb9ec5c2aa9f5e30027d Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Mon, 30 May 2022 14:29:58 +0530 Subject: [PATCH 13/21] new field --- CDC_Backend/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index 48b223c..514f55e 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -701,6 +701,7 @@ Response is a Json with these fields - message: Tells us what happened with our Request. - ongoing: Gives us the list of placements that are accepting applications. - previous: Gives us the list of placements that stopped accepting applications. +- new : Gives us the list of placements that is not yet accepeted by CDC. ### Status Codes From f95c4db108c6e1205f8ec7af012ea603bd3d9c74 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Mon, 30 May 2022 18:00:59 +0530 Subject: [PATCH 14/21] some changes updated --- CDC_Backend/README.md | 178 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 176 insertions(+), 2 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index 514f55e..c39eeba 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -604,7 +604,94 @@ Response is a Json with these fields { "action": "Get Dashboard - Admin", "message": "Data Found", - "new": [], + "new": [ + { + "id": "Z54IRZZMB3RP9TR", + "company_details_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FI5U4RDTV0OP0EM0_2019+Student+Details+-+Total%28State+Sort%29+-+Copy.pdf", + "name": "I5U4RDTV0OP0EM0_2019 Student Details - Total(State Sort) - Copy.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FW04JWWNNMIBX0JX_2019+Student+Details+-+Total%28State+Sort%29.pdf", + "name": "W04JWWNNMIBX0JX_2019 Student Details - Total(State Sort).pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FT1BXP98WBT9BHOR_AP0313017732021LL-Driving+Licence+-+Copy.pdf", + "name": "T1BXP98WBT9BHOR_AP0313017732021LL-Driving Licence - Copy.pdf" + } + ], + "description_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FC78TE2Z67BPZ41O_CSE-V-SEM.pdf", + "name": "C78TE2Z67BPZ41O_CSE-V-SEM.pdf" + } + ], + "compensation_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2F8D5OFQ46H43DD3S_module5And6Attendance.pdf", + "name": "8D5OFQ46H43DD3S_module5And6Attendance.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FG8OU2PE919PFKSR_Print+Application11.pdf", + "name": "G8OU2PE919PFKSR_Print Application11.pdf" + } + ], + "selection_procedure_details_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FDZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_", + "name": "DZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FN490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3", + "name": "N490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3" + } + ], + "company_name": "Cred", + "address": "Cred India Pvt. Ltd.5, Awagarh House, MG Road(next to Bachoomal collections)Agra (UP), - 282002India", + "company_type": "Private Sector", + "nature_of_business": "Technology", + "website": "www.cred.com", + "company_details": "This s a very nice company", + "is_company_details_pdf": true, + "contact_person_name": "John", + "phone_number": 9390291922, + "email": "@gmail.com", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "pin_code": 530013, + "city_type": "Domestic", + "designation": "Software Developer", + "description": "very nice job", + "is_description_pdf": true, + "compensation_CTC": 1200000, + "compensation_gross": 1100000, + "compensation_take_home": 1000000, + "compensation_bonus": 10000, + "compensation_details": "very good compensation", + "is_compensation_details_pdf": true, + "bond_details": "nil", + "selection_procedure_rounds": [ + "Resume Shortlisting", + "Technical Interview", + "HR Interview" + ], + "selection_procedure_details": "All rounds are complusory", + "is_selection_procedure_details_pdf": true, + "tier": "4", + "tentative_date_of_joining": "2022-01-15", + "allowed_batch": ["2018", "2019"], + "allowed_branch": ["CSE", "EE"], + "tentative_no_of_offers": 5, + "other_requirements": "above 8 cpi", + "additional_info": ["School", "Home Town"], + "email_verified": false, + "offer_accepted": null, + "deadline_date": "2021-12-04", + "created_at": "2021-12-02T20:12:21+05:30" + } + ], "ongoing": [ { "id": "Q54IRZZMC3RP8F6", @@ -693,7 +780,94 @@ Response is a Json with these fields "created_at": "2021-12-02T20:12:21+05:30" } ], - "previous": [] + "previous": [ + { + "id": "Q74IRZZMC3RP8F6", + "company_details_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FI5U4RDTV0OP0EM0_2019+Student+Details+-+Total%28State+Sort%29+-+Copy.pdf", + "name": "I5U4RDTV0OP0EM0_2019 Student Details - Total(State Sort) - Copy.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FW04JWWNNMIBX0JX_2019+Student+Details+-+Total%28State+Sort%29.pdf", + "name": "W04JWWNNMIBX0JX_2019 Student Details - Total(State Sort).pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FT1BXP98WBT9BHOR_AP0313017732021LL-Driving+Licence+-+Copy.pdf", + "name": "T1BXP98WBT9BHOR_AP0313017732021LL-Driving Licence - Copy.pdf" + } + ], + "description_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FC78TE2Z67BPZ41O_CSE-V-SEM.pdf", + "name": "C78TE2Z67BPZ41O_CSE-V-SEM.pdf" + } + ], + "compensation_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2F8D5OFQ46H43DD3S_module5And6Attendance.pdf", + "name": "8D5OFQ46H43DD3S_module5And6Attendance.pdf" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FG8OU2PE919PFKSR_Print+Application11.pdf", + "name": "G8OU2PE919PFKSR_Print Application11.pdf" + } + ], + "selection_procedure_details_pdf_links": [ + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FDZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_", + "name": "DZTQQ6YBGBQ47PY_screencapture-onlinesbi-sbi-sbicollect-fsssuccessresponseredirect-htm-2021-07-19-18_" + }, + { + "link": "https://storage.googleapis.com/cdc-backend-attachments/company_attachments/Q54IRZZMC3RP8F6%2FN490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3", + "name": "N490PUXJEEN4JZ9_screencapture-onlinesbi-sbi-sbicollect-payment-suvidhapayment-htm-2021-07-19-23_12_3" + } + ], + "company_name": "Make My Trip", + "address": "MakeMyTrip India Pvt. Ltd.5, Awagarh House, MG Road(next to Bachoomal collections)Agra (UP), - 282002India", + "company_type": "Private Sector", + "nature_of_business": "Technology", + "website": "www.makemytrip.com", + "company_details": "This s a very nice company", + "is_company_details_pdf": true, + "contact_person_name": "Gowtham", + "phone_number": 9390291911, + "email": "saisurya3127@gmail.com", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "pin_code": 530013, + "city_type": "Domestic", + "designation": "Software Developer", + "description": "very nice job", + "is_description_pdf": true, + "compensation_CTC": 1200000, + "compensation_gross": 1100000, + "compensation_take_home": 1000000, + "compensation_bonus": 10000, + "compensation_details": "very good compensation", + "is_compensation_details_pdf": true, + "bond_details": "nil", + "selection_procedure_rounds": [ + "Resume Shortlisting", + "Technical Interview", + "HR Interview" + ], + "selection_procedure_details": "All rounds are complusory", + "is_selection_procedure_details_pdf": true, + "tier": "4", + "tentative_date_of_joining": "2022-01-15", + "allowed_batch": ["2018", "2019"], + "allowed_branch": ["CSE", "EE"], + "tentative_no_of_offers": 5, + "other_requirements": "above 8 cpi", + "additional_info": ["School", "Home Town"], + "email_verified": false, + "offer_accepted": null, + "deadline_date": "2021-12-04", + "created_at": "2021-12-02T20:12:21+05:30" + } + ] } ``` From e0e14649653cf2efd29d3940e6e294be04c15d64 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Mon, 30 May 2022 18:10:45 +0530 Subject: [PATCH 15/21] fields updated --- CDC_Backend/README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index c39eeba..79ce3d8 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -1267,7 +1267,7 @@ Request_Body: ### Response -Response is a Json with these fields +Response is a Json with these fields when the application is found. ```json { @@ -1287,14 +1287,30 @@ Response is a Json with these fields } ``` +Response is a Json with these fields when the applciation is not found. + +```json +{ + "action": "Get Student Application", + "application_found": "false", + "student_details": { + "name": "John", + "batch": "2020", + "branch": "MMAE", + "resume_list": + } +} +``` + ### Status Codes The possible responses for this api request are as follows -| Status Codes | Possible Messages | -| --------------- | ---------------------- | -| 200 OK | `` | -| 400 BAD_REQUEST | `Something Went Wrong` | +| Status Codes | Possible Messages | +| --------------- | ----------------------- | +| 200 OK | `` | +| 400 BAD_REQUEST | `Something Went Wrong` | +| 404 NOT_FOUND | `Application not found` | You may see some different errors which can be seen [here](#common-errors) From 14334e86c7a1b39db5b5821f2f9f994e94814ae8 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Mon, 30 May 2022 19:25:14 +0530 Subject: [PATCH 16/21] application example json object added --- CDC_Backend/README.md | 51 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index 79ce3d8..d9cc5a2 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -1102,7 +1102,44 @@ Response is a Json with these fields { "action": "Get Applications", "message": "Data Found", - "applications": [] + "applications": [ + { + "id": "200010021", + "student_details": { + "id": "200010021", + "resume_list": [ + { + "link": "http://localhost/storage/Resumes/200010021/resume_link", + "name": "resume_link" + } + ], + "offers": [ + { + "designation": "sde", + "company_name": "JP Morgan", + "application_id": "200010021", + "placement_offer_type": "Normal" + } + ], + "roll_no": 200010021, + "name": "John", + "batch": "2020", + "branch": "CSE", + "phone_number": 8105699450, + "cpi": "9.00", + "can_apply": true + }, + "resume_link": { + "link": "http://localhost/storage/Resumes/200010021/resume_links", + "name": "resume_links" + }, + "additional_info": null, + "selected": true, + "applied_at": "2022-05-30T19:15:33+05:30", + "updated_at": "2022-05-30T19:16:31.662929+05:30", + "student": "200010021" + } + ] } ``` @@ -1275,7 +1312,10 @@ Response is a Json with these fields when the application is found. "application_found": "true", "application_info": { "id": "F28IRGGMC3RP8Y8", - "additional_info": , + "additional_info": { + "12th grade" : "9.1", + "current GPA": "9.6" + }, "resume": "resume_link" }, "student_details": { @@ -1297,11 +1337,16 @@ Response is a Json with these fields when the applciation is not found. "name": "John", "batch": "2020", "branch": "MMAE", - "resume_list": + "resume_link": { + "link": "http://localhost/storage/Resumes/200010021/resume_links", + "name": "resume_links" + } } } ``` +"resume_link": {link: "http://localhost/storage/Resumes/200010021/resume_links", name: "resume_links"} + ### Status Codes The possible responses for this api request are as follows From 28f78996f55a94bed4c28a66439204f6a22371d6 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Mon, 30 May 2022 19:32:46 +0530 Subject: [PATCH 17/21] resume_list field updated --- CDC_Backend/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index d9cc5a2..da9b819 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -1313,7 +1313,7 @@ Response is a Json with these fields when the application is found. "application_info": { "id": "F28IRGGMC3RP8Y8", "additional_info": { - "12th grade" : "9.1", + "12th grade": "9.1", "current GPA": "9.6" }, "resume": "resume_link" @@ -1322,7 +1322,10 @@ Response is a Json with these fields when the application is found. "name": "John", "batch": "2020", "branch": "MMAE", - "resume_list": + "resume_list": { + "link": "http://localhost/storage/Resumes/200010021/resume_links", + "name": "resume_link" + } } } ``` @@ -1337,9 +1340,9 @@ Response is a Json with these fields when the applciation is not found. "name": "John", "batch": "2020", "branch": "MMAE", - "resume_link": { + "resume_list": { "link": "http://localhost/storage/Resumes/200010021/resume_links", - "name": "resume_links" + "name": "resume_link" } } } From 3269496ab205f75de78ec6065dd593ae10048b47 Mon Sep 17 00:00:00 2001 From: jp-karthik Date: Mon, 30 May 2022 19:41:30 +0530 Subject: [PATCH 18/21] indentation issue --- CDC_Backend/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CDC_Backend/README.md b/CDC_Backend/README.md index da9b819..62258ef 100644 --- a/CDC_Backend/README.md +++ b/CDC_Backend/README.md @@ -1348,8 +1348,6 @@ Response is a Json with these fields when the applciation is not found. } ``` -"resume_link": {link: "http://localhost/storage/Resumes/200010021/resume_links", name: "resume_links"} - ### Status Codes The possible responses for this api request are as follows From 32395e17f60e7efbfb46b2e87f64ed595befa23b Mon Sep 17 00:00:00 2001 From: gowtham Date: Mon, 6 Jun 2022 11:07:41 +0530 Subject: [PATCH 19/21] Aditional Info Setup --- CDC_Backend/APIs/adminUrls.py | 2 +- CDC_Backend/APIs/adminViews.py | 18 ++++++++---------- CDC_Backend/APIs/constants.py | 1 + 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CDC_Backend/APIs/adminUrls.py b/CDC_Backend/APIs/adminUrls.py index 90d9c71..e0d6cd8 100644 --- a/CDC_Backend/APIs/adminUrls.py +++ b/CDC_Backend/APIs/adminUrls.py @@ -8,7 +8,7 @@ urlpatterns = [ path('updateDeadline/', adminViews.updateDeadline, name="Update Deadline"), path('updateOfferAccepted/', adminViews.updateOfferAccepted, name="Update Offer Accepted"), path('updateEmailVerified', adminViews.updateEmailVerified, name="Update Email Verified"), - path('updateAdditionalInfo/', adminViews.updateAdditionalInfo, name="Update Additional Info"), + path('deleteAdditionalInfo/', adminViews.deleteAdditionalInfo, name="Delete Additional Info"), path('getApplications/', adminViews.getApplications, name="Get Applications"), path("submitApplication/", adminViews.submitApplication, name="Submit Application"), path('generateCSV/', adminViews.generateCSV, name="Generate CSV"), diff --git a/CDC_Backend/APIs/adminViews.py b/CDC_Backend/APIs/adminViews.py index 4acf47c..637d9e7 100644 --- a/CDC_Backend/APIs/adminViews.py +++ b/CDC_Backend/APIs/adminViews.py @@ -145,20 +145,18 @@ def updateEmailVerified(request, id, email, user_type): @api_view(['POST']) @isAuthorized([ADMIN]) -@precheck([OPENING_ID, ADDITIONAL_INFO]) -def updateAdditionalInfo(request, id, email, user_type): +@precheck([OPENING_ID, FIELD]) +def deleteAdditionalInfo(request, id, email, user_type): try: data = request.data opening = get_object_or_404(Placement, pk=data[OPENING_ID]) - if data[ADDITIONAL_INFO] == "": - opening.additional_info = [] - elif isinstance(data[ADDITIONAL_INFO], list): - opening.additional_info = data[ADDITIONAL_INFO] + if data[FIELD] in opening.additional_info: + opening.additional_info.remove(data[FIELD]) + opening.save() + return Response({'action': "Delete Additional Info", 'message': "Additional Info Deleted"}, + status=status.HTTP_200_OK) else: - raise ValueError("Additional Info must be a list") - opening.save() - return Response({'action': "Update Additional Info", 'message': "Additional Info Updated"}, - status=status.HTTP_200_OK) + raise ValueError("Additional Info Not Found") except Http404: return Response({'action': "Update Additional Info", 'message': 'Opening Not Found'}, status=status.HTTP_404_NOT_FOUND) diff --git a/CDC_Backend/APIs/constants.py b/CDC_Backend/APIs/constants.py index 5981cba..75a23b6 100644 --- a/CDC_Backend/APIs/constants.py +++ b/CDC_Backend/APIs/constants.py @@ -70,6 +70,7 @@ RESUME_FILE_NAME = 'resume_file_name' APPLICATION_ID = "application_id" OPENING_ID = "opening_id" ADDITIONAL_INFO = "additional_info" +FIELD = "field" STATUS_ACCEPTING_APPLICATIONS = "Accepting Applications" From 8b7d78a67f966ca4f08e233f76482daca5bc7156 Mon Sep 17 00:00:00 2001 From: gowtham Date: Mon, 6 Jun 2022 11:55:56 +0530 Subject: [PATCH 20/21] Aditional Info complete --- CDC_Backend/APIs/adminUrls.py | 1 + CDC_Backend/APIs/adminViews.py | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/CDC_Backend/APIs/adminUrls.py b/CDC_Backend/APIs/adminUrls.py index e0d6cd8..587c1bb 100644 --- a/CDC_Backend/APIs/adminUrls.py +++ b/CDC_Backend/APIs/adminUrls.py @@ -9,6 +9,7 @@ urlpatterns = [ path('updateOfferAccepted/', adminViews.updateOfferAccepted, name="Update Offer Accepted"), path('updateEmailVerified', adminViews.updateEmailVerified, name="Update Email Verified"), path('deleteAdditionalInfo/', adminViews.deleteAdditionalInfo, name="Delete Additional Info"), + path('addAdditionalInfo/', adminViews.addAdditionalInfo, name="Add Additional Info"), path('getApplications/', adminViews.getApplications, name="Get Applications"), path("submitApplication/", adminViews.submitApplication, name="Submit Application"), path('generateCSV/', adminViews.generateCSV, name="Generate CSV"), diff --git a/CDC_Backend/APIs/adminViews.py b/CDC_Backend/APIs/adminViews.py index 637d9e7..66a7f8f 100644 --- a/CDC_Backend/APIs/adminViews.py +++ b/CDC_Backend/APIs/adminViews.py @@ -158,17 +158,43 @@ def deleteAdditionalInfo(request, id, email, user_type): else: raise ValueError("Additional Info Not Found") except Http404: - return Response({'action': "Update Additional Info", 'message': 'Opening Not Found'}, + return Response({'action': "Delete Additional Info", 'message': 'Opening Not Found'}, status=status.HTTP_404_NOT_FOUND) except ValueError: - return Response({'action': "Update Additional Info", 'message': "Additional Info must be a list"}, + return Response({'action': "Delete Additional Info", 'message': "Additional Info not found"}, + status=status.HTTP_404_NOT_FOUND) + except Exception as e: + logger.warning("Delete Additional Info: " + str(e)) + return Response({'action': "Delete Additional Info", 'message': "Something went wrong"}, + status=status.HTTP_400_BAD_REQUEST) + +@api_view(['POST']) +@isAuthorized([ADMIN]) +@precheck([OPENING_ID, FIELD]) +def addAdditionalInfo(request, id, email, user_type): + try: + data = request.data + opening = get_object_or_404(Placement, pk=data[OPENING_ID]) + if data[FIELD] not in opening.additional_info: + opening.additional_info.append(data[FIELD]) + opening.save() + return Response({'action': "Add Additional Info", 'message': "Additional Info Added"}, + status=status.HTTP_200_OK) + else: + raise ValueError("Additional Info Found") + except Http404: + return Response({'action': "Add Additional Info", 'message': 'Opening Not Found'}, + status=status.HTTP_404_NOT_FOUND) + except ValueError: + return Response({'action': "Add Additional Info", 'message': "Additional Info already found"}, status=status.HTTP_400_BAD_REQUEST) except Exception as e: - logger.warning("Update Additional Info: " + str(e)) - return Response({'action': "Update Additional Info", 'message': "Something went wrong"}, + logger.warning("Add Additional Info: " + str(e)) + return Response({'action': "Add Additional Info", 'message': "Something went wrong"}, status=status.HTTP_400_BAD_REQUEST) + @api_view(['GET']) @isAuthorized([ADMIN]) @precheck([OPENING_ID]) From 4f18d2d540647f7a48d567c92d7490fcb59c0bed Mon Sep 17 00:00:00 2001 From: karthik mv Date: Thu, 21 Jul 2022 16:41:31 +0530 Subject: [PATCH 21/21] Tracking object changes (#132) * track history using simple django history * tracking changes in model and saving api request sender * minor fixes * correcting requirements.txt Co-authored-by: Gowtham Sai <66207607+gowtham3105@users.noreply.github.com> --- .gitignore | 1 + CDC_Backend/APIs/admin.py | 13 +++--- CDC_Backend/APIs/adminViews.py | 9 ++++ CDC_Backend/APIs/models.py | 69 ++++++++++++++++++++++++++++- CDC_Backend/APIs/studentViews.py | 5 ++- CDC_Backend/CDC_Backend/settings.py | 7 +-- requirements.txt | 9 ++-- 7 files changed, 98 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 238e0ab..445be84 100644 --- a/.gitignore +++ b/.gitignore @@ -139,3 +139,4 @@ dmypy.json /CDC_Backend/Storage/ .idea *.pyc +dev.env diff --git a/CDC_Backend/APIs/admin.py b/CDC_Backend/APIs/admin.py index e2a87c3..ab52c34 100644 --- a/CDC_Backend/APIs/admin.py +++ b/CDC_Backend/APIs/admin.py @@ -1,4 +1,5 @@ from django.contrib import admin +from simple_history.admin import SimpleHistoryAdmin from django.contrib.admin.templatetags.admin_urls import admin_urlname from django.shortcuts import resolve_url from django.utils.html import format_html @@ -6,8 +7,8 @@ from django.utils.safestring import SafeText from .models import * -admin.site.register(User) -admin.site.register(Admin) +admin.site.register(User, SimpleHistoryAdmin) +admin.site.register(Admin, SimpleHistoryAdmin) admin.site.site_header = "CDC Recruitment Portal" @@ -18,7 +19,7 @@ def model_admin_url(obj, name=None) -> str: @admin.register(Student) -class Student(admin.ModelAdmin): +class Student(SimpleHistoryAdmin): list_display = ("roll_no", "name", "batch", "branch", "phone_number", 'can_apply') search_fields = ("roll_no", "name", "phone_number") ordering = ("roll_no", "name", "batch", "branch", "phone_number") @@ -37,7 +38,7 @@ class Student(admin.ModelAdmin): @admin.register(Placement) -class Placement(admin.ModelAdmin): +class Placement(SimpleHistoryAdmin): list_display = (COMPANY_NAME, CONTACT_PERSON_NAME, PHONE_NUMBER, 'tier', 'compensation_CTC') search_fields = (COMPANY_NAME, CONTACT_PERSON_NAME) ordering = (COMPANY_NAME, CONTACT_PERSON_NAME, 'tier', 'compensation_CTC') @@ -45,7 +46,7 @@ class Placement(admin.ModelAdmin): @admin.register(PlacementApplication) -class PlacementApplication(admin.ModelAdmin): +class PlacementApplication(SimpleHistoryAdmin): list_display = ('id', 'Placement', 'Student', 'selected') search_fields = ('id',) ordering = ('id',) @@ -59,7 +60,7 @@ class PlacementApplication(admin.ModelAdmin): @admin.register(PrePlacementOffer) -class PrePlacementOffer(admin.ModelAdmin): +class PrePlacementOffer(SimpleHistoryAdmin): list_display = ('company', 'Student', 'accepted') search_fields = ('company',) ordering = ('company',) diff --git a/CDC_Backend/APIs/adminViews.py b/CDC_Backend/APIs/adminViews.py index 66a7f8f..da935d9 100644 --- a/CDC_Backend/APIs/adminViews.py +++ b/CDC_Backend/APIs/adminViews.py @@ -39,6 +39,7 @@ def markStatus(request, id, email, user_type): sendEmail(email, subject, data, STUDENT_APPLICATION_STATUS_SELECTED_TEMPLATE) else: sendEmail(email, subject, data, STUDENT_APPLICATION_STATUS_NOT_SELECTED_TEMPLATE) + application.chaged_by = get_object_or_404(User, id=id) application.save() else: raise ValueError("Student - " + i[STUDENT_ID] + " didn't apply for this opening") @@ -89,6 +90,7 @@ def updateDeadline(request, id, email, user_type): opening = get_object_or_404(Placement, pk=data[OPENING_ID]) # Updating deadline date with correct format in datetime field opening.deadline_datetime = datetime.datetime.strptime(data[DEADLINE_DATETIME], '%Y-%m-%d %H:%M:%S %z') + opening.changed_by = get_object_or_404(User, id=id) opening.save() return Response({'action': "Update Deadline", 'message': "Deadline Updated"}, status=status.HTTP_200_OK) @@ -111,6 +113,7 @@ def updateOfferAccepted(request, id, email, user_type): opening = get_object_or_404(Placement, pk=data[OPENING_ID]) opening.offer_accepted = True if data[OFFER_ACCEPTED] == True else False print(opening.offer_accepted) + opening.changed_by = get_object_or_404(User, id=id) opening.save() return Response({'action': "Update Offer Accepted", 'message': "Offer Accepted Updated"}, status=status.HTTP_200_OK) @@ -131,6 +134,7 @@ def updateEmailVerified(request, id, email, user_type): data = request.data opening = get_object_or_404(Placement, pk=data[OPENING_ID]) opening.email_verified = True if data[EMAIL_VERIFIED] == "true" else False + opening.changed_by = get_object_or_404(User, id=id) opening.save() return Response({'action': "Update Email Verified", 'message': "Email Verified Updated"}, status=status.HTTP_200_OK) @@ -152,6 +156,7 @@ def deleteAdditionalInfo(request, id, email, user_type): opening = get_object_or_404(Placement, pk=data[OPENING_ID]) if data[FIELD] in opening.additional_info: opening.additional_info.remove(data[FIELD]) + opening.changed_by = get_object_or_404(User, id=id) opening.save() return Response({'action': "Delete Additional Info", 'message': "Additional Info Deleted"}, status=status.HTTP_200_OK) @@ -182,6 +187,7 @@ def addAdditionalInfo(request, id, email, user_type): status=status.HTTP_200_OK) else: raise ValueError("Additional Info Found") + except Http404: return Response({'action': "Add Additional Info", 'message': 'Opening Not Found'}, status=status.HTTP_404_NOT_FOUND) @@ -240,6 +246,7 @@ def submitApplication(request, id, email, user_type): else: additional_info[i] = data[ADDITIONAL_INFO][i] application.additional_info = json.dumps(additional_info) + application.changed_by = get_object_or_404(User, id=id) application.save() return Response({'action': "Add Student Application", 'message': "Application added"}, status=status.HTTP_200_OK) @@ -259,6 +266,7 @@ def submitApplication(request, id, email, user_type): additional_info[i] = data[ADDITIONAL_INFO][i] application.additional_info = json.dumps(additional_info) + application.changed_by = get_object_or_404(User, id=id) application.save() return Response({'action': "Add Student Application", 'message': "Application updated"}, status=status.HTTP_200_OK) @@ -349,6 +357,7 @@ def addPPO(request, id, email, user_type): PPO.tier = data[TIER] if COMPENSATION_DETAILS in data: PPO.compensation_details = data[COMPENSATION_DETAILS] + PPO.changed_by = get_object_or_404(User, id=id) PPO.save() return Response({'action': "Add PPO", 'message': "PPO added"}, status=status.HTTP_200_OK) diff --git a/CDC_Backend/APIs/models.py b/CDC_Backend/APIs/models.py index b986089..d013140 100644 --- a/CDC_Backend/APIs/models.py +++ b/CDC_Backend/APIs/models.py @@ -1,6 +1,7 @@ from django.contrib.postgres.fields import ArrayField from django.db import models from django.utils import timezone +from simple_history.models import HistoricalRecords from .constants import * @@ -13,6 +14,7 @@ class User(models.Model): id = models.CharField(blank=False, max_length=25) user_type = ArrayField(models.CharField(blank=False, max_length=10), size=4, default=list, blank=False) last_login_time = models.DateTimeField(default=timezone.now) + history = HistoricalRecords() class Meta: verbose_name_plural = "User" @@ -30,14 +32,41 @@ class Student(models.Model): default=list, blank=True) cpi = models.DecimalField(decimal_places=2, max_digits=4) can_apply = models.BooleanField(default=True, verbose_name='Registered') + changed_by = models.ForeignKey(User, blank=True, on_delete=models.RESTRICT, default=None, null=True) + history = HistoricalRecords(user_model=User) def __str__(self): return str(self.roll_no) + @property + def _history_user(self): + return self.changed_by + + @_history_user.setter + def _history_user(self, value): + if isinstance(value, User): + self.changed_by = value + else: + self.changed_by = None + + class Admin(models.Model): id = models.CharField(blank=False, max_length=15, primary_key=True) name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT) + changed_by = models.ForeignKey(User, blank=True, on_delete=models.RESTRICT, default=None, null=True) + history = HistoricalRecords(user_model=User) + + @property + def _history_user(self): + return self.changed_by + + @_history_user.setter + def _history_user(self, value): + if isinstance(value, User): + self.changed_by = value + else: + self.changed_by = None def two_day_after_today(): @@ -114,7 +143,8 @@ class Placement(models.Model): deadline_datetime = models.DateTimeField(blank=False, verbose_name="Deadline Date", default=two_day_after_today) created_at = models.DateTimeField(blank=False, default=None, null=True) updated_at = models.DateTimeField(blank=False, default=None, null=True) - + changed_by = models.ForeignKey(User, on_delete=models.CASCADE, blank=True, null=True) + history = HistoricalRecords(user_model=User) def format(self): if self.company_name is not None: self.company_name = self.company_name.strip()[:JNF_SMALLTEXT_MAX_CHARACTER_COUNT] @@ -158,6 +188,17 @@ class Placement(models.Model): if self.additional_info is not None: self.additional_info = [info.strip()[:JNF_TEXTMEDIUM_MAX_CHARACTER_COUNT] for info in list(self.additional_info)] + @property + def _history_user(self): + return self.changed_by + + @_history_user.setter + def _history_user(self, value): + if isinstance(value, User): + self.changed_by = value + else: + self.changed_by = None + def save(self, *args, **kwargs): ''' On save, add timestamps ''' if not self.created_at: @@ -179,6 +220,8 @@ class PlacementApplication(models.Model): selected = models.BooleanField(null=True, default=None, blank=True) applied_at = models.DateTimeField(blank=False, default=None, null=True) updated_at = models.DateTimeField(blank=False, default=None, null=True) + changed_by = models.ForeignKey(User, blank=False, on_delete=models.RESTRICT, default=None, null=True) + history = HistoricalRecords(user_model=User) def save(self, *args, **kwargs): ''' On save, add timestamps ''' @@ -188,6 +231,17 @@ class PlacementApplication(models.Model): return super(PlacementApplication, self).save(*args, **kwargs) + @property + def _history_user(self): + return self.changed_by + + @_history_user.setter + def _history_user(self, value): + if isinstance(value, User): + self.changed_by = value + else: + self.changed_by = None + class Meta: verbose_name_plural = "Placement Applications" unique_together = ('placement_id', 'student_id') @@ -206,3 +260,16 @@ class PrePlacementOffer(models.Model): tier = models.CharField(blank=False, choices=TIERS, max_length=10) designation = models.CharField(blank=False, max_length=25, default=None, null=True) accepted = models.BooleanField(default=None, null=True) + changed_by = models.ForeignKey(User, blank=False, on_delete=models.RESTRICT, default=None, null=True) + history = HistoricalRecords(user_model=User) + + @property + def _history_user(self): + return self.changed_by + + @_history_user.setter + def _history_user(self, value): + if isinstance(value, User): + self.changed_by = value + else: + self.changed_by = None diff --git a/CDC_Backend/APIs/studentViews.py b/CDC_Backend/APIs/studentViews.py index d3c3fe9..27c7c28 100644 --- a/CDC_Backend/APIs/studentViews.py +++ b/CDC_Backend/APIs/studentViews.py @@ -44,7 +44,7 @@ def addResume(request, id, email, user_type): destination_path = STORAGE_DESTINATION_RESUMES + str(student.roll_no) + "/" file_name = saveFile(file, destination_path) student.resumes.append(file_name) - + student.changed_by = get_object_or_404(User, id=id) student.save() return Response({'action': "Upload Resume", 'message': "Resume Added"}, status=status.HTTP_200_OK) @@ -104,6 +104,7 @@ def deleteResume(request, id, email, user_type): if path.exists(destination_path): # remove(destination_path) student.resumes.remove(file_name) + student.changed_by = get_object_or_404(User, id=id) student.save() return Response({'action': "Delete Resume", 'message': "Resume Deleted"}, status=status.HTTP_200_OK) @@ -177,7 +178,7 @@ def submitApplication(request, id, email, user_type): } subject = STUDENT_APPLICATION_SUBMITTED_TEMPLATE_SUBJECT.format(company_name=opening.company_name) sendEmail(email, subject, data, STUDENT_APPLICATION_SUBMITTED_TEMPLATE) - + application.changed_by = get_object_or_404(User, id=id) application.save() return Response({'action': "Submit Application", 'message': "Application Submitted"}, status=status.HTTP_200_OK) diff --git a/CDC_Backend/CDC_Backend/settings.py b/CDC_Backend/CDC_Backend/settings.py index 4c24f27..22552bf 100644 --- a/CDC_Backend/CDC_Backend/settings.py +++ b/CDC_Backend/CDC_Backend/settings.py @@ -29,7 +29,7 @@ SECRET_KEY = 'e_i2g3z!y4+p3dwm%k9k=zmsot@aya-0$mmetgxz4mp#8_oy#*' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['cdc-iitdh.herokuapp.com/', 'localhost', '192.168.29.199'] +ALLOWED_HOSTS = ['cdc-iitdh.herokuapp.com/', 'localhost', '192.168.29.199', '127.0.0.1'] # Application definition @@ -44,7 +44,8 @@ INSTALLED_APPS = [ 'rest_framework', 'corsheaders', 'django_db_logger', - 'background_task' + 'background_task', + 'simple_history', ] MIDDLEWARE = [ @@ -57,7 +58,7 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - + 'simple_history.middleware.HistoryRequestMiddleware', ] ROOT_URLCONF = 'CDC_Backend.urls' diff --git a/requirements.txt b/requirements.txt index 6ca6f8a..5fbc28b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,12 +5,14 @@ certifi==2021.10.8 chardet==4.0.0 charset-normalizer==2.0.12 colorama==0.4.4 +dill==0.3.5.1 dj-database-url==0.5.0 Django==3.2.13 django-background-tasks==1.2.5 django-compat==1.0.15 django-cors-headers==3.11.0 django-db-logger==0.1.12 +django-simple-history==3.1.1 djangorestframework==3.13.1 google-auth==2.6.6 gunicorn==20.1.0 @@ -26,17 +28,18 @@ platformdirs==2.5.1 psycopg2-binary==2.9.3 pyasn1==0.4.8 pyasn1-modules==0.2.8 +PyJWT==2.4.0 pylint==2.13.5 python-dotenv==0.20.0 pytz==2022.1 -PyJWT==2.4.0 requests==2.27.1 rsa==4.8 six==1.16.0 sqlparse==0.4.2 toml==0.10.2 -typing_extensions==4.1.1 +tomli==2.0.1 +typing-extensions==4.1.1 urllib3==1.26.9 whitenoise==6.0.0 +wrapt==1.14.0 zipp==3.8.0 -wrapt==1.14.0 \ No newline at end of file