Soal - 2 - Rest Api
Soal - 2 - Rest Api
SERVER-SIDE MODULE
CONTENTS
This module has the following files:
1. MODULE_SERVER_SIDE.doc
2. MODULE_SEVER_SIDE_MEDIA.zip
INTRODUCTION
We know that the pandemic is not over yet and vaccination is something that must be done to
be able to reduce the death rate against the COVID-19 attack. So the government appoints you
as a competent person to create a vaccination registration platform.
The goal of this platform is so that societies can register vaccinations on the platform without
having to come to the vaccine spot directly and can also see when and where society can come
to the vaccine spot.
But your scope of work on this module is only to create a society platform. This module is divided
into two phases:
- Phase one for creating a Society Vaccination REST API using one of the provided PHP
frameworks
- Phase two for building a Frontend using provided JavaScript libraries (react/angular/vue)
of the Society Vaccination Platform
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Specifications :
Feature: A1 - Login and Logout as society: as a visitor, i want to
login so that i can enter the system and register a vaccination.
Request:
URL: [domain]/api/v1/auth/login
Method: POST
Header:
Response:
Body: {
"born_date": "1974-10-22",
"gender": "male"|”female”,
"token": "e96aaafb6f2f76460b8cc93723bd030e",
"regional": {
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
"id": 1,
Request Consultation
To be able to register a vaccine, the society must consult with a doctor on the platform first. The
society can view consultation status and make consultation requests. The society can only
make one vaccination request.
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Specifications:
Feature: A2 - Request Consultation: As a society, I want to request
consultation so that I can register for vaccination when my
consultation is accepted.
Request:
URL: [domain]/api/v1/consultations
Params: { token }
Method: POST
Header:
“SomeText” }
Response:
Request:
URL: [domain]/api/v1/consultations
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Params: { token }
Method: GET
Header:
Body:
Response:
A2c - If success
Body: {
“consultation”: {
"id": 1,
"status": "pending”|”accepted”|”rejected",
"disease_history": "SomeText”|null,
"current_symptoms": "SomeText"|null,
"doctor_notes": “SomeText”|null,
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Vaccination Spot
When the consultation has been accepted by the doctor and society will register the
vaccination, the society can choose the vaccination spot based on the society region. List of
available vaccines at each vaccine spot should also be displayed.
In the spot detail, calculate the number of vaccination registrations at that spot and on the
requested date in the date param (optional and default today).
Specifications:
Request:
URL: [domain]/api/v1/spots
Params: { token }
Method: GET
Header:
Body:
Response:
A3a - If success
Body: {
“spots”: [
"id": 1,
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
"serve": 1|2|3,
"capacity": 15,
"available_vaccines": {
"Sinovac": true,
"AstraZeneca": false,
"Moderna": true,
"Pfizer": true,
"Sinnopharm": false
},
...,
Request:
URL: /api/v1/spots/<spot_id>
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Method: GET
Header:
Body:
Response:
A3c - If success
Body: {
"spot": {
"id": 1,
"serve": 2,
"capacity": 15
},
"vaccinations_count": 12
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Vaccination Registration
The society can register for vaccination if the society consultation has been accepted by the
doctor. At the vaccination register, if the society has finished the first vaccination, it will
automatically register the second vaccination.
Society can register for a second vaccination on condition that they have to wait 30 days after
the first vaccination day and each society can only register for vaccination 2 times. Society can
be said to be vaccinated if it has received a dose of the vaccine.
Spot ID and date must be filled where the date format is YYYY-MM-DD.
Specifications:
Feature: A4 - Vaccination: as a society, i want to register
vaccination and get all vaccination data.
Request:
URL: /api/v1/vaccinations
Params: { token }
Method: POST
Header:
Response:
A4a - If success
successful" }
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Body: {
Vaccination" }
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Request:
URL: [domain]/api/v1/vaccinations
Params: { token }
Method: GET
Header:
Body: Response:
A4g - If success
Body: {
“vaccinations”: {
"first": {
"queue": 1,
"dose": 1,
"vaccination_date": "2021-10-21",
"spot": {
"id": 1,
"serve": 2,
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
"capacity": 15,
"regional": {
"id": 1,
},
"status": "done",
"vaccine": {
"id": 1,
"name": "Sinovac"
},
"vaccinator": {
"id": 1,
"role": "doctor",
},
"second": <VACCINATION>|null
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side
LOMBA KOMPETENSI SISWA
SEKOLAH MENENGAH KEJURUAN
TINGKAT PROVINSI JAWA BARAT
TAHUN 2022
Soal LKS SMK Tingkat Provinsi Jawa Barat Tahun 2022 – Web Technologies – Server Side