이벤트 개발완료
This commit is contained in:
@@ -5,6 +5,97 @@ const Map<String, String> roleOptions = {
|
||||
'user': '일반 사용자',
|
||||
};
|
||||
|
||||
// -------------------------------
|
||||
// Strong enums for client usage
|
||||
// -------------------------------
|
||||
|
||||
/// 참가자 상태 (서버 enum과 1:1 매칭)
|
||||
enum ParticipantStatus { pending, confirmed, canceled, attended }
|
||||
|
||||
extension ParticipantStatusX on ParticipantStatus {
|
||||
String get apiValue {
|
||||
switch (this) {
|
||||
case ParticipantStatus.pending:
|
||||
return 'pending';
|
||||
case ParticipantStatus.confirmed:
|
||||
return 'confirmed';
|
||||
case ParticipantStatus.canceled:
|
||||
return 'canceled';
|
||||
case ParticipantStatus.attended:
|
||||
return 'attended';
|
||||
}
|
||||
}
|
||||
|
||||
String get labelKo {
|
||||
switch (this) {
|
||||
case ParticipantStatus.pending:
|
||||
return '대기';
|
||||
case ParticipantStatus.confirmed:
|
||||
return '확인됨';
|
||||
case ParticipantStatus.canceled:
|
||||
return '취소됨';
|
||||
case ParticipantStatus.attended:
|
||||
return '참석';
|
||||
}
|
||||
}
|
||||
|
||||
static ParticipantStatus? from(String? value) {
|
||||
switch ((value ?? '').toLowerCase()) {
|
||||
case 'pending':
|
||||
return ParticipantStatus.pending;
|
||||
case 'confirmed':
|
||||
return ParticipantStatus.confirmed;
|
||||
case 'canceled':
|
||||
return ParticipantStatus.canceled;
|
||||
case 'attended':
|
||||
return ParticipantStatus.attended;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 결제 상태 (서버 enum과 1:1 매칭)
|
||||
enum PaymentStatus { unpaid, paid }
|
||||
|
||||
extension PaymentStatusX on PaymentStatus {
|
||||
String get apiValue {
|
||||
switch (this) {
|
||||
case PaymentStatus.unpaid:
|
||||
return 'unpaid';
|
||||
case PaymentStatus.paid:
|
||||
return 'paid';
|
||||
}
|
||||
}
|
||||
|
||||
String get labelKo {
|
||||
switch (this) {
|
||||
case PaymentStatus.unpaid:
|
||||
return '미납';
|
||||
case PaymentStatus.paid:
|
||||
return '납부';
|
||||
}
|
||||
}
|
||||
|
||||
static PaymentStatus? from(String? value) {
|
||||
switch ((value ?? '').toLowerCase()) {
|
||||
case 'unpaid':
|
||||
return PaymentStatus.unpaid;
|
||||
case 'paid':
|
||||
return PaymentStatus.paid;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Backward-compatible helpers for non-enum callsites
|
||||
String toKoreanParticipantStatus(String? value) =>
|
||||
(ParticipantStatusX.from(value) ?? ParticipantStatus.pending).labelKo;
|
||||
|
||||
String toKoreanPaymentStatus(String? value) =>
|
||||
(PaymentStatusX.from(value) ?? PaymentStatus.unpaid).labelKo;
|
||||
|
||||
// 성별 옵션
|
||||
const Map<String, String> genderOptions = {
|
||||
'male': '남성',
|
||||
@@ -48,9 +139,10 @@ const Map<String, String> eventStatusOptions = {
|
||||
const Map<String, String> eventTypeOptions = {
|
||||
'regular': '정기전',
|
||||
'exchange': '교류전',
|
||||
'tournament': '토너먼트',
|
||||
'tournament': '대회',
|
||||
'lightning': '번개',
|
||||
'friendly': '친선전',
|
||||
'event': '이벤트',
|
||||
'other': '기타',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user