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

Module Server Side

The document outlines the creation of a car instalment platform for a sales company, detailing the project phases, which include developing a REST API and a frontend application using specified frameworks. It includes specifications for user authentication, data validation, and the process for applying for car instalments, along with various scenarios for user interactions. Additionally, it emphasizes the need for a Postman collection for API testing and provides guidelines for the frontend implementation and response handling.

Uploaded by

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

Module Server Side

The document outlines the creation of a car instalment platform for a sales company, detailing the project phases, which include developing a REST API and a frontend application using specified frameworks. It includes specifications for user authentication, data validation, and the process for applying for car instalments, along with various scenarios for user interactions. Additionally, it emphasizes the need for a Postman collection for API testing and provides guidelines for the frontend implementation and response handling.

Uploaded by

putragustin25
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SERVER-SIDE MODULE

CONTENTS
This module has the following files:
1. MODULE_SERVER_SIDE.doc
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:

● Laravel (v11.x)

● React (v18.x with react-router-dom and axios)

● Vue (v3.x with vue-router and axios)


Phase one – Society Car instalment REST API
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.
Scenario: Society Login
Request:
URL: [domain]/api/v1/auth/login
Method: POST
Header:
Body: { id_card_number: “SomeText”, password: “SomeText” }
Response:
A1a - If login success
Header: Response 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"
}
}
A1b - If ID Card Number or Password incorrect
Header: Response code: 401
Body: { "message": "ID Card Number or Password incorrect" }
Scenario: Society Logout
Request:
URL: [domain]/api/v1/auth/logout
Params:
Method: POST
Header: { Authorization: Bearer xxxxxx }
Body:
Response:
A1c - If logout success
Header: Response code: 200
Body: { "message": "Logout success" }
A1d - If logout invalid token
Header: Response code: 401
Body: { "message": "Invalid token" }

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.

Scenario: Request data validations


Request:
URL: [domain]/api/v1/validation
Params:
Method: POST
Header:{ Authorization: Bearer xxxxxx }
Body: { job: “SomeText”, job_description: “SomeText”,
income: “SomeText” , reason_accepted: “SomeText” }
Response:
A2a - If request data validation success
Header: Response code: 200
Body: { "message": "Request data validation sent
successful" }
A2b - If invalid token
Header: Response code: 401
Body: { "message": "Unauthorized user" }

Scenario: Get society data validation


Request:
URL: [domain]/api/v1/validations
Params:
Method: GET
Header: { Authorization: Bearer xxxxxx }
Body:
Response:
A2c - If success
Header: Response code: 200
Body: {
“validation”: {
"id": 1,
"status": "pending”|”accepted”|”rejected",
"job": "SomeText”|null,
"job_description": "SomeText"|null,
"income": "SomeText"|null,
"reason_accepted": “SomeText”|null,
"validator_notes": “SomeText”|null,
"validator": { VALIDATOR }|null
}
}
A2d - If invalid token
Header: Response code: 401
Body: {"message": "Unauthorized user"}
Instalment
When the validation data has been accepted by the validator and society will apply for
instalment cars, the society can choose the cas 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 cars.

Scenario: Get all Instalment cars


Request:
URL: [domain]/api/v1/instalment_cars
Params:
Method: GET
Header: { Authorization: Bearer xxxxxx }
Body:
Response:
A3a - If success
Header: Response code: 200
Body: {
"cars": [
{
"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",
},
...,
]
},
...,
]
}
A3b - If invalid token
Header: Response code: 401
Body: { "message": "Unauthorized user" }

Scenario: Get Instalment detail by instalment ID


Request:
URL: /api/v1/instalment_cars/<id>
Params: { id }
Method: GET
Header: { Authorization: Bearer xxxxxx }
Body:
Response:
A3c - If success
Header: Response 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
Header: Response code: 401
Body: { "message": "Unauthorized user" }

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
applying for Instalment.
Scenario: Applying for instalment
Request:
URL: /api/v1/applications
Params:
Method: POST
Header: { Authorization: Bearer xxxxxx }
Body: { instalment_id: 1, months: 12, notes : “SomeText” }
Response:
A4a - If success
Header: Response code: 200
Body: { "message": "Applying for Instalment successful" }
A4b - If invalid token
Header: Response code: 401
Body: { "message": "Unauthorized user" }
A4c - If the society validation data hasn’t accepted by
validator
Header: Response code: 401
Body: { "message": "Your data validator must be accepted by
validator before" }
A4d - If invalid fields
Header: Response code: 401
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
Header: Response code: 401
Body: { "message": " Application for a instalment can only
be once" }

Scenario: Get all of society instalment applications


Request:
URL: [domain]/api/v1/applications
Params:
Method: GET
Header: { Authorization: Bearer xxxxxx }
Body: Response:
A4f - If success
Header: Response 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


Header: Response code: 401
Body: { "message": "Unauthorized user" }

POSTMAN Collection
You have to create a postman collection to check the API that has been created. An example is as
follows:
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 following the REST API you created before.
Implement REST API into the frontend. All response formats must be in JSON form.

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

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
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
Scenario: B2f - The car instalment application is displayed when
society data validation have 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

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 can
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

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 is appear, and I redirected to
dashboard page

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
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.

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.
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 a 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 is appear and I redirected to
dashboard page

Notes:
- For each response from the REST API must be displayed.
- Build the frontend into production mode first before your
frontend project is pushed and the REST API must be consumed from
your API before.
ERD
You can make your own ERD according to your needs. bellow is an example of ERD:

INSTRUCTION FOR COMPETITORS


● You may create additional endpoints if necessary, but you must fulfil all of the
requirements listed above.

● You can add additional fields to the response body if needed, but ensure that all required
fields are included and the structure is displayed correctly.

● Create a root folder called XX_SERVER_MODULE in your local computer, where XX is


your computer number.

● Created Postman Collection, Database ([Link]) and ER diagram ([Link])


should be exported and saved under the root folder <host>/XX_SERVER_MODULE

● REST API should be reached on <host>/XX_SERVER_MODULE/BACKEND where xx is PC


number. No port and no /public suffix path.
● Frontend app should be reached on <host>/XX_SERVER_MODULE/FRONTEND.

● Zip root folder XX_SERVER_MODULE and submit to the submission page. Make sure to
exclude the vendor and node_modules folder when zipping files.

You might also like