module.exports=(s,D)=>{const M=s.define("Cart",{id:{type:D.STRING,primaryKey:true},user_id:{type:D.STRING,allowNull:false},status:{type:D.ENUM("ACTIVE","CHECKOUT_LOCKED","CONVERTED","ABANDONED"),allowNull:false,defaultValue:"ACTIVE"},currency:{type:D.STRING(3),allowNull:false,defaultValue:"LKR"},coupon_code:D.STRING(50),version:{type:D.INTEGER,allowNull:false,defaultValue:0},expires_at:D.DATE},{tableName:"carts",timestamps:true,indexes:[{unique:true,fields:["user_id","status"]}]});M.associate=db=>{M.hasMany(db.CartItem,{foreignKey:"cart_id",as:"items"});M.belongsTo(db.User,{foreignKey:"user_id",as:"owner"});};return M;};