const { DataTypes } = require("sequelize");

module.exports = (sequelize) => {
    const TradeSymbol = sequelize.define('TradeSymbol' , {
        id: {
            type: DataTypes.BIGINT.UNSIGNED,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true,
        },
        base: {
            type: DataTypes.STRING(100),
            allowNull: false
        },
        quote: {
            type: DataTypes.STRING(100),
            allowNull: false
        },
        symbol: {
            type: DataTypes.STRING(100),
            allowNull: false
        },
        cat: {
            type: DataTypes.STRING(100),
            allowNull: false
        },
        name: {
            type: DataTypes.STRING(100),
            allowNull: false
        },
        logo: {
            type: DataTypes.STRING(100),
            allowNull: false
        },
        tradeView: {
            type: DataTypes.STRING(100),

        },
        price:{
            type: DataTypes.DECIMAL(30,16)
        },
        change24h:{
            type: DataTypes.DECIMAL(20,4)
        },
        low24h:{
            type: DataTypes.DECIMAL(30,16)
        },
        high24h:{
            type: DataTypes.DECIMAL(30,16)
        },
        volume:{
            type: DataTypes.DECIMAL(30,16)
        },
        status:{
            type: DataTypes.BOOLEAN,
            allowNull: false,
            defaultValue: true
        }

    }, {
        timestamps: true,
        underscored: true,
        tableName: 'trading_symbols'
    })

    return TradeSymbol
}