feat: localize membership tier display
All checks were successful
deploy-socialize / image (push) Successful in 1m11s
deploy-socialize / deploy (push) Successful in 19s

This commit is contained in:
2026-05-07 20:43:08 -04:00
parent 6d92119c9c
commit 7a8a0a44bf
17 changed files with 2937 additions and 72 deletions

View File

@@ -0,0 +1,137 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Socialize.Api.Migrations
{
/// <inheritdoc />
internal partial class LocalizeOrganizationMembershipTiers : Migration
{
private static readonly string[] MembershipTierTranslationSeedColumns =
[
"Id",
"Culture",
"Description",
"MembershipTierId",
"Name"
];
private static readonly string[] MembershipTierColumnsToRestore =
[
"Description",
"Name"
];
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
ArgumentNullException.ThrowIfNull(migrationBuilder);
migrationBuilder.DropColumn(
name: "Description",
table: "OrganizationMembershipTiers");
migrationBuilder.DropColumn(
name: "Name",
table: "OrganizationMembershipTiers");
migrationBuilder.CreateTable(
name: "OrganizationMembershipTierTranslations",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
MembershipTierId = table.Column<Guid>(type: "uuid", nullable: false),
Culture = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Description = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationMembershipTierTranslations", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationMembershipTierTranslations_OrganizationMembersh~",
column: x => x.MembershipTierId,
principalTable: "OrganizationMembershipTiers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
table: "OrganizationMembershipTierTranslations",
columns: MembershipTierTranslationSeedColumns,
values: new object[,]
{
{ new Guid("20000000-0000-0001-0000-000000000001"), "en", "For trying Socialize on one real approval workflow.", new Guid("20000000-0000-0000-0000-000000000001"), "Free" },
{ new Guid("20000000-0000-0001-0000-000000000002"), "fr", "Pour essayer Socialize sur un vrai workflow d'approbation.", new Guid("20000000-0000-0000-0000-000000000001"), "Free" },
{ new Guid("20000000-0000-0001-0000-000000000003"), "en", "For solo operators managing recurring client reviews.", new Guid("20000000-0000-0000-0000-000000000002"), "Freelance" },
{ new Guid("20000000-0000-0001-0000-000000000004"), "fr", "Pour les independants qui gerent des revisions client recurrentes.", new Guid("20000000-0000-0000-0000-000000000002"), "Freelance" },
{ new Guid("20000000-0000-0001-0000-000000000005"), "en", "For agencies that need repeatable client approval operations.", new Guid("20000000-0000-0000-0000-000000000003"), "Agency" },
{ new Guid("20000000-0000-0001-0000-000000000006"), "fr", "Pour les agences qui veulent des operations d'approbation client repetables.", new Guid("20000000-0000-0000-0000-000000000003"), "Agency" },
{ new Guid("20000000-0000-0001-0000-000000000007"), "en", "For larger organizations with governance and access needs.", new Guid("20000000-0000-0000-0000-000000000004"), "Enterprise" },
{ new Guid("20000000-0000-0001-0000-000000000008"), "fr", "Pour les grandes organisations avec des besoins de gouvernance et d'acces.", new Guid("20000000-0000-0000-0000-000000000004"), "Enterprise" }
});
migrationBuilder.CreateIndex(
name: "IX_OrganizationMembershipTierTranslations_MembershipTierId_Cul~",
table: "OrganizationMembershipTierTranslations",
columns: ["MembershipTierId", "Culture"],
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
ArgumentNullException.ThrowIfNull(migrationBuilder);
migrationBuilder.DropTable(
name: "OrganizationMembershipTierTranslations");
migrationBuilder.AddColumn<string>(
name: "Description",
table: "OrganizationMembershipTiers",
type: "character varying(512)",
maxLength: 512,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "Name",
table: "OrganizationMembershipTiers",
type: "character varying(128)",
maxLength: 128,
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "OrganizationMembershipTiers",
keyColumn: "Id",
keyValue: new Guid("20000000-0000-0000-0000-000000000001"),
columns: MembershipTierColumnsToRestore,
values: new object[] { "For trying Socialize on one real approval workflow.", "Free" });
migrationBuilder.UpdateData(
table: "OrganizationMembershipTiers",
keyColumn: "Id",
keyValue: new Guid("20000000-0000-0000-0000-000000000002"),
columns: MembershipTierColumnsToRestore,
values: new object[] { "For solo operators managing recurring client reviews.", "Freelance" });
migrationBuilder.UpdateData(
table: "OrganizationMembershipTiers",
keyColumn: "Id",
keyValue: new Guid("20000000-0000-0000-0000-000000000003"),
columns: MembershipTierColumnsToRestore,
values: new object[] { "For agencies that need repeatable client approval operations.", "Agency" });
migrationBuilder.UpdateData(
table: "OrganizationMembershipTiers",
keyColumn: "Id",
keyValue: new Guid("20000000-0000-0000-0000-000000000004"),
columns: MembershipTierColumnsToRestore,
values: new object[] { "For larger organizations with governance and access needs.", "Enterprise" });
}
}
}

View File

@@ -1724,11 +1724,6 @@ namespace Socialize.Api.Migrations
b.Property<int?>("ActiveContentLimit")
.HasColumnType("integer");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("character varying(512)");
b.Property<int?>("ExternalReviewerLimit")
.HasColumnType("integer");
@@ -1746,11 +1741,6 @@ namespace Socialize.Api.Migrations
b.Property<int?>("MonthlyPriceCents")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<int>("SortOrder")
.HasColumnType("integer");
@@ -1771,13 +1761,11 @@ namespace Socialize.Api.Migrations
{
Id = new Guid("20000000-0000-0000-0000-000000000001"),
ActiveContentLimit = 3,
Description = "For trying Socialize on one real approval workflow.",
ExternalReviewerLimit = 1,
IsCustom = false,
Key = "free",
MemberLimit = 2,
MonthlyPriceCents = 0,
Name = "Free",
SortOrder = 10,
WorkspaceLimit = 1
},
@@ -1785,13 +1773,11 @@ namespace Socialize.Api.Migrations
{
Id = new Guid("20000000-0000-0000-0000-000000000002"),
ActiveContentLimit = 25,
Description = "For solo operators managing recurring client reviews.",
ExternalReviewerLimit = 10,
IsCustom = false,
Key = "freelance",
MemberLimit = 5,
MonthlyPriceCents = 1900,
Name = "Freelance",
SortOrder = 20,
WorkspaceLimit = 3
},
@@ -1799,26 +1785,120 @@ namespace Socialize.Api.Migrations
{
Id = new Guid("20000000-0000-0000-0000-000000000003"),
ActiveContentLimit = 250,
Description = "For agencies that need repeatable client approval operations.",
IsCustom = false,
Key = "agency",
MemberLimit = 25,
MonthlyPriceCents = 7900,
Name = "Agency",
SortOrder = 30,
WorkspaceLimit = 15
},
new
{
Id = new Guid("20000000-0000-0000-0000-000000000004"),
Description = "For larger organizations with governance and access needs.",
IsCustom = true,
Key = "enterprise",
Name = "Enterprise",
SortOrder = 40
});
});
modelBuilder.Entity("Socialize.Api.Modules.Organizations.Data.OrganizationMembershipTierTranslation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Culture")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("character varying(512)");
b.Property<Guid>("MembershipTierId")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.HasKey("Id");
b.HasIndex("MembershipTierId", "Culture")
.IsUnique();
b.ToTable("OrganizationMembershipTierTranslations", (string)null);
b.HasData(
new
{
Id = new Guid("20000000-0000-0001-0000-000000000001"),
Culture = "en",
Description = "For trying Socialize on one real approval workflow.",
MembershipTierId = new Guid("20000000-0000-0000-0000-000000000001"),
Name = "Free"
},
new
{
Id = new Guid("20000000-0000-0001-0000-000000000002"),
Culture = "fr",
Description = "Pour essayer Socialize sur un vrai workflow d'approbation.",
MembershipTierId = new Guid("20000000-0000-0000-0000-000000000001"),
Name = "Free"
},
new
{
Id = new Guid("20000000-0000-0001-0000-000000000003"),
Culture = "en",
Description = "For solo operators managing recurring client reviews.",
MembershipTierId = new Guid("20000000-0000-0000-0000-000000000002"),
Name = "Freelance"
},
new
{
Id = new Guid("20000000-0000-0001-0000-000000000004"),
Culture = "fr",
Description = "Pour les independants qui gerent des revisions client recurrentes.",
MembershipTierId = new Guid("20000000-0000-0000-0000-000000000002"),
Name = "Freelance"
},
new
{
Id = new Guid("20000000-0000-0001-0000-000000000005"),
Culture = "en",
Description = "For agencies that need repeatable client approval operations.",
MembershipTierId = new Guid("20000000-0000-0000-0000-000000000003"),
Name = "Agency"
},
new
{
Id = new Guid("20000000-0000-0001-0000-000000000006"),
Culture = "fr",
Description = "Pour les agences qui veulent des operations d'approbation client repetables.",
MembershipTierId = new Guid("20000000-0000-0000-0000-000000000003"),
Name = "Agency"
},
new
{
Id = new Guid("20000000-0000-0001-0000-000000000007"),
Culture = "en",
Description = "For larger organizations with governance and access needs.",
MembershipTierId = new Guid("20000000-0000-0000-0000-000000000004"),
Name = "Enterprise"
},
new
{
Id = new Guid("20000000-0000-0001-0000-000000000008"),
Culture = "fr",
Description = "Pour les grandes organisations avec des besoins de gouvernance et d'acces.",
MembershipTierId = new Guid("20000000-0000-0000-0000-000000000004"),
Name = "Enterprise"
});
});
modelBuilder.Entity("Socialize.Api.Modules.Workspaces.Data.Workspace", b =>
{
b.Property<Guid>("Id")
@@ -2256,6 +2336,15 @@ namespace Socialize.Api.Migrations
.IsRequired();
});
modelBuilder.Entity("Socialize.Api.Modules.Organizations.Data.OrganizationMembershipTierTranslation", b =>
{
b.HasOne("Socialize.Api.Modules.Organizations.Data.OrganizationMembershipTier", null)
.WithMany()
.HasForeignKey("MembershipTierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Socialize.Api.Modules.Workspaces.Data.Workspace", b =>
{
b.HasOne("Socialize.Api.Modules.Organizations.Data.Organization", null)