0% found this document useful (0 votes)
4 views21 pages

Module Server Side Rev00

The document outlines the development of a car instalment platform for a sales company, divided into two phases: creating a REST API and building a frontend application. It details user authentication, data validation, and the process for applying for car instalments, including API endpoints and expected responses. The frontend specifications include user login/logout functionality, a dashboard for data validation and instalment applications, and a list of available cars for instalment.

Uploaded by

zulkiflicaniyago
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views21 pages

Module Server Side Rev00

The document outlines the development of a car instalment platform for a sales company, divided into two phases: creating a REST API and building a frontend application. It details user authentication, data validation, and the process for applying for car instalments, including API endpoints and expected responses. The frontend specifications include user login/logout functionality, a dashboard for data validation and instalment applications, and a list of available cars for instalment.

Uploaded by

zulkiflicaniyago
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

SERVER-SIDE MODULE

CONTENTS
This module has the following files:
1. MODULE_SERVER_SIDE.pdf
2. MODULE_SEVER_SIDE_MEDIA.zip

INTRODUCTION
A car sales company wants to sell cars to many types of people. not all people can buy
a car with cash. So, the company appoints you as a competent person to create an
instalment cars platform.
The goal of this platform is for people to make car instalment transactions online.

DESCRIPTION OF PROJECTS AND TASKS


Registration involves the society platform (registering to the platform and applying for
instalment), the company platform (giving instalment cars, viewing and
accepting/rejecting registrations from the instalment), and the officer platform
(updating company data, checking the validity of society data).
This module is divided into two phases. In the first phase, you will create a REST API.
In the second phase, you will build a frontend application. You must use the provided
frameworks:
1. Laravel (v11.x)
2. React (v18.x with react-router-dom and axios)
3. Vue (v3.x with vue-router and axios)

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 1 dari 21
Phase one – Society Car instalment REST API
A1: Authentication
Before a society performs any activity on the society platform, they must be logged
in using their ID card number and password. Sanctum should be used to create
tokens. The generated token will be used to access all available endpoints.

Specifications:
Feature: A1 - Login and Logout as society: as a visitor, I want to login so that I can
enter the system and apply for Instalment.

POST /api/v1/auth/login
Request Headers

Accept application/json

Body (JSON)

id_card_number required
password required

Response:
A1a: Response Success

Status Code 200

Body {
"name": "Doni Rianto",
"born_date": "1974-10-22",
"gender": "male" | ”female”,
"address": "Ki. Raya Setiabudhi No. 790",
"token": "1|qgV2cTisoRVSwX6R2iPpxd..",
"regional": {
"id": 1,
"province": "DKI Jakarta",
"district": "Central Jakarta"
}
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 2 dari 21
A1b - If ID Card Number or Password incorrect

Status Code 401

Body {
"message": "ID Card Number or Password incorrect"
}

POST /api/v1/auth/logout
Request Headers

Accept application/json

Authorization Bearer <TOKEN>

Response:
A1c: If logout success

Status Code 200

Body {
"message": "Logout success"
}

A1d: If logout invalid token

Status Code 401

Body {
"message": "Invalid token"
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 3 dari 21
A2: Request Data Validation
To be able to apply for Instalment, the society must do validation data on the platform
first. The society can view validity status and make validation requests. The society
can only make one validation data request.

Specifications:
Feature: A2 - Request Data Validation: As a society, I want to request data validation
so that I can apply for instalment when my data validation is accepted.

POST /api/v1/validation
Request Headers

Accept application/json

Authorization Bearer <TOKEN>

Body (JSON)

job required
job_description required
income required
reason_accepted optional

Response:
A2a - If request data validation success
Header: Response code: 200

Status Code 200

Body {
"message": "Request data validation sent successful"
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 4 dari 21
A2b - If invalid token

Status Code 401

Body {
"message": "Unauthorized user"
}

GET /api/v1/validations
Request Headers

Accept application/json

Authorization Bearer <TOKEN>

Response:
A2c - If success

Status Code 200

Body {
"validation": {
"id": 1,
"status": "pending" | "accepted" | "declined",
"job": "SomeText" | null,
"job_description": "SomeText" | null,
"income": 1000000,
"reason_accepted": "SomeText" | null,
"validator": {
"role": "validator",
"name”: "Eva Mandasari"
} | null
}
}

A2d - If invalid token

Status Code 401

Body {
"message": "Unauthorized user"
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 5 dari 21
A3: Instalment
When the validation data has been accepted by the validator and society will apply for
instalment cars, the society can choose the cars based on the income that has been
entered during data validation. List of available cars at each brand should also be
displayed.
In the car's detail, it can calculate the price to be paid each month.

Specifications:
Feature: A3 – Instalment: As a society, I want to see a list of Instalment .

GET /api/v1/instalment_cars
Request Headers

Accept application/json

Authorization Bearer <TOKEN>

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 6 dari 21
Response:
A3a - If success

Status Code 200

Body {
"cars": [
{
"id": 1,
"car": "Toyota FT 86",
"brand": "Toyota",
"price": 900000000,
"description": "xxxx",
"available_month": [
{
"month": 12,
"description": "12 Months"
},
...
]
}
]
}

A3b - If invalid token

Status Code 401

Body {
"message": "Unauthorized user"
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 7 dari 21
GET /api/v1/instalment_cars/:id
Request Headers

Accept application/json

Authorization Bearer <TOKEN>

Response:
A3c - If success

Status Code 200

Body {
"instalment": {
"id": 1,
"car": "Toyota FT 86",
"brand": "Toyota",
"price": 900000000,
"description": " Toyota FT 86 car is the best",
"available_month": [
{
"month": 12,
"description": "12 Months"
},
...
]
}
}

A3d - If invalid token

Status Code 401

Body {
"message": "Unauthorized user"
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 8 dari 21
A4: Applying for instalment
The society can apply for an Instalment if the validation data has been accepted by
the validator.
Application for an Instalment can only be once.
Instalment ID and position must be filled.

Specifications:
Feature: A4 – Applying for Instalment: as a society, I want to apply for Instalment.

POST /api/v1/applications
Request Headers

Accept application/json

Authorization Bearer <TOKEN>

Body (JSON)

instalment_id required
months required
notes optional

Response:
A4a – If success

Status Code 200

Body {
“message”: “Applying for Instalment successful”
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 9 dari 21
A4b - If invalid token

Status Code 401

Body {
"message": "Unauthorized user"
}

A4c - If the society validation data hasn’t accepted by validator

Status Code 401

Body {
"message": "Your data validator must be accepted by
validator before"
}

A4d - If invalid fields

Status Code 422

Body {
"message": "Invalid field",
"errors": {
"instalment_id": [
"The instalment id field is required."
],
"months": [
"The months field is required."
]
}
}

A4e - If have been 2x applying

Status Code 422

Body {
"message": " Application for a instalment can only be
once"
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 10 dari 21
GET /api/v1/applications
Request Headers

Accept application/json

Authorization Bearer <TOKEN>

Response:
A4f - If success

Status Code 200

Body {
"instalments": [
{
"id": 1,
"car": "Toyota FT 86",
"brand": "Toyota",
"price": "900000000",
"description": "Toyota FT 86 car is the best",
"applications": [
{
"month": 12,
"nominal": 75000000,
"apply_status": "pending" | "accepted" |
"rejected",
"notes": "I want this cars"
},
...
]
},
...
]
}

A4g - If invalid token

Status Code 401

Body {
"message": "Unauthorized user"
}

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 11 dari 21
POSTMAN Collection
You must create a postman collection to check the API that has been created. An
example is as follows:

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 12 dari 21
Phase two - Society instalment Cars Platform (Frontend)
In this phase, you can use the gui template provided in the media files to build a society
platform. Use the REST API provided by the organizer that available on your virtual
workstation: [Link] where yyy is your region id.

B1: Society login and logout


To be able to enter the system, the society must first login using the ID card number
and password. When the society has entered the system, the logout button will appear,
and the society can exit the system by clicking the logout button
Specifications:
Feature: B1 - Society login and logout: as a visitor, I want to login into society
instalment cars platform and logout to exit the system.

Scenario: B1a - Society login success


Given I am on the login page
And I enter correct id_card_number and password
Then I redirected to society dashboard page

Scenario: B1b - Society login fails


Given I am on the login page
And I enter wrong id_card_number or password
Then I stay in the login page and I see error message “ID Card Number or Password
incorrect”

Scenario: B1c - Society logout success


Given I am on the any page that has been logged in
And I press logout button
Then I get message “logout success” and redirected to login page
And I cannot reach the previous page by going back

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 13 dari 21
B2: Society Dashboard
In the dashboard page, there are two sections, data validation and instalment cars
section. where the society must request a data validation and the data validation is
approved by the validator to be able to register for instalment cars application.

Specifications:
Feature: B2 - Society Dashboard: as a society, I want to see data validation info and
my instalment applications list in the dashboard page.

Scenario: B2a – Data validation section is displayed


Given I am on dashboard page
Then I see the data validation section with “My Data validation” title

Scenario: B2b - Link to request data validation appears when society hasn’t data
validation before
Given I am on dashboard page
And I haven’t request data validation before
Then I see request data validation link in the data validation section

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 14 dari 21
Scenario: B2c - Show data validation info

Given I am on dashboard page


And my request data validation is sent or accepted/rejected by validator
Then I see data validation info in the data validation section

Scenario: B2d - instalment cars application list section is displayed


Given I am on dashboard page
Then I see the instalment cars application list section with “instalment applications”
title

Scenario: B2e - Show instalment cars application info message


Given I am on dashboard page
And I haven’t request data validation before
Then I see “Your data validation must be approved by validator to get the applying
instalment” in the instalment cars application list section

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 15 dari 21
Scenario: B2f - The car instalment application is displayed when society data
validation has been accepted by validator

Given I am on dashboard page


And I my request data validation has been accepted by validator
Then I see the instalment cars application with link is displayed in the instalment cars
application list section

Given I am on dashboard page


And my instalment cars application is finished

Scenario: B2h - The instalment applications show instalment cars application info
correctly when instalment cars application is finished
Given I am on dashboard page
Then I see instalment cars application info (cars, total months, apply date, notes) in
the instalment cars application box

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 16 dari 21
B3: Request Data validation
In the data validation request page, the society can fill in the job, job description and
income if they have by selecting "Yes, I have" in the dropdown. Are you working?
question and they could send a request if the reason accepted has been filled.

Specifications:
Feature: B3 - Society Data validation: as a society, I want to request data validation.

Scenario: B3a - Data validation form is displayed correctly


When I press “Send Request” button in the dashboard page
Then I see the data validation form (job, job description, income, reason accepted) is
displayed

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 17 dari 21
Scenario: B3b - Request data validation successful
Given I am on request data validation page
And I press request button
Then the request data validation is sent, the “Request data validation successful”
message appears, and I redirected to dashboard page

B4: Instalment Cars List


When the society registers for instalment cars application by pressing the "Add
instalment cars application" button on the dashboard page, the society is directed to
the list instalment Cars page to select instalment Cars. In the item instalment Cars,
display the applying instalment available in those cars correctly.

Specifications:
Feature: B4 - instalment Cars List: as a society, I want to see a list of all instalment
Cars.

Scenario: B4a - Show list instalment Cars


Given I am on instalment Cars list page
Then I see a list of instalment Cars

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 18 dari 21
Scenario: B4b - Show information for each instalment Cars
Given I am on instalment Cars page
Then I see instalment information (car name, description, available month) in each
instalment item.

Scenario: B4c – instalment item unavailable when the instalment has been apply
before.

B5: Detail instalment


In the instalment detail page, there are details of instalment shown like car name,
address, car description, available months. Society can apply instalment by filling
months and notes for application.

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 19 dari 21
Specifications:
Feature: B5 - Detail Instalment: as a society, I want to see details of Instalment and
see available months.

Scenario: B5a - Information displays correctly


Given I am on instalment detail page
Then I see the section with available moths and calculate the price to be paid each
month.

Scenario: B5b - Can apply for an instalment if the income equal or exceed the
calculation per month
Given I am on instalment detail page
Then I see available months and calculate the price to be paid each month

Scenario: B5c - Register instalment cars application


Given I am on instalment detail page
I choose total months
I fill the Notes for instalment field
And I press “Apply” button
Then the success or error message appears, and I redirected to dashboard page

Notes:
1. For each response from the REST API must be displayed.
2. Build the frontend into production mode first before your frontend project is
pushed and the REST API must be consumed from API provided by the organize.

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 20 dari 21
ERD
You may use this ERD for building the RESTAPI Backend.

INSTRUCTION FOR COMPETITORS


1. Create a root folder called module_server_backend in your virtual workstation.
Upload your backend project so it can be accessible public on
[Link] where yyy is your region code.
2. Create Postman Collection and Database ([Link]).
3. REST API should be reached without port and no /public suffix path.
4. Frontend app should be reached on
[Link] where yyy is your region code. You
must use backend provided by the organizer that available on your virtual
workstation: [Link]
5. Zip root folder XX_SERVER_MODULE and store in submission folder in your
virtual workstation. Make sure to exclude the vendor and node_modules folder
when zipping files.

Server Module LKS Provinsi Jawa Barat Bidang Lomba Web Technologies (Rev 00-12-06-25) Hal 21 dari 21

You might also like