From 7e3603b4b327e49bdf2f0c7c3adc25e10158ee1c Mon Sep 17 00:00:00 2001 From: ychung-mot Date: Tue, 15 Oct 2024 09:30:58 -0700 Subject: [PATCH] chore: scaffold --- .../Controllers/OrganizationsController.cs | 12 +-- server/StrDss.Data/Entities/DssDbContext.cs | 1 - .../StrDss.Data/Entities/DssEmailMessage.cs | 34 +++---- .../StrDss.Data/Entities/DssOrganization.cs | 40 ++++---- .../Entities/DssOrganizationContactPerson.cs | 16 ++-- .../Entities/DssPhysicalAddress.cs | 78 +++++++-------- .../StrDss.Data/Entities/DssRentalListing.cs | 94 +++++++++---------- .../Entities/DssRentalListingReport.cs | 8 +- .../Entities/DssRentalListingVw.cs | 2 - .../StrDss.Data/Entities/DssUploadDelivery.cs | 10 +- server/StrDss.Data/Entities/DssUploadLine.cs | 10 +- 11 files changed, 151 insertions(+), 154 deletions(-) diff --git a/server/StrDss.Api/Controllers/OrganizationsController.cs b/server/StrDss.Api/Controllers/OrganizationsController.cs index b2f27d40..1983831c 100644 --- a/server/StrDss.Api/Controllers/OrganizationsController.cs +++ b/server/StrDss.Api/Controllers/OrganizationsController.cs @@ -79,7 +79,7 @@ public async Task> GetStrRequirements(double lo } - [ApiAuthorize(Permissions.PlatformRead)] //TODO: use platform_read permission when it's ready in the database + [ApiAuthorize(Permissions.PlatformRead)] [HttpGet("platforms")] public async Task>> GetPlatforms(int pageSize = 10, int pageNumber = 1, string orderBy = "OrganizationNm", string direction = "asc") { @@ -87,7 +87,7 @@ public async Task>> GetPlatforms(int pageSize return Ok(platforms); } - [ApiAuthorize(Permissions.PlatformRead)] //TODO: use platform_read permission when it's ready in the database + [ApiAuthorize(Permissions.PlatformRead)] [HttpGet("platforms/{id}")] public async Task> GetPlatform(long id) { @@ -101,7 +101,7 @@ public async Task> GetPlatform(long id) return Ok(platform); } - [ApiAuthorize(Permissions.PlatformWrite)] //todo: use platform_write permission when it's ready in the database + [ApiAuthorize(Permissions.PlatformWrite)] [HttpPost("platforms", Name = "CreatePlatform")] public async Task CreatePlatform(PlatformCreateDto dto) { @@ -115,7 +115,7 @@ public async Task CreatePlatform(PlatformCreateDto dto) return Ok(id); } - [ApiAuthorize(Permissions.PlatformWrite)] //todo: use platform_write permission when it's ready in the database + [ApiAuthorize(Permissions.PlatformWrite)] [HttpPut("platforms/{id}", Name = "UpdatePlatform")] public async Task UpdatePlatform(PlatformUpdateDto dto, long id) { @@ -131,7 +131,7 @@ public async Task UpdatePlatform(PlatformUpdateDto dto, long id) return Ok(); } - [ApiAuthorize(Permissions.PlatformWrite)] //todo: use platform_write permission when it's ready in the database + [ApiAuthorize(Permissions.PlatformWrite)] [HttpPost("platforms/subsidiaries", Name = "CreatePlatformSub")] public async Task CreatePlatformSub(PlatformSubCreateDto dto) { @@ -145,7 +145,7 @@ public async Task CreatePlatformSub(PlatformSubCreateDto dto) return Ok(id); } - [ApiAuthorize(Permissions.PlatformWrite)] //todo: use platform_write permission when it's ready in the database + [ApiAuthorize(Permissions.PlatformWrite)] [HttpPut("platforms/subsidiaries/{id}", Name = "UpdatePlatformSub")] public async Task UpdatePlatformSub(PlatformSubUpdateDto dto, long id) { diff --git a/server/StrDss.Data/Entities/DssDbContext.cs b/server/StrDss.Data/Entities/DssDbContext.cs index 80cceb6d..5a35c158 100644 --- a/server/StrDss.Data/Entities/DssDbContext.cs +++ b/server/StrDss.Data/Entities/DssDbContext.cs @@ -1066,7 +1066,6 @@ 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) diff --git a/server/StrDss.Data/Entities/DssEmailMessage.cs b/server/StrDss.Data/Entities/DssEmailMessage.cs index 0e7cf5ee..634fe2d9 100644 --- a/server/StrDss.Data/Entities/DssEmailMessage.cs +++ b/server/StrDss.Data/Entities/DssEmailMessage.cs @@ -28,20 +28,15 @@ public partial class DssEmailMessage /// public string MessageTemplateDsc { get; set; } = null!; - /// - /// Indicates whether the user initiating the message should receive a copy of the email - /// - public bool IsSubmitterCcRequired { get; set; } - /// /// Indicates whether the the property host has already been contacted by external means /// public bool? IsHostContactedExternally { get; set; } /// - /// Indicates whether message body should include text a block of detail text that is standard for the message type + /// Indicates whether the user initiating the message should receive a copy of the email /// - public bool? IsWithStandardDetail { get; set; } + public bool IsSubmitterCcRequired { get; set; } /// /// A phone number associated with a Local Government contact @@ -78,16 +73,6 @@ public partial class DssEmailMessage /// public string? LgStrBylawUrl { get; set; } - /// - /// Free form text that should be included in the message body - /// - public string? CustomDetailTxt { get; set; } - - /// - /// Foreign key - /// - public long? ConcernedWithRentalListingId { get; set; } - /// /// Foreign key /// @@ -128,6 +113,21 @@ public partial class DssEmailMessage /// public Guid? UpdUserGuid { get; set; } + /// + /// Foreign key + /// + public long? ConcernedWithRentalListingId { get; set; } + + /// + /// Indicates whether message body should include text a block of detail text that is standard for the message type + /// + public bool? IsWithStandardDetail { get; set; } + + /// + /// Free form text that should be included in the message body + /// + public string? CustomDetailTxt { get; set; } + public virtual DssUserIdentity? AffectedByUserIdentity { get; set; } public virtual DssEmailMessage? BatchingEmailMessage { get; set; } diff --git a/server/StrDss.Data/Entities/DssOrganization.cs b/server/StrDss.Data/Entities/DssOrganization.cs index c476042f..ca2dbc35 100644 --- a/server/StrDss.Data/Entities/DssOrganization.cs +++ b/server/StrDss.Data/Entities/DssOrganization.cs @@ -30,29 +30,29 @@ public partial class DssOrganization public string OrganizationNm { get; set; } = null!; /// - /// A sub-type of local government organization used for sorting and grouping of members + /// the multipolygon shape identifying the boundaries of a local government subdivision /// - public string? LocalGovernmentType { get; set; } + public Geometry? AreaGeometry { get; set; } /// - /// A free form description of the economic region to which a Local Government Subdivision belongs + /// Self-referential hierarchical foreign key /// - public string? EconomicRegionDsc { get; set; } + public long? ManagingOrganizationId { get; set; } /// - /// Indicates whether the ORGANIZATION is currently available for new associations + /// Trigger-updated timestamp of last change /// - public bool? IsActive { get; set; } + public DateTime UpdDtm { get; set; } /// - /// Indicates whether a LOCAL GOVERNMENT ORGANIZATION participates in Short Term Rental Data Sharing + /// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change /// - public bool? IsLgParticipating { get; set; } + public Guid? UpdUserGuid { get; set; } /// - /// Indicates whether a LOCAL GOVERNMENT ORGANIZATION entirely prohibits short term housing rentals + /// Indicates whether a LOCAL GOVERNMENT ORGANIZATION participates in Short Term Rental Data Sharing /// - public bool? IsStrProhibited { get; set; } + public bool? IsLgParticipating { get; set; } /// /// Indicates whether a LOCAL GOVERNMENT SUBDIVISION is subject to Provincial Principal Residence Short Term Rental restrictions @@ -65,29 +65,29 @@ public partial class DssOrganization public bool? IsBusinessLicenceRequired { get; set; } /// - /// the multipolygon shape identifying the boundaries of a local government subdivision + /// A free form description of the economic region to which a Local Government Subdivision belongs /// - public Geometry? AreaGeometry { get; set; } + public string? EconomicRegionDsc { get; set; } /// - /// Self-referential hierarchical foreign key + /// A sub-type of local government organization used for sorting and grouping of members /// - public long? ManagingOrganizationId { get; set; } + public string? LocalGovernmentType { get; set; } /// - /// Foreign key + /// Indicates whether a LOCAL GOVERNMENT ORGANIZATION entirely prohibits short term housing rentals /// - public string? PlatformType { get; set; } + public bool? IsStrProhibited { get; set; } /// - /// Trigger-updated timestamp of last change + /// Indicates whether the ORGANIZATION is currently available for new associations /// - public DateTime UpdDtm { get; set; } + public bool? IsActive { get; set; } /// - /// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change + /// Foreign key /// - public Guid? UpdUserGuid { get; set; } + public string? PlatformType { get; set; } public virtual ICollection DssBusinessLicences { get; set; } = new List(); diff --git a/server/StrDss.Data/Entities/DssOrganizationContactPerson.cs b/server/StrDss.Data/Entities/DssOrganizationContactPerson.cs index d7b7640f..91486225 100644 --- a/server/StrDss.Data/Entities/DssOrganizationContactPerson.cs +++ b/server/StrDss.Data/Entities/DssOrganizationContactPerson.cs @@ -13,11 +13,6 @@ public partial class DssOrganizationContactPerson /// public long OrganizationContactPersonId { get; set; } - /// - /// E-mail address given for the contact by the organization - /// - public string EmailAddressDsc { get; set; } = null!; - /// /// Indicates whether the contact should receive all communications directed at the organization /// @@ -39,14 +34,14 @@ public partial class DssOrganizationContactPerson public string? PhoneNo { get; set; } /// - /// Foreign key + /// E-mail address given for the contact by the organization /// - public long ContactedThroughOrganizationId { get; set; } + public string EmailAddressDsc { get; set; } = null!; /// /// Foreign key /// - public string? EmailMessageType { get; set; } + public long ContactedThroughOrganizationId { get; set; } /// /// Trigger-updated timestamp of last change @@ -58,6 +53,11 @@ public partial class DssOrganizationContactPerson /// public Guid? UpdUserGuid { get; set; } + /// + /// Foreign key + /// + public string? EmailMessageType { get; set; } + public virtual DssOrganization ContactedThroughOrganization { get; set; } = null!; public virtual DssEmailMessageType? EmailMessageTypeNavigation { get; set; } diff --git a/server/StrDss.Data/Entities/DssPhysicalAddress.cs b/server/StrDss.Data/Entities/DssPhysicalAddress.cs index b75e8965..89c0bc7c 100644 --- a/server/StrDss.Data/Entities/DssPhysicalAddress.cs +++ b/server/StrDss.Data/Entities/DssPhysicalAddress.cs @@ -34,6 +34,41 @@ public partial class DssPhysicalAddress /// public short? MatchScoreAmt { get; set; } + /// + /// The siteID returned by the address match + /// + public string? SiteNo { get; set; } + + /// + /// The blockID returned by the address match + /// + public string? BlockNo { get; set; } + + /// + /// The computed location point of the matched address + /// + public Geometry? LocationGeometry { get; set; } + + /// + /// Indicates whether the address has been identified as exempt from Short Term Rental regulations + /// + public bool? IsExempt { get; set; } + + /// + /// Foreign key + /// + public long? ContainingOrganizationId { get; set; } + + /// + /// Trigger-updated timestamp of last change + /// + public DateTime UpdDtm { get; set; } + + /// + /// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change + /// + public Guid? UpdUserGuid { get; set; } + /// /// The unitNumber (suite) returned by the address match (e.g. 100) /// @@ -75,35 +110,15 @@ public partial class DssPhysicalAddress public string? ProvinceCd { get; set; } /// - /// The siteID returned by the address match - /// - public string? SiteNo { get; set; } - - /// - /// The blockID returned by the address match - /// - public string? BlockNo { get; set; } - - /// - /// The computed location point of the matched address - /// - public Geometry? LocationGeometry { get; set; } - - /// - /// Indicates whether the address has been identified as exempt from Short Term Rental regulations + /// Foreign key /// - public bool? IsExempt { get; set; } + public long? ReplacingPhysicalAddressId { get; set; } /// /// Indicates whether the matched address has been verified as correct for the listing by the responsible authorities /// public bool? IsMatchVerified { get; set; } - /// - /// Indicates whether the original address has received a different property address from the platform in the last reporting period - /// - public bool? IsChangedOriginalAddress { get; set; } - /// /// Indicates whether the matched address has been manually changed to one that is verified as correct for the listing /// @@ -115,24 +130,9 @@ public partial class DssPhysicalAddress public bool? IsSystemProcessing { get; set; } /// - /// Foreign key - /// - public long? ContainingOrganizationId { get; set; } - - /// - /// Foreign key - /// - public long? ReplacingPhysicalAddressId { get; set; } - - /// - /// Trigger-updated timestamp of last change - /// - public DateTime UpdDtm { get; set; } - - /// - /// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change + /// Indicates whether the original address has received a different property address from the platform in the last reporting period /// - public Guid? UpdUserGuid { get; set; } + public bool? IsChangedOriginalAddress { get; set; } public virtual DssOrganization? ContainingOrganization { get; set; } diff --git a/server/StrDss.Data/Entities/DssRentalListing.cs b/server/StrDss.Data/Entities/DssRentalListing.cs index 712ceb3c..35ffdd98 100644 --- a/server/StrDss.Data/Entities/DssRentalListing.cs +++ b/server/StrDss.Data/Entities/DssRentalListing.cs @@ -29,124 +29,124 @@ public partial class DssRentalListing public string? BusinessLicenceNo { get; set; } /// - /// The local government issued licence number that should be used for compariing the rental offering with others + /// The Short Term Registry issued permit number /// - public string? EffectiveBusinessLicenceNo { get; set; } + public string? BcRegistryNo { get; set; } /// - /// The full name of the rental offering host that should be used for comparison with others + /// Indicates whether the entire dwelling unit is offered for rental (as opposed to a single bedroom) /// - public string? EffectiveHostNm { get; set; } + public bool? IsEntireUnit { get; set; } /// - /// The Short Term Registry issued permit number + /// The number of bedrooms in the dwelling unit that are available for short term rental /// - public string? BcRegistryNo { get; set; } + public short? AvailableBedroomsQty { get; set; } /// - /// Indicates whether the RENTAL LISTING VERSION is a CURRENT RENTAL LISTING (if it is a copy of the most current REPORTED RENTAL LISTING (having the same listing number for the same offering platform) + /// The number of nights that short term rental accommodation services were provided during the reporting period /// - public bool IsCurrent { get; set; } + public short? NightsBookedQty { get; set; } /// - /// Indicates whether a CURRENT RENTAL LISTING was included in the most recent RENTAL LISTING REPORT + /// The number of separate reservations that were taken during the reporting period /// - public bool? IsActive { get; set; } + public short? SeparateReservationsQty { get; set; } /// - /// Indicates whether a CURRENT RENTAL LISTING appeared for the first time in the last reporting period + /// Foreign key /// - public bool? IsNew { get; set; } + public long? IncludingRentalListingReportId { get; set; } /// - /// Indicates whether a CURRENT RENTAL LISTING has been reported as taken down by the offering platform + /// Foreign key /// - public bool? IsTakenDown { get; set; } + public long OfferingOrganizationId { get; set; } /// - /// Indicates whether a CURRENT RENTAL LISTING has received a different property address in the last reporting period + /// Foreign key /// - public bool? IsChangedOriginalAddress { get; set; } + public long? LocatingPhysicalAddressId { get; set; } /// - /// Indicates whether a CURRENT RENTAL LISTING has been subjected to address match changes by a user + /// Trigger-updated timestamp of last change /// - public bool? IsChangedAddress { get; set; } + public DateTime UpdDtm { get; set; } /// - /// Indicates whether a CURRENT RENTAL LISTING has been transferred to a different Local Goverment Organization as a result of address changes + /// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change /// - public bool? IsLgTransferred { get; set; } + public Guid? UpdUserGuid { get; set; } /// - /// Indicates whether a CURRENT RENTAL LISTING has been subjected to business licence linking changes by a user + /// Indicates whether the RENTAL LISTING VERSION is a CURRENT RENTAL LISTING (if it is a copy of the most current REPORTED RENTAL LISTING (having the same listing number for the same offering platform) /// - public bool? IsChangedBusinessLicence { get; set; } + public bool IsCurrent { get; set; } /// - /// Indicates whether the entire dwelling unit is offered for rental (as opposed to a single bedroom) + /// Indicates whether a CURRENT RENTAL LISTING has been reported as taken down by the offering platform /// - public bool? IsEntireUnit { get; set; } + public bool? IsTakenDown { get; set; } /// - /// Indicates when a CURRENT RENTAL LISTING was most recently transferred to a different Local Goverment Organization as a result of address changes + /// Foreign key /// - public DateTime? LgTransferDtm { get; set; } + public long? DerivedFromRentalListingId { get; set; } /// - /// The number of bedrooms in the dwelling unit that are available for short term rental + /// Indicates whether a CURRENT RENTAL LISTING was included in the most recent RENTAL LISTING REPORT /// - public short? AvailableBedroomsQty { get; set; } + public bool? IsActive { get; set; } /// - /// The number of nights that short term rental accommodation services were provided during the reporting period + /// Indicates whether a CURRENT RENTAL LISTING appeared for the first time in the last reporting period /// - public short? NightsBookedQty { get; set; } + public bool? IsNew { get; set; } /// - /// The number of separate reservations that were taken during the reporting period + /// Indicates whether a CURRENT RENTAL LISTING has been subjected to address match changes by a user /// - public short? SeparateReservationsQty { get; set; } + public bool? IsChangedAddress { get; set; } /// - /// Foreign key + /// Indicates whether a CURRENT RENTAL LISTING has been transferred to a different Local Goverment Organization as a result of address changes /// - public long OfferingOrganizationId { get; set; } + public bool? IsLgTransferred { get; set; } /// - /// Foreign key + /// Indicates whether a CURRENT RENTAL LISTING has received a different property address in the last reporting period /// - public long? IncludingRentalListingReportId { get; set; } + public bool? IsChangedOriginalAddress { get; set; } /// /// Foreign key /// - public long? DerivedFromRentalListingId { get; set; } + public string? ListingStatusType { get; set; } /// - /// Foreign key + /// The local government issued licence number that should be used for compariing the rental offering with others /// - public long? LocatingPhysicalAddressId { get; set; } + public string? EffectiveBusinessLicenceNo { get; set; } /// - /// Foreign key + /// The full name of the rental offering host that should be used for comparison with others /// - public long? GoverningBusinessLicenceId { get; set; } + public string? EffectiveHostNm { get; set; } /// - /// Foreign key + /// Indicates whether a CURRENT RENTAL LISTING has been subjected to business licence linking changes by a user /// - public string? ListingStatusType { get; set; } + public bool? IsChangedBusinessLicence { get; set; } /// - /// Trigger-updated timestamp of last change + /// Foreign key /// - public DateTime UpdDtm { get; set; } + public long? GoverningBusinessLicenceId { get; set; } /// - /// The globally unique identifier (assigned by the identity provider) for the most recent user to record a change + /// Indicates when a CURRENT RENTAL LISTING was most recently transferred to a different Local Goverment Organization as a result of address changes /// - public Guid? UpdUserGuid { get; set; } + public DateTime? LgTransferDtm { get; set; } public virtual DssRentalListing? DerivedFromRentalListing { get; set; } diff --git a/server/StrDss.Data/Entities/DssRentalListingReport.cs b/server/StrDss.Data/Entities/DssRentalListingReport.cs index 57d45218..1d8fad03 100644 --- a/server/StrDss.Data/Entities/DssRentalListingReport.cs +++ b/server/StrDss.Data/Entities/DssRentalListingReport.cs @@ -14,14 +14,14 @@ public partial class DssRentalListingReport public long RentalListingReportId { get; set; } /// - /// The month to which the listing information is relevant (always set to the first day of the month) + /// Indicates whether the rental listing version is the most recent one reported by the platform /// - public DateOnly ReportPeriodYm { get; set; } + public bool IsCurrent { get; set; } /// - /// Indicates whether the rental listing version is the most recent one reported by the platform + /// The month to which the listing information is relevant (always set to the first day of the month) /// - public bool IsCurrent { get; set; } + public DateOnly ReportPeriodYm { get; set; } /// /// Foreign key diff --git a/server/StrDss.Data/Entities/DssRentalListingVw.cs b/server/StrDss.Data/Entities/DssRentalListingVw.cs index 2bca3ec2..1f260c1a 100644 --- a/server/StrDss.Data/Entities/DssRentalListingVw.cs +++ b/server/StrDss.Data/Entities/DssRentalListingVw.cs @@ -104,6 +104,4 @@ public partial class DssRentalListingVw public bool? IsChangedBusinessLicence { get; set; } public DateTime? LgTransferDtm { get; set; } - - public bool? IsStrProhibited { get; set; } } diff --git a/server/StrDss.Data/Entities/DssUploadDelivery.cs b/server/StrDss.Data/Entities/DssUploadDelivery.cs index 04f5b502..508ef55a 100644 --- a/server/StrDss.Data/Entities/DssUploadDelivery.cs +++ b/server/StrDss.Data/Entities/DssUploadDelivery.cs @@ -33,11 +33,6 @@ public partial class DssUploadDelivery /// public byte[]? SourceBin { get; set; } - /// - /// Full text of the header line - /// - public string? SourceHeaderTxt { get; set; } - /// /// Foreign key /// @@ -53,6 +48,11 @@ public partial class DssUploadDelivery /// public Guid? UpdUserGuid { get; set; } + /// + /// Full text of the header line + /// + public string? SourceHeaderTxt { get; set; } + public virtual ICollection DssUploadLines { get; set; } = new List(); public virtual DssOrganization ProvidingOrganization { get; set; } = null!; diff --git a/server/StrDss.Data/Entities/DssUploadLine.cs b/server/StrDss.Data/Entities/DssUploadLine.cs index a2f25fbd..c4f398a5 100644 --- a/server/StrDss.Data/Entities/DssUploadLine.cs +++ b/server/StrDss.Data/Entities/DssUploadLine.cs @@ -23,11 +23,6 @@ public partial class DssUploadLine /// public bool IsSystemFailure { get; set; } - /// - /// Indicates that no further ingestion attempt is required for the upload line - /// - public bool IsProcessed { get; set; } - /// /// An immutable system code identifying the organization who created the information in the upload line (e.g. AIRBNB) /// @@ -53,5 +48,10 @@ public partial class DssUploadLine /// public long IncludingUploadDeliveryId { get; set; } + /// + /// Indicates that no further ingestion attempt is required for the upload line + /// + public bool IsProcessed { get; set; } + public virtual DssUploadDelivery IncludingUploadDelivery { get; set; } = null!; }