오류 수정, 통계 보강
This commit is contained in:
@@ -41,15 +41,15 @@ const EventParticipant = sequelize.define('EventParticipant', {
|
||||
comment: '비고'
|
||||
},
|
||||
status: {
|
||||
type: DataTypes.ENUM('참가예정', '참가확정', '취소'),
|
||||
type: DataTypes.ENUM('pending', 'confirmed', 'canceled'),
|
||||
allowNull: false,
|
||||
defaultValue: '참가예정',
|
||||
defaultValue: 'pending',
|
||||
comment: '참가 상태'
|
||||
},
|
||||
paymentStatus: {
|
||||
type: DataTypes.ENUM('미납', '납부완료'),
|
||||
type: DataTypes.ENUM('unpaid', 'paid'),
|
||||
allowNull: false,
|
||||
defaultValue: '미납',
|
||||
defaultValue: 'unpaid',
|
||||
comment: '참가비 납부 상태'
|
||||
}
|
||||
}, {
|
||||
@@ -70,25 +70,15 @@ EventParticipant.associate = (models) => {
|
||||
EventParticipant.belongsTo(models.Event, {
|
||||
foreignKey: 'eventId'
|
||||
});
|
||||
|
||||
EventParticipant.belongsTo(models.Member, {
|
||||
foreignKey: 'memberId'
|
||||
});
|
||||
|
||||
EventParticipant.belongsTo(models.EventTeam, {
|
||||
foreignKey: 'teamId'
|
||||
});
|
||||
|
||||
EventParticipant.hasMany(models.EventScore, {
|
||||
foreignKey: 'participantId'
|
||||
});
|
||||
};
|
||||
|
||||
EventParticipant.associate = (models) => {
|
||||
EventParticipant.hasMany(models.EventScore, {
|
||||
foreignKey: 'participantId'
|
||||
});
|
||||
EventParticipant.belongsTo(models.Member, { foreignKey: 'memberId' });
|
||||
};
|
||||
|
||||
module.exports = EventParticipant;
|
||||
|
||||
Reference in New Issue
Block a user