Store_UI/admin/distz/api/models/store.js
2022-09-26 11:48:12 +05:30

61 lines
1.7 KiB
JavaScript

'use strict';
const {
Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
class store extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
models.order.belongsTo(models.store);
models.prescription.belongsTo(models.store);
//models.prescription.belongsTo(models.store);
models.store.hasOne(models.subscription);
}
}
store.init({
storeName: DataTypes.STRING,
storeUrl: DataTypes.STRING,
ownerName: DataTypes.STRING,
contactNumber: DataTypes.STRING,
whatsAppNumber: DataTypes.STRING,
address1: DataTypes.STRING,
address2: DataTypes.STRING,
pincode: DataTypes.INTEGER,
location: DataTypes.STRING,
storeImage: DataTypes.STRING,
storeDoc: DataTypes.STRING,
openingTime: DataTypes.TIME,
closingTime: DataTypes.TIME,
features: DataTypes.STRING,
disclaimer: DataTypes.STRING,
storeType: DataTypes.INTEGER,
otp:DataTypes.INTEGER,
verifyOtp:DataTypes.INTEGER,
storeStatus:DataTypes.INTEGER,
returnPolicy:DataTypes.STRING,
pickup:DataTypes.INTEGER,
wideDiscount:DataTypes.STRING,
wideDiscountType:DataTypes.INTEGER,
cashondelivery:DataTypes.INTEGER,
upi:DataTypes.STRING,
planType:DataTypes.INTEGER,
planValidity:DataTypes.INTEGER,
planStatus:DataTypes.INTEGER,
startDate:DataTypes.DATE,
endDate:DataTypes.DATE,
status: DataTypes.INTEGER,
createdBy: DataTypes.INTEGER,
updatedBy: DataTypes.INTEGER
},
{
sequelize,
modelName: 'store',
});
return store;
};