A mobile-payment enabled, farmers market platform, for rural East African smallholders.
# efarmers-market
### *A mobile-payment enabled, farmer's market, for rural East African smallholders.*
## Databse info
- The database with all four populated produce, livestock, produceTransactions and livestockTransactions tables, has been exported to dump_file.sql in src/main/resources.
- There is also a data.sql file in src/main/resources with sql scripts to populate the produce and livestock tables only. *The following property has been set: spring.sql.init.mode=never. Change to spring.sql.init.mode=always to populate tables with the data.sql file.*
## Tests
- To run tests, use the following command ./mvnw test
- There is currently one test suite in ./src/test/java/com/jdy3/efarmersmarket/livestock/LivestockServiceTest.java
## API
- To start the API, use the following command from the directory root ./mvnw spring-boot:run
### Endpoints
Produce Endpoints
***
- POST /products/produce
>{
>"date": LocalDate,
>"expiry": LocalDate,
>"price": BigDecimal,
>"weight": BigDecimal,
>"description": String,
>"location": String,
>"name": String,
>"picture": String,
>"provenance": String,
>"variety": String,
>"category": enum {"Cereal", "Vegetable", "Fruit"}
>}
- PUT /products/produce/{id}
- GET /products/produce
- GET /products/produce?name={name}
- GET /products/produce?provenance={provenance}
- GET /products/produce?expiry={expiry}
- GET /products/produce/{id}
- DELETE /products/produce/{id}
***
Livestock Endpoints
***
- POST /products/livestock
>{
>"age": double,
>"date": LocalDate,
>"price": BigDecimal,
>"quantity": int,
>"weight": BigDecimal,
>"certification": String,
>"description": String,
>"location": String,
>"name": String,
>"picture": String,
>"provenance": String,
>"breed": String
>}
- PUT /products/livestock/{id}
- GET /products/livestock
- GET /products/livestock?name={name}
- GET /products/livestock/?provenance={provenance}
- GET /products/livestock/{id}
- DELETE /products/livestock/{id}
***
- Produce Transaction Endpoints
***
- POST /transac …