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
5221
src/Yavsc.Org/Migrations/20261108052221_RefundableResourceStorage.Designer.cs
generated
Normal file
5221
src/Yavsc.Org/Migrations/20261108052221_RefundableResourceStorage.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue