Compare commits
6 Commits
f5ca20307e
...
agent/rex/
| Author | SHA1 | Date | |
|---|---|---|---|
| 1411b68a95 | |||
| 7daa7d637c | |||
| c88ad43530 | |||
| 920042acac | |||
|
|
1ee7562e81 | ||
| 311dd2ee7f |
73
backend/Domain/Entities/FilamentUsage.cs
Normal file
73
backend/Domain/Entities/FilamentUsage.cs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
using Extrudex.Domain.Base;
|
||||||
|
|
||||||
|
namespace Extrudex.Domain.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tracks filament consumption for a specific print job on a specific spool.
|
||||||
|
/// Each record captures the grams used, which printer consumed it, and when the
|
||||||
|
/// usage was recorded. This enables granular per-job usage analytics, COGS
|
||||||
|
/// reconciliation, and spool weight depletion tracking.
|
||||||
|
///
|
||||||
|
/// A single PrintJob may have multiple FilamentUsage records if multiple spools
|
||||||
|
/// were consumed (e.g., multi-material prints via AMS).
|
||||||
|
/// </summary>
|
||||||
|
public class FilamentUsage : AuditableEntity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Foreign key to the print job that consumed this filament.
|
||||||
|
/// A usage record is always tied to a print job.
|
||||||
|
/// </summary>
|
||||||
|
public Guid PrintJobId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Navigation to the print job that consumed this filament.
|
||||||
|
/// </summary>
|
||||||
|
public PrintJob PrintJob { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Foreign key to the spool (filament) that provided the material.
|
||||||
|
/// Links usage back to the specific physical spool for inventory tracking.
|
||||||
|
/// </summary>
|
||||||
|
public Guid SpoolId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Navigation to the spool that provided the material.
|
||||||
|
/// </summary>
|
||||||
|
public Spool Spool { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Foreign key to the printer that executed the print job.
|
||||||
|
/// Denormalized from PrintJob for direct querying of per-printer usage.
|
||||||
|
/// </summary>
|
||||||
|
public Guid PrinterId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Navigation to the printer that executed the print job.
|
||||||
|
/// </summary>
|
||||||
|
public Printer Printer { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Grams of filament consumed during this print job.
|
||||||
|
/// Derived from mm_extruded × cross_section_area × material_density,
|
||||||
|
/// or measured directly from AMS weight delta.
|
||||||
|
/// </summary>
|
||||||
|
public decimal GramsUsed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Millimeters of filament extruded for this usage record.
|
||||||
|
/// The primary physical measurement; grams_used is derived from this.
|
||||||
|
/// </summary>
|
||||||
|
public decimal MmExtruded { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Timestamp when this usage record was created (UTC).
|
||||||
|
/// Represents when the usage was first logged, which may differ from
|
||||||
|
/// the print job's started_at or completed_at timestamps.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime RecordedAt { get; set; } = DateTime.UtcNow;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Optional notes about this usage record (e.g., "AMS tray 3", "manual weight check").
|
||||||
|
/// </summary>
|
||||||
|
public string? Notes { get; set; }
|
||||||
|
}
|
||||||
@@ -97,4 +97,10 @@ public class PrintJob : AuditableEntity
|
|||||||
/// Optional notes about the print job (e.g., "First layer adhesion issues").
|
/// Optional notes about the print job (e.g., "First layer adhesion issues").
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Notes { get; set; }
|
public string? Notes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Navigation collection of filament usage records for this print job.
|
||||||
|
/// Enables tracking granular per-spool consumption within a print.
|
||||||
|
/// </summary>
|
||||||
|
public ICollection<FilamentUsage> FilamentUsages { get; set; } = new List<FilamentUsage>();
|
||||||
}
|
}
|
||||||
@@ -94,4 +94,10 @@ public class Printer : AuditableEntity
|
|||||||
/// Navigation collection of print jobs executed on this printer.
|
/// Navigation collection of print jobs executed on this printer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ICollection<PrintJob> PrintJobs { get; set; } = new List<PrintJob>();
|
public ICollection<PrintJob> PrintJobs { get; set; } = new List<PrintJob>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Navigation collection of filament usage records tracking consumption on this printer.
|
||||||
|
/// Enables querying per-printer filament usage and COGS.
|
||||||
|
/// </summary>
|
||||||
|
public ICollection<FilamentUsage> FilamentUsages { get; set; } = new List<FilamentUsage>();
|
||||||
}
|
}
|
||||||
@@ -102,4 +102,10 @@ public class Spool : AuditableEntity
|
|||||||
/// Navigation collection of print jobs that consumed filament from this spool.
|
/// Navigation collection of print jobs that consumed filament from this spool.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ICollection<PrintJob> PrintJobs { get; set; } = new List<PrintJob>();
|
public ICollection<PrintJob> PrintJobs { get; set; } = new List<PrintJob>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Navigation collection of filament usage records tracking consumption from this spool.
|
||||||
|
/// Enables querying how much filament was consumed per print job.
|
||||||
|
/// </summary>
|
||||||
|
public ICollection<FilamentUsage> FilamentUsages { get; set; } = new List<FilamentUsage>();
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
using Extrudex.Domain.Entities;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
|
||||||
|
namespace Extrudex.Infrastructure.Data.Configurations;
|
||||||
|
|
||||||
|
public class FilamentUsageConfiguration : BaseEntityConfiguration<FilamentUsage>
|
||||||
|
{
|
||||||
|
public override void Configure(EntityTypeBuilder<FilamentUsage> builder)
|
||||||
|
{
|
||||||
|
base.Configure(builder);
|
||||||
|
|
||||||
|
builder.Property(e => e.PrintJobId)
|
||||||
|
.HasColumnName("print_job_id")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
builder.Property(e => e.SpoolId)
|
||||||
|
.HasColumnName("spool_id")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
builder.Property(e => e.PrinterId)
|
||||||
|
.HasColumnName("printer_id")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
builder.Property(e => e.GramsUsed)
|
||||||
|
.HasColumnName("grams_used")
|
||||||
|
.HasPrecision(10, 2)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
builder.Property(e => e.MmExtruded)
|
||||||
|
.HasColumnName("mm_extruded")
|
||||||
|
.HasPrecision(12, 2)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
builder.Property(e => e.RecordedAt)
|
||||||
|
.HasColumnName("recorded_at")
|
||||||
|
.HasDefaultValueSql("now() at time zone 'utc'")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
builder.Property(e => e.Notes)
|
||||||
|
.HasColumnName("notes")
|
||||||
|
.HasMaxLength(2000);
|
||||||
|
|
||||||
|
// Index on print_job_id for querying usage by print job
|
||||||
|
builder.HasIndex(e => e.PrintJobId)
|
||||||
|
.HasDatabaseName("ix_filament_usages_print_job_id");
|
||||||
|
|
||||||
|
// Index on spool_id for querying usage by spool (filament)
|
||||||
|
builder.HasIndex(e => e.SpoolId)
|
||||||
|
.HasDatabaseName("ix_filament_usages_spool_id");
|
||||||
|
|
||||||
|
// Index on printer_id for querying usage by printer
|
||||||
|
builder.HasIndex(e => e.PrinterId)
|
||||||
|
.HasDatabaseName("ix_filament_usages_printer_id");
|
||||||
|
|
||||||
|
// Index on recorded_at for time-range queries
|
||||||
|
builder.HasIndex(e => e.RecordedAt)
|
||||||
|
.HasDatabaseName("ix_filament_usages_recorded_at");
|
||||||
|
|
||||||
|
// Composite index for querying usage by spool within a date range
|
||||||
|
builder.HasIndex(e => new { e.SpoolId, e.RecordedAt })
|
||||||
|
.HasDatabaseName("ix_filament_usages_spool_id_recorded_at");
|
||||||
|
|
||||||
|
// Relationships
|
||||||
|
builder.HasOne(e => e.PrintJob)
|
||||||
|
.WithMany(e => e.FilamentUsages)
|
||||||
|
.HasForeignKey(e => e.PrintJobId)
|
||||||
|
.HasConstraintName("fk_filament_usages_print_job")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
builder.HasOne(e => e.Spool)
|
||||||
|
.WithMany(e => e.FilamentUsages)
|
||||||
|
.HasForeignKey(e => e.SpoolId)
|
||||||
|
.HasConstraintName("fk_filament_usages_spool")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
builder.HasOne(e => e.Printer)
|
||||||
|
.WithMany(e => e.FilamentUsages)
|
||||||
|
.HasForeignKey(e => e.PrinterId)
|
||||||
|
.HasConstraintName("fk_filament_usages_printer")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ public class ExtrudexDbContext : DbContext
|
|||||||
public DbSet<AmsUnit> AmsUnits => Set<AmsUnit>();
|
public DbSet<AmsUnit> AmsUnits => Set<AmsUnit>();
|
||||||
public DbSet<AmsSlot> AmsSlots => Set<AmsSlot>();
|
public DbSet<AmsSlot> AmsSlots => Set<AmsSlot>();
|
||||||
public DbSet<PrintJob> PrintJobs => Set<PrintJob>();
|
public DbSet<PrintJob> PrintJobs => Set<PrintJob>();
|
||||||
|
public DbSet<FilamentUsage> FilamentUsages => Set<FilamentUsage>();
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
1068
backend/Infrastructure/Data/Migrations/20260426183433_AddFilamentUsageTrackingModel.Designer.cs
generated
Normal file
1068
backend/Infrastructure/Data/Migrations/20260426183433_AddFilamentUsageTrackingModel.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,533 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Extrudex.Infrastructure.Data.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddFilamentUsageTrackingModel : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "filament_usages",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
print_job_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
spool_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
printer_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
grams_used = table.Column<decimal>(type: "numeric(10,2)", precision: 10, scale: 2, nullable: false),
|
||||||
|
mm_extruded = table.Column<decimal>(type: "numeric(12,2)", precision: 12, scale: 2, nullable: false),
|
||||||
|
recorded_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"),
|
||||||
|
notes = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true),
|
||||||
|
created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"),
|
||||||
|
updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_filament_usages", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_filament_usages_print_job",
|
||||||
|
column: x => x.print_job_id,
|
||||||
|
principalTable: "print_jobs",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_filament_usages_printer",
|
||||||
|
column: x => x.printer_id,
|
||||||
|
principalTable: "printers",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_filament_usages_spool",
|
||||||
|
column: x => x.spool_id,
|
||||||
|
principalTable: "spools",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9388), new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9388) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000002"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9871), new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9871) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000003"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9881), new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9881) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000004"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9888), new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9888) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000005"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9895), new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9895) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000006"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9901), new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9902) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000001"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(90), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(90) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000002"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(251), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(251) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000003"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(259), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(259) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000004"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(266), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(266) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000005"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(272), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(272) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000006"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(278), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(278) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000007"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(285), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(285) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000008"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(291), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(291) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000009"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(297), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(298) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000010"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(304), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(304) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000011"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(310), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(310) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000012"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(316), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(317) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000013"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(323), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(323) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000014"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(329), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(329) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000015"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(336), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(336) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000001"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(482), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(482) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000002"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(805), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(806) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000003"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(815), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(815) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000004"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(821), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(821) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000005"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(828), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(828) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000006"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(834), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(834) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000007"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(840), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(840) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000008"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(847), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(847) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000009"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(853), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(853) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000010"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(859), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(860) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000011"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(866), new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(866) });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_filament_usages_print_job_id",
|
||||||
|
table: "filament_usages",
|
||||||
|
column: "print_job_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_filament_usages_printer_id",
|
||||||
|
table: "filament_usages",
|
||||||
|
column: "printer_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_filament_usages_recorded_at",
|
||||||
|
table: "filament_usages",
|
||||||
|
column: "recorded_at");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_filament_usages_spool_id",
|
||||||
|
table: "filament_usages",
|
||||||
|
column: "spool_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_filament_usages_spool_id_recorded_at",
|
||||||
|
table: "filament_usages",
|
||||||
|
columns: new[] { "spool_id", "recorded_at" });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "filament_usages");
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1096), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1096) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000002"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1620), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1620) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000003"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1630), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1630) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000004"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1638), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1638) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000005"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1645), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1645) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_bases",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("10000000-0000-0000-0000-000000000006"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1651), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1652) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000001"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1850), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1850) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000002"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2041), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2041) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000003"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2049), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2049) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000004"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2055), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2056) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000005"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2062), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2062) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000006"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2068), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2068) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000007"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2075), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2075) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000008"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2081), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2081) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000009"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2100), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2100) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000010"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2107), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2107) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000011"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2113), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2113) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000012"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2120), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2120) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000013"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2126), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2126) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000014"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2132), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2133) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_finishes",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("20000000-0000-0000-0000-000000000015"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2139), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2139) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000001"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2304), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2304) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000002"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2463), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2463) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000003"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2471), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2471) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000004"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2477), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2478) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000005"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2484), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2484) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000006"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2490), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2491) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000007"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2497), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2497) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000008"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2503), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2503) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000009"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2510), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2510) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000010"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2516), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2516) });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "material_modifiers",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: new Guid("30000000-0000-0000-0000-000000000011"),
|
||||||
|
columns: new[] { "created_at", "updated_at" },
|
||||||
|
values: new object[] { new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2522), new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2523) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -104,6 +104,77 @@ namespace Extrudex.Infrastructure.Data.Migrations
|
|||||||
b.ToTable("ams_units", (string)null);
|
b.ToTable("ams_units", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Extrudex.Domain.Entities.FilamentUsage", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uuid")
|
||||||
|
.HasColumnName("id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("created_at")
|
||||||
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
||||||
|
|
||||||
|
b.Property<decimal>("GramsUsed")
|
||||||
|
.HasPrecision(10, 2)
|
||||||
|
.HasColumnType("numeric(10,2)")
|
||||||
|
.HasColumnName("grams_used");
|
||||||
|
|
||||||
|
b.Property<decimal>("MmExtruded")
|
||||||
|
.HasPrecision(12, 2)
|
||||||
|
.HasColumnType("numeric(12,2)")
|
||||||
|
.HasColumnName("mm_extruded");
|
||||||
|
|
||||||
|
b.Property<string>("Notes")
|
||||||
|
.HasMaxLength(2000)
|
||||||
|
.HasColumnType("character varying(2000)")
|
||||||
|
.HasColumnName("notes");
|
||||||
|
|
||||||
|
b.Property<Guid>("PrintJobId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
|
.HasColumnName("print_job_id");
|
||||||
|
|
||||||
|
b.Property<Guid>("PrinterId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
|
.HasColumnName("printer_id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("RecordedAt")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("recorded_at")
|
||||||
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
||||||
|
|
||||||
|
b.Property<Guid>("SpoolId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
|
.HasColumnName("spool_id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdatedAt")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("updated_at")
|
||||||
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("PrintJobId")
|
||||||
|
.HasDatabaseName("ix_filament_usages_print_job_id");
|
||||||
|
|
||||||
|
b.HasIndex("PrinterId")
|
||||||
|
.HasDatabaseName("ix_filament_usages_printer_id");
|
||||||
|
|
||||||
|
b.HasIndex("RecordedAt")
|
||||||
|
.HasDatabaseName("ix_filament_usages_recorded_at");
|
||||||
|
|
||||||
|
b.HasIndex("SpoolId")
|
||||||
|
.HasDatabaseName("ix_filament_usages_spool_id");
|
||||||
|
|
||||||
|
b.HasIndex("SpoolId", "RecordedAt")
|
||||||
|
.HasDatabaseName("ix_filament_usages_spool_id_recorded_at");
|
||||||
|
|
||||||
|
b.ToTable("filament_usages", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Extrudex.Domain.Entities.MaterialBase", b =>
|
modelBuilder.Entity("Extrudex.Domain.Entities.MaterialBase", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
@@ -145,50 +216,50 @@ namespace Extrudex.Infrastructure.Data.Migrations
|
|||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("10000000-0000-0000-0000-000000000001"),
|
Id = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1096),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9388),
|
||||||
DensityGperCm3 = 1.24m,
|
DensityGperCm3 = 1.24m,
|
||||||
Name = "PLA",
|
Name = "PLA",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1096)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9388)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("10000000-0000-0000-0000-000000000002"),
|
Id = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1620),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9871),
|
||||||
DensityGperCm3 = 1.27m,
|
DensityGperCm3 = 1.27m,
|
||||||
Name = "PETG",
|
Name = "PETG",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1620)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9871)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("10000000-0000-0000-0000-000000000003"),
|
Id = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1630),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9881),
|
||||||
DensityGperCm3 = 1.04m,
|
DensityGperCm3 = 1.04m,
|
||||||
Name = "ABS",
|
Name = "ABS",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1630)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9881)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("10000000-0000-0000-0000-000000000004"),
|
Id = new Guid("10000000-0000-0000-0000-000000000004"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1638),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9888),
|
||||||
DensityGperCm3 = 1.07m,
|
DensityGperCm3 = 1.07m,
|
||||||
Name = "ASA",
|
Name = "ASA",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1638)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9888)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("10000000-0000-0000-0000-000000000005"),
|
Id = new Guid("10000000-0000-0000-0000-000000000005"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1645),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9895),
|
||||||
DensityGperCm3 = 1.21m,
|
DensityGperCm3 = 1.21m,
|
||||||
Name = "TPU",
|
Name = "TPU",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1645)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9895)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("10000000-0000-0000-0000-000000000006"),
|
Id = new Guid("10000000-0000-0000-0000-000000000006"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1651),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9901),
|
||||||
DensityGperCm3 = 1.14m,
|
DensityGperCm3 = 1.14m,
|
||||||
Name = "Nylon",
|
Name = "Nylon",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1652)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 291, DateTimeKind.Utc).AddTicks(9902)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -232,122 +303,122 @@ namespace Extrudex.Infrastructure.Data.Migrations
|
|||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000001"),
|
Id = new Guid("20000000-0000-0000-0000-000000000001"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1850),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(90),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Basic",
|
Name = "Basic",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(1850)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(90)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000002"),
|
Id = new Guid("20000000-0000-0000-0000-000000000002"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2041),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(251),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Matte",
|
Name = "Matte",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2041)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(251)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000003"),
|
Id = new Guid("20000000-0000-0000-0000-000000000003"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2049),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(259),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Silk",
|
Name = "Silk",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2049)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(259)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000004"),
|
Id = new Guid("20000000-0000-0000-0000-000000000004"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2055),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(266),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Glitter",
|
Name = "Glitter",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2056)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(266)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000005"),
|
Id = new Guid("20000000-0000-0000-0000-000000000005"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2062),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(272),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Marble",
|
Name = "Marble",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2062)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(272)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000006"),
|
Id = new Guid("20000000-0000-0000-0000-000000000006"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2068),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(278),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Sparkle",
|
Name = "Sparkle",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2068)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(278)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000007"),
|
Id = new Guid("20000000-0000-0000-0000-000000000007"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2075),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(285),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||||
Name = "Basic",
|
Name = "Basic",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2075)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(285)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000008"),
|
Id = new Guid("20000000-0000-0000-0000-000000000008"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2081),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(291),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||||
Name = "Matte",
|
Name = "Matte",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2081)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(291)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000009"),
|
Id = new Guid("20000000-0000-0000-0000-000000000009"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2100),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(297),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||||
Name = "Silk",
|
Name = "Silk",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2100)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(298)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000010"),
|
Id = new Guid("20000000-0000-0000-0000-000000000010"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2107),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(304),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||||
Name = "Basic",
|
Name = "Basic",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2107)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(304)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000011"),
|
Id = new Guid("20000000-0000-0000-0000-000000000011"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2113),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(310),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||||
Name = "Matte",
|
Name = "Matte",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2113)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(310)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000012"),
|
Id = new Guid("20000000-0000-0000-0000-000000000012"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2120),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(316),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
|
||||||
Name = "Basic",
|
Name = "Basic",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2120)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(317)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000013"),
|
Id = new Guid("20000000-0000-0000-0000-000000000013"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2126),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(323),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
|
||||||
Name = "Matte",
|
Name = "Matte",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2126)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(323)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000014"),
|
Id = new Guid("20000000-0000-0000-0000-000000000014"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2132),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(329),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000005"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000005"),
|
||||||
Name = "Basic",
|
Name = "Basic",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2133)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(329)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("20000000-0000-0000-0000-000000000015"),
|
Id = new Guid("20000000-0000-0000-0000-000000000015"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2139),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(336),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
|
||||||
Name = "Basic",
|
Name = "Basic",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2139)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(336)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -391,90 +462,90 @@ namespace Extrudex.Infrastructure.Data.Migrations
|
|||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000001"),
|
Id = new Guid("30000000-0000-0000-0000-000000000001"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2304),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(482),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Carbon Fiber",
|
Name = "Carbon Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2304)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(482)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000002"),
|
Id = new Guid("30000000-0000-0000-0000-000000000002"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2463),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(805),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Glass Fiber",
|
Name = "Glass Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2463)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(806)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000003"),
|
Id = new Guid("30000000-0000-0000-0000-000000000003"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2471),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(815),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Wood Fill",
|
Name = "Wood Fill",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2471)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(815)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000004"),
|
Id = new Guid("30000000-0000-0000-0000-000000000004"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2477),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(821),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||||
Name = "Glow-in-the-Dark",
|
Name = "Glow-in-the-Dark",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2478)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(821)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000005"),
|
Id = new Guid("30000000-0000-0000-0000-000000000005"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2484),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(828),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||||
Name = "Carbon Fiber",
|
Name = "Carbon Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2484)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(828)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000006"),
|
Id = new Guid("30000000-0000-0000-0000-000000000006"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2490),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(834),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||||
Name = "Glass Fiber",
|
Name = "Glass Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2491)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(834)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000007"),
|
Id = new Guid("30000000-0000-0000-0000-000000000007"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2497),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(840),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||||
Name = "Carbon Fiber",
|
Name = "Carbon Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2497)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(840)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000008"),
|
Id = new Guid("30000000-0000-0000-0000-000000000008"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2503),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(847),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||||
Name = "Glass Fiber",
|
Name = "Glass Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2503)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(847)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000009"),
|
Id = new Guid("30000000-0000-0000-0000-000000000009"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2510),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(853),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
|
||||||
Name = "Carbon Fiber",
|
Name = "Carbon Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2510)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(853)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000010"),
|
Id = new Guid("30000000-0000-0000-0000-000000000010"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2516),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(859),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
|
||||||
Name = "Carbon Fiber",
|
Name = "Carbon Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2516)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(860)
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = new Guid("30000000-0000-0000-0000-000000000011"),
|
Id = new Guid("30000000-0000-0000-0000-000000000011"),
|
||||||
CreatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2522),
|
CreatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(866),
|
||||||
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
|
MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
|
||||||
Name = "Glass Fiber",
|
Name = "Glass Fiber",
|
||||||
UpdatedAt = new DateTime(2026, 4, 26, 13, 14, 18, 745, DateTimeKind.Utc).AddTicks(2523)
|
UpdatedAt = new DateTime(2026, 4, 26, 18, 34, 33, 292, DateTimeKind.Utc).AddTicks(866)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -838,6 +909,36 @@ namespace Extrudex.Infrastructure.Data.Migrations
|
|||||||
b.Navigation("Printer");
|
b.Navigation("Printer");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Extrudex.Domain.Entities.FilamentUsage", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Extrudex.Domain.Entities.PrintJob", "PrintJob")
|
||||||
|
.WithMany("FilamentUsages")
|
||||||
|
.HasForeignKey("PrintJobId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_filament_usages_print_job");
|
||||||
|
|
||||||
|
b.HasOne("Extrudex.Domain.Entities.Printer", "Printer")
|
||||||
|
.WithMany("FilamentUsages")
|
||||||
|
.HasForeignKey("PrinterId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_filament_usages_printer");
|
||||||
|
|
||||||
|
b.HasOne("Extrudex.Domain.Entities.Spool", "Spool")
|
||||||
|
.WithMany("FilamentUsages")
|
||||||
|
.HasForeignKey("SpoolId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_filament_usages_spool");
|
||||||
|
|
||||||
|
b.Navigation("PrintJob");
|
||||||
|
|
||||||
|
b.Navigation("Printer");
|
||||||
|
|
||||||
|
b.Navigation("Spool");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Extrudex.Domain.Entities.MaterialFinish", b =>
|
modelBuilder.Entity("Extrudex.Domain.Entities.MaterialFinish", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Extrudex.Domain.Entities.MaterialBase", "MaterialBase")
|
b.HasOne("Extrudex.Domain.Entities.MaterialBase", "MaterialBase")
|
||||||
@@ -936,10 +1037,17 @@ namespace Extrudex.Infrastructure.Data.Migrations
|
|||||||
b.Navigation("Spools");
|
b.Navigation("Spools");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Extrudex.Domain.Entities.PrintJob", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("FilamentUsages");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Extrudex.Domain.Entities.Printer", b =>
|
modelBuilder.Entity("Extrudex.Domain.Entities.Printer", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("AmsUnits");
|
b.Navigation("AmsUnits");
|
||||||
|
|
||||||
|
b.Navigation("FilamentUsages");
|
||||||
|
|
||||||
b.Navigation("PrintJobs");
|
b.Navigation("PrintJobs");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -947,6 +1055,8 @@ namespace Extrudex.Infrastructure.Data.Migrations
|
|||||||
{
|
{
|
||||||
b.Navigation("AmsSlots");
|
b.Navigation("AmsSlots");
|
||||||
|
|
||||||
|
b.Navigation("FilamentUsages");
|
||||||
|
|
||||||
b.Navigation("PrintJobs");
|
b.Navigation("PrintJobs");
|
||||||
});
|
});
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
|
|||||||
11
frontend/.dockerignore
Normal file
11
frontend/.dockerignore
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.angular
|
||||||
|
.vscode
|
||||||
|
*.md
|
||||||
|
.editorconfig
|
||||||
|
.prettierrc
|
||||||
|
src/test.ts
|
||||||
|
**/*.spec.ts
|
||||||
28
frontend/Dockerfile
Normal file
28
frontend/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Stage 1: Build the Angular application
|
||||||
|
FROM node:22-alpine AS build
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package files first for better layer caching
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
# Copy source and build
|
||||||
|
COPY . .
|
||||||
|
RUN npx ng build --configuration production
|
||||||
|
|
||||||
|
# Stage 2: Serve static files with nginx
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
# Remove default nginx config
|
||||||
|
RUN rm /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
# Copy custom nginx config
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
# Copy built Angular artifacts from build stage
|
||||||
|
COPY --from=build /app/dist/frontend/browser /usr/share/nginx/html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
42
frontend/nginx.conf
Normal file
42
frontend/nginx.conf
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
# Gzip compression
|
||||||
|
gzip on;
|
||||||
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
|
||||||
|
gzip_min_length 256;
|
||||||
|
|
||||||
|
# Angular SPA — fallback to index.html for client-side routing
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Cache static assets aggressively
|
||||||
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|eot)$ {
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Proxy API requests to backend
|
||||||
|
# Uses resolver so nginx doesn't crash if backend isn't available at startup
|
||||||
|
resolver 127.0.0.11 valid=30s ipv6=off;
|
||||||
|
set $backend "extrudex-api:8080";
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://$backend;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Health check endpoint
|
||||||
|
location /health {
|
||||||
|
access_log off;
|
||||||
|
return 200 "ok";
|
||||||
|
add_header Content-Type text/plain;
|
||||||
|
}
|
||||||
|
}
|
||||||
16
frontend/package-lock.json
generated
16
frontend/package-lock.json
generated
@@ -8,7 +8,6 @@
|
|||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^21.2.10",
|
|
||||||
"@angular/cdk": "^21.2.8",
|
"@angular/cdk": "^21.2.8",
|
||||||
"@angular/common": "^21.2.0",
|
"@angular/common": "^21.2.0",
|
||||||
"@angular/compiler": "^21.2.0",
|
"@angular/compiler": "^21.2.0",
|
||||||
@@ -327,21 +326,6 @@
|
|||||||
"yarn": ">= 1.13.0"
|
"yarn": ">= 1.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@angular/animations": {
|
|
||||||
"version": "21.2.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-21.2.10.tgz",
|
|
||||||
"integrity": "sha512-sIzAcxwtRCJ/fu0tK4mo1ooiEaDxJ+Nl6s9nK1D1NP1em12VX03Jx8CMixp/kVtgh4mZnm1x6psBB0FUz3U3Ug==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": "^2.3.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@angular/core": "21.2.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@angular/build": {
|
"node_modules/@angular/build": {
|
||||||
"version": "21.2.8",
|
"version": "21.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/@angular/build/-/build-21.2.8.tgz",
|
"resolved": "https://registry.npmjs.org/@angular/build/-/build-21.2.8.tgz",
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "npm@11.11.0",
|
"packageManager": "npm@11.11.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^21.2.10",
|
|
||||||
"@angular/cdk": "^21.2.8",
|
"@angular/cdk": "^21.2.8",
|
||||||
"@angular/common": "^21.2.0",
|
"@angular/common": "^21.2.0",
|
||||||
"@angular/compiler": "^21.2.0",
|
"@angular/compiler": "^21.2.0",
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
|
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
|
||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter } from '@angular/router';
|
||||||
import { provideHttpClient, withFetch } from '@angular/common/http';
|
|
||||||
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
|
||||||
|
|
||||||
import { routes } from './app.routes';
|
import { routes } from './app.routes';
|
||||||
|
|
||||||
export const appConfig: ApplicationConfig = {
|
export const appConfig: ApplicationConfig = {
|
||||||
providers: [
|
providers: [
|
||||||
provideBrowserGlobalErrorListeners(),
|
provideBrowserGlobalErrorListeners(),
|
||||||
provideRouter(routes),
|
provideRouter(routes)
|
||||||
provideHttpClient(withFetch()),
|
|
||||||
provideAnimationsAsync(),
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
<!-- Delete Filament Confirmation Dialog -->
|
|
||||||
<h2 mat-dialog-title>
|
|
||||||
<mat-icon aria-hidden="true">warning</mat-icon>
|
|
||||||
Delete Filament Spool?
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<mat-dialog-content>
|
|
||||||
<p class="dialog-description">
|
|
||||||
You are about to permanently remove this filament spool from inventory.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Spool details card -->
|
|
||||||
<div class="spool-details" role="list" aria-label="Spool details">
|
|
||||||
<div class="detail-row" role="listitem">
|
|
||||||
<span class="detail-label">Material</span>
|
|
||||||
<span class="detail-value">{{ filament.materialBaseName }}{{ filament.materialFinishName ? ' — ' + filament.materialFinishName : '' }}{{ filament.materialModifierName ? ' (' + filament.materialModifierName + ')' : '' }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="detail-row" role="listitem">
|
|
||||||
<span class="detail-label">Brand</span>
|
|
||||||
<span class="detail-value">{{ filament.brand }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="detail-row" role="listitem">
|
|
||||||
<span class="detail-label">Color</span>
|
|
||||||
<span class="detail-value color-value">
|
|
||||||
<span class="color-swatch-inline"
|
|
||||||
[style.background-color]="filament.colorHex"
|
|
||||||
[attr.aria-label]="filament.colorName">
|
|
||||||
</span>
|
|
||||||
{{ filament.colorName }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="detail-row" role="listitem">
|
|
||||||
<span class="detail-label">Serial</span>
|
|
||||||
<span class="detail-value serial-value">{{ filament.spoolSerial }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="detail-row" role="listitem">
|
|
||||||
<span class="detail-label">Remaining</span>
|
|
||||||
<span class="detail-value">{{ formatWeight(filament.weightRemainingGrams) }} / {{ formatWeight(filament.weightTotalGrams) }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="detail-row" role="listitem">
|
|
||||||
<span class="detail-label">Status</span>
|
|
||||||
<span class="detail-value">
|
|
||||||
<span class="status-badge"
|
|
||||||
[class.active]="filament.isActive"
|
|
||||||
[class.inactive]="!filament.isActive">
|
|
||||||
{{ filament.isActive ? 'Active' : 'Inactive' }}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="dialog-warning">
|
|
||||||
<mat-icon aria-hidden="true">info</mat-icon>
|
|
||||||
This action cannot be undone.
|
|
||||||
</p>
|
|
||||||
</mat-dialog-content>
|
|
||||||
|
|
||||||
<mat-dialog-actions align="end">
|
|
||||||
<button mat-button
|
|
||||||
type="button"
|
|
||||||
(click)="onCancel()"
|
|
||||||
class="cancel-button">
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
<button mat-flat-button
|
|
||||||
type="button"
|
|
||||||
color="warn"
|
|
||||||
(click)="onConfirm()"
|
|
||||||
class="confirm-button">
|
|
||||||
<mat-icon aria-hidden="true">delete</mat-icon>
|
|
||||||
Delete Spool
|
|
||||||
</button>
|
|
||||||
</mat-dialog-actions>
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
/**
|
|
||||||
* Delete Filament Dialog Styles
|
|
||||||
* Touch-optimized confirmation dialog for spool removal
|
|
||||||
*/
|
|
||||||
|
|
||||||
$spacing-unit: 8px;
|
|
||||||
$color-critical: #ef4444;
|
|
||||||
$color-inactive: #94a3b8;
|
|
||||||
$color-active: #22c55e;
|
|
||||||
|
|
||||||
// Dialog title
|
|
||||||
h2[mat-dialog-title] {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: $spacing-unit;
|
|
||||||
color: $color-critical;
|
|
||||||
|
|
||||||
mat-icon {
|
|
||||||
font-size: 24px !important;
|
|
||||||
width: 24px !important;
|
|
||||||
height: 24px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Description text
|
|
||||||
.dialog-description {
|
|
||||||
margin: 0 0 $spacing-unit * 2;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.5;
|
|
||||||
color: var(--mat-sys-on-surface);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Spool details card
|
|
||||||
.spool-details {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: $spacing-unit;
|
|
||||||
padding: $spacing-unit * 1.5;
|
|
||||||
background-color: var(--mat-sys-surface-container);
|
|
||||||
border-radius: 8px;
|
|
||||||
margin-bottom: $spacing-unit * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-row {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: $spacing-unit * 0.5 0;
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
&:not(:last-child) {
|
|
||||||
border-bottom: 1px solid var(--mat-sys-outline-variant);
|
|
||||||
padding-bottom: $spacing-unit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-label {
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--mat-sys-on-surface-variant);
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-value {
|
|
||||||
font-weight: 400;
|
|
||||||
color: var(--mat-sys-on-surface);
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Color swatch inline
|
|
||||||
.color-swatch-inline {
|
|
||||||
display: inline-block;
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 1.5px solid rgba(0, 0, 0, 0.12);
|
|
||||||
vertical-align: middle;
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-value {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Serial value — monospace
|
|
||||||
.serial-value {
|
|
||||||
font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
|
|
||||||
font-size: 13px;
|
|
||||||
letter-spacing: 0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Status badge — matches filament table styling
|
|
||||||
.status-badge {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 2px 8px;
|
|
||||||
border-radius: 10px;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 600;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.04em;
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
background-color: rgba($color-active, 0.12);
|
|
||||||
color: $color-active;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.inactive {
|
|
||||||
background-color: rgba($color-inactive, 0.12);
|
|
||||||
color: $color-inactive;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Warning text
|
|
||||||
.dialog-warning {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: $spacing-unit;
|
|
||||||
margin: 0;
|
|
||||||
font-size: 13px;
|
|
||||||
color: $color-critical;
|
|
||||||
|
|
||||||
mat-icon {
|
|
||||||
font-size: 18px !important;
|
|
||||||
width: 18px !important;
|
|
||||||
height: 18px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dialog action buttons
|
|
||||||
mat-dialog-actions {
|
|
||||||
padding-top: $spacing-unit * 2;
|
|
||||||
|
|
||||||
.cancel-button {
|
|
||||||
min-width: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button {
|
|
||||||
min-width: 120px;
|
|
||||||
|
|
||||||
mat-icon {
|
|
||||||
font-size: 18px !important;
|
|
||||||
width: 18px !important;
|
|
||||||
height: 18px !important;
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import {
|
|
||||||
MAT_DIALOG_DATA,
|
|
||||||
MatDialogRef,
|
|
||||||
MatDialogModule,
|
|
||||||
} from '@angular/material/dialog';
|
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
|
||||||
import { MatChipsModule } from '@angular/material/chips';
|
|
||||||
|
|
||||||
import { Filament } from '../../models/filament.model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Data passed into the delete confirmation dialog.
|
|
||||||
*/
|
|
||||||
export interface DeleteFilamentDialogData {
|
|
||||||
filament: Filament;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete confirmation dialog for filament spool removal.
|
|
||||||
*
|
|
||||||
* Displays spool details (material, brand, color, serial, remaining weight)
|
|
||||||
* and requires the user to confirm before deletion proceeds.
|
|
||||||
* Cancel dismisses the dialog with no action.
|
|
||||||
*/
|
|
||||||
@Component({
|
|
||||||
selector: 'app-delete-filament-dialog',
|
|
||||||
standalone: true,
|
|
||||||
imports: [
|
|
||||||
CommonModule,
|
|
||||||
MatDialogModule,
|
|
||||||
MatButtonModule,
|
|
||||||
MatIconModule,
|
|
||||||
MatChipsModule,
|
|
||||||
],
|
|
||||||
templateUrl: './delete-filament-dialog.component.html',
|
|
||||||
styleUrl: './delete-filament-dialog.component.scss',
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
||||||
})
|
|
||||||
export class DeleteFilamentDialogComponent {
|
|
||||||
private readonly dialogRef = inject(
|
|
||||||
MatDialogRef<DeleteFilamentDialogComponent, boolean>
|
|
||||||
);
|
|
||||||
readonly data: DeleteFilamentDialogData = inject(MAT_DIALOG_DATA);
|
|
||||||
|
|
||||||
/** The filament spool being considered for deletion */
|
|
||||||
readonly filament = this.data.filament;
|
|
||||||
|
|
||||||
/** Format weight for display in dialog */
|
|
||||||
formatWeight(grams: number): string {
|
|
||||||
if (grams >= 1000) {
|
|
||||||
return `${(grams / 1000).toFixed(1)}kg`;
|
|
||||||
}
|
|
||||||
return `${Math.round(grams)}g`;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Cancel — close dialog with false (no deletion) */
|
|
||||||
onCancel(): void {
|
|
||||||
this.dialogRef.close(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Confirm — close dialog with true (proceed with deletion) */
|
|
||||||
onConfirm(): void {
|
|
||||||
this.dialogRef.close(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- Filament Inventory Table — with low stock indicators and delete actions -->
|
<!-- Filament Inventory Table — with low stock indicators -->
|
||||||
<div class="filament-table-container" role="region" aria-label="Filament inventory">
|
<div class="filament-table-container" role="region" aria-label="Filament inventory">
|
||||||
|
|
||||||
<!-- Low Stock Alert Banner — shown when critical or low stock spools exist -->
|
<!-- Low Stock Alert Banner — shown when critical or low stock spools exist -->
|
||||||
@@ -106,32 +106,10 @@
|
|||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Actions Column — delete button -->
|
|
||||||
<ng-container matColumnDef="actions">
|
|
||||||
<th mat-header-cell *matHeaderCellDef>Actions</th>
|
|
||||||
<td mat-cell *matCellDef="let filament">
|
|
||||||
<button mat-icon-button
|
|
||||||
type="button"
|
|
||||||
color="warn"
|
|
||||||
[attr.aria-label]="'Delete ' + filament.materialBaseName + ' — ' + filament.colorName"
|
|
||||||
matTooltip="Delete spool"
|
|
||||||
matTooltipPosition="above"
|
|
||||||
[disabled]="deleting() === filament.id"
|
|
||||||
(click)="onDeleteClick(filament)">
|
|
||||||
@if (deleting() === filament.id) {
|
|
||||||
<mat-icon aria-hidden="true">hourglass_empty</mat-icon>
|
|
||||||
} @else {
|
|
||||||
<mat-icon aria-hidden="true">delete</mat-icon>
|
|
||||||
}
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="columns()"></tr>
|
<tr mat-header-row *matHeaderRowDef="columns()"></tr>
|
||||||
<tr mat-row *matRowDef="let row; columns: columns();"
|
<tr mat-row *matRowDef="let row; columns: columns();"
|
||||||
[class.row-critical]="classifyStockLevel(row) === 'critical'"
|
[class.row-critical]="classifyStockLevel(row) === 'critical'"
|
||||||
[class.row-low]="classifyStockLevel(row) === 'low'"
|
[class.row-low]="classifyStockLevel(row) === 'low'">
|
||||||
[class.row-deleting]="deleting() === row.id">
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@@ -235,20 +235,6 @@ mat-chip {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions column
|
|
||||||
.actions-cell {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Row being deleted — subtle fade
|
|
||||||
:host ::ng-deep .row-deleting {
|
|
||||||
opacity: 0.5;
|
|
||||||
pointer-events: none;
|
|
||||||
transition: opacity 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Empty state
|
// Empty state
|
||||||
.empty-state {
|
.empty-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import {
|
|||||||
Component,
|
Component,
|
||||||
Input,
|
Input,
|
||||||
computed,
|
computed,
|
||||||
inject,
|
|
||||||
signal,
|
signal,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
@@ -13,21 +12,12 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { MatSortModule, Sort } from '@angular/material/sort';
|
import { MatSortModule, Sort } from '@angular/material/sort';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
|
||||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
||||||
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Filament,
|
Filament,
|
||||||
StockLevel,
|
StockLevel,
|
||||||
getRemainingPercent,
|
getRemainingPercent,
|
||||||
classifyStockLevel,
|
classifyStockLevel,
|
||||||
} from '../../models/filament.model';
|
} from '../../models/filament.model';
|
||||||
import { FilamentService } from '../../services/filament.service';
|
|
||||||
import {
|
|
||||||
DeleteFilamentDialogComponent,
|
|
||||||
DeleteFilamentDialogData,
|
|
||||||
} from '../delete-filament-dialog/delete-filament-dialog.component';
|
|
||||||
|
|
||||||
/** Display column definitions for the filament table */
|
/** Display column definitions for the filament table */
|
||||||
export type FilamentColumn =
|
export type FilamentColumn =
|
||||||
@@ -37,8 +27,7 @@ export type FilamentColumn =
|
|||||||
| 'serial'
|
| 'serial'
|
||||||
| 'remaining'
|
| 'remaining'
|
||||||
| 'stockLevel'
|
| 'stockLevel'
|
||||||
| 'status'
|
| 'status';
|
||||||
| 'actions';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-filament-table',
|
selector: 'app-filament-table',
|
||||||
@@ -51,26 +40,16 @@ export type FilamentColumn =
|
|||||||
MatProgressBarModule,
|
MatProgressBarModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
MatSortModule,
|
MatSortModule,
|
||||||
MatButtonModule,
|
|
||||||
MatDialogModule,
|
|
||||||
MatSnackBarModule,
|
|
||||||
],
|
],
|
||||||
templateUrl: './filament-table.component.html',
|
templateUrl: './filament-table.component.html',
|
||||||
styleUrl: './filament-table.component.scss',
|
styleUrl: './filament-table.component.scss',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class FilamentTableComponent {
|
export class FilamentTableComponent {
|
||||||
private readonly dialog = inject(MatDialog);
|
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
|
||||||
private readonly filamentService = inject(FilamentService);
|
|
||||||
|
|
||||||
/** Filament data input — reactive signal for live updates */
|
/** Filament data input — reactive signal for live updates */
|
||||||
readonly filaments = signal<Filament[]>([]);
|
readonly filaments = signal<Filament[]>([]);
|
||||||
|
|
||||||
/** Whether a delete operation is in progress */
|
/** Columns to display — defaults to all columns */
|
||||||
readonly deleting = signal<string | null>(null);
|
|
||||||
|
|
||||||
/** Columns to display — defaults to all columns including actions */
|
|
||||||
@Input()
|
@Input()
|
||||||
set displayedColumns(cols: FilamentColumn[]) {
|
set displayedColumns(cols: FilamentColumn[]) {
|
||||||
this._displayedColumns.set(cols);
|
this._displayedColumns.set(cols);
|
||||||
@@ -86,7 +65,6 @@ export class FilamentTableComponent {
|
|||||||
'remaining',
|
'remaining',
|
||||||
'stockLevel',
|
'stockLevel',
|
||||||
'status',
|
'status',
|
||||||
'actions',
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Default columns for template binding */
|
/** Default columns for template binding */
|
||||||
@@ -274,52 +252,6 @@ export class FilamentTableComponent {
|
|||||||
this.sortedFilaments.set(sorted);
|
this.sortedFilaments.set(sorted);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Open the delete confirmation dialog for a filament spool.
|
|
||||||
* On confirm: calls DELETE endpoint and removes the row on success.
|
|
||||||
* On cancel: dialog dismissed, no action taken.
|
|
||||||
*/
|
|
||||||
onDeleteClick(filament: Filament): void {
|
|
||||||
const dialogData: DeleteFilamentDialogData = { filament };
|
|
||||||
const dialogRef = this.dialog.open(DeleteFilamentDialogComponent, {
|
|
||||||
data: dialogData,
|
|
||||||
width: '480px',
|
|
||||||
disableClose: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe((confirmed: boolean | undefined) => {
|
|
||||||
if (!confirmed) {
|
|
||||||
return; // User cancelled — no action
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mark as deleting for UI feedback
|
|
||||||
this.deleting.set(filament.id);
|
|
||||||
|
|
||||||
this.filamentService.deleteFilament(filament.id).subscribe({
|
|
||||||
next: () => {
|
|
||||||
// Remove the deleted filament from local data
|
|
||||||
const updated = this.filaments().filter((f) => f.id !== filament.id);
|
|
||||||
this.updateFilaments(updated);
|
|
||||||
this.deleting.set(null);
|
|
||||||
|
|
||||||
this.snackBar.open(
|
|
||||||
`Deleted ${filament.materialBaseName} — ${filament.colorName}`,
|
|
||||||
'Dismiss',
|
|
||||||
{ duration: 4000 }
|
|
||||||
);
|
|
||||||
},
|
|
||||||
error: () => {
|
|
||||||
this.deleting.set(null);
|
|
||||||
this.snackBar.open(
|
|
||||||
`Failed to delete ${filament.materialBaseName} — ${filament.colorName}. Please try again.`,
|
|
||||||
'Dismiss',
|
|
||||||
{ duration: 6000 }
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Template helper: get remaining percent */
|
/** Template helper: get remaining percent */
|
||||||
getRemainingPercent = getRemainingPercent;
|
getRemainingPercent = getRemainingPercent;
|
||||||
|
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
import { Injectable, inject } from '@angular/core';
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
|
|
||||||
import { Filament } from '../models/filament.model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* API base URL — matches the Extrudex backend default.
|
|
||||||
* TODO: Move to environment config when multi-environment support is added.
|
|
||||||
*/
|
|
||||||
const API_BASE_URL = '/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Service for CRUD operations on filament spools.
|
|
||||||
* Communicates with the Extrudex backend SpoolsController.
|
|
||||||
*/
|
|
||||||
@Injectable({ providedIn: 'root' })
|
|
||||||
export class FilamentService {
|
|
||||||
private readonly http = inject(HttpClient);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch all filament spools from the backend.
|
|
||||||
* GET /api/spools
|
|
||||||
*/
|
|
||||||
getFilaments(): Observable<Filament[]> {
|
|
||||||
return this.http.get<Filament[]>(`${API_BASE_URL}/spools`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Soft-delete a filament spool by ID.
|
|
||||||
* DELETE /api/spools/{id}
|
|
||||||
* Returns 204 No Content on success.
|
|
||||||
*/
|
|
||||||
deleteFilament(id: string): Observable<void> {
|
|
||||||
return this.http.delete<void>(`${API_BASE_URL}/spools/${id}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user