Added inital job entity and services. Added released works API integration.
This commit is contained in:
44
JSMR.Infrastructure/Data/Configuration/JobConfiguration.cs
Normal file
44
JSMR.Infrastructure/Data/Configuration/JobConfiguration.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using JSMR.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace JSMR.Infrastructure.Data.Configuration;
|
||||
|
||||
public sealed class JobConfiguration : IEntityTypeConfiguration<Job>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Job> builder)
|
||||
{
|
||||
builder.ToTable("Jobs");
|
||||
|
||||
builder.HasKey(x => x.Id);
|
||||
|
||||
builder.Property(x => x.Code)
|
||||
.HasMaxLength(100)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(x => x.RequestedByUserId)
|
||||
.HasMaxLength(100);
|
||||
|
||||
builder.Property(x => x.RequestedSource)
|
||||
.HasMaxLength(50)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(x => x.WorkerName)
|
||||
.HasMaxLength(200);
|
||||
|
||||
builder.Property(x => x.CurrentStep)
|
||||
.HasMaxLength(500);
|
||||
|
||||
builder.Property(x => x.ResultSummary)
|
||||
.HasMaxLength(2000);
|
||||
|
||||
builder.Property(x => x.Error)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
builder.Property(x => x.ParametersJson)
|
||||
.HasColumnType("LONGTEXT");
|
||||
|
||||
builder.HasIndex(x => new { x.Status, x.CreatedUtc });
|
||||
builder.HasIndex(x => x.Code);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user