tdd 진행
This commit is contained in:
@@ -16,7 +16,7 @@ class Club {
|
||||
final DateTime? updatedAt;
|
||||
|
||||
Club({
|
||||
required this.id,
|
||||
this.id = '', // 기본값 빈 문자열로 설정
|
||||
required this.name,
|
||||
this.description,
|
||||
this.logo,
|
||||
|
||||
@@ -7,8 +7,14 @@ class Event {
|
||||
final DateTime? endDate;
|
||||
final String? location;
|
||||
final String? type;
|
||||
final String? status;
|
||||
final int? maxParticipants;
|
||||
final int? currentParticipants;
|
||||
final int? gameCount;
|
||||
final double? participantFee;
|
||||
final DateTime? registrationDeadline;
|
||||
final String? publicHash;
|
||||
final String? accessPassword;
|
||||
final bool isActive;
|
||||
final String? createdBy;
|
||||
final DateTime? createdAt;
|
||||
@@ -23,8 +29,14 @@ class Event {
|
||||
this.endDate,
|
||||
this.location,
|
||||
this.type,
|
||||
this.status,
|
||||
this.maxParticipants,
|
||||
this.currentParticipants,
|
||||
this.gameCount,
|
||||
this.participantFee,
|
||||
this.registrationDeadline,
|
||||
this.publicHash,
|
||||
this.accessPassword,
|
||||
required this.isActive,
|
||||
this.createdBy,
|
||||
this.createdAt,
|
||||
@@ -42,8 +54,14 @@ class Event {
|
||||
endDate: json['endDate'] != null ? DateTime.parse(json['endDate'].toString()) : null,
|
||||
location: json['location']?.toString(),
|
||||
type: json['type']?.toString(),
|
||||
status: json['status']?.toString(),
|
||||
maxParticipants: json['maxParticipants'],
|
||||
currentParticipants: json['currentParticipants'],
|
||||
gameCount: json['gameCount'],
|
||||
participantFee: json['participantFee'] != null ? double.tryParse(json['participantFee'].toString()) : null,
|
||||
registrationDeadline: json['registrationDeadline'] != null ? DateTime.parse(json['registrationDeadline'].toString()) : null,
|
||||
publicHash: json['publicHash']?.toString(),
|
||||
accessPassword: json['accessPassword']?.toString(),
|
||||
isActive: json['isActive'] ?? true,
|
||||
createdBy: json['createdBy']?.toString(),
|
||||
createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt'].toString()) : null,
|
||||
@@ -62,8 +80,14 @@ class Event {
|
||||
'endDate': endDate?.toIso8601String(),
|
||||
'location': location,
|
||||
'type': type,
|
||||
'status': status,
|
||||
'maxParticipants': maxParticipants,
|
||||
'currentParticipants': currentParticipants,
|
||||
'gameCount': gameCount,
|
||||
'participantFee': participantFee,
|
||||
'registrationDeadline': registrationDeadline?.toIso8601String(),
|
||||
'publicHash': publicHash,
|
||||
'accessPassword': accessPassword,
|
||||
'isActive': isActive,
|
||||
'createdBy': createdBy,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
class Participant {
|
||||
final String id;
|
||||
final String eventId;
|
||||
final String memberId;
|
||||
final String? name;
|
||||
final String? email;
|
||||
final String? phoneNumber;
|
||||
final String? status; // 'registered', 'confirmed', 'cancelled', 'attended'
|
||||
final DateTime? registeredAt;
|
||||
final DateTime? confirmedAt;
|
||||
final DateTime? cancelledAt;
|
||||
final DateTime? attendedAt;
|
||||
final bool isPaid;
|
||||
final double? paidAmount;
|
||||
final String? notes;
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
|
||||
Participant({
|
||||
required this.id,
|
||||
required this.eventId,
|
||||
required this.memberId,
|
||||
this.name,
|
||||
this.email,
|
||||
this.phoneNumber,
|
||||
this.status,
|
||||
this.registeredAt,
|
||||
this.confirmedAt,
|
||||
this.cancelledAt,
|
||||
this.attendedAt,
|
||||
this.isPaid = false,
|
||||
this.paidAmount,
|
||||
this.notes,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
// JSON 데이터로부터 Participant 객체 생성
|
||||
factory Participant.fromJson(Map<String, dynamic> json) {
|
||||
return Participant(
|
||||
id: json['id']?.toString() ?? '',
|
||||
eventId: json['eventId']?.toString() ?? '',
|
||||
memberId: json['memberId']?.toString() ?? '',
|
||||
name: json['name']?.toString(),
|
||||
email: json['email']?.toString(),
|
||||
phoneNumber: json['phoneNumber']?.toString(),
|
||||
status: json['status']?.toString(),
|
||||
registeredAt: json['registeredAt'] != null ? DateTime.parse(json['registeredAt'].toString()) : null,
|
||||
confirmedAt: json['confirmedAt'] != null ? DateTime.parse(json['confirmedAt'].toString()) : null,
|
||||
cancelledAt: json['cancelledAt'] != null ? DateTime.parse(json['cancelledAt'].toString()) : null,
|
||||
attendedAt: json['attendedAt'] != null ? DateTime.parse(json['attendedAt'].toString()) : null,
|
||||
isPaid: json['isPaid'] ?? false,
|
||||
paidAmount: json['paidAmount'] != null ? double.tryParse(json['paidAmount'].toString()) : null,
|
||||
notes: json['notes']?.toString(),
|
||||
createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt'].toString()) : null,
|
||||
updatedAt: json['updatedAt'] != null ? DateTime.parse(json['updatedAt'].toString()) : null,
|
||||
);
|
||||
}
|
||||
|
||||
// Participant 객체를 JSON으로 변환
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'eventId': eventId,
|
||||
'memberId': memberId,
|
||||
'name': name,
|
||||
'email': email,
|
||||
'phoneNumber': phoneNumber,
|
||||
'status': status,
|
||||
'registeredAt': registeredAt?.toIso8601String(),
|
||||
'confirmedAt': confirmedAt?.toIso8601String(),
|
||||
'cancelledAt': cancelledAt?.toIso8601String(),
|
||||
'attendedAt': attendedAt?.toIso8601String(),
|
||||
'isPaid': isPaid,
|
||||
'paidAmount': paidAmount,
|
||||
'notes': notes,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ class Score {
|
||||
final int totalScore;
|
||||
final DateTime date;
|
||||
final String? notes;
|
||||
final String? participantName;
|
||||
|
||||
Score({
|
||||
required this.id,
|
||||
@@ -17,6 +18,7 @@ class Score {
|
||||
required this.totalScore,
|
||||
required this.date,
|
||||
this.notes,
|
||||
this.participantName,
|
||||
});
|
||||
|
||||
factory Score.fromJson(Map<String, dynamic> json) {
|
||||
@@ -29,6 +31,7 @@ class Score {
|
||||
totalScore: json['totalScore'] ?? 0,
|
||||
date: json['date'] != null ? DateTime.parse(json['date'].toString()) : DateTime.now(),
|
||||
notes: json['notes']?.toString(),
|
||||
participantName: json['participantName']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -42,6 +45,7 @@ class Score {
|
||||
'totalScore': totalScore,
|
||||
'date': date.toIso8601String(),
|
||||
'notes': notes,
|
||||
'participantName': participantName,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,6 +158,45 @@ class SubscriptionPlan {
|
||||
required this.hasPriority,
|
||||
});
|
||||
|
||||
/// JSON에서 구독 플랜 객체 생성
|
||||
factory SubscriptionPlan.fromJson(Map<String, dynamic> json) {
|
||||
return SubscriptionPlan(
|
||||
type: SubscriptionPlanType.values.firstWhere(
|
||||
(e) => e.toString().split('.').last == json['type'],
|
||||
orElse: () => SubscriptionPlanType.free,
|
||||
),
|
||||
name: json['name'],
|
||||
description: json['description'],
|
||||
monthlyPrice: json['monthlyPrice'].toDouble(),
|
||||
yearlyPrice: json['yearlyPrice'].toDouble(),
|
||||
currency: json['currency'],
|
||||
features: List<String>.from(json['features']),
|
||||
maxMembers: json['maxMembers'],
|
||||
maxEvents: json['maxEvents'],
|
||||
hasAdvancedStats: json['hasAdvancedStats'] ?? false,
|
||||
hasCustomization: json['hasCustomization'] ?? false,
|
||||
hasPriority: json['hasPriority'] ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
/// 구독 플랜 객체를 JSON으로 변환
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'type': type.toString().split('.').last,
|
||||
'name': name,
|
||||
'description': description,
|
||||
'monthlyPrice': monthlyPrice,
|
||||
'yearlyPrice': yearlyPrice,
|
||||
'currency': currency,
|
||||
'features': features,
|
||||
'maxMembers': maxMembers,
|
||||
'maxEvents': maxEvents,
|
||||
'hasAdvancedStats': hasAdvancedStats,
|
||||
'hasCustomization': hasCustomization,
|
||||
'hasPriority': hasPriority,
|
||||
};
|
||||
}
|
||||
|
||||
/// 기본 구독 플랜 목록 반환
|
||||
static List<SubscriptionPlan> getDefaultPlans() {
|
||||
return [
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
class Team {
|
||||
final String id;
|
||||
final String eventId;
|
||||
final String name;
|
||||
final List<String> memberIds;
|
||||
final String? description;
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
|
||||
Team({
|
||||
required this.id,
|
||||
required this.eventId,
|
||||
required this.name,
|
||||
required this.memberIds,
|
||||
this.description,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
// JSON 데이터로부터 Team 객체 생성
|
||||
factory Team.fromJson(Map<String, dynamic> json) {
|
||||
return Team(
|
||||
id: json['id']?.toString() ?? '',
|
||||
eventId: json['eventId']?.toString() ?? '',
|
||||
name: json['name']?.toString() ?? '',
|
||||
memberIds: json['memberIds'] != null ? List<String>.from(json['memberIds']) : [],
|
||||
description: json['description']?.toString(),
|
||||
createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt'].toString()) : null,
|
||||
updatedAt: json['updatedAt'] != null ? DateTime.parse(json['updatedAt'].toString()) : null,
|
||||
);
|
||||
}
|
||||
|
||||
// Team 객체를 JSON으로 변환
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'eventId': eventId,
|
||||
'name': name,
|
||||
'memberIds': memberIds,
|
||||
'description': description,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user