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:
Paul Schneider 2026-11-08 05:40:08 +00:00
commit ed8f41bd4a
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
17 changed files with 5636 additions and 65 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,34 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Yavsc.Migrations
{
/// <inheritdoc />
public partial class RefundableResourceStorage : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ResourceStorageRecords",
columns: table => new
{
UserId = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
Path = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
Bytes = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ResourceStorageRecords", x => new { x.UserId, x.Path });
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ResourceStorageRecords");
}
}
}

View file

@ -3081,6 +3081,24 @@ namespace Yavsc.Migrations
b.ToTable("Tags");
});
modelBuilder.Entity("Yavsc.Models.ResourceStorageRecord", b =>
{
b.Property<string>("UserId")
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("Path")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<long>("Bytes")
.HasColumnType("bigint");
b.HasKey("UserId", "Path");
b.ToTable("ResourceStorageRecords");
});
modelBuilder.Entity("Yavsc.Models.ResourceUsageRecord", b =>
{
b.Property<long>("Id")