Skip to content

Commit

Permalink
(#418) users: udpate core
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Sep 20, 2024
1 parent 0593b41 commit b3ec697
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace MiniSpace.Services.Students.Core.Entities
{
public class UserNotifications : AggregateRoot
{
public Guid StudentId { get; private set; }
public Guid UserId { get; private set; }
public NotificationPreferences NotificationPreferences { get; private set; }

public UserNotifications(Guid studentId, NotificationPreferences notificationPreferences)
public UserNotifications(Guid userId, NotificationPreferences notificationPreferences)
{
StudentId = studentId;
UserId = userId;
NotificationPreferences = notificationPreferences ?? new NotificationPreferences();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace MiniSpace.Services.Students.Core.Entities
{
public class UserSettings : AggregateRoot
{
public Guid StudentId { get; private set; }
public Guid UserId { get; private set; }
public UserAvailableSettings AvailableSettings { get; private set; }

public UserSettings(Guid studentId, UserAvailableSettings availableSettings)
public UserSettings(Guid userId, UserAvailableSettings availableSettings)
{
StudentId = studentId;
UserId = userId;
AvailableSettings = availableSettings ?? new UserAvailableSettings();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace MiniSpace.Services.Students.Core.Events
{
public class StudentNotificationPreferencesUpdated : IDomainEvent
{
public Guid StudentId { get; }
public Guid UserId { get; }
public NotificationPreferences NotificationPreferences { get; }

public StudentNotificationPreferencesUpdated(UserNotifications userNotifications)
{
StudentId = userNotifications.StudentId;
UserId = userNotifications.UserId;
NotificationPreferences = userNotifications.NotificationPreferences;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
public class StudentAlreadyInterestedInException : DomainException
{
public override string Code { get; } = "student_already_interested_in_event";
public Guid StudentId { get; }
public Guid UserId { get; }
public Guid EventId { get; }

public StudentAlreadyInterestedInException(Guid studentId, Guid eventId)
: base($"Student with id: {studentId} is already interested in event with id: {eventId}")
public StudentAlreadyInterestedInException(Guid userId, Guid eventId)
: base($"Student with id: {userId} is already interested in event with id: {eventId}")
{
StudentId = studentId;
UserId = userId;
EventId = eventId;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
public class StudentAlreadySignedUpException : DomainException
{
public override string Code { get; } = "student_already_signed_up";
public Guid StudentId { get; }
public Guid UserId { get; }
public Guid EventId { get; }

public StudentAlreadySignedUpException(Guid studentId, Guid eventId)
: base($"Student with id: {studentId} is already signed up for event with id: {eventId}")
public StudentAlreadySignedUpException(Guid userId, Guid eventId)
: base($"Student with id: {userId} is already signed up for event with id: {eventId}")
{
StudentId = studentId;
UserId = userId;
EventId = eventId;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ namespace MiniSpace.Services.Students.Core.Exceptions
public class StudentGalleryImageNotFoundException : DomainException
{
public override string Code { get; } = "student_gallery_image_not_found";
public Guid StudentId { get; }
public Guid UserId { get; }
public string MediaFileId { get; }

public StudentGalleryImageNotFoundException(Guid studentId, string mediaFileId)
: base($"Student with id: {studentId} does not have an image with media file id: {mediaFileId} in the gallery.")
public StudentGalleryImageNotFoundException(Guid userId, string mediaFileId)
: base($"Student with id: {userId} does not have an image with media file id: {mediaFileId} in the gallery.")
{
StudentId = studentId;
UserId = userId;
MediaFileId = mediaFileId;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
public class StudentIsNotInterestedException : DomainException
{
public override string Code { get; } = "student_is_not_interested_in_event";
public Guid StudentId { get; }
public Guid UserId { get; }
public Guid EventId { get; }

public StudentIsNotInterestedException(Guid studentId, Guid eventId)
: base($"Student with id: {studentId} is not interested in event with id: {eventId}")
public StudentIsNotInterestedException(Guid userId, Guid eventId)
: base($"Student with id: {userId} is not interested in event with id: {eventId}")
{
StudentId = studentId;
UserId = userId;
EventId = eventId;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
public class StudentIsNotSignedUpException : DomainException
{
public override string Code { get; } = "student_is_not_signed_up_to_event";
public Guid StudentId { get; }
public Guid UserId { get; }
public Guid EventId { get; }

public StudentIsNotSignedUpException(Guid studentId, Guid eventId)
: base($"Student with id: {studentId} is not signed up to event with id: {eventId}")
public StudentIsNotSignedUpException(Guid userId, Guid eventId)
: base($"Student with id: {userId} is not signed up to event with id: {eventId}")
{
StudentId = studentId;
UserId = userId;
EventId = eventId;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace MiniSpace.Services.Students.Core.Repositories
{
public interface IUserNotificationPreferencesRepository
{
Task<NotificationPreferences> GetNotificationPreferencesAsync(Guid studentId);
Task UpdateNotificationPreferencesAsync(Guid studentId, NotificationPreferences notificationPreferences);
Task<NotificationPreferences> GetNotificationPreferencesAsync(Guid userId);
Task UpdateNotificationPreferencesAsync(Guid userId, NotificationPreferences notificationPreferences);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace MiniSpace.Services.Students.Core.Repositories
{
public interface IUserSettingsRepository
{
Task<UserSettings> GetUserSettingsAsync(Guid studentId);
Task<UserSettings> GetUserSettingsAsync(Guid userId);
Task AddUserSettingsAsync(UserSettings userSettings);
Task UpdateUserSettingsAsync(UserSettings userSettings);
}
Expand Down

0 comments on commit b3ec697

Please sign in to comment.