Spaces:
Runtime error
Runtime error
File size: 1,089 Bytes
e66f26b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
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;
|