From cfb8920f94c44e2c3dc90a6992698c96c5b69870 Mon Sep 17 00:00:00 2001 From: Manuel Rodriguez Date: Mon, 27 May 2024 23:05:09 -0700 Subject: [PATCH] Generated scaffold for s81 (#4047) --- source/backend/entities/PimsBaseContext.cs | 222 +++++++++++++++++- .../entities/ef/PimsHistoricalFileNumber.cs | 1 + source/backend/entities/ef/PimsLease.cs | 35 ++- .../entities/ef/PimsLeaseChecklistItem.cs | 149 ++++++++++++ .../entities/ef/PimsLeaseChecklistItemHist.cs | 89 +++++++ .../ef/PimsLeaseChklstItemStatusType.cs | 79 +++++++ .../entities/ef/PimsLeaseChklstItemType.cs | 117 +++++++++ .../entities/ef/PimsLeaseChklstSectionType.cs | 91 +++++++ 8 files changed, 778 insertions(+), 5 deletions(-) create mode 100644 source/backend/entities/ef/PimsLeaseChecklistItem.cs create mode 100644 source/backend/entities/ef/PimsLeaseChecklistItemHist.cs create mode 100644 source/backend/entities/ef/PimsLeaseChklstItemStatusType.cs create mode 100644 source/backend/entities/ef/PimsLeaseChklstItemType.cs create mode 100644 source/backend/entities/ef/PimsLeaseChklstSectionType.cs diff --git a/source/backend/entities/PimsBaseContext.cs b/source/backend/entities/PimsBaseContext.cs index 0306a2e126..ad83de8391 100644 --- a/source/backend/entities/PimsBaseContext.cs +++ b/source/backend/entities/PimsBaseContext.cs @@ -266,6 +266,16 @@ public PimsBaseContext(DbContextOptions options) public virtual DbSet PimsLeaseCategoryTypes { get; set; } + public virtual DbSet PimsLeaseChecklistItems { get; set; } + + public virtual DbSet PimsLeaseChecklistItemHists { get; set; } + + public virtual DbSet PimsLeaseChklstItemStatusTypes { get; set; } + + public virtual DbSet PimsLeaseChklstItemTypes { get; set; } + + public virtual DbSet PimsLeaseChklstSectionTypes { get; set; } + public virtual DbSet PimsLeaseConsultations { get; set; } public virtual DbSet PimsLeaseConsultationHists { get; set; } @@ -4033,7 +4043,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) tb.HasTrigger("PIMS_LEASE_I_S_U_TR"); }); - entity.Property(e => e.LeaseId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_ID_SEQ])"); + entity.Property(e => e.LeaseId) + .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_ID_SEQ])") + .HasComment("Generated surrogate primary key."); entity.Property(e => e.AppCreateTimestamp) .HasDefaultValueSql("(getutcdate())") .HasComment("The date and time the user created the record."); @@ -4090,18 +4102,26 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.LFileNo).HasComment("Generated identifying lease/licence number"); entity.Property(e => e.LeaseAmount).HasComment("Lease/licence amount"); entity.Property(e => e.LeaseCategoryOtherDesc).HasComment("User-specified lease category description not included in standard set of lease purposes"); + entity.Property(e => e.LeaseCategoryTypeCode).HasComment("Foreign key to the PIMS_LEASE_CATEGORY_TYPE table."); entity.Property(e => e.LeaseDescription).HasComment("Manually etered lease description, not the legal description"); + entity.Property(e => e.LeaseInitiatorTypeCode).HasComment("Foreign key to the PIMS_LEASE_INITIATOR_TYPE table."); + entity.Property(e => e.LeaseLicenseTypeCode).HasComment("Foreign key to the PIMS_LEASE_LICENSE_TYPE table."); entity.Property(e => e.LeaseNotes).HasComment("Notes accompanying lease"); + entity.Property(e => e.LeasePayRvblTypeCode).HasComment("Foreign key to the PIMS_LEASE_PAY_RVBL_TYPE table."); + entity.Property(e => e.LeaseProgramTypeCode).HasComment("Foreign key to the PIMS_LEASE_PROGRAM_TYPE table."); entity.Property(e => e.LeasePurposeOtherDesc).HasComment("User-specified lease purpose description not included in standard set of lease purposes"); + entity.Property(e => e.LeasePurposeTypeCode).HasComment("Foreign key to the PIMS_LEASE_PURPOSE_TYPE table."); + entity.Property(e => e.LeaseResponsibilityTypeCode).HasComment("Foreign key to the PIMS_LEASE_RESPONSIBILITY_TYPE table."); + entity.Property(e => e.LeaseStatusTypeCode).HasComment("Foreign key to the PIMS_LEASE_STATUS_TYPE table."); entity.Property(e => e.MotiContact).HasComment("Contact of the MoTI person associated with the lease"); entity.Property(e => e.OrigExpiryDate).HasComment("Original expiry date of the lease/license"); entity.Property(e => e.OrigStartDate).HasComment("Original start date of the lease/license"); entity.Property(e => e.OtherLeaseLicenseType).HasComment("Description of a non-standard lease/license type"); entity.Property(e => e.OtherLeaseProgramType).HasComment("Description of a non-standard lease program type"); entity.Property(e => e.OtherLeasePurposeType).HasComment("Description of a non-standard lease purpose type"); - entity.Property(e => e.ProjectId).HasComment("Project associated with this lease."); + entity.Property(e => e.ProjectId).HasComment("Foreign key to the PIMS_PROJECT table."); entity.Property(e => e.PsFileNo).HasComment("Sourced from t_fileSubOverrideData.PSFile_No"); - entity.Property(e => e.RegionCode).HasComment("MoTI region associated with the lease"); + entity.Property(e => e.RegionCode).HasComment("Foreign key to the PIMS_REGION table."); entity.Property(e => e.ResponsibilityEffectiveDate).HasComment("Date current responsibility came into effect for this lease"); entity.Property(e => e.ReturnNotes).HasComment("Notes accompanying lease"); entity.Property(e => e.TerminationReason).HasComment("Reason for the termination of the lease. For example, \"The tenant is in violation of the terms of the agreement.\""); @@ -4156,6 +4176,196 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())"); }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LeaseChecklistItemId).HasName("LCHKLI_PK"); + + entity.ToTable("PIMS_LEASE_CHECKLIST_ITEM", tb => + { + tb.HasComment("Table that contains the lease & license checklist items."); + tb.HasTrigger("PIMS_LCHKLI_A_S_IUD_TR"); + tb.HasTrigger("PIMS_LCHKLI_I_S_I_TR"); + tb.HasTrigger("PIMS_LCHKLI_I_S_U_TR"); + }); + + entity.Property(e => e.LeaseChecklistItemId) + .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_CHECKLIST_ITEM_ID_SEQ])") + .HasComment("Generated surrogate primary key"); + entity.Property(e => e.AppCreateTimestamp) + .HasDefaultValueSql("(getutcdate())") + .HasComment("The date and time the user created the record."); + entity.Property(e => e.AppCreateUserDirectory) + .HasDefaultValueSql("(user_name())") + .HasComment("The directory of the user account that created the record."); + entity.Property(e => e.AppCreateUserGuid).HasComment("The GUID of the user account that created the record."); + entity.Property(e => e.AppCreateUserid) + .HasDefaultValueSql("(user_name())") + .HasComment("The user account that created the record."); + entity.Property(e => e.AppLastUpdateTimestamp) + .HasDefaultValueSql("(getutcdate())") + .HasComment("The date and time the user updated the record."); + entity.Property(e => e.AppLastUpdateUserDirectory) + .HasDefaultValueSql("(user_name())") + .HasComment("The directory of the user account that updated the record."); + entity.Property(e => e.AppLastUpdateUserGuid).HasComment("The GUID of the user account that updated the record."); + entity.Property(e => e.AppLastUpdateUserid) + .HasDefaultValueSql("(user_name())") + .HasComment("The user account that updated the record."); + 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.LeaseChklstItemStatusTypeCode) + .HasDefaultValue("INCOMP") + .HasComment("Foreign key to the PIMS_LEASE_CHKLST_ITEM_STATUS_TYPE table."); + entity.Property(e => e.LeaseChklstItemTypeCode).HasComment("Foreign key to the PIMS_LEASE_CHKLST_ITEM_TYPE table."); + entity.Property(e => e.LeaseId).HasComment("Foreign key to the PIMS_LEASE table."); + + entity.HasOne(d => d.LeaseChklstItemStatusTypeCodeNavigation).WithMany(p => p.PimsLeaseChecklistItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("PIM_LCISTY_PIM_LCHKLI_FK"); + + entity.HasOne(d => d.LeaseChklstItemTypeCodeNavigation).WithMany(p => p.PimsLeaseChecklistItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("PIM_LCKITY_PIM_LCHKLI_FK"); + + entity.HasOne(d => d.Lease).WithMany(p => p.PimsLeaseChecklistItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("PIM_LEASE_PIM_LCHKLI_FK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LeaseChecklistItemHistId).HasName("PIMS_LCHKLI_H_PK"); + + entity.Property(e => e.LeaseChecklistItemHistId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_CHECKLIST_ITEM_H_ID_SEQ])"); + entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LeaseChklstItemStatusTypeCode).HasName("LCISTY_PK"); + + entity.ToTable("PIMS_LEASE_CHKLST_ITEM_STATUS_TYPE", tb => + { + tb.HasComment("Tables that contains the codes and associated descriptions of the lease & license checklist item status types."); + tb.HasTrigger("PIMS_LCISTY_I_S_I_TR"); + tb.HasTrigger("PIMS_LCISTY_I_S_U_TR"); + }); + + entity.Property(e => e.LeaseChklstItemStatusTypeCode).HasComment("Codified version of the lease & license checklist item status 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 lease & license checklist item status type."); + entity.Property(e => e.DisplayOrder).HasComment("Display order of the codes."); + entity.Property(e => e.IsDisabled).HasComment("Indicates if the code value is inactive."); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LeaseChklstItemTypeCode).HasName("LCKITY_PK"); + + entity.ToTable("PIMS_LEASE_CHKLST_ITEM_TYPE", tb => + { + tb.HasComment("Table that contains the lease & license checklist items that are presented to the user through dynamically building the input form."); + tb.HasTrigger("PIMS_LCKITY_I_S_I_TR"); + tb.HasTrigger("PIMS_LCKITY_I_S_U_TR"); + }); + + entity.Property(e => e.LeaseChklstItemTypeCode).HasComment("Lease & license checklist item code value."); + 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("Lease & license checklist item descriptive text presented to the user."); + entity.Property(e => e.DisplayOrder).HasComment("Specifies the order that the lease & license checklist items are presented to the user."); + entity.Property(e => e.EffectiveDate) + .HasDefaultValueSql("(getutcdate())") + .HasComment("Date the lease & license checklist item is able to be presented to the user via the input form."); + entity.Property(e => e.ExpiryDate).HasComment("Date the lease & license checklist item is removed from the input form."); + entity.Property(e => e.Hint).HasComment("Lease & license checklist item descriptive tooltip presented to the user."); + entity.Property(e => e.IsDisabled).HasComment("Indicates if the code is currently active."); + entity.Property(e => e.IsRequired) + .HasDefaultValue(false) + .HasComment("Indicates if the lease & license checklist item is a required field."); + entity.Property(e => e.LeaseChklstSectionTypeCode).HasComment("Foreign key to the PIMS_LEASE_CHKLST_SECTION_TYPE table."); + + entity.HasOne(d => d.LeaseChklstSectionTypeCodeNavigation).WithMany(p => p.PimsLeaseChklstItemTypes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("PIM_LCKSTY_PIM_LCKITY_FK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LeaseChklstSectionTypeCode).HasName("LCKSTY_PK"); + + entity.ToTable("PIMS_LEASE_CHKLST_SECTION_TYPE", tb => + { + tb.HasComment("Table that contains the lease & license checklist sctions that are presented to the user through dynamically building the input form."); + tb.HasTrigger("PIMS_LCKSTY_I_S_I_TR"); + tb.HasTrigger("PIMS_LCKSTY_I_S_U_TR"); + }); + + entity.Property(e => e.LeaseChklstSectionTypeCode).HasComment("Lease & license checklist section code value."); + 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("Lease & license checklist section descriptive text presented to the user."); + entity.Property(e => e.DisplayOrder).HasComment("Specifies the order that the lease & license checklist sections are presented to the user."); + entity.Property(e => e.EffectiveDate) + .HasDefaultValueSql("(getutcdate())") + .HasComment("Date the lease & license checklist section is able to be presented to the user via the input form."); + entity.Property(e => e.ExpiryDate).HasComment("Date the lease & license checklist section is removed from the input form."); + entity.Property(e => e.IsDisabled).HasComment("Indicates if the code is currently active."); + }); + modelBuilder.Entity(entity => { entity.HasKey(e => e.LeaseConsultationId).HasName("LESCON_PK"); @@ -8191,6 +8401,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.HasSequence("PIMS_LEASE_ACTIVITY_PERIOD_ID_SEQ") .HasMin(1L) .HasMax(2147483647L); + modelBuilder.HasSequence("PIMS_LEASE_CHECKLIST_ITEM_H_ID_SEQ") + .HasMin(1L) + .HasMax(2147483647L); + modelBuilder.HasSequence("PIMS_LEASE_CHECKLIST_ITEM_ID_SEQ") + .HasMin(1L) + .HasMax(2147483647L); modelBuilder.HasSequence("PIMS_LEASE_CONSULTATION_H_ID_SEQ") .HasMin(1L) .HasMax(2147483647L); diff --git a/source/backend/entities/ef/PimsHistoricalFileNumber.cs b/source/backend/entities/ef/PimsHistoricalFileNumber.cs index 131f1cd0b9..388ccd57bf 100644 --- a/source/backend/entities/ef/PimsHistoricalFileNumber.cs +++ b/source/backend/entities/ef/PimsHistoricalFileNumber.cs @@ -13,6 +13,7 @@ namespace Pims.Dal.Entities; [Index("DataSourceTypeCode", Name = "HFLNUM_DATA_SOURCE_TYPE_CODE_IDX")] [Index("HistoricalFileNumber", Name = "HFLNUM_HISTORICAL_FILE_NUMBER_IDX")] [Index("PropertyId", Name = "HFLNUM_PROPERTY_ID_IDX")] +[Index("PropertyId", "HistoricalFileNumberTypeCode", "HistoricalFileNumber", "OtherHistFileNumberTypeCode", "IsDisabled", Name = "HFLNUM_PROPERTY_ID_UK", IsUnique = true)] public partial class PimsHistoricalFileNumber { /// diff --git a/source/backend/entities/ef/PimsLease.cs b/source/backend/entities/ef/PimsLease.cs index 71dda730d8..337e5dc4fb 100644 --- a/source/backend/entities/ef/PimsLease.cs +++ b/source/backend/entities/ef/PimsLease.cs @@ -19,61 +19,89 @@ namespace Pims.Dal.Entities; [Index("LeaseResponsibilityTypeCode", Name = "LEASE_LEASE_RESPONSIBILITY_TYPE_CODE_IDX")] [Index("LeaseStatusTypeCode", Name = "LEASE_LEASE_STATUS_TYPE_CODE_IDX")] [Index("LFileNo", Name = "LEASE_L_FILE_NO_IDX")] +[Index("ProjectId", Name = "LEASE_PROJECT_ID_IDX")] [Index("PsFileNo", Name = "LEASE_PS_FILE_NO_IDX")] [Index("RegionCode", Name = "LEASE_REGION_CODE_IDX")] [Index("TfaFileNo", Name = "LEASE_TFA_FILE_NO_IDX")] [Index("TfaFileNumber", Name = "LEASE_TFA_FILE_NUMBER_IDX")] public partial class PimsLease { + /// + /// Generated surrogate primary key. + /// [Key] [Column("LEASE_ID")] public long LeaseId { get; set; } + /// + /// Foreign key to the PIMS_LEASE_PAY_RVBL_TYPE table. + /// [Required] [Column("LEASE_PAY_RVBL_TYPE_CODE")] [StringLength(20)] public string LeasePayRvblTypeCode { get; set; } + /// + /// Foreign key to the PIMS_LEASE_LICENSE_TYPE table. + /// [Required] [Column("LEASE_LICENSE_TYPE_CODE")] [StringLength(20)] public string LeaseLicenseTypeCode { get; set; } + /// + /// Foreign key to the PIMS_LEASE_CATEGORY_TYPE table. + /// [Column("LEASE_CATEGORY_TYPE_CODE")] [StringLength(20)] public string LeaseCategoryTypeCode { get; set; } + /// + /// Foreign key to the PIMS_LEASE_PURPOSE_TYPE table. + /// [Required] [Column("LEASE_PURPOSE_TYPE_CODE")] [StringLength(20)] public string LeasePurposeTypeCode { get; set; } + /// + /// Foreign key to the PIMS_LEASE_PROGRAM_TYPE table. + /// [Required] [Column("LEASE_PROGRAM_TYPE_CODE")] [StringLength(20)] public string LeaseProgramTypeCode { get; set; } + /// + /// Foreign key to the PIMS_LEASE_INITIATOR_TYPE table. + /// [Column("LEASE_INITIATOR_TYPE_CODE")] [StringLength(20)] public string LeaseInitiatorTypeCode { get; set; } + /// + /// Foreign key to the PIMS_LEASE_RESPONSIBILITY_TYPE table. + /// [Column("LEASE_RESPONSIBILITY_TYPE_CODE")] [StringLength(20)] public string LeaseResponsibilityTypeCode { get; set; } + /// + /// Foreign key to the PIMS_LEASE_STATUS_TYPE table. + /// [Required] [Column("LEASE_STATUS_TYPE_CODE")] [StringLength(20)] public string LeaseStatusTypeCode { get; set; } /// - /// MoTI region associated with the lease + /// Foreign key to the PIMS_REGION table. /// [Column("REGION_CODE")] public short? RegionCode { get; set; } /// - /// Project associated with this lease. + /// Foreign key to the PIMS_PROJECT table. /// [Column("PROJECT_ID")] public long? ProjectId { get; set; } @@ -395,6 +423,9 @@ public partial class PimsLease [InverseProperty("Lease")] public virtual ICollection PimsInsurances { get; set; } = new List(); + [InverseProperty("Lease")] + public virtual ICollection PimsLeaseChecklistItems { get; set; } = new List(); + [InverseProperty("Lease")] public virtual ICollection PimsLeaseConsultations { get; set; } = new List(); diff --git a/source/backend/entities/ef/PimsLeaseChecklistItem.cs b/source/backend/entities/ef/PimsLeaseChecklistItem.cs new file mode 100644 index 0000000000..2a4c30765f --- /dev/null +++ b/source/backend/entities/ef/PimsLeaseChecklistItem.cs @@ -0,0 +1,149 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; + +namespace Pims.Dal.Entities; + +/// +/// Table that contains the lease & license checklist items. +/// +[Table("PIMS_LEASE_CHECKLIST_ITEM")] +[Index("LeaseChklstItemStatusTypeCode", Name = "LCHKLI_LEASE_CHKLST_ITEM_STATUS_TYPE_CODE_IDX")] +[Index("LeaseChklstItemTypeCode", Name = "LCHKLI_LEASE_CHKLST_ITEM_TYPE_CODE_IDX")] +[Index("LeaseId", Name = "LCHKLI_LEASE_ID_IDX")] +[Index("LeaseId", "LeaseChklstItemTypeCode", Name = "LCHKLI_LEASE_ID_UK", IsUnique = true)] +public partial class PimsLeaseChecklistItem +{ + /// + /// Generated surrogate primary key + /// + [Key] + [Column("LEASE_CHECKLIST_ITEM_ID")] + public long LeaseChecklistItemId { get; set; } + + /// + /// Foreign key to the PIMS_LEASE table. + /// + [Column("LEASE_ID")] + public long LeaseId { get; set; } + + /// + /// Foreign key to the PIMS_LEASE_CHKLST_ITEM_TYPE table. + /// + [Required] + [Column("LEASE_CHKLST_ITEM_TYPE_CODE")] + [StringLength(20)] + public string LeaseChklstItemTypeCode { get; set; } + + /// + /// Foreign key to the PIMS_LEASE_CHKLST_ITEM_STATUS_TYPE table. + /// + [Required] + [Column("LEASE_CHKLST_ITEM_STATUS_TYPE_CODE")] + [StringLength(20)] + public string LeaseChklstItemStatusTypeCode { get; set; } + + /// + /// 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 + /// + [Column("CONCURRENCY_CONTROL_NUMBER")] + public long ConcurrencyControlNumber { get; set; } + + /// + /// The date and time the user created the record. + /// + [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")] + public DateTime AppCreateTimestamp { get; set; } + + /// + /// The user account that created the record. + /// + [Required] + [Column("APP_CREATE_USERID")] + [StringLength(30)] + public string AppCreateUserid { get; set; } + + /// + /// The GUID of the user account that created the record. + /// + [Column("APP_CREATE_USER_GUID")] + public Guid? AppCreateUserGuid { get; set; } + + /// + /// The directory of the user account that created the record. + /// + [Required] + [Column("APP_CREATE_USER_DIRECTORY")] + [StringLength(30)] + public string AppCreateUserDirectory { get; set; } + + /// + /// The date and time the user updated the record. + /// + [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")] + public DateTime AppLastUpdateTimestamp { get; set; } + + /// + /// The user account that updated the record. + /// + [Required] + [Column("APP_LAST_UPDATE_USERID")] + [StringLength(30)] + public string AppLastUpdateUserid { get; set; } + + /// + /// The GUID of the user account that updated the record. + /// + [Column("APP_LAST_UPDATE_USER_GUID")] + public Guid? AppLastUpdateUserGuid { get; set; } + + /// + /// The directory of the user account that updated the record. + /// + [Required] + [Column("APP_LAST_UPDATE_USER_DIRECTORY")] + [StringLength(30)] + public string AppLastUpdateUserDirectory { get; set; } + + /// + /// The date and time the record was created. + /// + [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbCreateTimestamp { get; set; } + + /// + /// The user or proxy account that created the record. + /// + [Required] + [Column("DB_CREATE_USERID")] + [StringLength(30)] + public string DbCreateUserid { get; set; } + + /// + /// The date and time the record was created or last updated. + /// + [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbLastUpdateTimestamp { get; set; } + + /// + /// The user or proxy account that created or last updated the record. + /// + [Required] + [Column("DB_LAST_UPDATE_USERID")] + [StringLength(30)] + public string DbLastUpdateUserid { get; set; } + + [ForeignKey("LeaseId")] + [InverseProperty("PimsLeaseChecklistItems")] + public virtual PimsLease Lease { get; set; } + + [ForeignKey("LeaseChklstItemStatusTypeCode")] + [InverseProperty("PimsLeaseChecklistItems")] + public virtual PimsLeaseChklstItemStatusType LeaseChklstItemStatusTypeCodeNavigation { get; set; } + + [ForeignKey("LeaseChklstItemTypeCode")] + [InverseProperty("PimsLeaseChecklistItems")] + public virtual PimsLeaseChklstItemType LeaseChklstItemTypeCodeNavigation { get; set; } +} diff --git a/source/backend/entities/ef/PimsLeaseChecklistItemHist.cs b/source/backend/entities/ef/PimsLeaseChecklistItemHist.cs new file mode 100644 index 0000000000..43d84d43ca --- /dev/null +++ b/source/backend/entities/ef/PimsLeaseChecklistItemHist.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; + +namespace Pims.Dal.Entities; + +[Table("PIMS_LEASE_CHECKLIST_ITEM_HIST")] +[Index("LeaseChecklistItemHistId", "EndDateHist", Name = "PIMS_LCHKLI_H_UK", IsUnique = true)] +public partial class PimsLeaseChecklistItemHist +{ + [Key] + [Column("_LEASE_CHECKLIST_ITEM_HIST_ID")] + public long LeaseChecklistItemHistId { get; set; } + + [Column("EFFECTIVE_DATE_HIST", TypeName = "datetime")] + public DateTime EffectiveDateHist { get; set; } + + [Column("END_DATE_HIST", TypeName = "datetime")] + public DateTime? EndDateHist { get; set; } + + [Column("LEASE_CHECKLIST_ITEM_ID")] + public long LeaseChecklistItemId { get; set; } + + [Column("LEASE_ID")] + public long LeaseId { get; set; } + + [Required] + [Column("LEASE_CHKLST_ITEM_TYPE_CODE")] + [StringLength(20)] + public string LeaseChklstItemTypeCode { get; set; } + + [Required] + [Column("LEASE_CHKLST_ITEM_STATUS_TYPE_CODE")] + [StringLength(20)] + public string LeaseChklstItemStatusTypeCode { get; set; } + + [Column("CONCURRENCY_CONTROL_NUMBER")] + public long ConcurrencyControlNumber { get; set; } + + [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")] + public DateTime AppCreateTimestamp { get; set; } + + [Required] + [Column("APP_CREATE_USERID")] + [StringLength(30)] + public string AppCreateUserid { get; set; } + + [Column("APP_CREATE_USER_GUID")] + public Guid? AppCreateUserGuid { get; set; } + + [Required] + [Column("APP_CREATE_USER_DIRECTORY")] + [StringLength(30)] + public string AppCreateUserDirectory { get; set; } + + [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")] + public DateTime AppLastUpdateTimestamp { get; set; } + + [Required] + [Column("APP_LAST_UPDATE_USERID")] + [StringLength(30)] + public string AppLastUpdateUserid { get; set; } + + [Column("APP_LAST_UPDATE_USER_GUID")] + public Guid? AppLastUpdateUserGuid { get; set; } + + [Required] + [Column("APP_LAST_UPDATE_USER_DIRECTORY")] + [StringLength(30)] + public string AppLastUpdateUserDirectory { get; set; } + + [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbCreateTimestamp { get; set; } + + [Required] + [Column("DB_CREATE_USERID")] + [StringLength(30)] + public string DbCreateUserid { get; set; } + + [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbLastUpdateTimestamp { get; set; } + + [Required] + [Column("DB_LAST_UPDATE_USERID")] + [StringLength(30)] + public string DbLastUpdateUserid { get; set; } +} diff --git a/source/backend/entities/ef/PimsLeaseChklstItemStatusType.cs b/source/backend/entities/ef/PimsLeaseChklstItemStatusType.cs new file mode 100644 index 0000000000..0712a450ae --- /dev/null +++ b/source/backend/entities/ef/PimsLeaseChklstItemStatusType.cs @@ -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; + +/// +/// Tables that contains the codes and associated descriptions of the lease & license checklist item status types. +/// +[Table("PIMS_LEASE_CHKLST_ITEM_STATUS_TYPE")] +public partial class PimsLeaseChklstItemStatusType +{ + /// + /// Codified version of the lease & license checklist item status type. + /// + [Key] + [Column("LEASE_CHKLST_ITEM_STATUS_TYPE_CODE")] + [StringLength(20)] + public string LeaseChklstItemStatusTypeCode { get; set; } + + /// + /// Description of the lease & license checklist item status type. + /// + [Required] + [Column("DESCRIPTION")] + [StringLength(200)] + public string Description { get; set; } + + /// + /// Display order of the codes. + /// + [Column("DISPLAY_ORDER")] + public int? DisplayOrder { get; set; } + + /// + /// Indicates if the code value is inactive. + /// + [Column("IS_DISABLED")] + public bool IsDisabled { get; set; } + + /// + /// 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 + /// + [Column("CONCURRENCY_CONTROL_NUMBER")] + public long ConcurrencyControlNumber { get; set; } + + /// + /// The date and time the record was created. + /// + [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbCreateTimestamp { get; set; } + + /// + /// The user or proxy account that created the record. + /// + [Required] + [Column("DB_CREATE_USERID")] + [StringLength(30)] + public string DbCreateUserid { get; set; } + + /// + /// The date and time the record was created or last updated. + /// + [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbLastUpdateTimestamp { get; set; } + + /// + /// The user or proxy account that created or last updated the record. + /// + [Required] + [Column("DB_LAST_UPDATE_USERID")] + [StringLength(30)] + public string DbLastUpdateUserid { get; set; } + + [InverseProperty("LeaseChklstItemStatusTypeCodeNavigation")] + public virtual ICollection PimsLeaseChecklistItems { get; set; } = new List(); +} diff --git a/source/backend/entities/ef/PimsLeaseChklstItemType.cs b/source/backend/entities/ef/PimsLeaseChklstItemType.cs new file mode 100644 index 0000000000..5dc5a4df3f --- /dev/null +++ b/source/backend/entities/ef/PimsLeaseChklstItemType.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; + +namespace Pims.Dal.Entities; + +/// +/// Table that contains the lease & license checklist items that are presented to the user through dynamically building the input form. +/// +[Table("PIMS_LEASE_CHKLST_ITEM_TYPE")] +[Index("LeaseChklstSectionTypeCode", Name = "LCKITY_LEASE_CHKLST_SECTION_TYPE_CODE_IDX")] +public partial class PimsLeaseChklstItemType +{ + /// + /// Lease & license checklist item code value. + /// + [Key] + [Column("LEASE_CHKLST_ITEM_TYPE_CODE")] + [StringLength(20)] + public string LeaseChklstItemTypeCode { get; set; } + + /// + /// Foreign key to the PIMS_LEASE_CHKLST_SECTION_TYPE table. + /// + [Required] + [Column("LEASE_CHKLST_SECTION_TYPE_CODE")] + [StringLength(20)] + public string LeaseChklstSectionTypeCode { get; set; } + + /// + /// Lease & license checklist item descriptive text presented to the user. + /// + [Required] + [Column("DESCRIPTION")] + [StringLength(200)] + public string Description { get; set; } + + /// + /// Lease & license checklist item descriptive tooltip presented to the user. + /// + [Column("HINT")] + [StringLength(200)] + public string Hint { get; set; } + + /// + /// Indicates if the lease & license checklist item is a required field. + /// + [Column("IS_REQUIRED")] + public bool? IsRequired { get; set; } + + /// + /// Specifies the order that the lease & license checklist items are presented to the user. + /// + [Column("DISPLAY_ORDER")] + public int? DisplayOrder { get; set; } + + /// + /// Date the lease & license checklist item is able to be presented to the user via the input form. + /// + [Column("EFFECTIVE_DATE")] + public DateOnly EffectiveDate { get; set; } + + /// + /// Date the lease & license checklist item is removed from the input form. + /// + [Column("EXPIRY_DATE")] + public DateOnly? ExpiryDate { get; set; } + + /// + /// Indicates if the code is currently active. + /// + [Column("IS_DISABLED")] + public bool IsDisabled { get; set; } + + /// + /// 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 + /// + [Column("CONCURRENCY_CONTROL_NUMBER")] + public long ConcurrencyControlNumber { get; set; } + + /// + /// The date and time the record was created. + /// + [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbCreateTimestamp { get; set; } + + /// + /// The user or proxy account that created the record. + /// + [Required] + [Column("DB_CREATE_USERID")] + [StringLength(30)] + public string DbCreateUserid { get; set; } + + /// + /// The date and time the record was created or last updated. + /// + [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbLastUpdateTimestamp { get; set; } + + /// + /// The user or proxy account that created or last updated the record. + /// + [Required] + [Column("DB_LAST_UPDATE_USERID")] + [StringLength(30)] + public string DbLastUpdateUserid { get; set; } + + [ForeignKey("LeaseChklstSectionTypeCode")] + [InverseProperty("PimsLeaseChklstItemTypes")] + public virtual PimsLeaseChklstSectionType LeaseChklstSectionTypeCodeNavigation { get; set; } + + [InverseProperty("LeaseChklstItemTypeCodeNavigation")] + public virtual ICollection PimsLeaseChecklistItems { get; set; } = new List(); +} diff --git a/source/backend/entities/ef/PimsLeaseChklstSectionType.cs b/source/backend/entities/ef/PimsLeaseChklstSectionType.cs new file mode 100644 index 0000000000..47f6910fc5 --- /dev/null +++ b/source/backend/entities/ef/PimsLeaseChklstSectionType.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; + +namespace Pims.Dal.Entities; + +/// +/// Table that contains the lease & license checklist sctions that are presented to the user through dynamically building the input form. +/// +[Table("PIMS_LEASE_CHKLST_SECTION_TYPE")] +public partial class PimsLeaseChklstSectionType +{ + /// + /// Lease & license checklist section code value. + /// + [Key] + [Column("LEASE_CHKLST_SECTION_TYPE_CODE")] + [StringLength(20)] + public string LeaseChklstSectionTypeCode { get; set; } + + /// + /// Lease & license checklist section descriptive text presented to the user. + /// + [Required] + [Column("DESCRIPTION")] + [StringLength(200)] + public string Description { get; set; } + + /// + /// Specifies the order that the lease & license checklist sections are presented to the user. + /// + [Column("DISPLAY_ORDER")] + public int? DisplayOrder { get; set; } + + /// + /// Date the lease & license checklist section is able to be presented to the user via the input form. + /// + [Column("EFFECTIVE_DATE")] + public DateOnly EffectiveDate { get; set; } + + /// + /// Date the lease & license checklist section is removed from the input form. + /// + [Column("EXPIRY_DATE")] + public DateOnly? ExpiryDate { get; set; } + + /// + /// Indicates if the code is currently active. + /// + [Column("IS_DISABLED")] + public bool IsDisabled { get; set; } + + /// + /// 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 + /// + [Column("CONCURRENCY_CONTROL_NUMBER")] + public long ConcurrencyControlNumber { get; set; } + + /// + /// The date and time the record was created. + /// + [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbCreateTimestamp { get; set; } + + /// + /// The user or proxy account that created the record. + /// + [Required] + [Column("DB_CREATE_USERID")] + [StringLength(30)] + public string DbCreateUserid { get; set; } + + /// + /// The date and time the record was created or last updated. + /// + [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")] + public DateTime DbLastUpdateTimestamp { get; set; } + + /// + /// The user or proxy account that created or last updated the record. + /// + [Required] + [Column("DB_LAST_UPDATE_USERID")] + [StringLength(30)] + public string DbLastUpdateUserid { get; set; } + + [InverseProperty("LeaseChklstSectionTypeCodeNavigation")] + public virtual ICollection PimsLeaseChklstItemTypes { get; set; } = new List(); +}