diff --git a/src/Mocha/Mocha.sln b/src/Mocha/Mocha.sln
index 279aa211269..f3f126b0ee5 100644
--- a/src/Mocha/Mocha.sln
+++ b/src/Mocha/Mocha.sln
@@ -57,6 +57,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.ServiceDefaults", "src
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.Contracts", "src\Demo\Demo.Contracts\Demo.Contracts.csproj", "{58C302B9-4E15-447B-ACE3-867813189848}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mocha.Inbox", "src\Mocha.Inbox\Mocha.Inbox.csproj", "{0880A475-4F12-4974-A3FD-ABB4288909B2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -355,6 +357,18 @@ Global
{58C302B9-4E15-447B-ACE3-867813189848}.Release|x64.Build.0 = Release|Any CPU
{58C302B9-4E15-447B-ACE3-867813189848}.Release|x86.ActiveCfg = Release|Any CPU
{58C302B9-4E15-447B-ACE3-867813189848}.Release|x86.Build.0 = Release|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Debug|x64.Build.0 = Debug|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Debug|x86.Build.0 = Debug|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Release|x64.ActiveCfg = Release|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Release|x64.Build.0 = Release|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Release|x86.ActiveCfg = Release|Any CPU
+ {0880A475-4F12-4974-A3FD-ABB4288909B2}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -382,5 +396,6 @@ Global
{105A06D4-58C3-4A37-A590-C766D313AC8F} = {FB64595D-7A02-F2D4-9C1E-6F343453585F}
{046A5F8B-AF61-4C9C-A2E7-F965A3DF3AF6} = {FB64595D-7A02-F2D4-9C1E-6F343453585F}
{58C302B9-4E15-447B-ACE3-867813189848} = {FB64595D-7A02-F2D4-9C1E-6F343453585F}
+ {0880A475-4F12-4974-A3FD-ABB4288909B2} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
EndGlobal
diff --git a/src/Mocha/Mocha.slnx b/src/Mocha/Mocha.slnx
index ba788ff0d17..a539d861564 100644
--- a/src/Mocha/Mocha.slnx
+++ b/src/Mocha/Mocha.slnx
@@ -1,2 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Mocha/src/Demo/Demo.Billing/Data/BillingDbContext.cs b/src/Mocha/src/Demo/Demo.Billing/Data/BillingDbContext.cs
index d6ccef5a3ec..3424f1a454f 100644
--- a/src/Mocha/src/Demo/Demo.Billing/Data/BillingDbContext.cs
+++ b/src/Mocha/src/Demo/Demo.Billing/Data/BillingDbContext.cs
@@ -1,6 +1,7 @@
using Demo.Billing.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
+using Mocha.Inbox;
using Mocha.Outbox;
namespace Demo.Billing.Data;
@@ -11,12 +12,14 @@ public class BillingDbContext(DbContextOptions options) : DbCo
public DbSet Payments => Set();
public DbSet Refunds => Set();
public DbSet RevenueSummaries => Set();
+ public DbSet InboxMessages => Set();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.AddPostgresOutbox();
+ modelBuilder.AddPostgresInbox();
modelBuilder.Entity(entity =>
{
diff --git a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260104231110_Init.Designer.cs b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260104231110_Init.Designer.cs
deleted file mode 100644
index 3bddd3796ef..00000000000
--- a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260104231110_Init.Designer.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-using System;
-using Demo.Billing.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace Demo.Billing.Migrations
-{
- [DbContext(typeof(BillingDbContext))]
- [Migration("20260104231110_Init")]
- partial class Init
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("Demo.Billing.Entities.Invoice", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Amount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CustomerId")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("OrderId")
- .HasColumnType("uuid");
-
- b.Property("Status")
- .HasColumnType("integer");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("CustomerId");
-
- b.HasIndex("OrderId")
- .IsUnique();
-
- b.HasIndex("Status");
-
- b.ToTable("Invoices");
- });
-
- modelBuilder.Entity("Demo.Billing.Entities.Payment", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Amount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("InvoiceId")
- .HasColumnType("uuid");
-
- b.Property("Method")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("ProcessedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("InvoiceId");
-
- b.HasIndex("Status");
-
- b.ToTable("Payments");
- });
-
- modelBuilder.Entity("Demo.Billing.Entities.Payment", b =>
- {
- b.HasOne("Demo.Billing.Entities.Invoice", "Invoice")
- .WithMany("Payments")
- .HasForeignKey("InvoiceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Invoice");
- });
-
- modelBuilder.Entity("Demo.Billing.Entities.Invoice", b =>
- {
- b.Navigation("Payments");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260104231110_Init.cs b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260104231110_Init.cs
deleted file mode 100644
index 48b10955377..00000000000
--- a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260104231110_Init.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace Demo.Billing.Migrations
-{
- ///
- public partial class Init : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Invoices",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- OrderId = table.Column(type: "uuid", nullable: false),
- Amount = table.Column(type: "numeric(18,2)", nullable: false, precision: 18, scale: 2),
- Status = table.Column(type: "integer", nullable: false),
- CustomerId = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
- CreatedAt = table.Column(type: "timestamp with time zone", nullable: false),
- UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- table.PrimaryKey("PK_Invoices", x => x.Id));
-
- migrationBuilder.CreateTable(
- name: "Payments",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- InvoiceId = table.Column(type: "uuid", nullable: false),
- Amount = table.Column(type: "numeric(18,2)", nullable: false, precision: 18, scale: 2),
- Method = table.Column(type: "character varying(50)", maxLength: 50, nullable: false),
- Status = table.Column(type: "integer", nullable: false),
- ProcessedAt = table.Column(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Payments", x => x.Id);
- table.ForeignKey(
- name: "FK_Payments_Invoices_InvoiceId",
- column: x => x.InvoiceId,
- principalTable: "Invoices",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(name: "IX_Invoices_CustomerId", table: "Invoices", column: "CustomerId");
-
- migrationBuilder.CreateIndex(
- name: "IX_Invoices_OrderId",
- table: "Invoices",
- column: "OrderId",
- unique: true);
-
- migrationBuilder.CreateIndex(name: "IX_Invoices_Status", table: "Invoices", column: "Status");
-
- migrationBuilder.CreateIndex(name: "IX_Payments_InvoiceId", table: "Payments", column: "InvoiceId");
-
- migrationBuilder.CreateIndex(name: "IX_Payments_Status", table: "Payments", column: "Status");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(name: "Payments");
-
- migrationBuilder.DropTable(name: "Invoices");
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260109160738_Outbox.Designer.cs b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260109160738_Outbox.Designer.cs
deleted file mode 100644
index f8d4534d6cd..00000000000
--- a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260109160738_Outbox.Designer.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-using System;
-using System.Text.Json;
-using Demo.Billing.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace Demo.Billing.Migrations
-{
- [DbContext(typeof(BillingDbContext))]
- [Migration("20260109160738_Outbox")]
- partial class Outbox
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("Mocha.Outbox.OutboxMessage", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid")
- .HasColumnName("id");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasColumnName("created_at");
-
- b.Property("Envelope")
- .IsRequired()
- .HasColumnType("json")
- .HasColumnName("envelope");
-
- b.Property("TimesSent")
- .HasColumnType("integer")
- .HasColumnName("times_sent");
-
- b.HasKey("Id");
-
- b.HasIndex("CreatedAt")
- .IsDescending();
-
- b.HasIndex("TimesSent");
-
- b.ToTable("outbox_messages", (string)null);
- });
-
- modelBuilder.Entity("Demo.Billing.Entities.Invoice", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Amount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CustomerId")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("OrderId")
- .HasColumnType("uuid");
-
- b.Property("Status")
- .HasColumnType("integer");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("CustomerId");
-
- b.HasIndex("OrderId")
- .IsUnique();
-
- b.HasIndex("Status");
-
- b.ToTable("Invoices");
- });
-
- modelBuilder.Entity("Demo.Billing.Entities.Payment", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Amount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("InvoiceId")
- .HasColumnType("uuid");
-
- b.Property("Method")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("ProcessedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Status")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("InvoiceId");
-
- b.HasIndex("Status");
-
- b.ToTable("Payments");
- });
-
- modelBuilder.Entity("Demo.Billing.Entities.Payment", b =>
- {
- b.HasOne("Demo.Billing.Entities.Invoice", "Invoice")
- .WithMany("Payments")
- .HasForeignKey("InvoiceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Invoice");
- });
-
- modelBuilder.Entity("Demo.Billing.Entities.Invoice", b =>
- {
- b.Navigation("Payments");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260109160738_Outbox.cs b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260109160738_Outbox.cs
deleted file mode 100644
index dc2a614e246..00000000000
--- a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260109160738_Outbox.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System;
-using System.Text.Json;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace Demo.Billing.Migrations
-{
- ///
- public partial class Outbox : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "outbox_messages",
- columns: table => new
- {
- id = table.Column(type: "uuid", nullable: false),
- envelope = table.Column(type: "json", nullable: false),
- times_sent = table.Column(type: "integer", nullable: false),
- created_at = table.Column(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- table.PrimaryKey("PK_outbox_messages", x => x.id));
-
- migrationBuilder.CreateIndex(
- name: "IX_outbox_messages_created_at",
- table: "outbox_messages",
- column: "created_at",
- descending: new bool[0]);
-
- migrationBuilder.CreateIndex(
- name: "IX_outbox_messages_times_sent",
- table: "outbox_messages",
- column: "times_sent");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(name: "outbox_messages");
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260111233102_AddRefundSaga.cs b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260111233102_AddRefundSaga.cs
deleted file mode 100644
index 3679254bd7e..00000000000
--- a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260111233102_AddRefundSaga.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace Demo.Billing.Migrations
-{
- ///
- public partial class AddRefundSaga : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropPrimaryKey(name: "PK_outbox_messages", table: "outbox_messages");
-
- migrationBuilder.RenameIndex(
- name: "IX_outbox_messages_times_sent",
- newName: "ix_outbox_messages_times_sent",
- table: "outbox_messages");
-
- migrationBuilder.RenameIndex(
- name: "IX_outbox_messages_created_at",
- newName: "ix_outbox_messages_created_at",
- table: "outbox_messages");
-
- migrationBuilder.AddPrimaryKey(
- name: "ix_outbox_messages_primary_key",
- table: "outbox_messages",
- column: "id");
-
- migrationBuilder.CreateTable(
- name: "Refunds",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- OrderId = table.Column(type: "uuid", nullable: false),
- InvoiceId = table.Column(type: "uuid", nullable: true),
- OriginalAmount = table.Column(
- type: "numeric(18,2)",
- nullable: false,
- precision: 18,
- scale: 2),
- RefundedAmount = table.Column(
- type: "numeric(18,2)",
- nullable: false,
- precision: 18,
- scale: 2),
- RefundPercentage = table.Column(
- type: "numeric(5,2)",
- nullable: false,
- precision: 5,
- scale: 2),
- CustomerId = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
- Reason = table.Column(type: "character varying(500)", maxLength: 500, nullable: false),
- Status = table.Column(type: "integer", nullable: false),
- Type = table.Column(type: "integer", nullable: false),
- CreatedAt = table.Column(type: "timestamp with time zone", nullable: false),
- ProcessedAt = table.Column(type: "timestamp with time zone", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Refunds", x => x.Id);
- table.ForeignKey(
- name: "FK_Refunds_Invoices_InvoiceId",
- column: x => x.InvoiceId,
- principalTable: "Invoices",
- principalColumn: "Id");
- });
-
- migrationBuilder.CreateIndex(name: "IX_Refunds_InvoiceId", table: "Refunds", column: "InvoiceId");
-
- migrationBuilder.CreateIndex(name: "IX_Refunds_OrderId", table: "Refunds", column: "OrderId");
-
- migrationBuilder.CreateIndex(name: "IX_Refunds_Status", table: "Refunds", column: "Status");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(name: "Refunds");
-
- migrationBuilder.DropPrimaryKey(name: "ix_outbox_messages_primary_key", table: "outbox_messages");
-
- migrationBuilder.RenameIndex(
- name: "ix_outbox_messages_times_sent",
- newName: "IX_outbox_messages_times_sent",
- table: "outbox_messages");
-
- migrationBuilder.RenameIndex(
- name: "ix_outbox_messages_created_at",
- newName: "IX_outbox_messages_created_at",
- table: "outbox_messages");
-
- migrationBuilder.AddPrimaryKey(name: "PK_outbox_messages", table: "outbox_messages", column: "id");
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260111233102_AddRefundSaga.Designer.cs b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260309003629_Init.Designer.cs
similarity index 71%
rename from src/Mocha/src/Demo/Demo.Billing/Migrations/20260111233102_AddRefundSaga.Designer.cs
rename to src/Mocha/src/Demo/Demo.Billing/Migrations/20260309003629_Init.Designer.cs
index 937f3d4d6ab..d86800da0e7 100644
--- a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260111233102_AddRefundSaga.Designer.cs
+++ b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260309003629_Init.Designer.cs
@@ -10,11 +10,11 @@
#nullable disable
-namespace Demo.Billing.Migrations
+namespace HotChocolate.Demo.Billing.Migrations
{
[DbContext(typeof(BillingDbContext))]
- [Migration("20260111233102_AddRefundSaga")]
- partial class AddRefundSaga
+ [Migration("20260309003629_Init")]
+ partial class Init
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -26,39 +26,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
- modelBuilder.Entity("Mocha.Outbox.OutboxMessage", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid")
- .HasColumnName("id");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasColumnName("created_at");
-
- b.Property("Envelope")
- .IsRequired()
- .HasColumnType("json")
- .HasColumnName("envelope");
-
- b.Property("TimesSent")
- .HasColumnType("integer")
- .HasColumnName("times_sent");
-
- b.HasKey("Id")
- .HasName("ix_outbox_messages_primary_key");
-
- b.HasIndex("CreatedAt")
- .IsDescending()
- .HasDatabaseName("ix_outbox_messages_created_at");
-
- b.HasIndex("TimesSent")
- .HasDatabaseName("ix_outbox_messages_times_sent");
-
- b.ToTable("outbox_messages", (string)null);
- });
-
modelBuilder.Entity("Demo.Billing.Entities.Invoice", b =>
{
b.Property("Id")
@@ -188,6 +155,111 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.ToTable("Refunds");
});
+ modelBuilder.Entity("Demo.Billing.Entities.RevenueSummary", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AverageOrderAmount")
+ .HasPrecision(18, 2)
+ .HasColumnType("numeric(18,2)");
+
+ b.Property("CompletionMode")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("OrderCount")
+ .HasColumnType("integer");
+
+ b.Property("PeriodEnd")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("PeriodStart")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("TotalItemsSold")
+ .HasColumnType("integer");
+
+ b.Property("TotalRevenue")
+ .HasPrecision(18, 2)
+ .HasColumnType("numeric(18,2)");
+
+ b.HasKey("Id");
+
+ b.ToTable("RevenueSummaries");
+ });
+
+ modelBuilder.Entity("Mocha.Inbox.InboxMessage", b =>
+ {
+ b.Property("MessageId")
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasColumnName("message_id");
+
+ b.Property("ConsumerType")
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasColumnName("consumer_type");
+
+ b.Property("MessageType")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasColumnName("message_type");
+
+ b.Property("ProcessedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("processed_at")
+ .HasDefaultValueSql("NOW()");
+
+ b.HasKey("MessageId", "ConsumerType")
+ .HasName("ix_inbox_messages_primary_key");
+
+ b.HasIndex("ProcessedAt")
+ .HasDatabaseName("ix_inbox_messages_processed_at");
+
+ b.ToTable("inbox_messages", (string)null);
+ });
+
+ modelBuilder.Entity("Mocha.Outbox.OutboxMessage", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("Envelope")
+ .IsRequired()
+ .HasColumnType("json")
+ .HasColumnName("envelope");
+
+ b.Property("TimesSent")
+ .HasColumnType("integer")
+ .HasColumnName("times_sent");
+
+ b.HasKey("Id")
+ .HasName("ix_outbox_messages_primary_key");
+
+ b.HasIndex("CreatedAt")
+ .IsDescending()
+ .HasDatabaseName("ix_outbox_messages_created_at");
+
+ b.HasIndex("TimesSent")
+ .HasDatabaseName("ix_outbox_messages_times_sent");
+
+ b.ToTable("outbox_messages", (string)null);
+ });
+
modelBuilder.Entity("Demo.Billing.Entities.Payment", b =>
{
b.HasOne("Demo.Billing.Entities.Invoice", "Invoice")
diff --git a/src/Mocha/src/Demo/Demo.Billing/Migrations/20260309003629_Init.cs b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260309003629_Init.cs
new file mode 100644
index 00000000000..f3c028ca5ed
--- /dev/null
+++ b/src/Mocha/src/Demo/Demo.Billing/Migrations/20260309003629_Init.cs
@@ -0,0 +1,208 @@
+using System;
+using System.Text.Json;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace HotChocolate.Demo.Billing.Migrations
+{
+ ///
+ public partial class Init : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "inbox_messages",
+ columns: table => new
+ {
+ message_id = table.Column(type: "character varying(512)", maxLength: 512, nullable: false),
+ consumer_type = table.Column(type: "character varying(512)", maxLength: 512, nullable: false),
+ message_type = table.Column(type: "character varying(512)", maxLength: 512, nullable: false),
+ processed_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "NOW()")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("ix_inbox_messages_primary_key", x => new { x.message_id, x.consumer_type });
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Invoices",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ OrderId = table.Column(type: "uuid", nullable: false),
+ Amount = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: false),
+ Status = table.Column(type: "integer", nullable: false),
+ CustomerId = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
+ CreatedAt = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Invoices", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "outbox_messages",
+ columns: table => new
+ {
+ id = table.Column(type: "uuid", nullable: false),
+ envelope = table.Column(type: "json", nullable: false),
+ times_sent = table.Column(type: "integer", nullable: false),
+ created_at = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("ix_outbox_messages_primary_key", x => x.id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "RevenueSummaries",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ OrderCount = table.Column(type: "integer", nullable: false),
+ TotalRevenue = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: false),
+ AverageOrderAmount = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: false),
+ TotalItemsSold = table.Column(type: "integer", nullable: false),
+ PeriodStart = table.Column(type: "timestamp with time zone", nullable: false),
+ PeriodEnd = table.Column(type: "timestamp with time zone", nullable: false),
+ CompletionMode = table.Column(type: "character varying(50)", maxLength: 50, nullable: false),
+ CreatedAt = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RevenueSummaries", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Payments",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ InvoiceId = table.Column(type: "uuid", nullable: false),
+ Amount = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: false),
+ Method = table.Column(type: "character varying(50)", maxLength: 50, nullable: false),
+ Status = table.Column(type: "integer", nullable: false),
+ ProcessedAt = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Payments", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Payments_Invoices_InvoiceId",
+ column: x => x.InvoiceId,
+ principalTable: "Invoices",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Refunds",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ OrderId = table.Column(type: "uuid", nullable: false),
+ InvoiceId = table.Column(type: "uuid", nullable: true),
+ OriginalAmount = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: false),
+ RefundedAmount = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: false),
+ RefundPercentage = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false),
+ CustomerId = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
+ Reason = table.Column(type: "character varying(500)", maxLength: 500, nullable: false),
+ Status = table.Column(type: "integer", nullable: false),
+ Type = table.Column(type: "integer", nullable: false),
+ CreatedAt = table.Column(type: "timestamp with time zone", nullable: false),
+ ProcessedAt = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Refunds", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Refunds_Invoices_InvoiceId",
+ column: x => x.InvoiceId,
+ principalTable: "Invoices",
+ principalColumn: "Id");
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "ix_inbox_messages_processed_at",
+ table: "inbox_messages",
+ column: "processed_at");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Invoices_CustomerId",
+ table: "Invoices",
+ column: "CustomerId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Invoices_OrderId",
+ table: "Invoices",
+ column: "OrderId",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Invoices_Status",
+ table: "Invoices",
+ column: "Status");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_outbox_messages_created_at",
+ table: "outbox_messages",
+ column: "created_at",
+ descending: new bool[0]);
+
+ migrationBuilder.CreateIndex(
+ name: "ix_outbox_messages_times_sent",
+ table: "outbox_messages",
+ column: "times_sent");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Payments_InvoiceId",
+ table: "Payments",
+ column: "InvoiceId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Payments_Status",
+ table: "Payments",
+ column: "Status");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Refunds_InvoiceId",
+ table: "Refunds",
+ column: "InvoiceId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Refunds_OrderId",
+ table: "Refunds",
+ column: "OrderId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Refunds_Status",
+ table: "Refunds",
+ column: "Status");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "inbox_messages");
+
+ migrationBuilder.DropTable(
+ name: "outbox_messages");
+
+ migrationBuilder.DropTable(
+ name: "Payments");
+
+ migrationBuilder.DropTable(
+ name: "Refunds");
+
+ migrationBuilder.DropTable(
+ name: "RevenueSummaries");
+
+ migrationBuilder.DropTable(
+ name: "Invoices");
+ }
+ }
+}
diff --git a/src/Mocha/src/Demo/Demo.Billing/Migrations/BillingDbContextModelSnapshot.cs b/src/Mocha/src/Demo/Demo.Billing/Migrations/BillingDbContextModelSnapshot.cs
index 14034b65e66..606e3a622e9 100644
--- a/src/Mocha/src/Demo/Demo.Billing/Migrations/BillingDbContextModelSnapshot.cs
+++ b/src/Mocha/src/Demo/Demo.Billing/Migrations/BillingDbContextModelSnapshot.cs
@@ -9,7 +9,7 @@
#nullable disable
-namespace Demo.Billing.Migrations
+namespace HotChocolate.Demo.Billing.Migrations
{
[DbContext(typeof(BillingDbContext))]
partial class BillingDbContextModelSnapshot : ModelSnapshot
@@ -23,39 +23,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
- modelBuilder.Entity("Mocha.Outbox.OutboxMessage", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid")
- .HasColumnName("id");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasColumnName("created_at");
-
- b.Property("Envelope")
- .IsRequired()
- .HasColumnType("json")
- .HasColumnName("envelope");
-
- b.Property("TimesSent")
- .HasColumnType("integer")
- .HasColumnName("times_sent");
-
- b.HasKey("Id")
- .HasName("ix_outbox_messages_primary_key");
-
- b.HasIndex("CreatedAt")
- .IsDescending()
- .HasDatabaseName("ix_outbox_messages_created_at");
-
- b.HasIndex("TimesSent")
- .HasDatabaseName("ix_outbox_messages_times_sent");
-
- b.ToTable("outbox_messages", (string)null);
- });
-
modelBuilder.Entity("Demo.Billing.Entities.Invoice", b =>
{
b.Property("Id")
@@ -185,6 +152,111 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("Refunds");
});
+ modelBuilder.Entity("Demo.Billing.Entities.RevenueSummary", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AverageOrderAmount")
+ .HasPrecision(18, 2)
+ .HasColumnType("numeric(18,2)");
+
+ b.Property("CompletionMode")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("OrderCount")
+ .HasColumnType("integer");
+
+ b.Property("PeriodEnd")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("PeriodStart")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("TotalItemsSold")
+ .HasColumnType("integer");
+
+ b.Property("TotalRevenue")
+ .HasPrecision(18, 2)
+ .HasColumnType("numeric(18,2)");
+
+ b.HasKey("Id");
+
+ b.ToTable("RevenueSummaries");
+ });
+
+ modelBuilder.Entity("Mocha.Inbox.InboxMessage", b =>
+ {
+ b.Property("MessageId")
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasColumnName("message_id");
+
+ b.Property("ConsumerType")
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasColumnName("consumer_type");
+
+ b.Property("MessageType")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasColumnName("message_type");
+
+ b.Property("ProcessedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("processed_at")
+ .HasDefaultValueSql("NOW()");
+
+ b.HasKey("MessageId", "ConsumerType")
+ .HasName("ix_inbox_messages_primary_key");
+
+ b.HasIndex("ProcessedAt")
+ .HasDatabaseName("ix_inbox_messages_processed_at");
+
+ b.ToTable("inbox_messages", (string)null);
+ });
+
+ modelBuilder.Entity("Mocha.Outbox.OutboxMessage", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("Envelope")
+ .IsRequired()
+ .HasColumnType("json")
+ .HasColumnName("envelope");
+
+ b.Property("TimesSent")
+ .HasColumnType("integer")
+ .HasColumnName("times_sent");
+
+ b.HasKey("Id")
+ .HasName("ix_outbox_messages_primary_key");
+
+ b.HasIndex("CreatedAt")
+ .IsDescending()
+ .HasDatabaseName("ix_outbox_messages_created_at");
+
+ b.HasIndex("TimesSent")
+ .HasDatabaseName("ix_outbox_messages_times_sent");
+
+ b.ToTable("outbox_messages", (string)null);
+ });
+
modelBuilder.Entity("Demo.Billing.Entities.Payment", b =>
{
b.HasOne("Demo.Billing.Entities.Invoice", "Invoice")
diff --git a/src/Mocha/src/Demo/Demo.Billing/Program.cs b/src/Mocha/src/Demo/Demo.Billing/Program.cs
index c86b2da7d1a..59f166b654c 100644
--- a/src/Mocha/src/Demo/Demo.Billing/Program.cs
+++ b/src/Mocha/src/Demo/Demo.Billing/Program.cs
@@ -4,6 +4,9 @@
using Demo.Contracts.Events;
using Microsoft.EntityFrameworkCore;
using Mocha;
+using Mocha.EntityFrameworkCore;
+using Mocha.Inbox;
+using Mocha.Outbox;
using Mocha.Transport.RabbitMQ;
var builder = WebApplication.CreateBuilder(args);
@@ -37,6 +40,14 @@
// Request handlers for saga commands
.AddRequestHandler()
.AddRequestHandler()
+ .AddEntityFramework(p =>
+ {
+ p.UsePostgresOutbox();
+
+ p.UseResilience();
+ p.UseTransaction();
+ p.UsePostgresInbox();
+ })
.AddRabbitMQ();
var app = builder.Build();
diff --git a/src/Mocha/src/Demo/Demo.Catalog/Data/CatalogDbContext.cs b/src/Mocha/src/Demo/Demo.Catalog/Data/CatalogDbContext.cs
index f2eaa229f21..bf5f80f8359 100644
--- a/src/Mocha/src/Demo/Demo.Catalog/Data/CatalogDbContext.cs
+++ b/src/Mocha/src/Demo/Demo.Catalog/Data/CatalogDbContext.cs
@@ -1,6 +1,7 @@
using Demo.Catalog.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
+using Mocha.Inbox;
using Mocha.Outbox;
using Mocha.Sagas.EfCore;
@@ -11,6 +12,7 @@ public class CatalogDbContext(DbContextOptions options) : DbCo
public DbSet Products => Set();
public DbSet Categories => Set();
public DbSet Orders => Set();
+ public DbSet InboxMessages => Set();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
@@ -18,6 +20,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.AddPostgresSagas();
modelBuilder.AddPostgresOutbox();
+ modelBuilder.AddPostgresInbox();
modelBuilder.Entity(entity =>
{
diff --git a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260104231158_Init.Designer.cs b/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260104231158_Init.Designer.cs
deleted file mode 100644
index 85b01747f88..00000000000
--- a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260104231158_Init.Designer.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-using System;
-using Demo.Catalog.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace Demo.Catalog.Migrations
-{
- [DbContext(typeof(CatalogDbContext))]
- [Migration("20260104231158_Init")]
- partial class Init
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("Demo.Catalog.Entities.Category", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Description")
- .HasColumnType("text");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.HasKey("Id");
-
- b.ToTable("Categories");
-
- b.HasData(
- new
- {
- Id = new Guid("11111111-1111-1111-1111-111111111111"),
- Description = "Electronic devices and accessories",
- Name = "Electronics"
- },
- new
- {
- Id = new Guid("22222222-2222-2222-2222-222222222222"),
- Description = "Physical and digital books",
- Name = "Books"
- });
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.OrderRecord", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CustomerId")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("ProductId")
- .HasColumnType("uuid");
-
- b.Property("Quantity")
- .HasColumnType("integer");
-
- b.Property("ShippingAddress")
- .IsRequired()
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property("Status")
- .HasColumnType("integer");
-
- b.Property("TotalAmount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("CustomerId");
-
- b.HasIndex("ProductId");
-
- b.HasIndex("Status");
-
- b.ToTable("Orders");
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Product", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("CategoryId")
- .HasColumnType("uuid");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Price")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("StockQuantity")
- .HasColumnType("integer");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("CategoryId");
-
- b.ToTable("Products");
-
- b.HasData(
- new
- {
- Id = new Guid("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"),
- CategoryId = new Guid("11111111-1111-1111-1111-111111111111"),
- CreatedAt = new DateTimeOffset(new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2355), new TimeSpan(0, 0, 0, 0, 0)),
- Description = "Premium noise-cancelling wireless headphones",
- Name = "Wireless Headphones",
- Price = 299.99m,
- StockQuantity = 50,
- UpdatedAt = new DateTimeOffset(new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2527), new TimeSpan(0, 0, 0, 0, 0))
- },
- new
- {
- Id = new Guid("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"),
- CategoryId = new Guid("11111111-1111-1111-1111-111111111111"),
- CreatedAt = new DateTimeOffset(new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2622), new TimeSpan(0, 0, 0, 0, 0)),
- Description = "RGB mechanical gaming keyboard",
- Name = "Mechanical Keyboard",
- Price = 149.99m,
- StockQuantity = 100,
- UpdatedAt = new DateTimeOffset(new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2623), new TimeSpan(0, 0, 0, 0, 0))
- },
- new
- {
- Id = new Guid("cccccccc-cccc-cccc-cccc-cccccccccccc"),
- CategoryId = new Guid("22222222-2222-2222-2222-222222222222"),
- CreatedAt = new DateTimeOffset(new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2628), new TimeSpan(0, 0, 0, 0, 0)),
- Description = "A Handbook of Agile Software Craftsmanship by Robert C. Martin",
- Name = "Clean Code",
- Price = 39.99m,
- StockQuantity = 200,
- UpdatedAt = new DateTimeOffset(new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2629), new TimeSpan(0, 0, 0, 0, 0))
- });
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.OrderRecord", b =>
- {
- b.HasOne("Demo.Catalog.Entities.Product", "Product")
- .WithMany()
- .HasForeignKey("ProductId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Product");
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Product", b =>
- {
- b.HasOne("Demo.Catalog.Entities.Category", "Category")
- .WithMany("Products")
- .HasForeignKey("CategoryId");
-
- b.Navigation("Category");
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Category", b =>
- {
- b.Navigation("Products");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260104231158_Init.cs b/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260104231158_Init.cs
deleted file mode 100644
index 250cd5528c9..00000000000
--- a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260104231158_Init.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
-
-namespace Demo.Catalog.Migrations
-{
- ///
- public partial class Init : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Categories",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
- Description = table.Column(type: "text", nullable: true)
- },
- constraints: table =>
- table.PrimaryKey("PK_Categories", x => x.Id));
-
- migrationBuilder.CreateTable(
- name: "Products",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
- Description = table.Column(
- type: "character varying(2000)",
- maxLength: 2000,
- nullable: false),
- Price = table.Column(type: "numeric(18,2)", nullable: false, precision: 18, scale: 2),
- StockQuantity = table.Column(type: "integer", nullable: false),
- CategoryId = table.Column(type: "uuid", nullable: true),
- CreatedAt = table.Column(type: "timestamp with time zone", nullable: false),
- UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Products", x => x.Id);
- table.ForeignKey(
- name: "FK_Products_Categories_CategoryId",
- column: x => x.CategoryId,
- principalTable: "Categories",
- principalColumn: "Id");
- });
-
- migrationBuilder.CreateTable(
- name: "Orders",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- ProductId = table.Column(type: "uuid", nullable: false),
- Quantity = table.Column(type: "integer", nullable: false),
- CustomerId = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
- ShippingAddress = table.Column(
- type: "character varying(500)",
- maxLength: 500,
- nullable: false),
- TotalAmount = table.Column(
- type: "numeric(18,2)",
- nullable: false,
- precision: 18,
- scale: 2),
- Status = table.Column(type: "integer", nullable: false),
- CreatedAt = table.Column(type: "timestamp with time zone", nullable: false),
- UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Orders", x => x.Id);
- table.ForeignKey(
- name: "FK_Orders_Products_ProductId",
- column: x => x.ProductId,
- principalTable: "Products",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.InsertData(
- table: "Categories",
- columns: new[] { "Id", "Description", "Name" },
- values: new object[,]
- {
- {
- new Guid("11111111-1111-1111-1111-111111111111"),
- "Electronic devices and accessories",
- "Electronics"
- },
- { new Guid("22222222-2222-2222-2222-222222222222"), "Physical and digital books", "Books" }
- });
-
- migrationBuilder.InsertData(
- table: "Products",
- columns: new[]
- {
- "Id",
- "CategoryId",
- "CreatedAt",
- "Description",
- "Name",
- "Price",
- "StockQuantity",
- "UpdatedAt"
- },
- values: new object[,]
- {
- {
- new Guid("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"),
- new Guid("11111111-1111-1111-1111-111111111111"),
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2355),
- new TimeSpan(0, 0, 0, 0, 0)),
- "Premium noise-cancelling wireless headphones",
- "Wireless Headphones",
- 299.99m,
- 50,
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2527),
- new TimeSpan(0, 0, 0, 0, 0))
- },
- {
- new Guid("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"),
- new Guid("11111111-1111-1111-1111-111111111111"),
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2622),
- new TimeSpan(0, 0, 0, 0, 0)),
- "RGB mechanical gaming keyboard",
- "Mechanical Keyboard",
- 149.99m,
- 100,
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2623),
- new TimeSpan(0, 0, 0, 0, 0))
- },
- {
- new Guid("cccccccc-cccc-cccc-cccc-cccccccccccc"),
- new Guid("22222222-2222-2222-2222-222222222222"),
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2628),
- new TimeSpan(0, 0, 0, 0, 0)),
- "A Handbook of Agile Software Craftsmanship by Robert C. Martin",
- "Clean Code",
- 39.99m,
- 200,
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2629),
- new TimeSpan(0, 0, 0, 0, 0))
- }
- });
-
- migrationBuilder.CreateIndex(name: "IX_Orders_CustomerId", table: "Orders", column: "CustomerId");
-
- migrationBuilder.CreateIndex(name: "IX_Orders_ProductId", table: "Orders", column: "ProductId");
-
- migrationBuilder.CreateIndex(name: "IX_Orders_Status", table: "Orders", column: "Status");
-
- migrationBuilder.CreateIndex(name: "IX_Products_CategoryId", table: "Products", column: "CategoryId");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(name: "Orders");
-
- migrationBuilder.DropTable(name: "Products");
-
- migrationBuilder.DropTable(name: "Categories");
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260106180406_Outbox.Designer.cs b/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260106180406_Outbox.Designer.cs
deleted file mode 100644
index f33e69f3e42..00000000000
--- a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260106180406_Outbox.Designer.cs
+++ /dev/null
@@ -1,239 +0,0 @@
-//
-using System;
-using System.Text.Json;
-using Demo.Catalog.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace Demo.Catalog.Migrations
-{
- [DbContext(typeof(CatalogDbContext))]
- [Migration("20260106180406_Outbox")]
- partial class Outbox
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("Mocha.Outbox.OutboxMessage", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid")
- .HasColumnName("id");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasColumnName("created_at");
-
- b.Property("Envelope")
- .IsRequired()
- .HasColumnType("json")
- .HasColumnName("envelope");
-
- b.Property("TimesSent")
- .HasColumnType("integer")
- .HasColumnName("times_sent");
-
- b.HasKey("Id");
-
- b.HasIndex("CreatedAt")
- .IsDescending();
-
- b.HasIndex("TimesSent");
-
- b.ToTable("outbox_messages", (string)null);
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Category", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Description")
- .HasColumnType("text");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.HasKey("Id");
-
- b.ToTable("Categories");
-
- b.HasData(
- new
- {
- Id = new Guid("11111111-1111-1111-1111-111111111111"),
- Description = "Electronic devices and accessories",
- Name = "Electronics"
- },
- new
- {
- Id = new Guid("22222222-2222-2222-2222-222222222222"),
- Description = "Physical and digital books",
- Name = "Books"
- });
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.OrderRecord", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CustomerId")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("ProductId")
- .HasColumnType("uuid");
-
- b.Property("Quantity")
- .HasColumnType("integer");
-
- b.Property("ShippingAddress")
- .IsRequired()
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property("Status")
- .HasColumnType("integer");
-
- b.Property("TotalAmount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("CustomerId");
-
- b.HasIndex("ProductId");
-
- b.HasIndex("Status");
-
- b.ToTable("Orders");
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Product", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("CategoryId")
- .HasColumnType("uuid");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Price")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("StockQuantity")
- .HasColumnType("integer");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("CategoryId");
-
- b.ToTable("Products");
-
- b.HasData(
- new
- {
- Id = new Guid("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"),
- CategoryId = new Guid("11111111-1111-1111-1111-111111111111"),
- CreatedAt = new DateTimeOffset(new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(7989), new TimeSpan(0, 0, 0, 0, 0)),
- Description = "Premium noise-cancelling wireless headphones",
- Name = "Wireless Headphones",
- Price = 299.99m,
- StockQuantity = 50,
- UpdatedAt = new DateTimeOffset(new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8169), new TimeSpan(0, 0, 0, 0, 0))
- },
- new
- {
- Id = new Guid("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"),
- CategoryId = new Guid("11111111-1111-1111-1111-111111111111"),
- CreatedAt = new DateTimeOffset(new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8241), new TimeSpan(0, 0, 0, 0, 0)),
- Description = "RGB mechanical gaming keyboard",
- Name = "Mechanical Keyboard",
- Price = 149.99m,
- StockQuantity = 100,
- UpdatedAt = new DateTimeOffset(new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8241), new TimeSpan(0, 0, 0, 0, 0))
- },
- new
- {
- Id = new Guid("cccccccc-cccc-cccc-cccc-cccccccccccc"),
- CategoryId = new Guid("22222222-2222-2222-2222-222222222222"),
- CreatedAt = new DateTimeOffset(new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8244), new TimeSpan(0, 0, 0, 0, 0)),
- Description = "A Handbook of Agile Software Craftsmanship by Robert C. Martin",
- Name = "Clean Code",
- Price = 39.99m,
- StockQuantity = 200,
- UpdatedAt = new DateTimeOffset(new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8244), new TimeSpan(0, 0, 0, 0, 0))
- });
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.OrderRecord", b =>
- {
- b.HasOne("Demo.Catalog.Entities.Product", "Product")
- .WithMany()
- .HasForeignKey("ProductId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Product");
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Product", b =>
- {
- b.HasOne("Demo.Catalog.Entities.Category", "Category")
- .WithMany("Products")
- .HasForeignKey("CategoryId");
-
- b.Navigation("Category");
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Category", b =>
- {
- b.Navigation("Products");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260106180406_Outbox.cs b/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260106180406_Outbox.cs
deleted file mode 100644
index 7b3dbb619e2..00000000000
--- a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260106180406_Outbox.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-using System;
-using System.Text.Json;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace Demo.Catalog.Migrations
-{
- ///
- public partial class Outbox : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "outbox_messages",
- columns: table => new
- {
- id = table.Column(type: "uuid", nullable: false),
- envelope = table.Column(type: "json", nullable: false),
- times_sent = table.Column(type: "integer", nullable: false),
- created_at = table.Column(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- table.PrimaryKey("PK_outbox_messages", x => x.id));
-
- migrationBuilder.UpdateData(
- table: "Products",
- keyColumn: "Id",
- keyValue: new Guid("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"),
- columns: new[] { "CreatedAt", "UpdatedAt" },
- values: new object[]
- {
- new DateTimeOffset(
- new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(7989),
- new TimeSpan(0, 0, 0, 0, 0)),
- new DateTimeOffset(
- new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8169),
- new TimeSpan(0, 0, 0, 0, 0))
- });
-
- migrationBuilder.UpdateData(
- table: "Products",
- keyColumn: "Id",
- keyValue: new Guid("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"),
- columns: new[] { "CreatedAt", "UpdatedAt" },
- values: new object[]
- {
- new DateTimeOffset(
- new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8241),
- new TimeSpan(0, 0, 0, 0, 0)),
- new DateTimeOffset(
- new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8241),
- new TimeSpan(0, 0, 0, 0, 0))
- });
-
- migrationBuilder.UpdateData(
- table: "Products",
- keyColumn: "Id",
- keyValue: new Guid("cccccccc-cccc-cccc-cccc-cccccccccccc"),
- columns: new[] { "CreatedAt", "UpdatedAt" },
- values: new object[]
- {
- new DateTimeOffset(
- new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8244),
- new TimeSpan(0, 0, 0, 0, 0)),
- new DateTimeOffset(
- new DateTime(2026, 1, 6, 18, 4, 6, 412, DateTimeKind.Unspecified).AddTicks(8244),
- new TimeSpan(0, 0, 0, 0, 0))
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_outbox_messages_created_at",
- table: "outbox_messages",
- column: "created_at",
- descending: new bool[0]);
-
- migrationBuilder.CreateIndex(
- name: "IX_outbox_messages_times_sent",
- table: "outbox_messages",
- column: "times_sent");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(name: "outbox_messages");
-
- migrationBuilder.UpdateData(
- table: "Products",
- keyColumn: "Id",
- keyValue: new Guid("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"),
- columns: new[] { "CreatedAt", "UpdatedAt" },
- values: new object[]
- {
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2355),
- new TimeSpan(0, 0, 0, 0, 0)),
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2527),
- new TimeSpan(0, 0, 0, 0, 0))
- });
-
- migrationBuilder.UpdateData(
- table: "Products",
- keyColumn: "Id",
- keyValue: new Guid("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"),
- columns: new[] { "CreatedAt", "UpdatedAt" },
- values: new object[]
- {
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2622),
- new TimeSpan(0, 0, 0, 0, 0)),
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2623),
- new TimeSpan(0, 0, 0, 0, 0))
- });
-
- migrationBuilder.UpdateData(
- table: "Products",
- keyColumn: "Id",
- keyValue: new Guid("cccccccc-cccc-cccc-cccc-cccccccccccc"),
- columns: new[] { "CreatedAt", "UpdatedAt" },
- values: new object[]
- {
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2628),
- new TimeSpan(0, 0, 0, 0, 0)),
- new DateTimeOffset(
- new DateTime(2026, 1, 4, 23, 11, 57, 852, DateTimeKind.Unspecified).AddTicks(2629),
- new TimeSpan(0, 0, 0, 0, 0))
- });
- }
- }
-}
diff --git a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260107184104_OutboxJsonDoc.Designer.cs b/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260107184104_OutboxJsonDoc.Designer.cs
deleted file mode 100644
index d6710c1e399..00000000000
--- a/src/Mocha/src/Demo/Demo.Catalog/Migrations/20260107184104_OutboxJsonDoc.Designer.cs
+++ /dev/null
@@ -1,239 +0,0 @@
-//
-using System;
-using System.Text.Json;
-using Demo.Catalog.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace Demo.Catalog.Migrations
-{
- [DbContext(typeof(CatalogDbContext))]
- [Migration("20260107184104_OutboxJsonDoc")]
- partial class OutboxJsonDoc
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("Mocha.Outbox.OutboxMessage", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid")
- .HasColumnName("id");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasColumnName("created_at");
-
- b.Property("Envelope")
- .IsRequired()
- .HasColumnType("json")
- .HasColumnName("envelope");
-
- b.Property("TimesSent")
- .HasColumnType("integer")
- .HasColumnName("times_sent");
-
- b.HasKey("Id");
-
- b.HasIndex("CreatedAt")
- .IsDescending();
-
- b.HasIndex("TimesSent");
-
- b.ToTable("outbox_messages", (string)null);
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Category", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Description")
- .HasColumnType("text");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.HasKey("Id");
-
- b.ToTable("Categories");
-
- b.HasData(
- new
- {
- Id = new Guid("11111111-1111-1111-1111-111111111111"),
- Description = "Electronic devices and accessories",
- Name = "Electronics"
- },
- new
- {
- Id = new Guid("22222222-2222-2222-2222-222222222222"),
- Description = "Physical and digital books",
- Name = "Books"
- });
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.OrderRecord", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CustomerId")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("ProductId")
- .HasColumnType("uuid");
-
- b.Property("Quantity")
- .HasColumnType("integer");
-
- b.Property("ShippingAddress")
- .IsRequired()
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property("Status")
- .HasColumnType("integer");
-
- b.Property("TotalAmount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("CustomerId");
-
- b.HasIndex("ProductId");
-
- b.HasIndex("Status");
-
- b.ToTable("Orders");
- });
-
- modelBuilder.Entity("Demo.Catalog.Entities.Product", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("CategoryId")
- .HasColumnType("uuid");
-
- b.Property