#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function

__author__ = 'Vitor Henrique L. Mesquita <vitor@vitorhenrique.me>'

from database import Base

from sqlalchemy import Column, Integer, Text, Float


class CustomerAccount(Base):
    "A CostumerAccount table."
    __tablename__ = 'tb_customer_account'
    id_customer   = Column(Integer, primary_key = True)
    cpf_cnpj      = Column(Integer, nullable = False)
    nm_customer   = Column(Text, nullable = False)
    is_active     = Column(Integer, nullable = False)
    vl_total      = Column(Float)
    def __init__(self, nm_customer,cpf_cnpj, is_active, vl_total):
        self.nm_customer = nm_customer
        self.cpf_cnpj    = cpf_cnpj
        self.is_active   = is_active
        self.vl_total    = vl_total

class Product(Base):
    "A Product Table"
    __tablename__ = 'product'
    cod_mer       = Column(Integer, primary_key = True)
    type_mer      = Column(Text, nullable = False)
    name_mer      = Column(Text, nullable = False)
    amt           = Column(Integer, nullable = False)
    price         = Column(Float, nullable = False)
    type_b        = Column(Text, nullable = False)
    def __init__(self,cod_mer, type_mer, name_mer, amt, price, type_b):
        self.cod_mer = cod_mer
        self.type_mer = type_mer
        self.name_mer = name_mer
        self.amt      = amt
        self.price    = price
        self.type_b   = type_b

