Ignore:
Timestamp:
08/24/26 20:57:09 (13 days ago)
Author:
kikisrbinoska <srbinoskakristina07@…>
Branches:
main
Parents:
a6e33d1
Message:

Added corrected entitef from the ER diagram and changes for the logic to be coresponding to the ddl

Location:
ChapterX.Application
Files:
75 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • ChapterX.Application/AISuggestion/Commands/AddHandler.cs

    ra6e33d1 re882b92  
    2222                OriginalText = request.OriginalText,
    2323                SuggestedText = request.SuggestedText,
     24                SuggestionType = request.SuggestionType,
    2425                StoryId = request.StoryId,
    2526                Accepted = null,
  • ChapterX.Application/AISuggestion/Commands/AddRequest.cs

    ra6e33d1 re882b92  
    66        string OriginalText,
    77        string SuggestedText,
     8        string SuggestionType,
    89        int StoryId
    910    ) : IRequest<AddResponse>;
  • ChapterX.Application/Abstractions/IApplicationDbContext.cs

    ra6e33d1 re882b92  
    1111using LikesEntity = ChapterX.Domain.Entities.Likes;
    1212using CollaborationEntity = ChapterX.Domain.Entities.Collaboration;
    13 using NotifyEntity = ChapterX.Domain.Entities.Notify;
    1413using AISuggestionEntity = ChapterX.Domain.Entities.AISuggestion;
    1514using AdminEntity = ChapterX.Domain.Entities.Admin;
     
    3332        DbSet<LikesEntity> Likes { get; }
    3433        DbSet<CollaborationEntity> Collaborations { get; }
    35         DbSet<NotifyEntity> Notifies { get; }
    3634        DbSet<AISuggestionEntity> AISuggestions { get; }
    3735        DbSet<AdminEntity> Admins { get; }
  • ChapterX.Application/Admin/Commands/AddHandler.cs

    ra6e33d1 re882b92  
    2020            var admin = new Domain.Entities.Admin
    2121            {
    22                 Id = request.UserId
     22                Id = request.UserId,
     23                AssignedAt = DateTime.UtcNow
    2324            };
    2425
  • ChapterX.Application/Collaboration/Commands/AddHandler.cs

    ra6e33d1 re882b92  
    2222                UserId = request.UserId,
    2323                StoryId = request.StoryId,
     24                Role = request.Role,
     25                PermissionLevel = request.PermissionLevel,
    2426                CreatedAt = DateTime.UtcNow
    2527            };
  • ChapterX.Application/Collaboration/Commands/AddRequest.cs

    ra6e33d1 re882b92  
    33namespace ChapterX.Application.Collaboration.Commands
    44{
    5     public record AddRequest(int UserId, int StoryId, string Role) : IRequest<AddResponse>;
     5    public record AddRequest(int UserId, int StoryId, string Role, int? PermissionLevel = null) : IRequest<AddResponse>;
    66}
  • ChapterX.Application/Collaboration/Commands/UpdateHandler.cs

    ra6e33d1 re882b92  
    2222                return new UpdateResponse(false);
    2323
    24             // No updatable fields on Collaboration entity
     24            collaboration.Role = request.Role;
     25            collaboration.PermissionLevel = request.PermissionLevel;
    2526
    2627            await _collaborationRepository.UpdateAsync(collaboration, cancellationToken);
  • ChapterX.Application/Collaboration/Commands/UpdateRequest.cs

    ra6e33d1 re882b92  
    33namespace ChapterX.Application.Collaboration.Commands
    44{
    5     public record UpdateRequest(int Id, string Role) : IRequest<UpdateResponse>;
     5    public record UpdateRequest(int Id, string Role, int? PermissionLevel = null) : IRequest<UpdateResponse>;
    66}
  • ChapterX.Application/Likes/Commands/AddHandler.cs

    ra6e33d1 re882b92  
    2222                UserId = request.UserId,
    2323                StoryId = request.StoryId,
    24                 CreatedAt = DateTime.UtcNow
     24                LikedAt = DateTime.UtcNow
    2525            };
    2626
  • ChapterX.Application/Notification/Commands/AddHandler.cs

    ra6e33d1 re882b92  
    2121            {
    2222                Content = request.Content,
     23                ContentType = request.ContentType,
    2324                IsRead = false,
     25                Link = request.Link,
     26                UserId = request.UserId,
     27                StoryId = request.StoryId,
    2428                CreatedAt = DateTime.UtcNow,
    25                 RecipientUserId = request.RecipientUserId,
    26                 Type = request.Type,
    27                 Link = request.Link,
    2829            };
    2930
  • ChapterX.Application/Notification/Commands/AddRequest.cs

    ra6e33d1 re882b92  
    33namespace ChapterX.Application.Notification.Commands
    44{
    5     public record AddRequest(string Content, int? RecipientUserId = null, string? Type = null, string? Link = null) : IRequest<AddResponse>;
     5    public record AddRequest(string Content, string ContentType, int UserId, int? StoryId = null, string? Link = null) : IRequest<AddResponse>;
    66}
  • ChapterX.Application/RegularUser/Commands/AddHandler.cs

    ra6e33d1 re882b92  
    2020            var regularUser = new Domain.Entities.RegularUser
    2121            {
    22                 Id = request.UserId
     22                Id = request.UserId,
     23                JoinedAt = DateTime.UtcNow
    2324            };
    2425
  • ChapterX.Application/Story/Commands/AddHandler.cs

    ra6e33d1 re882b92  
    3535                    Image = request.Image,
    3636                    Content = request.Content,
     37                    Status = "draft",
    3738                    UserId = request.UserId,
    3839                    CreatedAt = DateTime.UtcNow,
  • ChapterX.Application/Story/Commands/UpdateHandler.cs

    ra6e33d1 re882b92  
    3030            story.Image = request.Image;
    3131            story.Content = request.Content;
     32            if (request.Status is not null)
     33                story.Status = request.Status;
    3234            story.UpdatedAt = DateTime.UtcNow;
    3335
  • ChapterX.Application/Story/Commands/UpdateRequest.cs

    ra6e33d1 re882b92  
    33namespace ChapterX.Application.Story.Commands
    44{
    5     public record UpdateRequest(int Id, bool MatureContent, string Title, string ShortDescription, string? Image, string Content, int CallerId = 0) : IRequest<UpdateResponse>;
     5    public record UpdateRequest(int Id, bool MatureContent, string Title, string ShortDescription, string? Image, string Content, string? Status = null, int CallerId = 0) : IRequest<UpdateResponse>;
    66}
  • ChapterX.Application/Writer/Commands/AddHandler.cs

    ra6e33d1 re882b92  
    2020            var writer = new Domain.Entities.Writer
    2121            {
    22                 Id = request.UserId
     22                Id = request.UserId,
     23                Bio = request.Bio
    2324            };
    2425
  • ChapterX.Application/Writer/Commands/UpdateHandler.cs

    ra6e33d1 re882b92  
    2222                return new UpdateResponse(false);
    2323
    24             // No updatable fields on Writer entity
     24            writer.Bio = request.Bio;
    2525
    2626            await _writerRepository.UpdateAsync(writer, cancellationToken);
Note: See TracChangeset for help on using the changeset viewer.