@briswell/bw-domain
Version:
Domain Library for Node.js
122 lines (121 loc) • 3.39 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize = require("sequelize");
exports.default = (sqlize) => {
return sqlize.define('sales', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT(20).UNSIGNED
},
orderId: {
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'order_id'
},
customerId: {
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'customer_id'
},
customerName: {
type: Sequelize.STRING(100),
field: 'customer_name'
},
customerKana: {
type: Sequelize.STRING(200),
field: 'customer_kana'
},
customerTel: {
type: Sequelize.STRING(100),
field: 'customer_tel'
},
customerStaffName: {
type: Sequelize.STRING(50),
field: 'customer_staff_name'
},
customerEmail: {
type: Sequelize.STRING(100),
field: 'customer_email'
},
customerZip: {
type: Sequelize.STRING(8),
field: 'customer_zip'
},
customerAddress1: {
type: Sequelize.STRING(50),
field: 'customer_address1'
},
customerAddress2: {
type: Sequelize.STRING(300),
field: 'customer_address2'
},
locationId: {
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'location_id'
},
billingId: {
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'billing_id'
},
billingDate: {
type: Sequelize.DATEONLY,
field: 'billing_date'
},
paymentDate: {
type: Sequelize.DATEONLY,
field: 'payment_date'
},
taxRate: {
type: Sequelize.SMALLINT(6).UNSIGNED,
field: 'tax_rate'
},
amount: {
type: Sequelize.INTEGER(11).UNSIGNED
},
tax: {
type: Sequelize.INTEGER(11).UNSIGNED
},
totalAmount: {
type: Sequelize.INTEGER(11).UNSIGNED,
field: 'total_amount'
},
type: {
type: Sequelize.SMALLINT(6).UNSIGNED
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'created_at'
},
createdBy: {
allowNull: false,
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'created_by'
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'updated_at'
},
updatedBy: {
allowNull: false,
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'updated_by'
},
deletedAt: {
allowNull: true,
type: Sequelize.DATE,
field: 'deleted_at'
},
deletedBy: {
allowNull: true,
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'deleted_by'
}
}, {
tableName: 'sales',
paranoid: true
});
};