diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..88315da --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +bin/ +build/ +develop-eggs/ +dist/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Rope +.ropeproject + +# Django stuff: +*.log +*.pot + +# Sphinx documentation +docs/_build/ \ No newline at end of file diff --git a/init.py b/init.py new file mode 100644 index 0000000..de33c21 --- /dev/null +++ b/init.py @@ -0,0 +1,13 @@ +cards = [ + {"number": "1111222233334444", "type": "Credit", "pin": "1234"}, + {"number": "2222333344445555", "type": "Prepaid", "pin": "2345"}, + {"number": "3333444455556666", "type": "ATM", "pin": "3456"}, + {"number": "444666", "type": "University ID", }, +] + +accounts = [ + {}, + {}, + {}, + {}, +] \ No newline at end of file diff --git a/main.py b/main.py index b964256..279ec4a 100644 --- a/main.py +++ b/main.py @@ -1,9 +1,10 @@ -from src.cards.cards import cards from src.tools.tools import * from src.modules.Card import Card +from src.modules.Account import Acount +import init + + card = cards[int(input("Chose a card from 1 to " + str(len(cards)) + ": ")) - 1] - - -PrintCardInfo(Card(card["number"], card["name"], card["surname"], card["type"])) \ No newline at end of file +PrintCardInfo(Card(card["number"], card["pin"], card["type"])) \ No newline at end of file diff --git a/src/bank/data/allCards.py b/src/bank/data/allCards.py deleted file mode 100644 index 277c58b..0000000 --- a/src/bank/data/allCards.py +++ /dev/null @@ -1,5 +0,0 @@ -cards = [ - {"number": "1111222233334444", "name": "John", "surname": "Doe", "type": "Credit", "pin": "1234", "clientID": "1234abcd"}, - {"number": "2222333344445555", "name": "Jane", "surname": "Doe", "type": "Prepaid", "pin": "2345", "clientID": "2345bcde"}, - {"number": "3333444455556666", "name": "Eric", "surname": "Gudmundson", "type": "ATM", "pin": "3456", "clientID": "3456cdef"}, -] \ No newline at end of file diff --git a/src/cards/__pycache__/cards.cpython-38.pyc b/src/cards/__pycache__/cards.cpython-38.pyc deleted file mode 100644 index 5b11601..0000000 Binary files a/src/cards/__pycache__/cards.cpython-38.pyc and /dev/null differ diff --git a/src/cards/cards.py b/src/cards/cards.py deleted file mode 100644 index 14babe9..0000000 --- a/src/cards/cards.py +++ /dev/null @@ -1,6 +0,0 @@ -cards = [ - {"number": "1111222233334444", "name": "John", "surname": "Doe", "type": "Credit"}, - {"number": "2222333344445555", "name": "Jane", "surname": "Doe", "type": "Prepaid"}, - {"number": "3333444455556666", "name": "Eric", "surname": "Gudmundson", "type": "ATM"}, - {"number": "444666", "name": "Adam", "surname": "Somm", "type": "University ID"}, -] \ No newline at end of file diff --git a/src/modules/Account.py b/src/modules/Account.py new file mode 100644 index 0000000..a87b874 --- /dev/null +++ b/src/modules/Account.py @@ -0,0 +1,10 @@ +class Acount: + def __init__(self, number, name, surname, credit): + self.number = number + self.name = name + self.surname = surname + self.credit = credit + self.cards = [] + + def addCard(self, card): + self.cards.append(card) \ No newline at end of file diff --git a/src/modules/Card.py b/src/modules/Card.py index e034e24..8957e40 100644 --- a/src/modules/Card.py +++ b/src/modules/Card.py @@ -1,7 +1,10 @@ class Card: - def __init__(self, ownerName, ownerSurname, number, type): - self.ownerName = ownerName - self.ownerSurname = ownerSurname - self.number = number - self.type = type + def __init__(self, number, pin, type, account): + self.number = number + self.pin = pin + self.type = type + self.account = account + account.addCard(self) + + \ No newline at end of file diff --git a/src/modules/__pycache__/Card.cpython-38.pyc b/src/modules/__pycache__/Card.cpython-38.pyc deleted file mode 100644 index bdef05f..0000000 Binary files a/src/modules/__pycache__/Card.cpython-38.pyc and /dev/null differ diff --git a/src/tools/__pycache__/tools.cpython-38.pyc b/src/tools/__pycache__/tools.cpython-38.pyc deleted file mode 100644 index 591c7e0..0000000 Binary files a/src/tools/__pycache__/tools.cpython-38.pyc and /dev/null differ diff --git a/src/tools/tools.py b/src/tools/tools.py index ebd6502..4478a0f 100644 --- a/src/tools/tools.py +++ b/src/tools/tools.py @@ -1,5 +1,6 @@ def PrintCardInfo(card): - print("Owner's Name: " + card.ownerName) - print("Owner's Surname: " + card.ownerSurname) - print("Card's Number: " + card.number) - print("Card's Type: " + card.type) \ No newline at end of file + print("Owner's Name: " + card.account.name) + print("Owner's Surname: " + card.account.surname) + print("Card's Number: " + card.number) + print("Card's Type: " + card.type) + print("Card's PIN: " + card.pin) \ No newline at end of file