Giter Site home page Giter Site logo

library-system's Introduction

Library System

This is the code for a very simple library system. The system contains books (library.model.book) with their respective authors (library.model.author) and publishers (library.model.publisher). There are 3 types of books: Paper, Digital and Audio books. All books can be borrowed by users. Once the users return the books they will receive an invoice (library.payment.invoice) for all their returned books. The user can then pay the invoice either by credit card or using PayPal.

The system does not have any interface, yet. However, there are some tests that may help you understand the use cases / scenarios of the system.

Your task

The current code is messy. Your task is to refactor the code and create a cleaner and more straight forward structure. Concentrate on the following classes since they contain mostly all of the logic and refactoring-worthy code:

  • library.model.book
  • library.model.user
  • library.payment.invoice

You are free to change or move existing code, and add new classes and modules. The interfaces and method signatures do not need to stay stable, while the functionality of the code should remain the same.

Prerequisites

  1. Install Python (>= 3.9)
  2. Create a virtual environment
    python -m venv .venv
  3. Activate the virtual environment
    source .venv/bin/activate (Linux) or .venv/Scripts/activate (Windows)
  4. Install all requirements
    pip install -r requirements.txt

Run the system

In order to run the tests activate the environment and run pytest --gherkin-terminal-reporter -vv.

library-system's People

Contributors

bludau-peter avatar fadysalama 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.