Skip to content

Commit

Permalink
scaffold (#4341)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Sep 17, 2024
1 parent d09e148 commit 7bfe273
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 3 deletions.
57 changes: 56 additions & 1 deletion source/backend/entities/PimsBaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public PimsBaseContext(DbContextOptions<PimsBaseContext> options)

public virtual DbSet<PimsCompensationRequisitionHist> PimsCompensationRequisitionHists { get; set; }

public virtual DbSet<PimsConsultationOutcomeType> PimsConsultationOutcomeTypes { get; set; }

public virtual DbSet<PimsConsultationStatusType> PimsConsultationStatusTypes { get; set; }

public virtual DbSet<PimsConsultationType> PimsConsultationTypes { get; set; }
Expand Down Expand Up @@ -462,6 +464,8 @@ public PimsBaseContext(DbContextOptions<PimsBaseContext> options)

public virtual DbSet<PimsPropertyAnomalyType> PimsPropertyAnomalyTypes { get; set; }

public virtual DbSet<PimsPropertyBoundaryLiteVw> PimsPropertyBoundaryLiteVws { get; set; }

public virtual DbSet<PimsPropertyBoundaryVw> PimsPropertyBoundaryVws { get; set; }

public virtual DbSet<PimsPropertyContact> PimsPropertyContacts { get; set; }
Expand All @@ -480,6 +484,8 @@ public PimsBaseContext(DbContextOptions<PimsBaseContext> options)

public virtual DbSet<PimsPropertyLeaseHist> PimsPropertyLeaseHists { get; set; }

public virtual DbSet<PimsPropertyLocationLiteVw> PimsPropertyLocationLiteVws { get; set; }

public virtual DbSet<PimsPropertyLocationVw> PimsPropertyLocationVws { get; set; }

public virtual DbSet<PimsPropertyOperation> PimsPropertyOperations { get; set; }
Expand Down Expand Up @@ -1698,6 +1704,38 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});

modelBuilder.Entity<PimsConsultationOutcomeType>(entity =>
{
entity.HasKey(e => e.ConsultationOutcomeTypeCode).HasName("OUTCMT_PK");

entity.ToTable("PIMS_CONSULTATION_OUTCOME_TYPE", tb =>
{
tb.HasComment("Description of the consultation outcome type for a lease or license.");
tb.HasTrigger("PIMS_OUTCMT_I_S_I_TR");
tb.HasTrigger("PIMS_OUTCMT_I_S_U_TR");
});

entity.Property(e => e.ConsultationOutcomeTypeCode).HasComment("Code value of the consultation outcome type.");
entity.Property(e => e.ConcurrencyControlNumber)
.HasDefaultValue(1L)
.HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
entity.Property(e => e.DbCreateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the record was created.");
entity.Property(e => e.DbCreateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created the record.");
entity.Property(e => e.DbLastUpdateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the record was created or last updated.");
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.Description).HasComment("Description of the consultation outcome type.");
entity.Property(e => e.DisplayOrder).HasComment("Onscreen display order of the code types.");
entity.Property(e => e.IsDisabled).HasComment("Indicates if the code type is active.");
});

modelBuilder.Entity<PimsConsultationStatusType>(entity =>
{
entity.HasKey(e => e.ConsultationStatusTypeCode).HasName("CONSTY_PK");
Expand Down Expand Up @@ -4345,6 +4383,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.ConcurrencyControlNumber)
.HasDefaultValue(1L)
.HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
entity.Property(e => e.ConsultationOutcomeTypeCode)
.HasDefaultValue("INPROGRESS")
.HasComment("Foreign key to the PIMS_CONSULTATION_OUTCOME_TYPE table.");
entity.Property(e => e.ConsultationStatusTypeCode)
.HasDefaultValue("UNKNOWN")
.HasComment("Foreign key to the PIMS_CONSULTATION_STATUS_TYPE table.");
Expand Down Expand Up @@ -4373,6 +4414,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.RequestedOn).HasComment("Date that the approval / consultation request was sent.");
entity.Property(e => e.ResponseReceivedDate).HasComment("Date that the consultation request response was received.");

entity.HasOne(d => d.ConsultationOutcomeTypeCodeNavigation).WithMany(p => p.PimsLeaseConsultations)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_OUTCMT_PIM_LESCON_FK");

entity.HasOne(d => d.ConsultationStatusTypeCodeNavigation).WithMany(p => p.PimsLeaseConsultations)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_CONSTY_PIM_LESCON_FK");
Expand Down Expand Up @@ -6845,6 +6890,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.IsDisabled).HasComment("Indicates if the code is disabled.");
});

modelBuilder.Entity<PimsPropertyBoundaryLiteVw>(entity =>
{
entity.ToView("PIMS_PROPERTY_BOUNDARY_LITE_VW");
});

modelBuilder.Entity<PimsPropertyBoundaryVw>(entity =>
{
entity.ToView("PIMS_PROPERTY_BOUNDARY_VW");
Expand Down Expand Up @@ -7019,6 +7069,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});

modelBuilder.Entity<PimsPropertyLocationLiteVw>(entity =>
{
entity.ToView("PIMS_PROPERTY_LOCATION_LITE_VW");
});

modelBuilder.Entity<PimsPropertyLocationVw>(entity =>
{
entity.ToView("PIMS_PROPERTY_LOCATION_VW");
Expand Down Expand Up @@ -7538,7 +7593,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)

modelBuilder.Entity<PimsResearchFileNote>(entity =>
{
entity.HasKey(e => new { e.ResearchFileNoteId, e.ResearchFileId }).HasName("RFLNOT_PK");
entity.HasKey(e => e.ResearchFileNoteId).HasName("RFLNOT_PK");

entity.ToTable("PIMS_RESEARCH_FILE_NOTE", tb =>
{
Expand Down
79 changes: 79 additions & 0 deletions source/backend/entities/ef/PimsConsultationOutcomeType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace Pims.Dal.Entities;

/// <summary>
/// Description of the consultation outcome type for a lease or license.
/// </summary>
[Table("PIMS_CONSULTATION_OUTCOME_TYPE")]
public partial class PimsConsultationOutcomeType
{
/// <summary>
/// Code value of the consultation outcome type.
/// </summary>
[Key]
[Column("CONSULTATION_OUTCOME_TYPE_CODE")]
[StringLength(20)]
public string ConsultationOutcomeTypeCode { get; set; }

/// <summary>
/// Description of the consultation outcome type.
/// </summary>
[Required]
[Column("DESCRIPTION")]
[StringLength(200)]
public string Description { get; set; }

/// <summary>
/// Onscreen display order of the code types.
/// </summary>
[Column("DISPLAY_ORDER")]
public int? DisplayOrder { get; set; }

/// <summary>
/// Indicates if the code type is active.
/// </summary>
[Column("IS_DISABLED")]
public bool IsDisabled { get; set; }

/// <summary>
/// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
/// </summary>
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }

/// <summary>
/// The date and time the record was created.
/// </summary>
[Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
public DateTime DbCreateTimestamp { get; set; }

/// <summary>
/// The user or proxy account that created the record.
/// </summary>
[Required]
[Column("DB_CREATE_USERID")]
[StringLength(30)]
public string DbCreateUserid { get; set; }

/// <summary>
/// The date and time the record was created or last updated.
/// </summary>
[Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
public DateTime DbLastUpdateTimestamp { get; set; }

/// <summary>
/// The user or proxy account that created or last updated the record.
/// </summary>
[Required]
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }

[InverseProperty("ConsultationOutcomeTypeCodeNavigation")]
public virtual ICollection<PimsLeaseConsultation> PimsLeaseConsultations { get; set; } = new List<PimsLeaseConsultation>();
}
13 changes: 13 additions & 0 deletions source/backend/entities/ef/PimsLeaseConsultation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Pims.Dal.Entities;

[Table("PIMS_LEASE_CONSULTATION")]
[Index("ConsultationOutcomeTypeCode", Name = "LESCON_CONSULTATION_OUTCOME_TYPE_CODE_IDX")]
[Index("ConsultationStatusTypeCode", Name = "LESCON_CONSULTATION_STATUS_TYPE_CODE_IDX")]
[Index("ConsultationTypeCode", Name = "LESCON_CONSULTATION_TYPE_CODE_IDX")]
[Index("LeaseId", Name = "LESCON_LEASE_ID_IDX")]
Expand Down Expand Up @@ -62,6 +63,14 @@ public partial class PimsLeaseConsultation
[StringLength(20)]
public string ConsultationStatusTypeCode { get; set; }

/// <summary>
/// Foreign key to the PIMS_CONSULTATION_OUTCOME_TYPE table.
/// </summary>
[Required]
[Column("CONSULTATION_OUTCOME_TYPE_CODE")]
[StringLength(20)]
public string ConsultationOutcomeTypeCode { get; set; }

/// <summary>
/// Description for the approval / consultation when &quot;Other&quot; consultation type is selected.
/// </summary>
Expand Down Expand Up @@ -189,6 +198,10 @@ public partial class PimsLeaseConsultation
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }

[ForeignKey("ConsultationOutcomeTypeCode")]
[InverseProperty("PimsLeaseConsultations")]
public virtual PimsConsultationOutcomeType ConsultationOutcomeTypeCodeNavigation { get; set; }

[ForeignKey("ConsultationStatusTypeCode")]
[InverseProperty("PimsLeaseConsultations")]
public virtual PimsConsultationStatusType ConsultationStatusTypeCodeNavigation { get; set; }
Expand Down
5 changes: 5 additions & 0 deletions source/backend/entities/ef/PimsLeaseConsultationHist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public partial class PimsLeaseConsultationHist
[StringLength(20)]
public string ConsultationStatusTypeCode { get; set; }

[Required]
[Column("CONSULTATION_OUTCOME_TYPE_CODE")]
[StringLength(20)]
public string ConsultationOutcomeTypeCode { get; set; }

[Column("OTHER_DESCRIPTION")]
[StringLength(2000)]
public string OtherDescription { get; set; }
Expand Down
36 changes: 36 additions & 0 deletions source/backend/entities/ef/PimsPropertyBoundaryLiteVw.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using NetTopologySuite.Geometries;

namespace Pims.Dal.Entities;

[Keyless]
public partial class PimsPropertyBoundaryLiteVw
{
[Column("PROPERTY_ID")]
public long PropertyId { get; set; }

[Column("GEOMETRY", TypeName = "geometry")]
public Geometry Geometry { get; set; }

[Column("IS_OWNED")]
public bool IsOwned { get; set; }

[Column("IS_RETIRED")]
public bool? IsRetired { get; set; }

[Column("IS_OTHER_INTEREST")]
public bool? IsOtherInterest { get; set; }

[Column("IS_DISPOSED")]
public bool? IsDisposed { get; set; }

[Column("HAS_ACTIVE_ACQUISITION_FILE")]
public bool? HasActiveAcquisitionFile { get; set; }

[Column("HAS_ACTIVE_RESEARCH_FILE")]
public bool? HasActiveResearchFile { get; set; }
}
36 changes: 36 additions & 0 deletions source/backend/entities/ef/PimsPropertyLocationLiteVw.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using NetTopologySuite.Geometries;

namespace Pims.Dal.Entities;

[Keyless]
public partial class PimsPropertyLocationLiteVw
{
[Column("PROPERTY_ID")]
public long PropertyId { get; set; }

[Column("GEOMETRY", TypeName = "geometry")]
public Geometry Geometry { get; set; }

[Column("IS_OWNED")]
public bool IsOwned { get; set; }

[Column("IS_RETIRED")]
public bool? IsRetired { get; set; }

[Column("IS_OTHER_INTEREST")]
public bool? IsOtherInterest { get; set; }

[Column("IS_DISPOSED")]
public bool? IsDisposed { get; set; }

[Column("HAS_ACTIVE_ACQUISITION_FILE")]
public bool? HasActiveAcquisitionFile { get; set; }

[Column("HAS_ACTIVE_RESEARCH_FILE")]
public bool? HasActiveResearchFile { get; set; }
}
2 changes: 0 additions & 2 deletions source/backend/entities/ef/PimsResearchFileNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Pims.Dal.Entities;
/// <summary>
/// Defines the relationship betwwen a research file and a note.
/// </summary>
[PrimaryKey("ResearchFileNoteId", "ResearchFileId")]
[Table("PIMS_RESEARCH_FILE_NOTE")]
[Index("NoteId", Name = "RFLNOT_NOTE_ID_IDX")]
[Index("ResearchFileId", Name = "RFLNOT_RESEARCH_FILE_ID_IDX")]
Expand All @@ -20,7 +19,6 @@ public partial class PimsResearchFileNote
[Column("RESEARCH_FILE_NOTE_ID")]
public long ResearchFileNoteId { get; set; }

[Key]
[Column("RESEARCH_FILE_ID")]
public long ResearchFileId { get; set; }

Expand Down

0 comments on commit 7bfe273

Please sign in to comment.