Bansari Akhani
sync vendors and glaccounts
e66f26b
import {
DataTypes,
Model,
CreationOptional
} from 'sequelize';
import { sequelize } from './index';
import { PwVendorInterface } from 'shared/interfaces/PwVendorsInterface';
class PWVendors extends Model<PwVendorInterface> implements PwVendorInterface
{
declare id: CreationOptional<number>;
declare pw_id: bigint;
declare name: string;
declare type: string;
declare default_bill_split: bigint;
}
PWVendors.init(
{
id: {
type: DataTypes.BIGINT.UNSIGNED,
autoIncrement: true,
primaryKey: true,
unique: true,
},
pw_id: {
type: DataTypes.BIGINT,
allowNull: false,
unique: true,
},
default_bill_split: {
type: DataTypes.BIGINT,
allowNull: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
},
type: {
type: DataTypes.STRING,
allowNull: true,
}
},
{
sequelize,
tableName: 'pw_vendors',
underscored: true,
freezeTableName: true,
createdAt: 'created_at',
updatedAt: 'updated_at',
}
);
export default PWVendors;