@briswell/bw-domain
Version:
Domain Library for Node.js
112 lines (111 loc) • 3.14 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize = require("sequelize");
exports.default = (sqlize) => {
return sqlize.define('order', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT(20).UNSIGNED
},
quotationId: {
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'quotation_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'
},
orderDate: {
type: Sequelize.DATEONLY,
field: 'order_date'
},
deliveryDate: {
type: Sequelize.DATEONLY,
field: 'delivery_date'
},
contractAmount: {
type: Sequelize.INTEGER(11).UNSIGNED,
field: 'contract_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: 'order',
paranoid: true
});
};