Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IS93 Scaffold #4482

Merged
merged 5 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions source/backend/entities/PimsBaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.DocumentQueueId)
.HasDefaultValueSql("(NEXT VALUE FOR [PIMS_DOCUMENT_QUEUE_ID_SEQ])")
.HasComment("Generated surrogate primary key.");
entity.Property(e => e.AcquisitionFileDocumentId).HasComment("Foreign key to the PIMS_ACQUISITION_FILE_DOCUMENT table.");
entity.Property(e => e.AppCreateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the user created the record.");
Expand Down Expand Up @@ -3148,24 +3149,39 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.DbLastUpdateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created or last updated the record.");
entity.Property(e => e.DispositionFileDocumentId).HasComment("Foreign key to the PIMS_DISPOSITION_FILE_DOCUMENT table.");
entity.Property(e => e.DocProcessEndDt).HasComment("When the document?s processing finishes, this will be populated");
entity.Property(e => e.DocProcessRetries).HasComment("The number of times that this document has been queued for upload.");
entity.Property(e => e.DocProcessStartDt).HasComment("When the document is sent to the backend for processing, this will be populated.");
entity.Property(e => e.Document).HasComment("The actual document blob, stored temporarily until after processing completes.");
entity.Property(e => e.DocumentExternalId).HasComment("Fluid key used to uniquely identify document in external system.");
entity.Property(e => e.DocumentId).HasComment("Foreign key to the PIMS_DOCUMENT table.");
entity.Property(e => e.DocumentMetadata).HasComment("Used to store JSON-encoded metadata that needs to be added to the document during upload.");
entity.Property(e => e.DocumentQueueStatusTypeCode).HasComment("Code value that represents the current status of the document as it is processed by PIMS/MAYAN");
entity.Property(e => e.LeaseDocumentId).HasComment("Foreign key to the PIMS_LEASE_DOCUMENT table.");
entity.Property(e => e.MayanError).HasComment("If the upload process fails, the error corresponding to the failure will be displayed here.");
entity.Property(e => e.PropertyActivityDocumentId).HasComment("Foreign key to the PIMS_PROPERTY_ACTIVITY_DOCUMENT table.");
entity.Property(e => e.ResearchFileDocumentId).HasComment("Foreign key to the PIMS_RESEARCH_FILE_DOCUMENT table.");

entity.HasOne(d => d.AcquisitionFileDocument).WithMany(p => p.PimsDocumentQueues).HasConstraintName("PIM_ACQDOC_PIM_DOCQUE_FK");

entity.HasOne(d => d.DataSourceTypeCodeNavigation).WithMany(p => p.PimsDocumentQueues)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_PIDSRT_PIM_DOCQUE_FK");

entity.HasOne(d => d.DispositionFileDocument).WithMany(p => p.PimsDocumentQueues).HasConstraintName("PIM_DSPDOC_PIM_DOCQUE_FK");

entity.HasOne(d => d.DocumentNavigation).WithMany(p => p.PimsDocumentQueues).HasConstraintName("PIM_DOCMNT_PIM_DOCQUE_FK");

entity.HasOne(d => d.DocumentQueueStatusTypeCodeNavigation).WithMany(p => p.PimsDocumentQueues)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_DOCQST_PIM_DOCQUE_FK");

entity.HasOne(d => d.LeaseDocument).WithMany(p => p.PimsDocumentQueues).HasConstraintName("PIM_LESDOC_PIM_DOCQUE_FK");

entity.HasOne(d => d.PropertyActivityDocument).WithMany(p => p.PimsDocumentQueues).HasConstraintName("PIM_PRACDO_PIM_DOCQUE_FK");

entity.HasOne(d => d.ResearchFileDocument).WithMany(p => p.PimsDocumentQueues).HasConstraintName("PIM_RFLDOC_PIM_DOCQUE_FK");
});

modelBuilder.Entity<PimsDocumentQueueHist>(entity =>
Expand Down
3 changes: 3 additions & 0 deletions source/backend/entities/ef/PimsAcquisitionFileDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,7 @@ public partial class PimsAcquisitionFileDocument
[ForeignKey("DocumentId")]
[InverseProperty("PimsAcquisitionFileDocuments")]
public virtual PimsDocument Document { get; set; }

[InverseProperty("AcquisitionFileDocument")]
public virtual ICollection<PimsDocumentQueue> PimsDocumentQueues { get; set; } = new List<PimsDocumentQueue>();
}
3 changes: 3 additions & 0 deletions source/backend/entities/ef/PimsDispositionFileDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,7 @@ public partial class PimsDispositionFileDocument
[ForeignKey("DocumentId")]
[InverseProperty("PimsDispositionFileDocuments")]
public virtual PimsDocument Document { get; set; }

[InverseProperty("DispositionFileDocument")]
public virtual ICollection<PimsDocumentQueue> PimsDocumentQueues { get; set; } = new List<PimsDocumentQueue>();
}
62 changes: 62 additions & 0 deletions source/backend/entities/ef/PimsDocumentQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ namespace Pims.Dal.Entities;
/// Table providing progress tracking of document inclusion into the MAYAN EDMS.
/// </summary>
[Table("PIMS_DOCUMENT_QUEUE")]
[Index("AcquisitionFileDocumentId", Name = "DOCQUE_ACQUISITION_FILE_DOCUMENT_ID_IDX")]
[Index("DataSourceTypeCode", Name = "DOCQUE_DATA_SOURCE_TYPE_CODE_IDX")]
[Index("DispositionFileDocumentId", Name = "DOCQUE_DISPOSITION_FILE_DOCUMENT_ID_IDX")]
[Index("DocumentId", Name = "DOCQUE_DOCUMENT_ID_IDX")]
[Index("DocumentQueueStatusTypeCode", Name = "DOCQUE_DOCUMENT_QUEUE_STATUS_TYPE_CODE_IDX")]
[Index("LeaseDocumentId", Name = "DOCQUE_LEASE_DOCUMENT_ID_IDX")]
[Index("PropertyActivityDocumentId", Name = "DOCQUE_PROPERTY_ACTIVITY_DOCUMENT_ID_IDX")]
[Index("ResearchFileDocumentId", Name = "DOCQUE_RESEARCH_FILE_DOCUMENT_ID_IDX")]
public partial class PimsDocumentQueue
{
/// <summary>
Expand Down Expand Up @@ -44,13 +49,50 @@ public partial class PimsDocumentQueue
[StringLength(20)]
public string DataSourceTypeCode { get; set; }

/// <summary>
/// Foreign key to the PIMS_PROPERTY_ACTIVITY_DOCUMENT table.
/// </summary>
[Column("PROPERTY_ACTIVITY_DOCUMENT_ID")]
public long? PropertyActivityDocumentId { get; set; }

/// <summary>
/// Foreign key to the PIMS_ACQUISITION_FILE_DOCUMENT table.
/// </summary>
[Column("ACQUISITION_FILE_DOCUMENT_ID")]
public long? AcquisitionFileDocumentId { get; set; }

/// <summary>
/// Foreign key to the PIMS_RESEARCH_FILE_DOCUMENT table.
/// </summary>
[Column("RESEARCH_FILE_DOCUMENT_ID")]
public long? ResearchFileDocumentId { get; set; }

/// <summary>
/// Foreign key to the PIMS_LEASE_DOCUMENT table.
/// </summary>
[Column("LEASE_DOCUMENT_ID")]
public long? LeaseDocumentId { get; set; }

/// <summary>
/// Foreign key to the PIMS_DISPOSITION_FILE_DOCUMENT table.
/// </summary>
[Column("DISPOSITION_FILE_DOCUMENT_ID")]
public long? DispositionFileDocumentId { get; set; }

/// <summary>
/// Fluid key used to uniquely identify document in external system.
/// </summary>
[Column("DOCUMENT_EXTERNAL_ID")]
[StringLength(1000)]
public string DocumentExternalId { get; set; }

/// <summary>
/// Used to store JSON-encoded metadata that needs to be added to the document during upload.
/// </summary>
[Column("DOCUMENT_METADATA")]
[StringLength(4000)]
public string DocumentMetadata { get; set; }

/// <summary>
/// When the document is sent to the backend for processing, this will be populated.
/// </summary>
Expand Down Expand Up @@ -172,15 +214,35 @@ public partial class PimsDocumentQueue
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }

[ForeignKey("AcquisitionFileDocumentId")]
[InverseProperty("PimsDocumentQueues")]
public virtual PimsAcquisitionFileDocument AcquisitionFileDocument { get; set; }

[ForeignKey("DataSourceTypeCode")]
[InverseProperty("PimsDocumentQueues")]
public virtual PimsDataSourceType DataSourceTypeCodeNavigation { get; set; }

[ForeignKey("DispositionFileDocumentId")]
[InverseProperty("PimsDocumentQueues")]
public virtual PimsDispositionFileDocument DispositionFileDocument { get; set; }

[ForeignKey("DocumentId")]
[InverseProperty("PimsDocumentQueues")]
public virtual PimsDocument DocumentNavigation { get; set; }

[ForeignKey("DocumentQueueStatusTypeCode")]
[InverseProperty("PimsDocumentQueues")]
public virtual PimsDocumentQueueStatusType DocumentQueueStatusTypeCodeNavigation { get; set; }

[ForeignKey("LeaseDocumentId")]
[InverseProperty("PimsDocumentQueues")]
public virtual PimsLeaseDocument LeaseDocument { get; set; }

[ForeignKey("PropertyActivityDocumentId")]
[InverseProperty("PimsDocumentQueues")]
public virtual PimsPropertyActivityDocument PropertyActivityDocument { get; set; }

[ForeignKey("ResearchFileDocumentId")]
[InverseProperty("PimsDocumentQueues")]
public virtual PimsResearchFileDocument ResearchFileDocument { get; set; }
}
19 changes: 19 additions & 0 deletions source/backend/entities/ef/PimsDocumentQueueHist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,29 @@ public partial class PimsDocumentQueueHist
[StringLength(20)]
public string DataSourceTypeCode { get; set; }

[Column("PROPERTY_ACTIVITY_DOCUMENT_ID")]
public long? PropertyActivityDocumentId { get; set; }

[Column("ACQUISITION_FILE_DOCUMENT_ID")]
public long? AcquisitionFileDocumentId { get; set; }

[Column("RESEARCH_FILE_DOCUMENT_ID")]
public long? ResearchFileDocumentId { get; set; }

[Column("LEASE_DOCUMENT_ID")]
public long? LeaseDocumentId { get; set; }

[Column("DISPOSITION_FILE_DOCUMENT_ID")]
public long? DispositionFileDocumentId { get; set; }

[Column("DOCUMENT_EXTERNAL_ID")]
[StringLength(1000)]
public string DocumentExternalId { get; set; }

[Column("DOCUMENT_METADATA")]
[StringLength(4000)]
public string DocumentMetadata { get; set; }

[Column("DOC_PROCESS_START_DT", TypeName = "datetime")]
public DateTime? DocProcessStartDt { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions source/backend/entities/ef/PimsLeaseDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@ public partial class PimsLeaseDocument
[ForeignKey("LeaseId")]
[InverseProperty("PimsLeaseDocuments")]
public virtual PimsLease Lease { get; set; }

[InverseProperty("LeaseDocument")]
public virtual ICollection<PimsDocumentQueue> PimsDocumentQueues { get; set; } = new List<PimsDocumentQueue>();
}
3 changes: 3 additions & 0 deletions source/backend/entities/ef/PimsPropertyActivityDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public partial class PimsPropertyActivityDocument
[InverseProperty("PimsPropertyActivityDocuments")]
public virtual PimsDocument Document { get; set; }

[InverseProperty("PropertyActivityDocument")]
public virtual ICollection<PimsDocumentQueue> PimsDocumentQueues { get; set; } = new List<PimsDocumentQueue>();

[ForeignKey("PimsPropertyActivityId")]
[InverseProperty("PimsPropertyActivityDocuments")]
public virtual PimsPropertyActivity PimsPropertyActivity { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions source/backend/entities/ef/PimsResearchFileDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public partial class PimsResearchFileDocument
[InverseProperty("PimsResearchFileDocuments")]
public virtual PimsDocument Document { get; set; }

[InverseProperty("ResearchFileDocument")]
public virtual ICollection<PimsDocumentQueue> PimsDocumentQueues { get; set; } = new List<PimsDocumentQueue>();

[ForeignKey("ResearchFileId")]
[InverseProperty("PimsResearchFileDocuments")]
public virtual PimsResearchFile ResearchFile { get; set; }
Expand Down
Loading