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