'use strict'
/**
 * 订单信息明细表
 */
module.exports = function (db, DataTypes) {
	return db.define('obusinessmen', {
    orderId: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单id' },
    merchantId: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, comment:'商户id 为了司机宝' },
    channelOrderNo: { type: DataTypes.STRING, field: 'channel_order_no', allowNull: true, defaultValue:'', comment:'渠道订单号 为了司机宝'},
		status: {type: DataTypes.STRING, field: 'status', allowNull: true,defaultValue:'2000', comment:'业务状态: 2000办理中, 2010待签约, 2020已完成' },
    legalName: { type: DataTypes.STRING, field: 'legal_name', allowNull: false,defaultValue:'', comment:'法人姓名'},
		legalMobile: {type: DataTypes.STRING, field: 'legal_mobile', allowNull: true,defaultValue:'', comment:'法人电话'},
		legalIdCard: { type: DataTypes.STRING, field: 'legalId_card', allowNull: true, defaultValue:'',comment:'法人身份证号'},
    name: {type: DataTypes.STRING, field: 'name', allowNull: true,  defaultValue:'',comment:'个体工商户名称' },
    creditCode: { type: DataTypes.STRING, field: 'credit_code', allowNull: true, defaultValue:'', comment:'统一社会信用代码'},
    businessPlace: {type: DataTypes.STRING, field: 'business_place', allowNull: true, defaultValue:'', comment:'经营场所' },
    businessScope: {type: DataTypes.STRING, field: 'business_scope', allowNull: true, defaultValue:'', comment:'经营范围' },
    regDate: {type: DataTypes.DATE, field: 'reg_date', allowNull: true, defaultValue:'', comment:'注册日期' },
    businessImg: {type: DataTypes.STRING, field: 'business_img', allowNull: true, defaultValue:'', comment:'执照照片' },
    businessGovFile: {type: DataTypes.STRING, field: 'business_gov_file', allowNull: true, defaultValue:'', comment:'工商官方文件' },
    gongzhang: {type: DataTypes.STRING, field: 'gongzhang', allowNull: true, defaultValue:'', comment:'公章' },
    caiwuzhang: {type: DataTypes.STRING, field: 'caiwuzhang', allowNull: true, defaultValue:'', comment:'财务章' },
    fapiaozhang: {type: DataTypes.STRING, field: 'fapiaozhang', allowNull: true, defaultValue:'', comment:'发票章' },
    hetongzhang: {type: DataTypes.STRING, field: 'hetongzhang', allowNull: true, defaultValue:'', comment:'合同章' },
    farenzhang: {type: DataTypes.STRING, field: 'farenzhang', allowNull: true, defaultValue:'', comment:'法人章' },
    zhangGovFile: {type: DataTypes.STRING, field: 'zhang_gov_file', allowNull: true, defaultValue:'', comment:'刻章官方文件' },
    isBank: {type: DataTypes.BOOLEAN, field: 'is_bank', allowNull: true, defaultValue:false, comment:'是否开户' },
    bankName: {type: DataTypes.STRING, field: 'bank_name', allowNull: true, defaultValue:'', comment:'账户名称' },
    bankNo: {type: DataTypes.STRING, field: 'bank_no', allowNull: true, defaultValue:'', comment:'账户号' },
    bank: {type: DataTypes.STRING, field: 'bank', allowNull: true, defaultValue:'', comment:'开户行' },
    bankImg: {type: DataTypes.STRING, field: 'bank_img', allowNull: true, defaultValue:'', comment:'账户信息' },
    bankGovFile: {type: DataTypes.STRING, field: 'bank_gov_file', allowNull: true, defaultValue:'', comment:'银行开户官方文件' },
    caImg: {type: DataTypes.STRING, field: 'ca_img', allowNull: true, defaultValue:'', comment:'CA照片' },
    taxRegDay: {type: DataTypes.DATE, field: 'tax_reg_day', allowNull: true, defaultValue:'', comment:'税务登记日' },
    taxOrg: {type: DataTypes.STRING, field: 'tax_org', allowNull: true, defaultValue:'', comment:'税务机构名称' },
    taxGovFile: {type: DataTypes.STRING, field: 'tax_gov_file', allowNull: true, defaultValue:'', comment:'税务报道官方文件' },
    notes: {type: DataTypes.STRING, field: 'notes', allowNull: true, defaultValue:'', comment:'备注' },
    commonTaxLadder: {type: DataTypes.STRING, field: 'common_tax_ladder', allowNull: true, defaultValue:'', comment:'普票个税阶梯' },
    commonOtherLadder: {type: DataTypes.STRING, field: 'common_other_ladder', allowNull: true, defaultValue:'', comment:'普票增值税、附加税阶梯' },
    specialTaxLadder: {type: DataTypes.STRING, field: 'special_tax_ladder', allowNull: true, defaultValue:'', comment:'专票个税阶梯' },
    specialOtherLadder: {type: DataTypes.STRING, field: 'special_other_ladder', allowNull: true, defaultValue:'', comment:'专票增值税、附加税阶梯' },
    serviceBeginTime: {type: DataTypes.DATE, field: 'service_begin_time', allowNull: true, defaultValue:null, comment:'服务开始时间' },
    serviceEndTime: {type: DataTypes.DATE, field: 'service_end_time', allowNull: true, defaultValue:null, comment:'服务结束时间' },
    costRate: {type: DataTypes.INTEGER, field: 'cost_rate', allowNull: true, defaultValue:0, comment:'核定成本费用率' },
    taxRate: {type: DataTypes.INTEGER, field: 'tax_rate', allowNull: true, defaultValue:0, comment:'服务开始时间' },
    addValueUpType: {type: DataTypes.STRING, field: 'add_value_up_type', allowNull: true, defaultValue:'1', comment:'增值税累计类型 1按月 2按季度' },
    taxUpType: {type: DataTypes.STRING, field: 'tax_up_type', allowNull: true, defaultValue:'1', comment:'个税累计类型 1按月累计 2按年累计' },
    serviceRate: {type: DataTypes.INTEGER, field: 'service_rate', allowNull: true, defaultValue:0, comment:'服务费比例' },
    signNotes: {type: DataTypes.STRING, field: 'sign_notes', allowNull: true, defaultValue:'', comment:'签约备注' },
    signTime: {type: DataTypes.DATE, field: 'sign_time', allowNull: true, defaultValue:null, comment:'签约时间' },
    isCreateAccount: {type: DataTypes.BOOLEAN, field: 'is_create_account', allowNull: true, defaultValue:false, comment:'是否建帐' },
    createdAt: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW },
    updatedAt: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW },
    deletedAt: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true }
	},
	{
		timestamps: true,
		underscore: true,
    paranoid: true,
    version: true,
		tableName: 'o_businessmen',
		comment: '个体户表',
	});
}

