🚀 Test task - Receipt API
Table of Contents
Task Description
Getting Started
API Usage
Demo
Database
Backend
Build Tool
PaaS
API already deployed on PaaS Heroku:
https://clevertec-test-task.herokuapp.com
git clone https://github.com/IvanHayel/clevertec-test-task.git
🦖 Local Startup with Gradle
Java version 17+ is required.
git clone https://github.com/IvanHayel/clevertec-test-task.git
Example:
CREATE DATABASE " clevertec-api"
WITH
OWNER = postgres
ENCODING = ' UTF8'
LC_COLLATE = ' English_World.1252'
LC_CTYPE = ' English_World.1252'
TABLESPACE = pg_default
CONNECTION LIMIT = - 1 ;
Set up environment variables
DB_URL - JDBC url for Postgres database.
DB_USERNAME - database username
DB_PASSWORD - database password
gradle clean build bootRun
You can also use the gradle wrapper: ./gradlew
HTTP METHOD
URL
QUERY PARAMETERS
TEMPLATE
DESCRIPTION
GET
/api/v1/products
none
none
Getting all Products
.
GET
/api/v1/products/{id}
none
none
Getting Product
by id.
GET
/api/v1/products/search
term
: {any} - required
none
Full text search for all Products
.
POST
/api/v1/products
none
Creating a new Product
.
PUT
/api/v1/products
none
Updating existing Product
.
DELETE
/api/v1/products/{id}
none
none
Deleting Product
by id.
HTTP METHOD
URL
QUERY PARAMETERS
TEMPLATE
DESCRIPTION
GET
/api/v1/cards
none
none
Getting all Discount Cards
.
GET
/api/v1/cards/{id}
none
none
Getting Discount Card
by id.
POST
/api/v1/cards
none
Creating a new Discount Card
.
PUT
/api/v1/cards
none
Updating existing Discount Card
.
DELETE
/api/v1/cards/{id}
none
none
Deleting Discount Card
by id.
HTTP METHOD
URL
QUERY PARAMETERS
TEMPLATE
DESCRIPTION
GET
/api/v1/receipts
none
none
Getting all Receipts
.
GET
/api/v1/receipts/{id}
none
none
Getting Receipt
by id.
GET
/api/v1/receipts/search
term
: {any} - required
none
Full text search for all Receipts
.
GET
/api/v1/receipts/download/{id}
none
none
Download existing Receipt
in PDF format.
POST
/api/v1/receipts
none
Creating a new Receipt
.
PUT
/api/v1/receipts
none
Updating existing Receipt
.
DELETE
/api/v1/receipts/{id}
none
none
Deleting Receipt
by id.
Insomnia used for demonstration.
Products full text search
Receipts full text search