const { DataTypes } = require('sequelize');
const { sequelize } = require('../config/database');

const SegmentPrice = sequelize.define('segment_prices', {
  id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  route_id: { type: DataTypes.INTEGER, allowNull: false },
  from_stop_id: { type: DataTypes.INTEGER, allowNull: false },
  to_stop_id: { type: DataTypes.INTEGER, allowNull: false },
  vehicle_type: { type: DataTypes.ENUM('economy', 'vip', 'premium', 'standard'), allowNull: false },
  price_nad: { type: DataTypes.DECIMAL(10, 2), allowNull: false },
  price_bwp: { type: DataTypes.DECIMAL(10, 2), allowNull: false },
}, {
  timestamps: true,
  createdAt: 'created_at',
  updatedAt: 'updated_at',
});

module.exports = SegmentPrice;
