完善项目
This commit is contained in:
@@ -29,6 +29,38 @@ const InsuranceType = sequelize.define('InsuranceType', {
|
||||
allowNull: true,
|
||||
comment: '保险类型描述'
|
||||
},
|
||||
applicable_livestock: {
|
||||
type: DataTypes.STRING(100),
|
||||
allowNull: true,
|
||||
comment: '适用生资(如:牛、羊、猪等)'
|
||||
},
|
||||
insurance_term: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
comment: '保险期限(月)',
|
||||
validate: {
|
||||
min: {
|
||||
args: [1],
|
||||
msg: '保险期限不能小于1个月'
|
||||
}
|
||||
}
|
||||
},
|
||||
policy_form: {
|
||||
type: DataTypes.STRING(50),
|
||||
allowNull: true,
|
||||
comment: '保单形式(电子保单、纸质保单等)'
|
||||
},
|
||||
on_sale_status: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: true,
|
||||
comment: '在售状态(true-在售,false-停售)'
|
||||
},
|
||||
add_time: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true,
|
||||
comment: '添加时间'
|
||||
},
|
||||
coverage_amount_min: {
|
||||
type: DataTypes.DECIMAL(15, 2),
|
||||
allowNull: false,
|
||||
|
||||
@@ -19,6 +19,21 @@ const LivestockClaim = sequelize.define('LivestockClaim', {
|
||||
}
|
||||
}
|
||||
},
|
||||
reporter_name: {
|
||||
type: DataTypes.STRING(100),
|
||||
allowNull: false,
|
||||
comment: '报案人姓名'
|
||||
},
|
||||
contact_phone: {
|
||||
type: DataTypes.STRING(20),
|
||||
allowNull: false,
|
||||
comment: '联系电话'
|
||||
},
|
||||
policy_no: {
|
||||
type: DataTypes.STRING(50),
|
||||
allowNull: false,
|
||||
comment: '保单号'
|
||||
},
|
||||
policy_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
@@ -29,9 +44,32 @@ const LivestockClaim = sequelize.define('LivestockClaim', {
|
||||
}
|
||||
},
|
||||
claim_type: {
|
||||
type: DataTypes.ENUM('disease', 'natural_disaster', 'accident', 'theft', 'other'),
|
||||
type: DataTypes.ENUM('death', 'disease', 'accident', 'natural_disaster'),
|
||||
allowNull: false,
|
||||
comment: '理赔类型:disease-疾病,natural_disaster-自然灾害,accident-意外事故,theft-盗窃,other-其他'
|
||||
comment: '理赔类型:death-死亡,disease-疾病,accident-意外事故,natural_disaster-自然灾害'
|
||||
},
|
||||
affected_count: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 1,
|
||||
comment: '受影响牲畜数量',
|
||||
validate: {
|
||||
min: {
|
||||
args: [1],
|
||||
msg: '受影响牲畜数量不能小于1'
|
||||
}
|
||||
}
|
||||
},
|
||||
claim_amount: {
|
||||
type: DataTypes.DECIMAL(15, 2),
|
||||
allowNull: false,
|
||||
comment: '理赔金额',
|
||||
validate: {
|
||||
min: {
|
||||
args: [0],
|
||||
msg: '理赔金额不能小于0'
|
||||
}
|
||||
}
|
||||
},
|
||||
incident_date: {
|
||||
type: DataTypes.DATE,
|
||||
@@ -63,28 +101,6 @@ const LivestockClaim = sequelize.define('LivestockClaim', {
|
||||
}
|
||||
}
|
||||
},
|
||||
affected_count: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
comment: '受影响牲畜数量',
|
||||
validate: {
|
||||
min: {
|
||||
args: [1],
|
||||
msg: '受影响牲畜数量不能小于1'
|
||||
}
|
||||
}
|
||||
},
|
||||
claim_amount: {
|
||||
type: DataTypes.DECIMAL(15, 2),
|
||||
allowNull: false,
|
||||
comment: '理赔金额',
|
||||
validate: {
|
||||
min: {
|
||||
args: [0],
|
||||
msg: '理赔金额不能小于0'
|
||||
}
|
||||
}
|
||||
},
|
||||
claim_status: {
|
||||
type: DataTypes.ENUM('pending', 'investigating', 'approved', 'rejected', 'paid'),
|
||||
allowNull: false,
|
||||
@@ -100,15 +116,10 @@ const LivestockClaim = sequelize.define('LivestockClaim', {
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
investigation_notes: {
|
||||
investigation_report: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true,
|
||||
comment: '调查备注'
|
||||
},
|
||||
investigation_date: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true,
|
||||
comment: '调查日期'
|
||||
comment: '调查报告'
|
||||
},
|
||||
reviewer_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
@@ -129,7 +140,12 @@ const LivestockClaim = sequelize.define('LivestockClaim', {
|
||||
allowNull: true,
|
||||
comment: '审核日期'
|
||||
},
|
||||
settlement_amount: {
|
||||
payment_date: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true,
|
||||
comment: '赔付日期'
|
||||
},
|
||||
payment_amount: {
|
||||
type: DataTypes.DECIMAL(15, 2),
|
||||
allowNull: true,
|
||||
comment: '实际赔付金额',
|
||||
@@ -140,11 +156,6 @@ const LivestockClaim = sequelize.define('LivestockClaim', {
|
||||
}
|
||||
}
|
||||
},
|
||||
settlement_date: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true,
|
||||
comment: '赔付日期'
|
||||
},
|
||||
supporting_documents: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: true,
|
||||
|
||||
@@ -212,7 +212,7 @@ LivestockClaim.belongsTo(User, {
|
||||
as: 'creator'
|
||||
});
|
||||
LivestockClaim.belongsTo(User, {
|
||||
foreignKey: 'reviewed_by',
|
||||
foreignKey: 'reviewer_id',
|
||||
as: 'reviewer'
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user