class Cliente(db.Model): idCliente = db.Column(db.Integer, primary_key=True) rfc = db.Column(db.String) password = db.Column(db.String) crm = db.Column(db.String) embarques = db.relationship('Embarque') def __init__(self, rfc, passw, crm): self.rfc = rfc self.password = passw self.crm = crm
class Customer_facility_db(db.Model): __tablename__ = 's_fcty' customer_id = db.Column(db.Integer, primary_key=True) facility_id = db.Column(db.String(80), unique=True) facility_balance = db.Column(db.String(320), unique=True) facility_status = db.Column(db.String(32), nullable=False) def __init__(self, form): self.customer_id = form.get('customer_id', '') self.facility_id = form.get('facility_id', '') self.facility_balance = form.get('facility_balance', '') self.facility_status = form.get('facility_status', '')
class Customer_info_db(db.Model): __tablename__ = 's_cust' customer_id = db.Column(db.Integer, primary_key=True) customer_name = db.Column(db.String(80), unique=True) balance = db.Column(db.String(320), unique=True) status = db.Column(db.String(32), nullable=False) def __init__(self, form): self.customer_id = None self.customer_name = form.get('customer_name', '') self.balance = form.get('balance', '') self.status = form.get('status', '')
class Cliente(db.Model): idCliente = db.Column(db.Integer, primary_key = True) rfc = db.Column(db.String) username = db.Column(db.String) password = db.Column(db.String) crm = db.Column(db.String, unique=True) embarques = db.relationship('Embarque') embarquesTer = db.relationship('EmbarqueTer') embarquesAer = db.relationship('EmbarqueAer') def __init__(self, username, rfc, passw, crm): self.rfc = rfc self.username = username self.password = passw self.crm = crm
class EtfPriceDaily(db.Model): id: Column = db.Column(db.Integer, primary_key=True, nullable=False) symbol_id: Column = db.Column(db.Integer, nullable=False) price_date: Column = db.Column(db.DateTime, nullable=False) open_price: Column = db.Column(db.Numeric(18, 2), nullable=False) high_price: Column = db.Column(db.Numeric(18, 2), nullable=False) low_price: Column = db.Column(db.Numeric(18, 2), nullable=False) close_price: Column = db.Column(db.Numeric(18, 2), nullable=False) volume: Column = db.Column(db.Integer, nullable=False)
class SymbolMaster(db.Model): id: Column = db.Column(db.Integer, primary_key=True, nullable=False) symbol: Column = db.Column(db.String(15), nullable=False) name: Column = db.Column(db.String(200), nullable=False) status: Column = db.Column(db.Integer, nullable=False) instrument: Column = db.Column(db.String(50), nullable=False) sector: Column = db.Column(db.String(200)) industry: Column = db.Column(db.String(200))
class Financial(db.Model): id: Column = db.Column(db.Integer, primary_key=True, nullable=False) symbol_id: Column = db.Column(db.Integer, nullable=False) year: Column = db.Column(db.Integer, nullable=False) quarter: Column = db.Column(db.Integer, nullable=False) quarter_end_date: Column = db.Column(db.DateTime, nullable=False) file_date: Column = db.Column(db.DateTime) market_cap: Column = db.Column(db.Numeric(18, 2)) revenue: Column = db.Column(db.Numeric(18, 2)) gross_profit: Column = db.Column(db.Numeric(18, 2)) operating_income: Column = db.Column(db.Numeric(18, 2)) net_income: Column = db.Column(db.Numeric(18, 2)) current_assets: Column = db.Column(db.Numeric(18, 2)) ttl_assets: Column = db.Column(db.Numeric(18, 2)) current_liabilities: Column = db.Column(db.Numeric(18, 2)) ttl_liabilities: Column = db.Column(db.Numeric(18, 2)) ttl_equity: Column = db.Column(db.Numeric(18, 2)) revenue_growth: Column = db.Column(db.Numeric(18, 2)) revenue_qq_growth: Column = db.Column(db.Numeric(18, 2)) nopat_growth: Column = db.Column(db.Numeric(18, 2)) nopat_qq_growth: Column = db.Column(db.Numeric(18, 2)) net_income_growth: Column = db.Column(db.Numeric(18, 2)) net_income_qq_growth: Column = db.Column(db.Numeric(18, 2)) free_cash_flow: Column = db.Column(db.Numeric(18, 2)) current_ratio: Column = db.Column(db.Numeric(18, 2)) debt_to_equity_ratio: Column = db.Column(db.Numeric(18, 2)) pe_ratio: Column = db.Column(db.Numeric(18, 2)) pb_ratio: Column = db.Column(db.Numeric(18, 2)) div_payout_ratio: Column = db.Column(db.Numeric(18, 2)) roe: Column = db.Column(db.Numeric(18, 2)) roa: Column = db.Column(db.Numeric(18, 2))
class VwSymbolEtfPriceDaily(db.Model): symbol_id: Column = db.Column(db.Integer, nullable=False) symbol: Column = db.Column(db.String(15), nullable=False) symbol_name: Column = db.Column(db.String(200), nullable=False) status: Column = db.Column(db.Integer, nullable=False) instrument: Column = db.Column(db.String(50), nullable=False) etf_price_daily_id: Column = db.Column(db.Integer, primary_key=True, nullable=False) price_date: Column = db.Column(db.DateTime, nullable=False) open_price: Column = db.Column(db.Numeric(18, 2), nullable=False) high_price: Column = db.Column(db.Numeric(18, 2), nullable=False) low_price: Column = db.Column(db.Numeric(18, 2), nullable=False) close_price: Column = db.Column(db.Numeric(18, 2), nullable=False) volume: Column = db.Column(db.Integer, nullable=False)
class Embarque(db.Model): id = db.Column(db.Integer, primary_key = True) idFile = db.Column(db.Integer) mbl = db.Column(db.String) hbl = db.Column(db.String) buque = db.Column(db.String) pol = db.Column(db.String) pod = db.Column(db.String) destinoFinal = db.Column(db.String) viaje = db.Column(db.String) naviera = db.Column(db.String) tipo = db.Column(db.String) cliente = db.Column(db.String) cntr20DC = db.Column(db.Integer) cntr40DC = db.Column(db.Integer) cntr40HQ = db.Column(db.Integer) cntrLCL = db.Column(db.Integer) contenedores = db.Column(db.String) etd = db.Column(db.String) eta = db.Column(db.String) status = db.Column(db.String) crm = db.Column(db.String, db.ForeignKey('cliente.crm')) def __init__(self, idFile, mbl, hbl, buque, pol, pod, destinoFinal, viaje, naviera , tipo, cliente, cntr20DC, cntr40DC, cntr40HQ, cntrLCL, contenedores, etd, eta, status, crm): self.idFile = idFile self.mbl = mbl self.hbl = hbl self.buque = buque self.pol = pol self.pod = pod self.destinoFinal = destinoFinal self.viaje = viaje self.naviera = naviera self.tipo = tipo self.cliente = cliente self.cntr20DC = cntr20DC self.cntr40DC = cntr40DC self.cntr40HQ = cntr40HQ self.cntrLCL = cntrLCL self.contenedores = contenedores self.etd = etd self.eta = eta self.status = status self.crm = crm
class EmbarqueTer(db.Model): id = db.Column(db.Integer, primary_key=True) idFileTer = db.Column(db.String) operacion = db.Column(db.String) tipoMovimiento = db.Column(db.String) cliente = db.Column(db.String) origen = db.Column(db.String) destino = db.Column(db.String) fechaCarga = db.Column(db.String) fechaArribo = db.Column(db.String) tipoCaja = db.Column(db.String) crm = db.Column(db.String, db.ForeignKey('cliente.crm')) rutaInt = db.Column(db.String) frontera = db.Column(db.String) lineanac = db.Column(db.String) lineaint = db.Column(db.String) mercancia = db.Column(db.String) fechaDescarga = db.Column(db.String) def __init__(self, idFileTer, operacion, tipoMovimiento, cliente, origen, destino, fechaCarga, fechaArribo, tipoCaja, crm, rutaInt, frontera, lineanac, lineaint, mercancia, fechaDescarga): self.idFileTer = idFileTer self.operacion = operacion self.tipoMovimiento = tipoMovimiento self.cliente = cliente self.origen = origen self.destino = destino self.fechaCarga = fechaCarga self.fechaArribo = fechaArribo self.tipoCaja = tipoCaja self.crm = crm self.rutaInt = rutaInt self.frontera = frontera self.lineanac = lineanac self.lineaint = lineaint self.mercancia = mercancia self.fechaDescarga = fechaDescarga
class EmbarqueAer(db.Model): id = db.Column(db.Integer, primary_key=True) idFileAer = db.Column(db.String) idCalculo = db.Column(db.String) shipper = db.Column(db.String) consignatario = db.Column(db.String) aeropuertoSalida = db.Column(db.String) origen = db.Column(db.String) aeropuertoDestino = db.Column(db.String) destino = db.Column(db.String) awb = db.Column(db.String) hwb = db.Column(db.String) etd = db.Column(db.String) eta = db.Column(db.String) crm = db.Column(db.String, db.ForeignKey('cliente.crm')) cliente = db.Column(db.String) def __init__(self, idFileAer, idCalculo, shipper, consignatario, aeropuertoSalida, origen, aeropuertoDestino, destino, awb, hwb, etd, eta, crm, cliente): self.idFileAer = idFileAer self.idCalculo = idCalculo self.shipper = shipper self.consignatario = consignatario self.aeropuertoSalida = aeropuertoSalida self.origen = origen self.aeropuertoDestino = aeropuertoDestino self.destino = destino self.awb = awb self.hwb = hwb self.etd = etd self.eta = eta self.crm = crm self.cliente = cliente
class TradeOrder(db.Model): id: Column = db.Column(db.Integer, primary_key=True, nullable=False) stock_price_daily_id: Column = db.Column(db.Integer, nullable=False) strategy: Column = db.Column(db.String(50), nullable=False) alpaca_id: Column = db.Column(db.String(200)) status: Column = db.Column(db.Integer, nullable=False) action: Column = db.Column(db.String(50), nullable=False) qty: Column = db.Column(db.Integer, nullable=False) order_type: Column = db.Column(db.String(50)) time_in_force: Column = db.Column(db.String(50)) target_price: Column = db.Column(db.Numeric(18, 2)) stop_loss: Column = db.Column(db.Numeric(18, 2)) created: Column = db.Column(db.DateTime, nullable=False) modified: Column = db.Column(db.DateTime, nullable=False) exit_stock_price_daily_id: Column = db.Column(db.Integer) exit_alpaca_id: Column = db.Column(db.String(200)) actual_qty: Column = db.Column(db.Integer) actual_entry_price: Column = db.Column(db.Numeric(18, 2)) actual_exit_price: Column = db.Column(db.Numeric(18, 2))