const { sequelize } = require("../../../../config/db");
const { DataTypes } = require("sequelize");

const WeightLog = sequelize.define(
  "weight_logs",
  {
    id: {
      type: DataTypes.INTEGER,
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
    },
    user_id: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    date: {
      type: DataTypes.DATE,
      allowNull: true,
    },
    weight_kg: {
      type: DataTypes.DOUBLE,
      allowNull: true,
    },
    weight_lbs: {
      type: DataTypes.DOUBLE,
      allowNull: true,
    },
    createdAt: {
      type: DataTypes.DATE,
      allowNull: true,
    },
    updatedAt: {
      type: DataTypes.DATE,
      allowNull: true,
    },
  },
  {
    tableName: "weight_logs",
    timestamps: true,
  }
);

module.exports = WeightLog;
