From 7445615893b28151ad15c8db29d9fff8c5cb8a84 Mon Sep 17 00:00:00 2001 From: Manuel Rodriguez Date: Tue, 23 Jan 2024 14:20:17 -0800 Subject: [PATCH] generated scaffold and removed lingering files (#3738) --- source/backend/entities/PimsBaseContext.cs | 5 +- .../backend/entities/ef/PimsOrganization.cs | 3 - source/backend/entities/ef/PimsPerson.cs | 3 - .../ef/PimsPropPropClassificationHist.cs | 71 ---------- source/backend/entities/ef/PimsProperty.cs | 22 +-- .../entities/ef/PimsPropertyBoundaryVw.cs | 3 + .../ef/PimsPropertyDispositionFile.cs | 134 ------------------ .../ef/PimsPropertyDispositionFileHist.cs | 82 ----------- .../backend/entities/ef/PimsPropertyHist.cs | 3 + .../entities/ef/PimsPropertyLocationVw.cs | 3 + 10 files changed, 16 insertions(+), 313 deletions(-) delete mode 100644 source/backend/entities/ef/PimsPropPropClassificationHist.cs delete mode 100644 source/backend/entities/ef/PimsPropertyDispositionFile.cs delete mode 100644 source/backend/entities/ef/PimsPropertyDispositionFileHist.cs diff --git a/source/backend/entities/PimsBaseContext.cs b/source/backend/entities/PimsBaseContext.cs index f3b47e6d78..134ee60bf3 100644 --- a/source/backend/entities/PimsBaseContext.cs +++ b/source/backend/entities/PimsBaseContext.cs @@ -5598,6 +5598,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.FileNumber).HasComment("The (ARCS/ORCS) number identifying the Property File."); entity.Property(e => e.FileNumberSuffix).HasComment("A suffix to distinguish between Property Files with the same number."); entity.Property(e => e.GeneralLocation).HasComment("Descriptive location of the property, primarily for H120 activities."); + entity.Property(e => e.IsDisposed).HasComment("Has the property currently in disposition status? This infers that the property was once owned by the Ministry but has since ceased to retain ownership of the property."); entity.Property(e => e.IsOwned) .HasDefaultValue(true) .HasComment("Is the property currently owned?"); @@ -5642,8 +5643,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(d => d.PphStatusTypeCodeNavigation).WithMany(p => p.PimsProperties).HasConstraintName("PIM_PPHSTT_PIM_PRPRTY_FK"); - entity.HasOne(d => d.PropMgmtOrg).WithMany(p => p.PimsProperties).HasConstraintName("PIM_ORG_PIM_PRPRTY_FK"); - entity.HasOne(d => d.PropertyAreaUnitTypeCodeNavigation).WithMany(p => p.PimsProperties).HasConstraintName("PIM_ARUNIT_PIM_PRPRTY_FK"); entity.HasOne(d => d.PropertyClassificationTypeCodeNavigation).WithMany(p => p.PimsProperties) @@ -5654,8 +5653,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("PIM_PIDSRT_PIM_PRPRTY_FK"); - entity.HasOne(d => d.PropertyManager).WithMany(p => p.PimsProperties).HasConstraintName("PIM_PERSON_PIM_PRPRTY_FK"); - entity.HasOne(d => d.PropertyStatusTypeCodeNavigation).WithMany(p => p.PimsProperties) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("PIM_PRPSTS_PIM_PRPRTY_FK"); diff --git a/source/backend/entities/ef/PimsOrganization.cs b/source/backend/entities/ef/PimsOrganization.cs index 49c02499a1..9b29d1e642 100644 --- a/source/backend/entities/ef/PimsOrganization.cs +++ b/source/backend/entities/ef/PimsOrganization.cs @@ -174,9 +174,6 @@ public partial class PimsOrganization [InverseProperty("Organization")] public virtual ICollection PimsPropActInvolvedParties { get; set; } = new List(); - [InverseProperty("PropMgmtOrg")] - public virtual ICollection PimsProperties { get; set; } = new List(); - [InverseProperty("ServiceProviderOrg")] public virtual ICollection PimsPropertyActivities { get; set; } = new List(); diff --git a/source/backend/entities/ef/PimsPerson.cs b/source/backend/entities/ef/PimsPerson.cs index de9dd81b10..554ee5f085 100644 --- a/source/backend/entities/ef/PimsPerson.cs +++ b/source/backend/entities/ef/PimsPerson.cs @@ -166,9 +166,6 @@ public partial class PimsPerson [InverseProperty("Person")] public virtual ICollection PimsPropActMinContacts { get; set; } = new List(); - [InverseProperty("PropertyManager")] - public virtual ICollection PimsProperties { get; set; } = new List(); - [InverseProperty("ServiceProviderPerson")] public virtual ICollection PimsPropertyActivities { get; set; } = new List(); diff --git a/source/backend/entities/ef/PimsPropPropClassificationHist.cs b/source/backend/entities/ef/PimsPropPropClassificationHist.cs deleted file mode 100644 index 4882d09cf6..0000000000 --- a/source/backend/entities/ef/PimsPropPropClassificationHist.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -#nullable disable - -namespace Pims.Dal.Entities -{ - [Table("PIMS_PROP_PROP_CLASSIFICATION_HIST")] - [Index(nameof(PropPropClassificationHistId), nameof(EndDateHist), Name = "PIMS_PRPRCL_H_UK", IsUnique = true)] - public partial class PimsPropPropClassificationHist - { - [Key] - [Column("_PROP_PROP_CLASSIFICATION_HIST_ID")] - public long PropPropClassificationHistId { 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("PROP_PROP_CLASSIFICATION_ID")] - public long PropPropClassificationId { get; set; } - [Column("PROPERTY_ID")] - public long PropertyId { get; set; } - [Required] - [Column("PROPERTY_CLASSIFICATION_TYPE_CODE")] - [StringLength(20)] - public string PropertyClassificationTypeCode { get; set; } - [Column("IS_DISABLED")] - public bool IsDisabled { 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/PimsProperty.cs b/source/backend/entities/ef/PimsProperty.cs index b5fd0c11d2..38399eacc3 100644 --- a/source/backend/entities/ef/PimsProperty.cs +++ b/source/backend/entities/ef/PimsProperty.cs @@ -20,10 +20,8 @@ namespace Pims.Dal.Entities; [Index("PropertyAreaUnitTypeCode", Name = "PRPRTY_PROPERTY_AREA_UNIT_TYPE_CODE_IDX")] [Index("PropertyClassificationTypeCode", Name = "PRPRTY_PROPERTY_CLASSIFICATION_TYPE_CODE_IDX")] [Index("PropertyDataSourceTypeCode", Name = "PRPRTY_PROPERTY_DATA_SOURCE_TYPE_CODE_IDX")] -[Index("PropertyManagerId", Name = "PRPRTY_PROPERTY_MANAGER_ID_IDX")] [Index("PropertyStatusTypeCode", Name = "PRPRTY_PROPERTY_STATUS_TYPE_CODE_IDX")] [Index("PropertyTypeCode", Name = "PRPRTY_PROPERTY_TYPE_CODE_IDX")] -[Index("PropMgmtOrgId", Name = "PRPRTY_PROP_MGMT_ORG_ID_IDX")] [Index("RegionCode", Name = "PRPRTY_REGION_CODE_IDX")] [Index("SurplusDeclarationTypeCode", Name = "PRPRTY_SURPLUS_DECLARATION_TYPE_CODE_IDX")] [Index("SurveyPlanNumber", Name = "PRPRTY_SURVEY_PLAN_NUMBER_IDX")] @@ -35,12 +33,6 @@ public partial class PimsProperty [Column("PROPERTY_ID")] public long PropertyId { get; set; } - [Column("PROPERTY_MANAGER_ID")] - public long? PropertyManagerId { get; set; } - - [Column("PROP_MGMT_ORG_ID")] - public long? PropMgmtOrgId { get; set; } - [Required] [Column("PROPERTY_TYPE_CODE")] [StringLength(20)] @@ -225,6 +217,12 @@ public partial class PimsProperty [Column("IS_OWNED")] public bool IsOwned { get; set; } + /// + /// Has the property currently in disposition status? This infers that the property was once owned by the Ministry but has since ceased to retain ownership of the property. + /// + [Column("IS_DISPOSED")] + public bool IsDisposed { get; set; } + /// /// Is this a property of interest to the Ministry? /// @@ -417,10 +415,6 @@ public partial class PimsProperty [InverseProperty("PimsProperties")] public virtual PimsPphStatusType PphStatusTypeCodeNavigation { get; set; } - [ForeignKey("PropMgmtOrgId")] - [InverseProperty("PimsProperties")] - public virtual PimsOrganization PropMgmtOrg { get; set; } - [ForeignKey("PropertyAreaUnitTypeCode")] [InverseProperty("PimsProperties")] public virtual PimsAreaUnitType PropertyAreaUnitTypeCodeNavigation { get; set; } @@ -433,10 +427,6 @@ public partial class PimsProperty [InverseProperty("PimsProperties")] public virtual PimsDataSourceType PropertyDataSourceTypeCodeNavigation { get; set; } - [ForeignKey("PropertyManagerId")] - [InverseProperty("PimsProperties")] - public virtual PimsPerson PropertyManager { get; set; } - [ForeignKey("PropertyStatusTypeCode")] [InverseProperty("PimsProperties")] public virtual PimsPropertyStatusType PropertyStatusTypeCodeNavigation { get; set; } diff --git a/source/backend/entities/ef/PimsPropertyBoundaryVw.cs b/source/backend/entities/ef/PimsPropertyBoundaryVw.cs index c151e5bac7..1309900ffd 100644 --- a/source/backend/entities/ef/PimsPropertyBoundaryVw.cs +++ b/source/backend/entities/ef/PimsPropertyBoundaryVw.cs @@ -131,6 +131,9 @@ public partial class PimsPropertyBoundaryVw [Column("IS_OWNED")] public bool IsOwned { get; set; } + [Column("IS_DISPOSED")] + public bool IsDisposed { get; set; } + [Column("IS_PROPERTY_OF_INTEREST")] public bool IsPropertyOfInterest { get; set; } diff --git a/source/backend/entities/ef/PimsPropertyDispositionFile.cs b/source/backend/entities/ef/PimsPropertyDispositionFile.cs deleted file mode 100644 index e5d1ad8b86..0000000000 --- a/source/backend/entities/ef/PimsPropertyDispositionFile.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Pims.Dal.Entities; - -/// -/// Entity to associate the properties involved with the disposition file. -/// -[Table("PIMS_PROPERTY_DISPOSITION_FILE")] -[Index("DispositionFileId", Name = "PRDSPF_DISPOSITION_FILE_ID_IDX")] -[Index("PropertyId", "DispositionFileId", Name = "PRDSPF_PROPERTY_DISPOSITION_TUC", IsUnique = true)] -[Index("PropertyId", Name = "PRDSPF_PROPERTY_ID_IDX")] -public partial class PimsPropertyDispositionFile -{ - /// - /// Unique auto-generated surrogate primary key - /// - [Key] - [Column("PROPERTY_DISPOSITION_FILE_ID")] - public long PropertyDispositionFileId { get; set; } - - /// - /// Primary key of the associated property. - /// - [Column("PROPERTY_ID")] - public long PropertyId { get; set; } - - /// - /// Primary key of the associated disposition file. - /// - [Column("DISPOSITION_FILE_ID")] - public long DispositionFileId { 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 - /// - [Column("CONCURRENCY_CONTROL_NUMBER")] - public long ConcurrencyControlNumber { get; set; } - - /// - /// The date and time the record was created by the user. - /// - [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")] - public DateTime AppCreateTimestamp { get; set; } - - /// - /// The user that created the record. - /// - [Required] - [Column("APP_CREATE_USERID")] - [StringLength(30)] - public string AppCreateUserid { get; set; } - - /// - /// GUID of the user that created the record. - /// - [Column("APP_CREATE_USER_GUID")] - public Guid? AppCreateUserGuid { get; set; } - - /// - /// User directory of the user that created the record. - /// - [Required] - [Column("APP_CREATE_USER_DIRECTORY")] - [StringLength(30)] - public string AppCreateUserDirectory { get; set; } - - /// - /// The date and time the record was updated by the user. - /// - [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")] - public DateTime AppLastUpdateTimestamp { get; set; } - - /// - /// The user that updated the record. - /// - [Required] - [Column("APP_LAST_UPDATE_USERID")] - [StringLength(30)] - public string AppLastUpdateUserid { get; set; } - - /// - /// GUID of the user that updated the record. - /// - [Column("APP_LAST_UPDATE_USER_GUID")] - public Guid? AppLastUpdateUserGuid { get; set; } - - /// - /// User directory of the user 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("DispositionFileId")] - [InverseProperty("PimsPropertyDispositionFiles")] - public virtual PimsDispositionFile DispositionFile { get; set; } - - [ForeignKey("PropertyId")] - [InverseProperty("PimsPropertyDispositionFiles")] - public virtual PimsProperty Property { get; set; } -} diff --git a/source/backend/entities/ef/PimsPropertyDispositionFileHist.cs b/source/backend/entities/ef/PimsPropertyDispositionFileHist.cs deleted file mode 100644 index b70212e87d..0000000000 --- a/source/backend/entities/ef/PimsPropertyDispositionFileHist.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Pims.Dal.Entities; - -[Table("PIMS_PROPERTY_DISPOSITION_FILE_HIST")] -[Index("PropertyDispositionFileHistId", "EndDateHist", Name = "PIMS_PRDSPF_H_UK", IsUnique = true)] -public partial class PimsPropertyDispositionFileHist -{ - [Key] - [Column("_PROPERTY_DISPOSITION_FILE_HIST_ID")] - public long PropertyDispositionFileHistId { 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("PROPERTY_DISPOSITION_FILE_ID")] - public long PropertyDispositionFileId { get; set; } - - [Column("PROPERTY_ID")] - public long PropertyId { get; set; } - - [Column("DISPOSITION_FILE_ID")] - public long DispositionFileId { 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/PimsPropertyHist.cs b/source/backend/entities/ef/PimsPropertyHist.cs index 9978322736..65285912ec 100644 --- a/source/backend/entities/ef/PimsPropertyHist.cs +++ b/source/backend/entities/ef/PimsPropertyHist.cs @@ -138,6 +138,9 @@ public partial class PimsPropertyHist [Column("IS_OWNED")] public bool IsOwned { get; set; } + [Column("IS_DISPOSED")] + public bool IsDisposed { get; set; } + [Column("IS_PROPERTY_OF_INTEREST")] public bool IsPropertyOfInterest { get; set; } diff --git a/source/backend/entities/ef/PimsPropertyLocationVw.cs b/source/backend/entities/ef/PimsPropertyLocationVw.cs index c3e621092e..308575677a 100644 --- a/source/backend/entities/ef/PimsPropertyLocationVw.cs +++ b/source/backend/entities/ef/PimsPropertyLocationVw.cs @@ -131,6 +131,9 @@ public partial class PimsPropertyLocationVw [Column("IS_OWNED")] public bool IsOwned { get; set; } + [Column("IS_DISPOSED")] + public bool IsDisposed { get; set; } + [Column("IS_PROPERTY_OF_INTEREST")] public bool IsPropertyOfInterest { get; set; }