Files
ecoconnect/server/models/Voucher.js
ZacTohZY fbedd28d3b Voucher given to user
I am going to fix all design now
2024-08-12 00:57:20 +08:00

44 lines
1.1 KiB
JavaScript

const { DataTypes } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
const Voucher = sequelize.define(
"Voucher",
{
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
allowNull: false,
primaryKey: true,
},
brandLogo: {
type: DataTypes.BLOB("long"),
allowNull: true,
},
brand: {
type: DataTypes.STRING,
allowNull: false,
},
description: {
type: DataTypes.STRING,
allowNull: false,
},
expirationDate: {
type: DataTypes.DATE,
allowNull: false,
},
quantityAvailable: {
type: DataTypes.INTEGER,
allowNull: false
},
code: {
type: DataTypes.STRING,
allowNull: false,
},
},
{
tableName: "vouchers",
timestamps: true,
});
return Voucher;
};