/var/www/verywell.gr/server/delivery/models
Edit: /var/www/verywell.gr/server/delivery/models/account.js (1189B)
module.exports = (sequelize, Sequelize) => {
const Account = sequelize.define(
'account',
{
id: {
type: Sequelize.BIGINT,
autoIncrement: true,
allowNull: false,
primaryKey: true
},
uid: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV4
},
branchId: {
type: Sequelize.BIGINT,
allowNull: true
},
companyId: {
type: Sequelize.BIGINT,
allowNull: true
},
userId: {
type: Sequelize.BIGINT,
allowNull: true
},
balance: {
type: Sequelize.DECIMAL(10, 2),
allowNull: false,
defaultValue: 0
},
default: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false
},
type: {
allowNull: false,
type: Sequelize.ENUM(
'branch',
'cash',
'client',
'company',
'employee'
),
defaultValue: 'client'
},
description: {
type: Sequelize.STRING,
allowNull: false,
defaultValue: ''
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
},
{
timestamps: true,
paranoid: true,
tableName: 'accounts'
}
)
return Account
}