Generated response

This commit is contained in:
2026-05-14 19:53:26 +02:00
parent 7aef20fe71
commit deb4bfda90
33 changed files with 1555 additions and 102 deletions
+46
View File
@@ -0,0 +1,46 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Musify.Domain.Entities
{
[Table("UploadIntents")]
public class UploadIntent
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
public required Guid UserId { get; set; }
[Required, MaxLength(128)]
public required string Bucket { get; set; }
// Full S3 key (including prefix and object name)
[Required, MaxLength(512)]
public required string Key { get; set; }
// Just the filename portion stored in Track/PlayList entities (e.g. "{guid}.webp")
[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!;
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace Musify.Domain.Entities
{
public enum UploadIntentPurpose
{
PlayListPicture,
TrackPicture,
TrackAudio,
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace Musify.Domain.Entities
{
public enum UploadIntentStatus
{
Issued,
Consumed,
Expired,
}
}