feat: refund tracked storage usage on deletion and replacement
Persist per-file storage receipts, preserve refundability on rename, account for PDF replacements and permit deletion at the consumption limit. Update CGU, installation documentation and regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
650e5f5e30
commit
ed8f41bd4a
17 changed files with 5636 additions and 65 deletions
|
|
@ -145,6 +145,7 @@ namespace Yavsc.Models
|
|||
builder.Entity<ApplicationUser>().HasMany<ChatConnection>(c => c.Connections);
|
||||
builder.Entity<ApplicationUser>().Property(u => u.Avatar).HasDefaultValue(Constants.DefaultAvatar);
|
||||
builder.Entity<ApplicationUser>().Property(u => u.DiskQuota).HasDefaultValue(Constants.DefaultFSQ);
|
||||
builder.Entity<ResourceStorageRecord>().HasKey(r => new { r.UserId, r.Path });
|
||||
builder.Entity<ApplicationUser>().HasAlternateKey(u => u.Email);
|
||||
builder.Entity<BlackListed>().HasOne<ApplicationUser>(bl => bl.User);
|
||||
builder.Entity<BlackListed>().HasOne<ApplicationUser>(bl => bl.Owner);
|
||||
|
|
@ -380,6 +381,7 @@ namespace Yavsc.Models
|
|||
public DbSet<Estimate> Estimates { get; set; }
|
||||
public DbSet<Signature> Signatures { get; set; }
|
||||
public DbSet<ResourceUsageRecord> ResourceUsageRecords { get; set; }
|
||||
public DbSet<ResourceStorageRecord> ResourceStorageRecords { get; set; }
|
||||
public DbSet<ResourceSubscription> ResourceSubscriptions { get; set; }
|
||||
public DbSet<ResourceSubscriptionPayment> ResourceSubscriptionPayments { get; set; }
|
||||
public DbSet<AccountBalance> BankStatus { get; set; }
|
||||
|
|
|
|||
13
src/Yavsc.Server/Models/ResourceStorageRecord.cs
Normal file
13
src/Yavsc.Server/Models/ResourceStorageRecord.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#nullable enable
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models;
|
||||
|
||||
public sealed class ResourceStorageRecord
|
||||
{
|
||||
[MaxLength(450)]
|
||||
public string UserId { get; set; } = "";
|
||||
[MaxLength(1024)]
|
||||
public string Path { get; set; } = "";
|
||||
public long Bytes { get; set; }
|
||||
}
|
||||
Loading…
Reference in a new issue