The Kirana Management System is a Java-based application designed to manage transactions and store owner information in a Kirana store.
The project is organized into several packages, each serving a specific purpose:
com.kirana.management.model
: Contains the entity classes representing the data model.com.kirana.management.dto
: Contains Data Transfer Objects (DTOs) used for communication.com.kirana.management.repository
: Provides Spring Data JPA repositories for database interaction.com.kirana.management.service
: Defines service interfaces and their implementations for business logic.com.kirana.management.controller
: Contains controllers handling HTTP requests.
- I have use H2 database so you can directly run this code and spring will automatically establish connection to the database.
- start the main spring function and
- Use postman for check api endpoint.
- Java 20
- Spring boot 3.1.0
- H2 Database
- IntellijIDE
- Postman
- API for currency rate -> https://api.fxratesapi.com/latest
- New Store Owner : it can be done using - http://localhost:8080/api/storeOwner/create and passing ownerName , storeAddress and balanceINR as request body.
- New Transaction : it can be done using - http://localhost:8080/api/transaction/new and passing type , transactionAmount and date as request body. This will return transaction json response with all the required information. Trannsaction will affect the balanceAmount of owner.
- All Transaction by Type : it can be done using - http://localhost:8080/api/transaction/all/debit it can be credit also. This will return list of all transaction of specific type.
- All Transaction by Date : it can be done using - http://localhost:8080/api/transaction/all/date/2020-01-11 in this date should be of "yyyy-MM-dd" pattern. This will return list of transaction occur on the given date.