게스트-기능 #2

Merged
jaybe merged 4 commits from 게스트-기능 into main 2025-05-08 16:24:42 +00:00
18 changed files with 293 additions and 140 deletions
Showing only changes of commit 283c8a7f4a - Show all commits
+21 -10
View File
@@ -5,15 +5,18 @@ const Club = sequelize.define('Club', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '클럽 고유 식별자'
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '클럽명'
}, },
description: { description: {
type: DataTypes.TEXT, type: DataTypes.TEXT,
allowNull: true allowNull: true,
comment: '클럽 설명'
}, },
ownerId: { ownerId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -21,36 +24,44 @@ const Club = sequelize.define('Club', {
references: { references: {
model: 'Users', model: 'Users',
key: 'id' key: 'id'
} },
comment: '클럽장(소유자) 유저 ID'
}, },
location: { location: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true allowNull: true,
comment: '주 활동 지역'
}, },
contact: { contact: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true allowNull: true,
comment: '연락처'
}, },
status: { status: {
type: DataTypes.ENUM('active', 'inactive', 'suspended'), type: DataTypes.ENUM('active', 'inactive', 'suspended'),
allowNull: false, allowNull: false,
defaultValue: 'active' defaultValue: 'active',
comment: '클럽 상태'
}, },
memberCount: { memberCount: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '회원 수'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '생성일'
}, },
updatedAt: { updatedAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '수정일'
} }
}, { }, {
tableName: 'Clubs', tableName: 'Clubs',
comment: '볼링 클럽 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+15 -7
View File
@@ -5,7 +5,8 @@ const ClubFeature = sequelize.define('ClubFeature', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '클럽-기능 연결 고유 식별자'
}, },
clubId: { clubId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,7 +14,8 @@ const ClubFeature = sequelize.define('ClubFeature', {
references: { references: {
model: 'Clubs', model: 'Clubs',
key: 'id' key: 'id'
} },
comment: '클럽 ID'
}, },
featureId: { featureId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -21,27 +23,33 @@ const ClubFeature = sequelize.define('ClubFeature', {
references: { references: {
model: 'Features', model: 'Features',
key: 'id' key: 'id'
} },
comment: '기능 ID'
}, },
enabled: { enabled: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: false, allowNull: false,
defaultValue: true defaultValue: true,
comment: '기능 활성화 여부'
}, },
expiryDate: { expiryDate: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true,
comment: '기능 만료일'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '생성일'
}, },
updatedAt: { updatedAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '수정일'
} }
}, { }, {
tableName: 'ClubFeatures', tableName: 'ClubFeatures',
comment: '클럽별 활성화된 기능 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+15 -7
View File
@@ -5,7 +5,8 @@ const ClubSubscription = sequelize.define('ClubSubscription', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '클럽-구독 연결 고유 식별자'
}, },
clubId: { clubId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,7 +14,8 @@ const ClubSubscription = sequelize.define('ClubSubscription', {
references: { references: {
model: 'Clubs', model: 'Clubs',
key: 'id' key: 'id'
} },
comment: '클럽 ID'
}, },
planId: { planId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -21,28 +23,34 @@ const ClubSubscription = sequelize.define('ClubSubscription', {
references: { references: {
model: 'SubscriptionPlans', model: 'SubscriptionPlans',
key: 'id' key: 'id'
} },
comment: '구독 플랜 ID'
}, },
status: { status: {
type: DataTypes.ENUM('active', 'expired', 'suspended'), type: DataTypes.ENUM('active', 'expired', 'suspended'),
defaultValue: 'active', defaultValue: 'active',
allowNull: false allowNull: false,
comment: '구독 상태'
}, },
startDate: { startDate: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '구독 시작일'
}, },
endDate: { endDate: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '구독 종료일'
}, },
price: { price: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '구독 가격'
} }
}, { }, {
tableName: 'ClubSubscriptions', tableName: 'ClubSubscriptions',
comment: '클럽별 구독 정보(플랜 등)를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+33 -16
View File
@@ -5,7 +5,8 @@ const Event = sequelize.define('Event', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '이벤트 고유 식별자'
}, },
clubId: { clubId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,72 +14,88 @@ const Event = sequelize.define('Event', {
references: { references: {
model: 'Clubs', model: 'Clubs',
key: 'id' key: 'id'
} },
comment: '소속 클럽 ID'
}, },
title: { title: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '이벤트 제목'
}, },
description: { description: {
type: DataTypes.TEXT, type: DataTypes.TEXT,
allowNull: true allowNull: true,
comment: '이벤트 설명'
}, },
eventType: { eventType: {
type: DataTypes.ENUM('정기전', '번개', '연습', '교류전', '이벤트', '기타'), type: DataTypes.ENUM('정기전', '번개', '연습', '교류전', '이벤트', '기타'),
allowNull: false, allowNull: false,
defaultValue: '정기전' defaultValue: '정기전',
comment: '이벤트 유형'
}, },
startDate: { startDate: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '시작일'
}, },
endDate: { endDate: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true,
comment: '종료일'
}, },
location: { location: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true allowNull: true,
comment: '장소'
}, },
gameCount: { gameCount: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 3 defaultValue: 3,
comment: '게임 수'
}, },
participantFee: { participantFee: {
type: DataTypes.DECIMAL(10, 2), type: DataTypes.DECIMAL(10, 2),
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '참가비'
}, },
maxParticipants: { maxParticipants: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '최대 참가 인원'
}, },
registrationDeadline: { registrationDeadline: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true,
comment: '참가 신청 마감일'
}, },
participantCount: { participantCount: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '참가자 수'
}, },
status: { status: {
type: DataTypes.ENUM('준비', '활성', '완료', '취소', '삭제'), type: DataTypes.ENUM('준비', '활성', '완료', '취소', '삭제'),
allowNull: false, allowNull: false,
defaultValue: '활성' defaultValue: '활성',
comment: '이벤트 상태'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '생성일'
}, },
updatedAt: { updatedAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '수정일'
} }
}, { }, {
tableName: 'Events', tableName: 'Events',
comment: '클럽 내 이벤트(대회, 모임 등) 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+13 -6
View File
@@ -5,7 +5,8 @@ const EventParticipant = sequelize.define('EventParticipant', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '이벤트 참가자 고유 식별자'
}, },
eventId: { eventId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,7 +14,8 @@ const EventParticipant = sequelize.define('EventParticipant', {
references: { references: {
model: 'Events', model: 'Events',
key: 'id' key: 'id'
} },
comment: '이벤트 ID'
}, },
memberId: { memberId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -21,7 +23,8 @@ const EventParticipant = sequelize.define('EventParticipant', {
references: { references: {
model: 'Members', model: 'Members',
key: 'id' key: 'id'
} },
comment: '회원 ID'
}, },
teamId: { teamId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -29,20 +32,24 @@ const EventParticipant = sequelize.define('EventParticipant', {
references: { references: {
model: 'EventTeams', model: 'EventTeams',
key: 'id' key: 'id'
} },
comment: '이벤트 팀 ID'
}, },
status: { status: {
type: DataTypes.ENUM('참가예정', '참가확정', '취소'), type: DataTypes.ENUM('참가예정', '참가확정', '취소'),
allowNull: false, allowNull: false,
defaultValue: '참가예정' defaultValue: '참가예정',
comment: '참가 상태'
}, },
paymentStatus: { paymentStatus: {
type: DataTypes.ENUM('미납', '납부완료'), type: DataTypes.ENUM('미납', '납부완료'),
allowNull: false, allowNull: false,
defaultValue: '미납' defaultValue: '미납',
comment: '참가비 납부 상태'
} }
}, { }, {
tableName: 'EventParticipants', tableName: 'EventParticipants',
comment: '이벤트별 참가자 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+16 -7
View File
@@ -5,7 +5,8 @@ const EventScore = sequelize.define('EventScore', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '점수 고유 식별자'
}, },
eventId: { eventId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,7 +14,8 @@ const EventScore = sequelize.define('EventScore', {
references: { references: {
model: 'Events', model: 'Events',
key: 'id' key: 'id'
} },
comment: '이벤트 ID'
}, },
participantId: { participantId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -21,31 +23,38 @@ const EventScore = sequelize.define('EventScore', {
references: { references: {
model: 'EventParticipants', model: 'EventParticipants',
key: 'id' key: 'id'
} },
comment: '이벤트 참가자 ID'
}, },
teamNumber: { teamNumber: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
allowNull: true, allowNull: true,
comment: '팀 번호'
}, },
gameNumber: { gameNumber: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
allowNull: false allowNull: false,
comment: '게임 번호'
}, },
score: { score: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false allowNull: false,
comment: '점수'
}, },
handicap: { handicap: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '핸디캡'
}, },
totalScore: { totalScore: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false allowNull: false,
comment: '총점'
} }
}, { }, {
tableName: 'EventScores', tableName: 'EventScores',
comment: '이벤트별 참가자 점수 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+6
View File
@@ -6,25 +6,31 @@ const EventTeam = sequelize.define('EventTeam', {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true, autoIncrement: true,
comment: '이벤트 팀 고유 식별자',
}, },
eventId: { eventId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
allowNull: false, allowNull: false,
comment: '이벤트 ID',
}, },
teamNumber: { teamNumber: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
allowNull: false, allowNull: false,
comment: '팀 번호',
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
comment: '팀명',
}, },
handicap: { handicap: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
comment: '팀 핸디캡',
}, },
}, { }, {
tableName: 'EventTeams', tableName: 'EventTeams',
comment: '이벤트별 팀 정보를 저장하는 테이블',
timestamps: true, timestamps: true,
}); });
+7 -3
View File
@@ -5,20 +5,24 @@ const EventTeamMember = sequelize.define('EventTeamMember', {
eventTeamId: { eventTeamId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
allowNull: false, allowNull: false,
primaryKey: true primaryKey: true,
comment: '이벤트 팀 ID'
}, },
eventParticipantId: { eventParticipantId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
allowNull: false, allowNull: false,
primaryKey: true primaryKey: true,
comment: '이벤트 참가자 ID'
}, },
order: { order: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
allowNull: false, allowNull: false,
defaultValue: 1 defaultValue: 1,
comment: '팀 내 순번'
} }
}, { }, {
tableName: 'EventTeamMembers', tableName: 'EventTeamMembers',
comment: '이벤트 팀별 멤버 정보를 저장하는 테이블',
timestamps: false timestamps: false
}); });
+17 -8
View File
@@ -5,41 +5,50 @@ const Feature = sequelize.define('Feature', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '기능 고유 식별자'
}, },
code: { code: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
unique: true unique: true,
comment: '기능 코드'
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '기능명'
}, },
description: { description: {
type: DataTypes.TEXT, type: DataTypes.TEXT,
allowNull: true allowNull: true,
comment: '기능 설명'
}, },
price: { price: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '기능 가격'
}, },
status: { status: {
type: DataTypes.ENUM('active', 'inactive', 'suspended'), type: DataTypes.ENUM('active', 'inactive', 'suspended'),
allowNull: false, allowNull: false,
defaultValue: 'active' defaultValue: 'active',
comment: '기능 상태'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '생성일'
}, },
updatedAt: { updatedAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '수정일'
} }
}, { }, {
tableName: 'Features', tableName: 'Features',
comment: '클럽에서 제공하는 기능 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+27 -13
View File
@@ -7,7 +7,8 @@ const Member = sequelize.define('Member', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '회원 고유 식별자'
}, },
clubId: { clubId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -15,7 +16,8 @@ const Member = sequelize.define('Member', {
references: { references: {
model: 'Clubs', model: 'Clubs',
key: 'id' key: 'id'
} },
comment: '소속 클럽 ID'
}, },
userId: { userId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -23,56 +25,68 @@ const Member = sequelize.define('Member', {
references: { references: {
model: 'Users', model: 'Users',
key: 'id' key: 'id'
} },
comment: '유저 ID'
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '회원 이름'
}, },
gender: { gender: {
type: DataTypes.ENUM('남성', '여성'), type: DataTypes.ENUM('남성', '여성'),
allowNull: false allowNull: false,
comment: '성별'
}, },
memberType: { memberType: {
type: DataTypes.ENUM('정회원', '준회원', '운영진', '모임장'), type: DataTypes.ENUM('정회원', '준회원', '운영진', '모임장'),
allowNull: false, allowNull: false,
defaultValue: '준회원' defaultValue: '준회원',
comment: '회원 유형'
}, },
handicap: { handicap: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '핸디캡'
}, },
average: { average: {
type: DataTypes.FLOAT, type: DataTypes.FLOAT,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '평균 점수'
}, },
games: { games: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '게임 수'
}, },
phone: { phone: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true allowNull: true,
comment: '전화번호'
}, },
email: { email: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true allowNull: true,
comment: '이메일'
}, },
joinDate: { joinDate: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false, allowNull: false,
defaultValue: DataTypes.NOW defaultValue: DataTypes.NOW,
comment: '가입일'
}, },
status: { status: {
type: DataTypes.ENUM('active', 'inactive', 'suspended', 'deleted'), type: DataTypes.ENUM('active', 'inactive', 'suspended', 'deleted'),
allowNull: false, allowNull: false,
defaultValue: 'active' defaultValue: 'active',
comment: '회원 상태'
} }
}, { }, {
tableName: 'Members', tableName: 'Members',
comment: '클럽 회원 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
Member.associate = (models) => { Member.associate = (models) => {
+24 -15
View File
@@ -5,7 +5,8 @@ const Menu = sequelize.define('Menu', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '메뉴 고유 식별자'
}, },
parentId: { parentId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,19 +14,23 @@ const Menu = sequelize.define('Menu', {
references: { references: {
model: 'Menus', // 실제 테이블명 model: 'Menus', // 실제 테이블명
key: 'id' key: 'id'
} },
comment: '상위 메뉴 ID'
}, },
title: { title: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '메뉴명'
}, },
icon: { icon: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true allowNull: true,
comment: '아이콘'
}, },
to: { to: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '라우팅 경로'
}, },
featureCode: { featureCode: {
type: DataTypes.STRING, type: DataTypes.STRING,
@@ -33,37 +38,41 @@ const Menu = sequelize.define('Menu', {
references: { references: {
model: 'Features', model: 'Features',
key: 'code' key: 'code'
} },
}, comment: '연결된 기능 코드'
requiredSubscriptionTier: {
type: DataTypes.ENUM('basic', 'standard', 'premium'),
allowNull: true
}, },
role: { role: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: 'user' defaultValue: 'user',
comment: '권한 역할'
}, },
order: { order: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '정렬 순서'
}, },
visible: { visible: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: false, allowNull: false,
defaultValue: true defaultValue: true,
comment: '표시 여부'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '생성일'
}, },
updatedAt: { updatedAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '수정일'
} }
}, { }, {
tableName: 'Menus', tableName: 'Menus',
comment: '서비스 내 메뉴 구조 및 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+21 -10
View File
@@ -5,7 +5,8 @@ const Notification = sequelize.define('Notification', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '알림 고유 식별자'
}, },
userId: { userId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,46 +14,56 @@ const Notification = sequelize.define('Notification', {
references: { references: {
model: 'Users', model: 'Users',
key: 'id' key: 'id'
} },
comment: '유저 ID'
}, },
title: { title: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '알림 제목'
}, },
message: { message: {
type: DataTypes.TEXT, type: DataTypes.TEXT,
allowNull: false allowNull: false,
comment: '알림 내용'
}, },
icon: { icon: {
type: DataTypes.STRING, type: DataTypes.STRING,
defaultValue: 'pi pi-info-circle' defaultValue: 'pi pi-info-circle',
comment: '아이콘'
}, },
type: { type: {
type: DataTypes.ENUM('info', 'success', 'warning', 'error'), type: DataTypes.ENUM('info', 'success', 'warning', 'error'),
defaultValue: 'info' defaultValue: 'info',
comment: '알림 타입'
}, },
read: { read: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: false, allowNull: false,
defaultValue: false defaultValue: false,
comment: '읽음 여부'
}, },
link: { link: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null defaultValue: null,
comment: '관련 링크'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false, allowNull: false,
defaultValue: DataTypes.NOW defaultValue: DataTypes.NOW,
comment: '생성일'
}, },
updatedAt: { updatedAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false, allowNull: false,
defaultValue: DataTypes.NOW defaultValue: DataTypes.NOW,
comment: '수정일'
} }
}, { }, {
timestamps: true, timestamps: true,
comment: '유저 알림 정보를 저장하는 테이블',
tableName: 'Notifications' tableName: 'Notifications'
}); });
+21 -10
View File
@@ -5,7 +5,8 @@ const Participant = sequelize.define('Participant', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '미팅 참가자 고유 식별자'
}, },
meetingId: { meetingId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,7 +14,8 @@ const Participant = sequelize.define('Participant', {
references: { references: {
model: 'Meetings', model: 'Meetings',
key: 'id' key: 'id'
} },
comment: '미팅 ID'
}, },
memberId: { memberId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -21,42 +23,51 @@ const Participant = sequelize.define('Participant', {
references: { references: {
model: 'Members', model: 'Members',
key: 'id' key: 'id'
} },
comment: '회원 ID'
}, },
teamNumber: { teamNumber: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
allowNull: false, allowNull: false,
defaultValue: 1 defaultValue: 1,
comment: '팀 번호'
}, },
status: { status: {
type: DataTypes.ENUM('참가예정', '참가완료', '취소'), type: DataTypes.ENUM('참가예정', '참가완료', '취소'),
allowNull: false, allowNull: false,
defaultValue: '참가예정' defaultValue: '참가예정',
comment: '참가 상태'
}, },
attendance: { attendance: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
defaultValue: false defaultValue: false,
comment: '출석 여부'
}, },
paymentStatus: { paymentStatus: {
type: DataTypes.ENUM('미납', '납부완료'), type: DataTypes.ENUM('미납', '납부완료'),
allowNull: false, allowNull: false,
defaultValue: '미납' defaultValue: '미납',
comment: '참가비 납부 상태'
}, },
paymentAmount: { paymentAmount: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '납부 금액'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '생성일'
}, },
updatedAt: { updatedAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '수정일'
} }
}, { }, {
tableName: 'EventParticipants', tableName: 'EventParticipants',
comment: '미팅 참가자 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+13 -6
View File
@@ -5,31 +5,38 @@ const SubscriptionPlan = sequelize.define('SubscriptionPlan', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '구독 플랜 고유 식별자'
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '플랜명'
}, },
description: { description: {
type: DataTypes.TEXT type: DataTypes.TEXT,
comment: '플랜 설명'
}, },
maxMembers: { maxMembers: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false allowNull: false,
comment: '최대 허용 회원 수'
}, },
price: { price: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: 0 defaultValue: 0,
comment: '플랜 가격'
}, },
status: { status: {
type: DataTypes.ENUM('active', 'inactive'), type: DataTypes.ENUM('active', 'inactive'),
defaultValue: 'active', defaultValue: 'active',
allowNull: false allowNull: false,
comment: '플랜 상태'
} }
}, { }, {
tableName: 'SubscriptionPlan', tableName: 'SubscriptionPlan',
comment: '구독 플랜 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+9 -4
View File
@@ -5,7 +5,8 @@ const SubscriptionPlanFeature = sequelize.define('SubscriptionPlanFeature', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '구독-기능 연결 고유 식별자'
}, },
planId: { planId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -13,7 +14,8 @@ const SubscriptionPlanFeature = sequelize.define('SubscriptionPlanFeature', {
references: { references: {
model: 'SubscriptionPlans', model: 'SubscriptionPlans',
key: 'id' key: 'id'
} },
comment: '구독 플랜 ID'
}, },
featureId: { featureId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -21,15 +23,18 @@ const SubscriptionPlanFeature = sequelize.define('SubscriptionPlanFeature', {
references: { references: {
model: 'Features', model: 'Features',
key: 'id' key: 'id'
} },
comment: '기능 ID'
}, },
status: { status: {
type: DataTypes.ENUM('active', 'inactive'), type: DataTypes.ENUM('active', 'inactive'),
defaultValue: 'active', defaultValue: 'active',
allowNull: false allowNull: false,
comment: '상태'
} }
}, { }, {
tableName: 'SubscriptionPlanFeatures', tableName: 'SubscriptionPlanFeatures',
comment: '구독 플랜별 제공 기능 정보를 저장하는 테이블',
timestamps: true timestamps: true
}); });
+21 -10
View File
@@ -6,20 +6,24 @@ const User = sequelize.define('User', {
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '유저 고유 식별자'
}, },
username: { username: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
unique: true unique: true,
comment: '로그인 계정명'
}, },
password: { password: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '비밀번호(해시)'
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false allowNull: false,
comment: '이름'
}, },
email: { email: {
type: DataTypes.STRING, type: DataTypes.STRING,
@@ -27,32 +31,39 @@ const User = sequelize.define('User', {
unique: true, unique: true,
validate: { validate: {
isEmail: true isEmail: true
} },
comment: '이메일'
}, },
role: { role: {
type: DataTypes.ENUM('admin', 'clubadmin', 'user'), type: DataTypes.ENUM('admin', 'clubadmin', 'user'),
allowNull: false, allowNull: false,
defaultValue: 'user' defaultValue: 'user',
comment: '권한 역할'
}, },
status: { status: {
type: DataTypes.ENUM('active', 'inactive', 'suspended'), type: DataTypes.ENUM('active', 'inactive', 'suspended'),
allowNull: false, allowNull: false,
defaultValue: 'active' defaultValue: 'active',
comment: '계정 상태'
}, },
lastLoginAt: { lastLoginAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true,
comment: '마지막 로그인 일시'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '생성일'
}, },
updatedAt: { updatedAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false allowNull: false,
comment: '수정일'
} }
}, { }, {
tableName: 'Users', tableName: 'Users',
comment: '서비스 회원(유저) 정보를 저장하는 테이블',
timestamps: true, timestamps: true,
hooks: { hooks: {
beforeCreate: async (user) => { beforeCreate: async (user) => {
+11 -5
View File
@@ -7,7 +7,8 @@ ActivityLog.init({
id: { id: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
comment: '활동 로그 고유 식별자'
}, },
userId: { userId: {
type: DataTypes.INTEGER.UNSIGNED, type: DataTypes.INTEGER.UNSIGNED,
@@ -15,22 +16,27 @@ ActivityLog.init({
references: { references: {
model: 'Users', model: 'Users',
key: 'id' key: 'id'
} },
comment: '유저 ID'
}, },
type: { type: {
type: DataTypes.STRING(50), type: DataTypes.STRING(50),
allowNull: false allowNull: false,
comment: '로그 유형'
}, },
description: { description: {
type: DataTypes.TEXT, type: DataTypes.TEXT,
allowNull: true allowNull: true,
comment: '상세 설명'
}, },
createdAt: { createdAt: {
type: DataTypes.DATE, type: DataTypes.DATE,
defaultValue: DataTypes.NOW defaultValue: DataTypes.NOW,
comment: '생성일'
} }
}, { }, {
sequelize, sequelize,
comment: '유저 활동 로그를 저장하는 테이블',
modelName: 'ActivityLog', modelName: 'ActivityLog',
tableName: 'ActivityLogs', tableName: 'ActivityLogs',
timestamps: true, timestamps: true,
+3 -3
View File
@@ -56,7 +56,7 @@ module.exports = {
visible: true, visible: true,
parentId: clubMenuId, parentId: clubMenuId,
featureCode: 'event_management', featureCode: 'event_management',
requiredSubscriptionTier: 'standard',
createdAt: new Date(), createdAt: new Date(),
updatedAt: new Date() updatedAt: new Date()
}, },
@@ -69,7 +69,7 @@ module.exports = {
visible: true, visible: true,
parentId: clubMenuId, parentId: clubMenuId,
featureCode: 'event_calendar', featureCode: 'event_calendar',
requiredSubscriptionTier: 'standard',
createdAt: new Date(), createdAt: new Date(),
updatedAt: new Date() updatedAt: new Date()
}, },
@@ -82,7 +82,7 @@ module.exports = {
visible: true, visible: true,
parentId: clubMenuId, parentId: clubMenuId,
featureCode: 'statistics', featureCode: 'statistics',
requiredSubscriptionTier: 'premium',
createdAt: new Date(), createdAt: new Date(),
updatedAt: new Date() updatedAt: new Date()
} }