forked from PalisadoesFoundation/talawa
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Volunteer Management(GSoC) (PalisadoesFoundation#2567)
* Volunteer Management(GSoC) * fixing codebase * fixing codebase * fixing codebase * fixing tests * fixing tests * fixing tests * fixing tests * fixing tests * fixing tests * fixing tests * fixing tests
- Loading branch information
Showing
28 changed files
with
3,493 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import 'package:talawa/models/events/event_model.dart'; | ||
import 'package:talawa/models/events/event_volunteer_group.dart'; | ||
import 'package:talawa/models/user/user_info.dart'; | ||
|
||
/// This class creates an event volunteer model and returns an EventVolunteer instance. | ||
class EventVolunteer { | ||
EventVolunteer({ | ||
this.id, | ||
this.creator, | ||
this.event, | ||
this.group, | ||
this.isAssigned, | ||
this.isInvited, | ||
this.response, | ||
this.user, | ||
}); | ||
|
||
// Creating a new EventVolunteer instance from a map structure. | ||
factory EventVolunteer.fromJson(Map<String, dynamic> json) { | ||
return EventVolunteer( | ||
id: json['_id'] as String?, | ||
creator: json['creator'] != null | ||
? User.fromJson( | ||
json['creator'] as Map<String, dynamic>, | ||
fromOrg: true, | ||
) | ||
: null, | ||
event: json['event'] != null | ||
? Event.fromJson(json['event'] as Map<String, dynamic>) | ||
: null, | ||
group: json['group'] != null | ||
? EventVolunteerGroup.fromJson(json['group'] as Map<String, dynamic>) | ||
: null, | ||
isAssigned: json['isAssigned'] as bool?, | ||
isInvited: json['isInvited'] as bool?, | ||
response: json['response'] as String?, | ||
user: json['user'] != null | ||
? User.fromJson(json['user'] as Map<String, dynamic>, fromOrg: true) | ||
: null, | ||
); | ||
} | ||
|
||
/// Unique identifier for the event volunteer. | ||
String? id; | ||
|
||
/// The creation date of the event volunteer. | ||
String? createdAt; | ||
|
||
/// The creator of the event volunteer. | ||
User? creator; | ||
|
||
/// The event associated with the event volunteer. | ||
Event? event; | ||
|
||
/// The group associated with the event volunteer. | ||
EventVolunteerGroup? group; | ||
|
||
/// A boolean value that indicates if the volunteer is assigned. | ||
bool? isAssigned; | ||
|
||
/// A boolean value that indicates if the volunteer is invited. | ||
bool? isInvited; | ||
|
||
/// The response of the volunteer. | ||
String? response; | ||
|
||
/// The last update date of the event volunteer. | ||
String? updatedAt; | ||
|
||
/// The user who is the volunteer. | ||
User? user; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import 'package:talawa/models/events/event_model.dart'; | ||
import 'package:talawa/models/events/event_volunteer.dart'; | ||
import 'package:talawa/models/user/user_info.dart'; | ||
|
||
/// This class creates an event volunteer group model and returns an EventVolunteerGroup instance. | ||
class EventVolunteerGroup { | ||
EventVolunteerGroup({ | ||
this.id, | ||
this.createdAt, | ||
this.creator, | ||
this.event, | ||
this.leader, | ||
this.name, | ||
this.updatedAt, | ||
this.volunteers, | ||
this.volunteersRequired, | ||
}); | ||
|
||
// Creating a new EventVolunteerGroup instance from a map structure. | ||
factory EventVolunteerGroup.fromJson(Map<String, dynamic> json) { | ||
return EventVolunteerGroup( | ||
id: json['_id'] as String?, | ||
createdAt: json['createdAt'] as String?, | ||
creator: json['creator'] == null | ||
? null | ||
: User.fromJson( | ||
json['creator'] as Map<String, dynamic>, | ||
fromOrg: true, | ||
), | ||
event: json['event'] == null | ||
? null | ||
: Event.fromJson(json['event'] as Map<String, dynamic>), | ||
leader: json['leader'] == null | ||
? null | ||
: User.fromJson( | ||
json['leader'] as Map<String, dynamic>, | ||
fromOrg: true, | ||
), | ||
name: json['name'] as String?, | ||
updatedAt: json['updatedAt'] as String?, | ||
volunteers: (json['volunteers'] as List<dynamic>?) | ||
?.map((e) => EventVolunteer.fromJson(e as Map<String, dynamic>)) | ||
.toList(), | ||
volunteersRequired: json['volunteersRequired'] as int?, | ||
); | ||
} | ||
|
||
/// Unique identifier for the event volunteer group. | ||
String? id; | ||
|
||
/// The creation date of the event volunteer group. | ||
String? createdAt; | ||
|
||
/// The creator of the event volunteer group. | ||
User? creator; | ||
|
||
/// The event associated with the event volunteer group. | ||
Event? event; | ||
|
||
/// The leader of the event volunteer group. | ||
User? leader; | ||
|
||
/// The name of the event volunteer group. | ||
String? name; | ||
|
||
/// The last update date of the event volunteer group. | ||
String? updatedAt; | ||
|
||
/// The list of volunteers in the event volunteer group. | ||
List<EventVolunteer>? volunteers; | ||
|
||
/// The number of volunteers required for the event volunteer group. | ||
int? volunteersRequired; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.