Skip to content

Commit

Permalink
Merge pull request #695 from bcgov/ricander
Browse files Browse the repository at this point in the history
Ricander
  • Loading branch information
larsenle authored Oct 4, 2024
2 parents f459d8c + ba94892 commit c36f73d
Show file tree
Hide file tree
Showing 13 changed files with 223 additions and 142 deletions.
39 changes: 38 additions & 1 deletion server/StrDss.Data/Entities/DssDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public DssDbContext(DbContextOptions<DssDbContext> options)

public virtual DbSet<DssPhysicalAddress> DssPhysicalAddresses { get; set; }

public virtual DbSet<DssPlatformType> DssPlatformTypes { get; set; }

public virtual DbSet<DssPlatformVw> DssPlatformVws { get; set; }

public virtual DbSet<DssRentalListing> DssRentalListings { get; set; }
Expand Down Expand Up @@ -432,6 +434,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasMaxLength(100)
.HasComment("A free form description of the economic region to which a Local Government Subdivision belongs")
.HasColumnName("economic_region_dsc");
entity.Property(e => e.IsActive)
.HasComment("Indicates whether the ORGANIZATION is currently available for new associations")
.HasColumnName("is_active");
entity.Property(e => e.IsBusinessLicenceRequired)
.HasComment("Indicates whether a LOCAL GOVERNMENT SUBDIVISION requires a business licence for Short Term Rental operation")
.HasColumnName("is_business_licence_required");
Expand All @@ -446,7 +451,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasColumnName("is_str_prohibited");
entity.Property(e => e.LocalGovernmentType)
.HasMaxLength(50)
.HasComment("A sub-type of local government organization used for sorting and grouping or members")
.HasComment("A sub-type of local government organization used for sorting and grouping of members")
.HasColumnName("local_government_type");
entity.Property(e => e.ManagingOrganizationId)
.HasComment("Self-referential hierarchical foreign key")
Expand All @@ -463,6 +468,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasMaxLength(25)
.HasComment("Foreign key")
.HasColumnName("organization_type");
entity.Property(e => e.PlatformType)
.HasMaxLength(25)
.HasComment("Foreign key")
.HasColumnName("platform_type");
entity.Property(e => e.UpdDtm)
.HasComment("Trigger-updated timestamp of last change")
.HasColumnName("upd_dtm");
Expand All @@ -478,6 +487,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasForeignKey(d => d.OrganizationType)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("dss_organization_fk_treated_as");

entity.HasOne(d => d.PlatformTypeNavigation).WithMany(p => p.DssOrganizations)
.HasForeignKey(d => d.PlatformType)
.HasConstraintName("dss_organization_fk_classified_as");
});

modelBuilder.Entity<DssOrganizationContactPerson>(entity =>
Expand Down Expand Up @@ -660,12 +673,29 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasConstraintName("dss_physical_address_fk_replaced_by");
});

modelBuilder.Entity<DssPlatformType>(entity =>
{
entity.HasKey(e => e.PlatformType).HasName("dss_platform_type_pk");

entity.ToTable("dss_platform_type", tb => tb.HasComment("A sub-type of rental platform organization used for sorting and grouping of members"));

entity.Property(e => e.PlatformType)
.HasMaxLength(25)
.HasComment("System-consistent code (e.g. Major/Minor)")
.HasColumnName("platform_type");
entity.Property(e => e.PlatformTypeNm)
.HasMaxLength(250)
.HasComment("Business term for the platform type (e.g. Major/Minor)")
.HasColumnName("platform_type_nm");
});

modelBuilder.Entity<DssPlatformVw>(entity =>
{
entity
.HasNoKey()
.ToView("dss_platform_vw");

entity.Property(e => e.IsActive).HasColumnName("is_active");
entity.Property(e => e.ManagingOrganizationId).HasColumnName("managing_organization_id");
entity.Property(e => e.OrganizationCd)
.HasMaxLength(25)
Expand All @@ -677,6 +707,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.OrganizationType)
.HasMaxLength(25)
.HasColumnName("organization_type");
entity.Property(e => e.PlatformType)
.HasMaxLength(25)
.HasColumnName("platform_type");
entity.Property(e => e.PlatformTypeNm)
.HasMaxLength(250)
.HasColumnName("platform_type_nm");
entity.Property(e => e.PrimaryNoticeOfTakedownContactEmail)
.HasMaxLength(320)
.HasColumnName("primary_notice_of_takedown_contact_email");
Expand Down Expand Up @@ -1030,6 +1066,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.IsMatchVerified).HasColumnName("is_match_verified");
entity.Property(e => e.IsNew).HasColumnName("is_new");
entity.Property(e => e.IsPrincipalResidenceRequired).HasColumnName("is_principal_residence_required");
entity.Property(e => e.IsStrProhibited).HasColumnName("is_str_prohibited");
entity.Property(e => e.IsTakenDown).HasColumnName("is_taken_down");
entity.Property(e => e.LastActionDtm).HasColumnName("last_action_dtm");
entity.Property(e => e.LastActionNm)
Expand Down
34 changes: 17 additions & 17 deletions server/StrDss.Data/Entities/DssEmailMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ public partial class DssEmailMessage
/// </summary>
public string MessageTemplateDsc { get; set; } = null!;

/// <summary>
/// Indicates whether the user initiating the message should receive a copy of the email
/// </summary>
public bool IsSubmitterCcRequired { get; set; }

/// <summary>
/// Indicates whether the the property host has already been contacted by external means
/// </summary>
public bool? IsHostContactedExternally { get; set; }

/// <summary>
/// Indicates whether the user initiating the message should receive a copy of the email
/// Indicates whether message body should include text a block of detail text that is standard for the message type
/// </summary>
public bool IsSubmitterCcRequired { get; set; }
public bool? IsWithStandardDetail { get; set; }

/// <summary>
/// A phone number associated with a Local Government contact
Expand Down Expand Up @@ -73,6 +78,16 @@ public partial class DssEmailMessage
/// </summary>
public string? LgStrBylawUrl { get; set; }

/// <summary>
/// Free form text that should be included in the message body
/// </summary>
public string? CustomDetailTxt { get; set; }

/// <summary>
/// Foreign key
/// </summary>
public long? ConcernedWithRentalListingId { get; set; }

/// <summary>
/// Foreign key
/// </summary>
Expand Down Expand Up @@ -113,21 +128,6 @@ public partial class DssEmailMessage
/// </summary>
public Guid? UpdUserGuid { get; set; }

/// <summary>
/// Foreign key
/// </summary>
public long? ConcernedWithRentalListingId { get; set; }

/// <summary>
/// Indicates whether message body should include text a block of detail text that is standard for the message type
/// </summary>
public bool? IsWithStandardDetail { get; set; }

/// <summary>
/// Free form text that should be included in the message body
/// </summary>
public string? CustomDetailTxt { get; set; }

public virtual DssUserIdentity? AffectedByUserIdentity { get; set; }

public virtual DssEmailMessage? BatchingEmailMessage { get; set; }
Expand Down
44 changes: 28 additions & 16 deletions server/StrDss.Data/Entities/DssOrganization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,29 @@ public partial class DssOrganization
public string OrganizationNm { get; set; } = null!;

/// <summary>
/// the multipolygon shape identifying the boundaries of a local government subdivision
/// A sub-type of local government organization used for sorting and grouping of members
/// </summary>
public Geometry? AreaGeometry { get; set; }
public string? LocalGovernmentType { get; set; }

/// <summary>
/// Self-referential hierarchical foreign key
/// A free form description of the economic region to which a Local Government Subdivision belongs
/// </summary>
public long? ManagingOrganizationId { get; set; }
public string? EconomicRegionDsc { get; set; }

/// <summary>
/// Trigger-updated timestamp of last change
/// Indicates whether the ORGANIZATION is currently available for new associations
/// </summary>
public DateTime UpdDtm { get; set; }
public bool? IsActive { get; set; }

/// <summary>
/// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change
/// Indicates whether a LOCAL GOVERNMENT ORGANIZATION participates in Short Term Rental Data Sharing
/// </summary>
public Guid? UpdUserGuid { get; set; }
public bool? IsLgParticipating { get; set; }

/// <summary>
/// Indicates whether a LOCAL GOVERNMENT ORGANIZATION participates in Short Term Rental Data Sharing
/// Indicates whether a LOCAL GOVERNMENT ORGANIZATION entirely prohibits short term housing rentals
/// </summary>
public bool? IsLgParticipating { get; set; }
public bool? IsStrProhibited { get; set; }

/// <summary>
/// Indicates whether a LOCAL GOVERNMENT SUBDIVISION is subject to Provincial Principal Residence Short Term Rental restrictions
Expand All @@ -65,19 +65,29 @@ public partial class DssOrganization
public bool? IsBusinessLicenceRequired { get; set; }

/// <summary>
/// A free form description of the economic region to which a Local Government Subdivision belongs
/// the multipolygon shape identifying the boundaries of a local government subdivision
/// </summary>
public string? EconomicRegionDsc { get; set; }
public Geometry? AreaGeometry { get; set; }

/// <summary>
/// A sub-type of local government organization used for sorting and grouping or members
/// Self-referential hierarchical foreign key
/// </summary>
public string? LocalGovernmentType { get; set; }
public long? ManagingOrganizationId { get; set; }

/// <summary>
/// Indicates whether a LOCAL GOVERNMENT ORGANIZATION entirely prohibits short term housing rentals
/// Foreign key
/// </summary>
public bool? IsStrProhibited { get; set; }
public string? PlatformType { get; set; }

/// <summary>
/// Trigger-updated timestamp of last change
/// </summary>
public DateTime UpdDtm { get; set; }

/// <summary>
/// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change
/// </summary>
public Guid? UpdUserGuid { get; set; }

public virtual ICollection<DssBusinessLicence> DssBusinessLicences { get; set; } = new List<DssBusinessLicence>();

Expand All @@ -104,4 +114,6 @@ public partial class DssOrganization
public virtual DssOrganization? ManagingOrganization { get; set; }

public virtual DssOrganizationType OrganizationTypeNavigation { get; set; } = null!;

public virtual DssPlatformType? PlatformTypeNavigation { get; set; }
}
16 changes: 8 additions & 8 deletions server/StrDss.Data/Entities/DssOrganizationContactPerson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ public partial class DssOrganizationContactPerson
/// </summary>
public long OrganizationContactPersonId { get; set; }

/// <summary>
/// E-mail address given for the contact by the organization
/// </summary>
public string EmailAddressDsc { get; set; } = null!;

/// <summary>
/// Indicates whether the contact should receive all communications directed at the organization
/// </summary>
Expand All @@ -34,14 +39,14 @@ public partial class DssOrganizationContactPerson
public string? PhoneNo { get; set; }

/// <summary>
/// E-mail address given for the contact by the organization
/// Foreign key
/// </summary>
public string EmailAddressDsc { get; set; } = null!;
public long ContactedThroughOrganizationId { get; set; }

/// <summary>
/// Foreign key
/// </summary>
public long ContactedThroughOrganizationId { get; set; }
public string? EmailMessageType { get; set; }

/// <summary>
/// Trigger-updated timestamp of last change
Expand All @@ -53,11 +58,6 @@ public partial class DssOrganizationContactPerson
/// </summary>
public Guid? UpdUserGuid { get; set; }

/// <summary>
/// Foreign key
/// </summary>
public string? EmailMessageType { get; set; }

public virtual DssOrganization ContactedThroughOrganization { get; set; } = null!;

public virtual DssEmailMessageType? EmailMessageTypeNavigation { get; set; }
Expand Down
78 changes: 39 additions & 39 deletions server/StrDss.Data/Entities/DssPhysicalAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,6 @@ public partial class DssPhysicalAddress
/// </summary>
public short? MatchScoreAmt { get; set; }

/// <summary>
/// The siteID returned by the address match
/// </summary>
public string? SiteNo { get; set; }

/// <summary>
/// The blockID returned by the address match
/// </summary>
public string? BlockNo { get; set; }

/// <summary>
/// The computed location point of the matched address
/// </summary>
public Geometry? LocationGeometry { get; set; }

/// <summary>
/// Indicates whether the address has been identified as exempt from Short Term Rental regulations
/// </summary>
public bool? IsExempt { get; set; }

/// <summary>
/// Foreign key
/// </summary>
public long? ContainingOrganizationId { get; set; }

/// <summary>
/// Trigger-updated timestamp of last change
/// </summary>
public DateTime UpdDtm { get; set; }

/// <summary>
/// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change
/// </summary>
public Guid? UpdUserGuid { get; set; }

/// <summary>
/// The unitNumber (suite) returned by the address match (e.g. 100)
/// </summary>
Expand Down Expand Up @@ -110,15 +75,35 @@ public partial class DssPhysicalAddress
public string? ProvinceCd { get; set; }

/// <summary>
/// Foreign key
/// The siteID returned by the address match
/// </summary>
public long? ReplacingPhysicalAddressId { get; set; }
public string? SiteNo { get; set; }

/// <summary>
/// The blockID returned by the address match
/// </summary>
public string? BlockNo { get; set; }

/// <summary>
/// The computed location point of the matched address
/// </summary>
public Geometry? LocationGeometry { get; set; }

/// <summary>
/// Indicates whether the address has been identified as exempt from Short Term Rental regulations
/// </summary>
public bool? IsExempt { get; set; }

/// <summary>
/// Indicates whether the matched address has been verified as correct for the listing by the responsible authorities
/// </summary>
public bool? IsMatchVerified { get; set; }

/// <summary>
/// Indicates whether the original address has received a different property address from the platform in the last reporting period
/// </summary>
public bool? IsChangedOriginalAddress { get; set; }

/// <summary>
/// Indicates whether the matched address has been manually changed to one that is verified as correct for the listing
/// </summary>
Expand All @@ -130,9 +115,24 @@ public partial class DssPhysicalAddress
public bool? IsSystemProcessing { get; set; }

/// <summary>
/// Indicates whether the original address has received a different property address from the platform in the last reporting period
/// Foreign key
/// </summary>
public bool? IsChangedOriginalAddress { get; set; }
public long? ContainingOrganizationId { get; set; }

/// <summary>
/// Foreign key
/// </summary>
public long? ReplacingPhysicalAddressId { get; set; }

/// <summary>
/// Trigger-updated timestamp of last change
/// </summary>
public DateTime UpdDtm { get; set; }

/// <summary>
/// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change
/// </summary>
public Guid? UpdUserGuid { get; set; }

public virtual DssOrganization? ContainingOrganization { get; set; }

Expand Down
Loading

0 comments on commit c36f73d

Please sign in to comment.