/** * Copyright (c) 2026 Niolla * All rights reserved. * * This source code is proprietary and confidential. * Unauthorized copying, modification, distribution, or use * of this file, via any medium, is strictly prohibited. */ // app/models/customer.model.js module.exports = (sequelize, DataTypes) => { const Customer = sequelize.define( "Customer", { customer_id: { type: DataTypes.STRING, primaryKey: true, collate: "utf8mb4_general_ci", }, user_id: { type: DataTypes.STRING, allowNull: false, unique: true, }, address: { type: DataTypes.STRING, allowNull: false, }, phoneNumber: { type: DataTypes.STRING, allowNull: false, }, }, { tableName: "customers", timestamps: true, }, ); Customer.associate = (db) => { Customer.belongsTo(db.User, { foreignKey: "user_id", as: "user", }); }; return Customer; };