diff --git a/source/backend/apimodels/Models/Concepts/Property/PropertyActivityMap.cs b/source/backend/apimodels/Models/Concepts/Property/PropertyActivityMap.cs index cd11593d35..f5ea6a071d 100644 --- a/source/backend/apimodels/Models/Concepts/Property/PropertyActivityMap.cs +++ b/source/backend/apimodels/Models/Concepts/Property/PropertyActivityMap.cs @@ -19,10 +19,10 @@ public void Register(TypeAdapterConfig config) .Map(dest => dest.CompletionDateOnly, src => src.CompletionDt) .Map(dest => dest.Description, src => src.Description) .Map(dest => dest.RequestSource, src => src.RequestSource) - .Map(dest => dest.PretaxAmt, src => src.PretaxAmt) - .Map(dest => dest.GstAmt, src => src.GstAmt) - .Map(dest => dest.PstAmt, src => src.PstAmt) - .Map(dest => dest.TotalAmt, src => src.TotalAmt) + //.Map(dest => dest.PretaxAmt, src => src.PretaxAmt) // TODO: Fix mapping + //.Map(dest => dest.GstAmt, src => src.GstAmt) + //.Map(dest => dest.PstAmt, src => src.PstAmt) + //.Map(dest => dest.TotalAmt, src => src.TotalAmt) .Map(dest => dest.IsDisabled, src => src.IsDisabled) .Map(dest => dest.ServiceProviderOrgId, src => src.ServiceProviderOrgId) .Map(dest => dest.ServiceProviderOrg, src => src.ServiceProviderOrg) @@ -43,10 +43,10 @@ public void Register(TypeAdapterConfig config) .Map(dest => dest.CompletionDt, src => src.CompletionDateOnly) .Map(dest => dest.Description, src => src.Description) .Map(dest => dest.RequestSource, src => src.RequestSource) - .Map(dest => dest.PretaxAmt, src => src.PretaxAmt) - .Map(dest => dest.GstAmt, src => src.GstAmt) - .Map(dest => dest.PstAmt, src => src.PstAmt) - .Map(dest => dest.TotalAmt, src => src.TotalAmt) + //.Map(dest => dest.PretaxAmt, src => src.PretaxAmt) + //.Map(dest => dest.GstAmt, src => src.GstAmt) + //.Map(dest => dest.PstAmt, src => src.PstAmt) + //.Map(dest => dest.TotalAmt, src => src.TotalAmt) .Map(dest => dest.IsDisabled, src => src.IsDisabled) .Map(dest => dest.ServiceProviderOrgId, src => src.ServiceProviderOrgId) .Map(dest => dest.ServiceProviderPersonId, src => src.ServiceProviderPersonId) diff --git a/source/backend/entities/PimsBaseContext.cs b/source/backend/entities/PimsBaseContext.cs index ac16728ddd..be096fe674 100644 --- a/source/backend/entities/PimsBaseContext.cs +++ b/source/backend/entities/PimsBaseContext.cs @@ -448,6 +448,12 @@ public PimsBaseContext(DbContextOptions options) public virtual DbSet PimsPropertyLocationVws { get; set; } + public virtual DbSet PimsPropertyOperations { get; set; } + + public virtual DbSet PimsPropertyOperationHists { get; set; } + + public virtual DbSet PimsPropertyOperationTypes { get; set; } + public virtual DbSet PimsPropertyOrganizations { get; set; } public virtual DbSet PimsPropertyOrganizationHists { get; set; } @@ -5608,6 +5614,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasComment("Is the property currently owned?"); entity.Property(e => e.IsPropertyOfInterest).HasComment("Is this a property of interest to the Ministry?"); entity.Property(e => e.IsProvincialPublicHwy).HasComment("Is this property a provincial public highway?"); + entity.Property(e => e.IsRetired).HasComment("If the property was the source of a subdivision operation or the target of a consolidation operation, the property is marked as retired."); entity.Property(e => e.IsRwyBeltDomPatent) .HasDefaultValue(false) .HasComment("Indicates if this property is original federal vs. provincial ownership."); @@ -5746,11 +5753,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())"); entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())"); entity.Property(e => e.Description).HasComment("Description of the property management activity."); - entity.Property(e => e.GstAmt).HasComment("GST on the management activity."); entity.Property(e => e.IsDisabled) .HasDefaultValue(false) .HasComment("Indicates if the code is disabled."); - entity.Property(e => e.PretaxAmt).HasComment("Subtotal of the management activity cost."); entity.Property(e => e.PropMgmtActivityStatusTypeCode) .HasDefaultValue("NOTSTARTED") .HasComment("Status of the property management activity."); @@ -5760,12 +5765,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.PropMgmtActivityTypeCode) .HasDefaultValue("UNKNOWN") .HasComment("Type of property management activity."); - entity.Property(e => e.PstAmt).HasComment("PST on the management activity."); entity.Property(e => e.RequestAddedDt).HasComment("Date the request for a property management activity was added"); entity.Property(e => e.RequestSource).HasComment("Source of the management activity request."); entity.Property(e => e.ServiceProviderOrgId).HasComment("Foreign key of the organization as a service provider."); entity.Property(e => e.ServiceProviderPersonId).HasComment("Foreign key of the person as a service provider."); - entity.Property(e => e.TotalAmt).HasComment("Total cost of the management activity."); entity.HasOne(d => d.PropMgmtActivityStatusTypeCodeNavigation).WithMany(p => p.PimsPropertyActivities) .OnDelete(DeleteBehavior.ClientSetNull) @@ -6099,6 +6102,116 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.ToView("PIMS_PROPERTY_LOCATION_VW"); }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PropertyOperationId).HasName("PROPOP_PK"); + + entity.ToTable("PIMS_PROPERTY_OPERATION", tb => + { + tb.HasComment("Defines the operations that are associated with properties. These operations conccern property consolidations and suvdivisions."); + tb.HasTrigger("PIMS_PROPOP_A_S_IUD_TR"); + tb.HasTrigger("PIMS_PROPOP_I_S_I_TR"); + tb.HasTrigger("PIMS_PROPOP_I_S_U_TR"); + }); + + entity.Property(e => e.PropertyOperationId) + .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_PROPERTY_OPERATION_ID_SEQ])") + .HasComment("Surrogate sequence-based generated primary key for the table. This is used internally to enforce data uniqueness."); + 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.DestinationPropertyId).HasComment("Foreign key to the destination property of the property operation."); + entity.Property(e => e.IsDisabled) + .HasDefaultValue(false) + .HasComment("Indicates if the record is disabled."); + entity.Property(e => e.OperationDt).HasComment("Business date of the property operation."); + entity.Property(e => e.PropertyOperationNo).HasComment("Sequence-based operation identifying business key. This is used to help identify when multiple properties were involved in a discrete operation. The sequence number referenced is PIMS_PROPERTY_OPERATION_NO_SEQ."); + entity.Property(e => e.PropertyOperationTypeCode).HasComment("Foriegn key to the descriptive operation type code."); + entity.Property(e => e.SourcePropertyId).HasComment("Foreign key to the source property of the property operation."); + + entity.HasOne(d => d.DestinationProperty).WithMany(p => p.PimsPropertyOperationDestinationProperties) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("PIM_PRPRTY_PIM_PROPOP_DST_FK"); + + entity.HasOne(d => d.PropertyOperationTypeCodeNavigation).WithMany(p => p.PimsPropertyOperations).HasConstraintName("PIM_PRPOTY_PIM_PROPOP_FK"); + + entity.HasOne(d => d.SourceProperty).WithMany(p => p.PimsPropertyOperationSourceProperties) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("PIM_PRPRTY_PIM_PROPOP_SRC_FK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PropertyOperationHistId).HasName("PIMS_PROPOP_H_PK"); + + entity.Property(e => e.PropertyOperationHistId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_PROPERTY_OPERATION_H_ID_SEQ])"); + entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PropertyOperationTypeCode).HasName("PRPOTY_PK"); + + entity.ToTable("PIMS_PROPERTY_OPERATION_TYPE", tb => + { + tb.HasComment("Code table to describe the type of property operation. Currently, property operations are consolidations and subdivisions."); + tb.HasTrigger("PIMS_PRPOTY_I_S_I_TR"); + tb.HasTrigger("PIMS_PRPOTY_I_S_U_TR"); + }); + + entity.Property(e => e.PropertyOperationTypeCode).HasComment("Code representing the type of property operation."); + 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 type of property operation."); + entity.Property(e => e.DisplayOrder).HasComment("Force the display order of the codes."); + entity.Property(e => e.IsDisabled).HasComment("Indicates if the code is disabled."); + }); + modelBuilder.Entity(entity => { entity.HasKey(e => e.PropertyOrganizationId).HasName("PRPORG_PK"); @@ -8030,9 +8143,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.HasSequence("PIMS_PROP_PROP_ANOMALY_TYPE_ID_SEQ") .HasMin(1L) .HasMax(2147483647L); - modelBuilder.HasSequence("PIMS_PROP_PROP_CLASSIFICATION_H_ID_SEQ") - .HasMin(1L) - .HasMax(2147483647L); modelBuilder.HasSequence("PIMS_PROP_PROP_CLASSIFICATION_ID_SEQ") .HasMin(1L) .HasMax(2147483647L); @@ -8099,6 +8209,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.HasSequence("PIMS_PROPERTY_LEASE_ID_SEQ") .HasMin(1L) .HasMax(2147483647L); + modelBuilder.HasSequence("PIMS_PROPERTY_OPERATION_H_ID_SEQ") + .HasMin(1L) + .HasMax(2147483647L); + modelBuilder.HasSequence("PIMS_PROPERTY_OPERATION_ID_SEQ") + .HasMin(1L) + .HasMax(2147483647L); + modelBuilder.HasSequence("PIMS_PROPERTY_OPERATION_NO_SEQ") + .HasMin(1L) + .HasMax(2147483647L); modelBuilder.HasSequence("PIMS_PROPERTY_ORGANIZATION_H_ID_SEQ") .HasMin(1L) .HasMax(2147483647L); diff --git a/source/backend/entities/ef/PimsProperty.cs b/source/backend/entities/ef/PimsProperty.cs index 54ffe849ef..06ad316baa 100644 --- a/source/backend/entities/ef/PimsProperty.cs +++ b/source/backend/entities/ef/PimsProperty.cs @@ -247,6 +247,12 @@ public partial class PimsProperty [Column("IS_SENSITIVE")] public bool IsSensitive { get; set; } + /// + /// If the property was the source of a subdivision operation or the target of a consolidation operation, the property is marked as retired. + /// + [Column("IS_RETIRED")] + public bool? IsRetired { get; set; } + /// /// Is this property a provincial public highway? /// @@ -411,6 +417,12 @@ public partial class PimsProperty [InverseProperty("Property")] public virtual ICollection PimsPropertyLeases { get; set; } = new List(); + [InverseProperty("DestinationProperty")] + public virtual ICollection PimsPropertyOperationDestinationProperties { get; set; } = new List(); + + [InverseProperty("SourceProperty")] + public virtual ICollection PimsPropertyOperationSourceProperties { get; set; } = new List(); + [InverseProperty("Property")] public virtual ICollection PimsPropertyOrganizations { get; set; } = new List(); diff --git a/source/backend/entities/ef/PimsPropertyActivity.cs b/source/backend/entities/ef/PimsPropertyActivity.cs index 97ec5b16ad..0d03262e51 100644 --- a/source/backend/entities/ef/PimsPropertyActivity.cs +++ b/source/backend/entities/ef/PimsPropertyActivity.cs @@ -83,30 +83,6 @@ public partial class PimsPropertyActivity [StringLength(2000)] public string RequestSource { get; set; } - /// - /// Subtotal of the management activity cost. - /// - [Column("PRETAX_AMT", TypeName = "money")] - public decimal? PretaxAmt { get; set; } - - /// - /// GST on the management activity. - /// - [Column("GST_AMT", TypeName = "money")] - public decimal? GstAmt { get; set; } - - /// - /// PST on the management activity. - /// - [Column("PST_AMT", TypeName = "money")] - public decimal? PstAmt { get; set; } - - /// - /// Total cost of the management activity. - /// - [Column("TOTAL_AMT", TypeName = "money")] - public decimal? TotalAmt { get; set; } - /// /// Indicates if the code is disabled. /// diff --git a/source/backend/entities/ef/PimsPropertyActivityHist.cs b/source/backend/entities/ef/PimsPropertyActivityHist.cs index 1244a0d011..f9d39e7145 100644 --- a/source/backend/entities/ef/PimsPropertyActivityHist.cs +++ b/source/backend/entities/ef/PimsPropertyActivityHist.cs @@ -58,18 +58,6 @@ public partial class PimsPropertyActivityHist [StringLength(2000)] public string RequestSource { get; set; } - [Column("PRETAX_AMT", TypeName = "money")] - public decimal? PretaxAmt { get; set; } - - [Column("GST_AMT", TypeName = "money")] - public decimal? GstAmt { get; set; } - - [Column("PST_AMT", TypeName = "money")] - public decimal? PstAmt { get; set; } - - [Column("TOTAL_AMT", TypeName = "money")] - public decimal? TotalAmt { get; set; } - [Column("IS_DISABLED")] public bool? IsDisabled { get; set; } diff --git a/source/backend/entities/ef/PimsPropertyBoundaryVw.cs b/source/backend/entities/ef/PimsPropertyBoundaryVw.cs index 24eca0bbd7..d261da0bfe 100644 --- a/source/backend/entities/ef/PimsPropertyBoundaryVw.cs +++ b/source/backend/entities/ef/PimsPropertyBoundaryVw.cs @@ -140,6 +140,9 @@ public partial class PimsPropertyBoundaryVw [Column("IS_OTHER_INTEREST")] public bool IsOtherInterest { get; set; } + [Column("IS_RETIRED")] + public bool? IsRetired { get; set; } + [Column("IS_VISIBLE_TO_OTHER_AGENCIES")] public bool IsVisibleToOtherAgencies { get; set; } diff --git a/source/backend/entities/ef/PimsPropertyHist.cs b/source/backend/entities/ef/PimsPropertyHist.cs index 698f7236db..207535bc90 100644 --- a/source/backend/entities/ef/PimsPropertyHist.cs +++ b/source/backend/entities/ef/PimsPropertyHist.cs @@ -147,6 +147,9 @@ public partial class PimsPropertyHist [Column("IS_SENSITIVE")] public bool IsSensitive { get; set; } + [Column("IS_RETIRED")] + public bool? IsRetired { get; set; } + [Column("IS_PROVINCIAL_PUBLIC_HWY")] public bool? IsProvincialPublicHwy { get; set; } diff --git a/source/backend/entities/ef/PimsPropertyLocationVw.cs b/source/backend/entities/ef/PimsPropertyLocationVw.cs index 3e90444ab7..d0a06bbc10 100644 --- a/source/backend/entities/ef/PimsPropertyLocationVw.cs +++ b/source/backend/entities/ef/PimsPropertyLocationVw.cs @@ -140,6 +140,9 @@ public partial class PimsPropertyLocationVw [Column("IS_OTHER_INTEREST")] public bool IsOtherInterest { get; set; } + [Column("IS_RETIRED")] + public bool? IsRetired { get; set; } + [Column("IS_VISIBLE_TO_OTHER_AGENCIES")] public bool IsVisibleToOtherAgencies { get; set; } diff --git a/source/backend/entities/ef/PimsPropertyOperation.cs b/source/backend/entities/ef/PimsPropertyOperation.cs new file mode 100644 index 0000000000..e5d5fbd673 --- /dev/null +++ b/source/backend/entities/ef/PimsPropertyOperation.cs @@ -0,0 +1,164 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; + +namespace Pims.Dal.Entities; + +/// +/// Defines the operations that are associated with properties. These operations conccern property consolidations and suvdivisions. +/// +[Table("PIMS_PROPERTY_OPERATION")] +[Index("DestinationPropertyId", Name = "PROPOP_DESTINATION_PROPERTY_ID_IDX")] +[Index("PropertyOperationNo", Name = "PROPOP_PROPERTY_OPERATION_NO_IDX")] +[Index("PropertyOperationTypeCode", Name = "PROPOP_PROPERTY_OPERATION_TYPE_CODE_IDX")] +[Index("SourcePropertyId", Name = "PROPOP_SOURCE_PROPERTY_ID_IDX")] +public partial class PimsPropertyOperation +{ + /// + /// Surrogate sequence-based generated primary key for the table. This is used internally to enforce data uniqueness. + /// + [Key] + [Column("PROPERTY_OPERATION_ID")] + public long PropertyOperationId { get; set; } + + /// + /// Foreign key to the source property of the property operation. + /// + [Column("SOURCE_PROPERTY_ID")] + public long SourcePropertyId { get; set; } + + /// + /// Foreign key to the destination property of the property operation. + /// + [Column("DESTINATION_PROPERTY_ID")] + public long DestinationPropertyId { get; set; } + + /// + /// Foriegn key to the descriptive operation type code. + /// + [Column("PROPERTY_OPERATION_TYPE_CODE")] + [StringLength(20)] + public string PropertyOperationTypeCode { get; set; } + + /// + /// Sequence-based operation identifying business key. This is used to help identify when multiple properties were involved in a discrete operation. The sequence number referenced is PIMS_PROPERTY_OPERATION_NO_SEQ. + /// + [Column("PROPERTY_OPERATION_NO")] + public long PropertyOperationNo { get; set; } + + /// + /// Business date of the property operation. + /// + [Column("OPERATION_DT", TypeName = "datetime")] + public DateTime? OperationDt { get; set; } + + /// + /// Indicates if the record is disabled. + /// + [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 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("DestinationPropertyId")] + [InverseProperty("PimsPropertyOperationDestinationProperties")] + public virtual PimsProperty DestinationProperty { get; set; } + + [ForeignKey("PropertyOperationTypeCode")] + [InverseProperty("PimsPropertyOperations")] + public virtual PimsPropertyOperationType PropertyOperationTypeCodeNavigation { get; set; } + + [ForeignKey("SourcePropertyId")] + [InverseProperty("PimsPropertyOperationSourceProperties")] + public virtual PimsProperty SourceProperty { get; set; } +} diff --git a/source/backend/entities/ef/PimsPropertyOperationHist.cs b/source/backend/entities/ef/PimsPropertyOperationHist.cs new file mode 100644 index 0000000000..d6590bcd45 --- /dev/null +++ b/source/backend/entities/ef/PimsPropertyOperationHist.cs @@ -0,0 +1,95 @@ +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_OPERATION_HIST")] +[Index("PropertyOperationHistId", "EndDateHist", Name = "PIMS_PROPOP_H_UK", IsUnique = true)] +public partial class PimsPropertyOperationHist +{ + [Key] + [Column("_PROPERTY_OPERATION_HIST_ID")] + public long PropertyOperationHistId { 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_OPERATION_ID")] + public long PropertyOperationId { get; set; } + + [Column("SOURCE_PROPERTY_ID")] + public long SourcePropertyId { get; set; } + + [Column("DESTINATION_PROPERTY_ID")] + public long DestinationPropertyId { get; set; } + + [Column("PROPERTY_OPERATION_TYPE_CODE")] + [StringLength(20)] + public string PropertyOperationTypeCode { get; set; } + + [Column("PROPERTY_OPERATION_NO")] + public long PropertyOperationNo { get; set; } + + [Column("OPERATION_DT", TypeName = "datetime")] + public DateTime? OperationDt { 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/PimsPropertyOperationType.cs b/source/backend/entities/ef/PimsPropertyOperationType.cs new file mode 100644 index 0000000000..7962084f9d --- /dev/null +++ b/source/backend/entities/ef/PimsPropertyOperationType.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; + +/// +/// Code table to describe the type of property operation. Currently, property operations are consolidations and subdivisions. +/// +[Table("PIMS_PROPERTY_OPERATION_TYPE")] +public partial class PimsPropertyOperationType +{ + /// + /// Code representing the type of property operation. + /// + [Key] + [Column("PROPERTY_OPERATION_TYPE_CODE")] + [StringLength(20)] + public string PropertyOperationTypeCode { get; set; } + + /// + /// Description of the type of property operation. + /// + [Required] + [Column("DESCRIPTION")] + [StringLength(200)] + public string Description { get; set; } + + /// + /// Indicates if the code is disabled. + /// + [Column("IS_DISABLED")] + public bool IsDisabled { get; set; } + + /// + /// Force the display order of the codes. + /// + [Column("DISPLAY_ORDER")] + public int? DisplayOrder { 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("PropertyOperationTypeCodeNavigation")] + public virtual ICollection PimsPropertyOperations { get; set; } = new List(); +}