Giter Site home page Giter Site logo

happy_bank_core's People

Contributors

janmate avatar oleksandr6676 avatar

Watchers

 avatar

happy_bank_core's Issues

Add lint, code style, build and publish core app docker image on on-PR and on-merge (CI) pipelines

Setup core app

  1. Refactor repo structure:
    1. create new folder "core" in root of the repo and move there all current folders in the root folder.
    2. set the moved folders as python module (hint: https://naucse.python.cz/course/mi-pyt/intro/distribution/)
  2. Update "workdir" config in Dockerfile to created "core" folder to fetch correctly python code into the docker image.
  3. Prepare python venv to enable to run the python code for anybody who faces the repo.

Hint: https://github.com/MeStrak/dr-sven/blob/main/pyproject.toml

Create core app logic

Create new class Transaction in logic/transaction folder with following methods:

  • init()
  • check_account_balance(account_id, amount)
  • transfer(sender_account, receiver_account, amount)
    • sender_account is Account instance
    • receiver_account is Account instance

Implement bash_exam.sh script

Replace "TODOs" in the bash_exam.sh script with your implementation by the instruction above it.

If you have no clue by any of tasks, do not hesitate to open discussion, either in this issue or in a pull request that you would have opened.

Remember and don't forget to be up-to-date -> rebase yourself onto main branch and create a new branch for your task !!!

Create data layer in core app

Create general and uniform interface (create class Connector) in data/connector.py

Add following methods into class:

  • read(account_id) -> Account
  • update(account_id, account, amount) -> void/WriteException
  • Create new class MemoryConnector in data/memory_connector.py that inherits behavior from Connector class. This class will contains list of Account instances - read() method returns the certain account by ID and update() method updates the existing list.
  • Create new class FileConnector in data/file_connector.py that inherits behavior from Connector class. This class will contains file read logic - read() method returns the certain account by ID and update() method updates the existing list in json data file.

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.