#!/usr/bin/env python

import argparse
import random
from datetime import datetime

def main():
    
    parser = argparse.ArgumentParser(description="Creating a bank account.")
    parser.add_argument('balance', type=int, help='Enter the account balance')

    # adding an option to output the result in a file
    parser.add_argument(
        "-o", "--output", help="output result to a file", action="store_true")

    # Grabbing the argument from the command line
    args = parser.parse_args()

    account = Account(random.randint(100,1000), args.balance, 0.7)

    print(account.toString())

class Account:
    

    def __init__(self) -> None:
        super().__init__()
        self.id = 0
        self.balance = 0
        self.annualInterestRate = 0
        self.dateCreated = datetime.now()

    def __init__(self, id, balance, annualInterestRate):
        self.id = id
        self.balance = balance
        self.annualInterestRate =  annualInterestRate



    def getID(self):
        return self.id

    def getBalance(self):
        return self.balance

    def getAnnualInterestRate(self):
        return self.annualInterestRate

    def withdraw(self, amount):
        if amount > self.balance:
            return "Can't withdraw an larger balance amount"
        else:
            self.balance = self.balance - amount
            return amount

    def deposit(self, amount):
        self.balance = self.balance + amount
        return self.balance
    
    def getMonthyInterestRate(self):
        return self.annualInterestRate / 12

    def setID(self,id):
        self.id = id

    def setBalance(self, balance):
        self.balance = balance
    
    def setAnnualInterestRate(self, anIR):
        self.annualInterestRate = anIR

    def toString(self):
        return "The acount is with id "+str(self.id)+" and balance "+str(self.balance)+" and annual interest rate "+str(self.annualInterestRate)
    

main()