This project is a web sale point for managing sales and products.
This project is a RESTful API built with Spring Boot, providing a robust backend for.
-
Authentication and Authorization
- Secure token-based system for user authentication and authorization
-
Sale Point Management
- Create and manage sale points
- Add and remove sale point members
- Open, close, and manage sessions for each sale point
-
Product Management
- Maintain a shared catalog of products across all sale points
- Full CRUD (Create, Read, Update, Delete) operations for products
- Set discounts and offers on products
- Implement soft deletion for all objects, including products
-
Sales and Invoicing
- Record sales with relation to specific sale points and sessions
- Generate invoices for completed sales
- Export invoices as PDF files for printing or digital distribution
-
Data Integrity
- Maintain relationships between sales, sale points, and sessions
- Ensure data consistency across all operations
- Java 17 or higher
- Maven 3.9.6 or higher
- Postegresql
- Clone the repository
git clone
https://github.com/IsmailKattan/chashier_system.git- Navigate to the project directory
cd chashier_system - Build the project
mvn clean install
```cmd
4. Run the application
```cmd
mvn spring-boot:runThe application will start running at http://localhost:8080.
{
"username" : "admin",
"password" : "32-bit"
}.
βββ .mvn/
β βββ wrapper/
β βββ maven-wrapper.jar
β βββ maven-wrapper.properties
βββ src/
β βββ main/
β β βββ java/
β β β βββ com._32bit.porject.cashier_system/
β β β βββ DAO/
β β β β βββ InvoiceRepository
β β β β βββ OfferRepository
β β β β βββ PaymentRepository
β β β β βββ ProductRepository
β β β β βββ RoleRepository
β β β β βββ SaleItemRepository
β β β β βββ SalePointRepository
β β β β βββ SaleRepository
β β β β βββ SessionRepository
β β β β βββ TeamMemberRepository
β β β βββ domains/
β β β β βββ enums/
β β β β β βββ Category
β β β β β βββ ERole
β β β β β βββ PaymentMethod
β β β β β βββ Unit
β β β β βββ Invoice
β β β β βββ Offer
β β β β βββ Payment
β β β β βββ Product
β β β β βββ Role
β β β β βββ Sale
β β β β βββ SaleItem
β β β β βββ SalePoint
β β β β βββ Session
β β β β βββ TeamMember
β β β βββ DTO/
β β β β βββ invoice/
β β β β β βββ InvoceEmailRequest
β β β β β βββ InvoceInfoDto
β β β β βββ offer/
β β β β β βββ CreateOfferRequest
β β β β β βββ OfferInfoResponse
β β β β βββ payment/
β β β β β βββ PaymentOfSaleDto
β β β β βββ product/
β β β β β βββ CreateProductRequest
β β β β β βββ ProductInfoResponse
β β β β β βββ UpdatePriceRequest
β β β β β βββ UpdateQuantityrequest
β β β β βββ sale/
β β β β β βββ CreateSaleRequest
β β β β β βββ SaleInfoResponse
β β β β β βββ SaleSpecification
β β β β βββ saleItem/
β β β β β βββ ItemOfSaleDto
β β β β β βββ SaleItemInfoResponseDto
β β β β β βββ SaleItemInforesponseSerializer
β β β β βββ salePoint/
β β β β β βββ CreateSalePointRequest
β β β β β βββ SalePointInfoResponse
β β β β β βββ SessionOfSalePoint
β β β β β βββ TeamMemberOfSalePoint
β β β β βββ session/
β β β β β βββ SaleOfSession
β β β β β βββ SessionInforesponse
β β β β βββ teamMember/
β β β β β βββ request/
β β β β β β βββ CreateTeamMemberDto
β β β β β β βββ LoginInfoDto
β β β β β β βββ UpdatePasswordDto
β β β β β βββ response/
β β β β β βββ JwtResponseDto
β β β β β βββ TeamMemberInfoDto
β β β β βββ MessageResponse
β β β β βββ ObjectWithMessageResponse
β β β βββ mapper/
β β β β βββ InvoiceMapper
β β β β βββ OfferMapper
β β β β βββ PaymentMapper
β β β β βββ ProductMapper
β β β β βββ SaleItemMapper
β β β β βββ SaleMapper
β β β β βββ SalePointMapper
β β β β βββ SessionMapper
β β β β βββ TeamMemberMapper
β β β βββ pdf/
β β β β βββ PDFGenerator
β β β βββ resource/
β β β β βββ AuthenticationResource
β β β β βββ HelloWorldResource
β β β β βββ InvoiceResource
β β β β βββ OfferResource
β β β β βββ ProductResource
β β β β βββ SalePointResource
β β β β βββ SaleResource
β β β β βββ SessionResource
β β β β βββ TeamMemberResource
β β β βββ security/
β β β β βββ jwt/
β β β β β βββ AuthEntryPointJwt
β β β β β βββ AuthTokenFilter
β β β β β βββ JwtUtils
β β β β βββ service/
β β β β β βββ UserDetailsImpl
β β β β β βββ UserDetailsServiceImpl
β β β β βββ SecurityConfig
β β β βββ service/
β β β β βββ impl/
β β β β β βββ AuthServiceImpl
β β β β β βββ InvoiceServiceImpl
β β β β β βββ OfferServiceImpl
β β β β β βββ PaymentServiceImpl
β β β β β βββ ProductServiceImpl
β β β β β βββ SaleItemServiceImpl
β β β β β βββ SalePointServiceImpl
β β β β β βββ SaleServiceImpl
β β β β β βββ SessionServiceImpl
β β β β β βββ TeamMemberServiceImpl
β β β β βββ AuthService
β β β β βββ InvoiceService
β β β β βββ OfferService
β β β β βββ PaymentService
β β β β βββ ProductService
β β β β βββ SaleItemService
β β β β βββ SalePointService
β β β β βββ SaleService
β β β β βββ SessionService
β β β β βββ TeamMemberService
β β β βββ CashierSystemApplication
β β βββ resources/
β β βββ application.properties
β β βββ log4j2.xml
β βββ test/
β βββ java/
β β βββ com/
β β βββ _32bit.project.cashier_system/
β β βββ tests/
β β β βββ sale
β β β βββ OfferServiceTest
β β β βββ ProductServiceTest
β β β βββ SalePointServiceTest
β β β βββ SessionServiceTest
β β βββ CashierSystemApplicationTests
β βββ resources/
β βββ application-test.properties
βββ .gitignore
βββ compose.yaml
βββ mvnw
βββ mvnw.cmd
βββ pom.xml
βββ README.md
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| GET | /api/admin | only admin allowed endpoint (for testing security) | - |
| GET | /api/manager | only manager allowed endpoint (for testing security) | - |
| GET | /api/cashier | only cashier allowed endpoint (for testing security) | - |
| GET | /api/erisebilir | permit all endpoint (for testing security) | - |
| GET | /api/erisilmez | for authenticated users (for testing security) | - |
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| POST | /login | Endpoint for loging in | Login Body |
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| POST | /api/sale-point/create-point | Endpoint for creating sale point | Create sale point request body |
| GET | /api/sale-point/point/{id} | Get sale point by id | - |
| PUT | /api/sale-point/update-point | Endpoint for updating sale point | Create sale point request body |
| DELETE | /api/sale-point/delete-point/{id} | Delete sale point | - |
| PATCH | /api/sale-point/restore-point/{id} | Restore sale point | - |
| GET | /api/sale-point/all-points | Get all sale points | - |
| GET | /api/sale-point/all-deleted-points | Get all deleted sale points | - |
| GET | /api/sale-point/deleted-point/{id} | Get deleted sale point by id | - |
| GET | /api/sale-point/point-by-address/{address} | Get sale point by address | - |
| GET | /api/sale-point/point-by-name/{name} | Get sale point by name | - |
| GET | /api/sale-point/poin-sessins/{id} | Get sale point sessions | - |
| GET | /api/sale-point/point-team-members/{id} | Get sale point members | - |
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| POST | /api/team-member/register | Register a new team member | Create Team Member request body |
| GET | /api/team-member/id/{id} | Get a team member by ID | - |
| GET | /api/team-member/username/{username} | Get a team member by username | - |
| GET | /api/team-member/deleted/id/{id} | Get a deleted team member by ID | - |
| GET | /api/team-member/deleted/username/{username} | Get a deleted team member by username | - |
| GET | /api/team-member/all | Get all non-deleted team members | - |
| GET | /api/team-member/all-deleted | Get all deleted team members | - |
| PUT | /api/team-member/update/{id} | Update a team member | Create Team Member request body |
| DELETE | /api/team-member/delete/{id} | Delete a team member | - |
| PUT | /api/team-member/restore/{id} | Restore a deleted team member | - |
| PUT | /api/team-member/update-authority/{id} | Update a team member's authority | List of strings |
| PUT | /api/team-member/update-password/{id} | Update a team member's password | Update Password request body |
| PUT | /api/team-member/update-sale-point/{id}/{salePointId} | Update a team member's sale point | - |
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| GET | /api/session/sessions | Get all sessions | - |
| GET | /api/session/deleted-sessions | Get all deleted sessions | - |
| GET | /api/session/sale-point-sessions/{id} | Get sessions for a specific sale point | - |
| POST | /api/session/open-session/{salePointId} | Open a new session for a sale point | - |
| POST | /api/session/close-session/{salePointId} | Close the current session for a sale point | - |
| GET | /api/session/{sessionId} | Get information about a specific session | - |
| GET | /api/session/delete-session/{sessionId} | Delete a specific session | - |
| GET | /api/session/restore-session/{sessionId} | Restore a deleted session | - |
| GET | /api/session/sale-point-open-session/{id} | Get the open session for a specific sale point | - |
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| GET | /api/offer/all | Get all non-deleted offers | - |
| GET | /api/offer/all-deleted | Get all deleted offers | - |
| GET | /api/offer/by-name/{name} | Get non-deleted offers by name | - |
| GET | /api/offer/deleted-by-name/{name} | Get deleted offers by name | - |
| GET | /api/offer/by-description/{description} | Get non-deleted offers by description | - |
| GET | /api/offer/deleted-by-description/{description} | Get deleted offers by description | - |
| POST | /api/offer/by-start-date | Get non-deleted offers by date range | Query params: startDate, endDate |
| POST | /api/offer/deleted-by-start-date | Get deleted offers by date range | Query params: startDate, endDate |
| POST | /api/offer/create-offer | Create a new offer | Create Offer request body |
| PUT | /api/offer/update-offer/{id} | Update an existing offer | Create Offer request body |
| DELETE | /api/offer/delete-offer/{id} | Delete an offer | - |
| PATCH | /api/offer/restore-offer/{id} | Restore a deleted offer | - |
| GET | /api/offer/by-id/{id} | Get a non-deleted offer by ID | - |
| GET | /api/offer/deleted-by-id/{id} | Get a deleted offer by ID | - |
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| GET | /api/product/all | Get all non-deleted products | - |
| GET | /api/product/all-deleted | Get all deleted products | - |
| GET | /api/product/by-name/{name} | Get non-deleted products by name | - |
| GET | /api/product/by-brand/{brand} | Get non-deleted products by brand | - |
| GET | /api/product/by-category/{category} | Get non-deleted products by category | - |
| GET | /api/product/deleted-by-name/{name} | Get deleted products by name | - |
| GET | /api/product/deleted-by-brand/{brand} | Get deleted products by brand | - |
| GET | /api/product/deleted-by-category/{category} | Get deleted products by category | - |
| GET | /api/product/by-id/{id} | Get a non-deleted product by ID | - |
| GET | /api/product/deleted-by-id/{id} | Get a deleted product by ID | - |
| POST | /api/product/create | Create a new product | Create Product request body |
| PUT | /api/product/update/{id} | Update an existing product | Create Product request body |
| DELETE | /api/product/delete/{id} | Delete a product | - |
| POST | /api/product/restore/{id} | Restore a deleted product | - |
| POST | /api/product/set-discount/{id}/{discountRate} | Set a discount for a product | - |
| DELETE | /api/product/remove-discount/{id} | Remove a discount from a product | - |
| POST | /api/product/set-offer/{productId}/{offerId} | Set an offer for a product | - |
| DELETE | /api/product/remove-offer/{productId} | Remove an offer from a product | - |
| POST | /api/product/update-quantities | Update quantities for multiple products | List of Update Quantity requests |
| POST | /api/product/update-add-quantities | Add quantities for multiple products | List of Update Quantity requests |
| POST | /api/product/create-products | Create multiple products | List of Create Products request |
| POST | /api/product/update-prices | Update prices for multiple products | List of Update Prices request |
| GET | /api/product/price/{id} | Get the price of a product by ID | - |
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| GET | /api/sale/sales | Get all non-deleted sales | - |
| GET | /api/sale/deleted-sales | Get all deleted sales | - |
| GET | /api/sale/sale/{id} | Get a non-deleted sale by ID | - |
| GET | /api/sale/deleted-sale/{id} | Get a deleted sale by ID | - |
| GET | /api/sale/sale-point-sales/{id} | Get sales for a specific sale point | - |
| GET | /api/sale/session-sales/{id} | Get sales for a specific session | - |
| POST | /api/sale/create-sale | Create a new sale | Create Sale request body |
| POST | /api/sale/payment/{saleId} | Process payment for a sale | List of Payment of Sale DTOs |
| POST | /api/sale/invoice/{saleId} | Generate invoice for a sale | - |
| PUT | /api/sale/update-sale/{id} | Update an existing sale | Create Sale request body |
| DELETE | /api/sale/delete-sale/{id} | Delete a sale | - |
| PUT | /api/sale/restore-sale/{id} | Restore a deleted sale | - |
| GET | /api/sale/paged-sales | Get paginated sales with filters | Query parameters |
| GET | /api/sale/paged-session-sales/{sessionId} | Get paginated sales for a session with filters | Query parameters |
| GET | /api/sale/paged-sale-point-sales/{salePointId} | Get paginated sales for a sale point with filters | Query parameters |
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
| GET | /api/invoice/invoices | Get all invoices | - |
| GET | /api/invoice/invoice/{id} | Get an invoice by ID | - |
| GET | /api/invoice/sale-invoice/{saleId} | Get an invoice by sale ID | - |
| GET | /api/invoice/sale-point-invoices/{salePointId} | Get invoices for a specific sale point | - |
| GET | /api/invoice/team-member-invoices/{teamMemberId} | Get invoices for a specific team member | - |
| GET | /api/invoice/generate-invoice/{invoiceId} | Generate an invoice PDF | - |
{
"username" : "admin",
"password" : "32-bit"
}{
"name" : "istanbul",
"address" : "fatih"
}{
"firstname" : "ismail",
"lastname" : "kattan",
"username" : "smlkttn_cashier",
"email" : "smlkttn855@gmail.com",
"phoneNumber" : "05314326135",
"password" : "32-bit",
"roles" : ["cashier"],
"salePointId" : 2
}{
"password" : "32-bit"
}{
"name" : "3 al 2 ode",
"description" : "2 alana 1 bedava",
"startDate" : "01-01-2025",
"endDate" : "01-01-2026",
"getCount" : 3,
"payFor" : 2
}{
"name" : "telefon",
"brand" : "samsung",
"category" : "ELeCTRONIC",
"quantity" : "100",
"unit" : "adet",
"price" : 4000
}[
{
"name" : "telefon",
"brand" : "samsung",
"category" : "ELeCTRONIC",
"quantity" : "100",
"unit" : "adet",
"price" : 4000
},
{
"name" : "kulaklik",
"brand" : "polo-smart",
"category" : "ELECTRONIC",
"quantity" : "1000",
"unit" : "adet",
"price" : 25.0
}
][
{
"id" : 1,
"quantity" : 15
},
{
"id" : 2,
"quantity" : 15
}
][
{
"id" : 1,
"price" : 15
},
{
"id" : 2,
"price" : 15
}
]{
"salePointId" : 1,
"items" : [
{
"productId" : 1,
"quantity" : 5
},
{
"productId" : 2,
"quantity" : 5
}
]
}Ismail KATTAN
-
Github : https://github.com/IsmailKattan
-
Email : ismailkattan.contact@gmail.com