text: const { Model, DataTypes } = require("sequelize");
  const sequelize = require("../config/connection");
  
  class Cost extends Model {}
  
  Cost.init(
    {
      id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
      },
      date: {
        type: DataTypes.DATEONLY,
        allowNull: false,
      },
      // add other properties as needed
      description: {
        type: DataTypes.TEXT,
        allowNull: false,
      },
      price: {
        type: DataTypes.INTEGER,
        allowNull: false,
      },
      user_id: {
        type: DataTypes.INTEGER,
        references: {
          model: "user",
          key: "id",
        },
      },
    },
    {
      sequelize,
      freezeTableName: true,
      underscored: true,
      modelName: "cost",
    }
  );
  
  module.exports = Cost;
  