SGR is the new system for recycling PET bottles implemented in Romania, similar to other countries in the EU. It works by adding a deposit to the price of PET containers, which could be cashed out once the container is returned to one of the selected locations (usually in stores).
- Spring Boot
- JPA
- Hibernate
It is necessary to create a configuration file (you can also use a CLI configuration if you prefere, more info available at the Spring documentation)
In the usual approach, the file is found under src/main/resources/application.properties and follows the general Spring configuration structure
For a quick start, only the following properties are necessary:
spring.application.name
spring.jpa.generate-ddl
spring.jpa.show-sql
spring.datasource.driver-class-name
spring.datasource.url
spring.datasource.username
spring.datasource.password
SGRItemis a simple product that takes part in the SGR systemSGRStoreis a location that canISSUEproducts orCONSUME(orSCAN) products.SGRPretGarantieis a price for the return issued at a certain point in time. The latest one is always valid, but the system keeps track of past onesSGRPurchaserepresents anISSUEtransaction (i.e. a product is bought from aSGRStore)
ISSUErepresents a purchase of an SGR itemCONSUME(orSCAN) represents the return of a previously purchased SGR item
Item flow:
SGRItemgets createdSGRStore Aexecutes anISSUEtransaction and creates aSGRPurchasefor the itemSGRStore Bexecutes aCONSUMEtransaction and theSGRPurchaseis marked asSGRComplete
Note: Store A and B can be the same store, or completely different ones