Overview • Entities • APIs • Demo • Application Properties • Development • Build
Creating a solution for a customer which is a big player in the Vehicles sales. The company has sales channels in multi geographies and sells different types of vehicles - 2 wheelers, 3 wheelers, 4 wheelers and commercial vehicles. They have a complex commission calculation model and needs help in creating a sales incentive management platform.
- Used to manage the commission to be paid to the Salesmen.
- The system should allow addition of a sales team member.
- System should allow for the definition of products under the following product types:
- 2 Wheelers
- 3 Wheelers
- 4 Wheelers
- Commercial Vehicles
- System should allow for batch input of sales for every product on a daily basis.
- The system should calculate the commission payable for every sales team member once the data for a month is updated.
- Backend - Spring Boot
- Database - MySQL
- Frontend - React
- Build System - Maven
- userId (primary key)
- username
- name
- password
- userQuota
- role
- roleId (primary key)
- roleName
- userId (foreign key)
- roleId (foreign key)
- productTypeId (primary key)
- pType
- pId (primary key)
- pName
- pCost
- pType
- salesId (primary key)
- pId (foreign key)
- userId (foreign key)
- pName
- pType
- transactionMonth
- commissionId (primary key)
- productTypeId (foreign key)
- startRange
- endRange
- commissionPercentage
- transactionId (primary key)
- userId (foreign key)
- productTypeId (foreign key)
- userAmount
- transactionMonth
- pCost
- userQuota
- pType
- commissionPercentage
- Post Mapping to return JWT.
{
username: "user",
password: "password"
}
- Get Mapping to find all users in the database.
- Get Mapping to find user by ID provided.
- Post Mapping to create user.
{
"username": "username",
"name": "Full Name",
"password": "password",
"userQuota": 50000
}
- Put Mapping to edit user by ID.
{
"username": "newusername",
"name": "Full Name",
"password": "password",
"userQuota": 48000
}
- Get Mapping to find all products in the database.
- Post Mapping to create new product.
{
"pName": "Honda",
"pCost": 72000
"pType": "2 Wheeler"
}
- Post Mapping to add sales details (Upload CSV in frontend). Auto updates the User Commission table when performed.
[
{
"pId": 1,
"userId": 2,
"pName": "Honda",
"pType": "2 Wheeler",
"transactionMonth": "2022-07"
},
{
"pId": 2,
"userId": 3,
"pName": "Hyundai",
"pType": "4 Wheeler",
"transactionMonth": "2022-08"
}
]
- Get Mapping to return commission structure for every product type.
- Get Mapping to find commission structure for a particular product type within a rage by it's ID.
- Put Mapping to edit the commission structure by ID.
{
"productTypeId": 3,
"startRange": 28000,
"endRange": 45000,
"commissionPercentage": 6
}
- Get Mapping for forced commission change. Updates the auto calculated commission amount of a user by force using Query.
{
"userId": 2,
"transactionMonth": "2022-07",
"userAmount": 34000
}
- Get Mapping to find all sales by every salesman in the database.
- Get Mapping to find their sales based on the month.
{
"userId": 2,
"transactionMonth": "2022-07"
}
- Get Mapping to display all the sales carried out by the logged in user.
- Get Mapping to display commission amount and user quota in bar chart form for the logged in user.
demo.mp4
server.port = yourPreferredPortNumber
spring.datasource.url = jdbc:mysql://localhost:3306/yourSchemaName
spring.datasource.username = yourUsername
spring.datasource.password = yourPassword
- Frontend
npm install
- Backend
mvn install
- Frontend
npm start
- Backend
mvn spring-boot:run