refactor: standardize project names to Musify.* and flatten layout
- Flatten nested per-repo folders into flat Musify.* projects at root - Rename assemblies/csproj: Domain->Musify.Domain, Application->Musify.Application, Infrastructure->Musify.Infrastructure, WebApi->Musify.Api, Worker->Musify.Worker, StreamingGateway->Musify.StreamingGateway - Rename WebApi.* namespaces to Musify.Api.* - Update all ProjectReference paths and the solution file - Consolidate stray per-repo dotfiles; add root .gitattributes - Move flutter client out to _archive Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
using Musify.Domain.Abstractions;
|
||||
using Musify.Domain.ValueObjects;
|
||||
|
||||
namespace Musify.Domain.Entities
|
||||
{
|
||||
#pragma warning disable CS8618
|
||||
[Table("PlayLists")]
|
||||
public class PlayList : IAuditable
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
public required long UserId { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string NormalizedName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(256)]
|
||||
public required string Description { get; set; } = "No description was provided.";
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string OriginalPictureName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string SmallPictureName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string MediumPictureName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string LargePictureName { get; set; }
|
||||
|
||||
[Required]
|
||||
public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active;
|
||||
|
||||
[Required]
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[Required]
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[ForeignKey(nameof(UserId)) ]
|
||||
public User User { get; set; }
|
||||
|
||||
public ICollection<PlayListHasTrack> PlayListTracks { get; set; } = new List<PlayListHasTrack>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Musify.Domain.Entities
|
||||
{
|
||||
#pragma warning disable CS8618
|
||||
[Table("PlayListHasTrack")]
|
||||
public class PlayListHasTrack
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
public required Guid PlayListId { get; set; }
|
||||
|
||||
[Required]
|
||||
public required Guid TrackId { get; set; }
|
||||
|
||||
[Required]
|
||||
public int Position { get; set; } = 0;
|
||||
|
||||
[Required]
|
||||
public DateTime AddedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[ForeignKey(nameof(PlayListId)) ]
|
||||
public PlayList PlayList { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TrackId)) ]
|
||||
public Track Track { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using Musify.Domain.Abstractions;
|
||||
using Musify.Domain.ValueObjects;
|
||||
|
||||
namespace Musify.Domain.Entities
|
||||
{
|
||||
#pragma warning disable CS8618
|
||||
public class Track : IAuditable
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string Title { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string NormalizedTitle { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string OriginalPictureName { get; set; }
|
||||
|
||||
[MaxLength(64)]
|
||||
public string? SmallPictureName { get; set; }
|
||||
|
||||
[MaxLength(64)]
|
||||
public string? MediumPictureName { get; set; }
|
||||
|
||||
[MaxLength(64)]
|
||||
public string? LargePictureName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string OriginalAudioName { get; set; }
|
||||
|
||||
[MaxLength(64)]
|
||||
public string? AudioFolderName { get; set; }
|
||||
|
||||
[Required]
|
||||
public ProcessingStatus PicturesProcessingStatus { get; set; } = ProcessingStatus.Pending;
|
||||
|
||||
[Required]
|
||||
public ProcessingStatus AudioTranscodeProcessingStatus { get; set; } = ProcessingStatus.Pending;
|
||||
|
||||
[Required]
|
||||
public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active;
|
||||
|
||||
[Required]
|
||||
public int RetryCount { get; set; } = 0;
|
||||
|
||||
public DateTime? LastRetryAt { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[Required]
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<UserHasTrack> UserTracks { get; set; } = new List<UserHasTrack>();
|
||||
|
||||
public ICollection<PlayListHasTrack> PlayListTracks { get; set; } = new List<PlayListHasTrack>();
|
||||
|
||||
[NotMapped]
|
||||
[MemberNotNullWhen(true, nameof(SmallPictureName)) ]
|
||||
[MemberNotNullWhen(true, nameof(MediumPictureName)) ]
|
||||
[MemberNotNullWhen(true, nameof(LargePictureName)) ]
|
||||
public bool IsPicturesProcessed => PicturesProcessingStatus == ProcessingStatus.Completed;
|
||||
|
||||
[NotMapped]
|
||||
[MemberNotNullWhen(true, nameof(AudioFolderName)) ]
|
||||
public bool IsAudioProcessed => AudioTranscodeProcessingStatus == ProcessingStatus.Completed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
using Musify.Domain.ValueObjects;
|
||||
|
||||
namespace Musify.Domain.Entities
|
||||
{
|
||||
[Table("Upload")]
|
||||
public class Upload
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
public required string Bucket { get; set; }
|
||||
|
||||
[Required]
|
||||
public required string Key { get; set; }
|
||||
|
||||
[Required]
|
||||
public required string ContentType { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[Required]
|
||||
public UploadState State { get; set; } = UploadState.Pending;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
using Musify.Domain.ValueObjects;
|
||||
|
||||
namespace Musify.Domain.Entities
|
||||
{
|
||||
[Table("UploadIntents")]
|
||||
public class UploadIntent
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
public required long UserId { get; set; }
|
||||
|
||||
[Required, MaxLength(128)]
|
||||
public required string Bucket { get; set; }
|
||||
|
||||
[Required, MaxLength(512)]
|
||||
public required string Key { get; set; }
|
||||
|
||||
[Required, MaxLength(128)]
|
||||
public required string ObjectName { get; set; }
|
||||
|
||||
[Required, MaxLength(128)]
|
||||
public required string ContentType { get; set; }
|
||||
|
||||
public long? ExpectedSizeBytes { get; set; }
|
||||
|
||||
[Required]
|
||||
public UploadIntentPurpose Purpose { get; set; }
|
||||
|
||||
[Required]
|
||||
public UploadIntentStatus Status { get; set; } = UploadIntentStatus.Issued;
|
||||
|
||||
[Required]
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[ForeignKey(nameof(UserId)) ]
|
||||
public User User { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Musify.Domain.Abstractions;
|
||||
|
||||
namespace Musify.Domain.Entities
|
||||
{
|
||||
[Table("User")]
|
||||
public class User : IAuditable
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public required long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(48)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(48)]
|
||||
public required string NormalizedName { get; set; }
|
||||
|
||||
[MaxLength(48)]
|
||||
public string? FirstName { get; set; }
|
||||
|
||||
[MaxLength(48)]
|
||||
public string? SecondName { get; set; }
|
||||
|
||||
[MaxLength(2048)]
|
||||
public string? ProfilePictureUrl { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[Required]
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<UserHasTrack> UserTracks { get; set; } = new List<UserHasTrack>();
|
||||
|
||||
public ICollection<PlayList> PlayLists { get; set; } = new List<PlayList>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Musify.Domain.Entities
|
||||
{
|
||||
#pragma warning disable CS8618
|
||||
[Table("UserHasTrack")]
|
||||
public class UserHasTrack
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
public required long UserId { get; set; }
|
||||
|
||||
[Required]
|
||||
public required Guid TrackId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(UserId)) ]
|
||||
public User User { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TrackId)) ]
|
||||
public Track Track { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user