Giter VIP home page Giter VIP logo

promocode's Introduction

PromoCode

Django Task

forthebadge

forthebadge

forthebadge

forthebadge

Please install:

  1. djangorestframework
  2. django-filter

Two Models:

  1. PromoCode - the promo code itself

    Field Type Meaning
    code string the code for the promocode, case insensitive
    code_l string automatically set lowercase version of the promocode code
    type string either percent or value, how the value field should be interpreted
    expires datetime optional field to set when the promocode expires
    value decimal the value for the promocode, such as 100 or 0.50
    bound boolean if true then the promocode can only be used by the specified user in the user field
    user foreign key set when bound to a user
    repeat integer if 0 the promocode can be used infinitely, otherwise it specifies how often any system user can use it
  2. ClaimedPromoCode - to track when a user redeems a promocode.

    Field Type Meaning
    redeemed datetime automatically set when a promocode is redeemed
    promocode foreign key automatically set to point at the promocode when redeemed
    user foreign key automatically set to point at the promocode when redeemed
    typeOfPayment string what type of payment method did the user use when reddeming the code
    company string name of the business company that handeled the transaction
    item string what did the user buy? a ticket? clothes?
    service string what type of service is this?
    total_price integer how much does the transaction cost?
API Endpoint Details
GET /promocode List all promocode in the system, only superuser can see all.
GET /promocode/{pk} Retrieve details about a promocode by database id
POST /promocode Create a new promocode
PUT /promocode/{pk} Update a promocode
DELETE /promocode/{pk} Delete a promocode
PUT /promocode/{pk}/redeem Redeem a promocode by database id
GET /promocode/{pk}/redeemed List all times specified promocode was redeemed, superuser can see all
PATCH /promocode/{pk} Not supported
GET /promocode List all redeemed instances, filter-able only superuser can see all

promocode's People

Contributors

omaure 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.