Model
This commit is contained in:
parent
42ff13da70
commit
82e1ec78d5
3 changed files with 70 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -55,3 +55,6 @@ docs/_build/
|
||||||
|
|
||||||
# PyBuilder
|
# PyBuilder
|
||||||
target/
|
target/
|
||||||
|
|
||||||
|
|
||||||
|
.idea
|
0
pyinvoice/__init__.py
Normal file
0
pyinvoice/__init__.py
Normal file
67
pyinvoice/models.py
Normal file
67
pyinvoice/models.py
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
class InvoiceInfo(object):
|
||||||
|
"""
|
||||||
|
Invoice information
|
||||||
|
"""
|
||||||
|
def __init__(self, invoice_id, invoice_datetime, due_datetime):
|
||||||
|
self.invoice_id = invoice_id
|
||||||
|
self.invoice_datetime = invoice_datetime
|
||||||
|
self.due_datetime = due_datetime
|
||||||
|
|
||||||
|
|
||||||
|
class AddressInfo(object):
|
||||||
|
def __init__(self, name, street, city, state, country, post_code):
|
||||||
|
self.name = name
|
||||||
|
self.street = street
|
||||||
|
self.city = city
|
||||||
|
self.state = state
|
||||||
|
self.country = country
|
||||||
|
self.post_code = post_code
|
||||||
|
|
||||||
|
|
||||||
|
class ServiceProviderInfo(AddressInfo):
|
||||||
|
"""
|
||||||
|
Service provider/Merchant information
|
||||||
|
"""
|
||||||
|
def __init__(self, name, street, city, state, country, post_code):
|
||||||
|
super(ServiceProviderInfo, self).__init__(name, street, city, state, country, post_code)
|
||||||
|
|
||||||
|
|
||||||
|
class ClientInfo(AddressInfo):
|
||||||
|
"""
|
||||||
|
Client/Custom information
|
||||||
|
"""
|
||||||
|
def __init__(self, email, client_id, name, street, city, state, country, post_code):
|
||||||
|
super(ClientInfo, self).__init__(name, street, city, state, country, post_code)
|
||||||
|
self.email = email
|
||||||
|
self.client_id = client_id
|
||||||
|
|
||||||
|
|
||||||
|
class Item(object):
|
||||||
|
"""
|
||||||
|
Product/Item information
|
||||||
|
"""
|
||||||
|
def __init__(self, item_id, name, description, units, unit_price):
|
||||||
|
"""
|
||||||
|
Item modal init
|
||||||
|
:param item_id: Order id or Item id
|
||||||
|
:param name: Item name
|
||||||
|
:param units: Amount
|
||||||
|
:param unit_price: Unit price
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
self.item_id = item_id
|
||||||
|
self.name = name
|
||||||
|
self.description = description
|
||||||
|
self.units = units
|
||||||
|
self.unit_price = unit_price
|
||||||
|
|
||||||
|
|
||||||
|
class Transaction(object):
|
||||||
|
"""
|
||||||
|
Transaction information
|
||||||
|
"""
|
||||||
|
def __init__(self, gateway, transaction_id, transaction_datetime, amount):
|
||||||
|
self.gateway = gateway
|
||||||
|
self.transaction_id = transaction_id
|
||||||
|
self.transaction_datetime = transaction_datetime
|
||||||
|
self.amount = amount
|
Loading…
Reference in a new issue