Git Product home page Git Product logo

couponsvc's Introduction

Coupon Service

Overview

Coupon service is a small web application (backend) for a specific ticket redeeming scenario. There can be selected X ticket in every day where every #th coupon sender wins. The application supports multiple territories with different conditions.

Technology stack

  • Java 11
  • Maven
  • Spring
  • Postgres

API

Path Method Path variable Parameter Request Response
/redeem Post n/a n/a JSON Winner flag
/analytics Get country startDate/endDate/pageNumber/pageSize n/a List of winners

Database

The underlying database holds 3 table.

  • The territory infos
  • The redeemed ticket
  • The actual status for every territory

A pre-defined database image could be created with the given sql script and Dockerfile inside the /database folder

How to run

With maven

  • The skipTests flag indicates that the tests should not run
  • There is no special profile so a simple mvn spring-boot:run would do the magic

With docker

  • The Docker image creation is wired in the maven build cycle with a profile container
  • The image should expose port 8080
  • The spring.datasource.url value should be overriden

Testing

The project uses TestNg with the following cosntraints:

  • Class Ratio: 75%
  • Method Ratio: 75%
  • Branch Ratio: 75%
  • Line Ratio: 75%

Current limitations

  • The acutal state table should be reseted everyday manually

couponsvc's People

Contributors

zeletrik avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.