Skip to content

Commit

Permalink
Merge pull request #653 from bcgov/yj
Browse files Browse the repository at this point in the history
Yj
  • Loading branch information
ychung-mot committed Sep 17, 2024
2 parents f3a3292 + 56625fb commit f80e759
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Binary file added gateway/Public Short-Term Rental Data API.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,17 @@ public async Task AddRentalListingAsync(DssRentalListing listing)
return listing;
}

/// <summary>
/// The definition of YTD has been changed to the current month and the past 11 months
/// </summary>
/// <param name="reportPeriodYm"></param>
/// <param name="offeringOrgId"></param>
/// <param name="listingId"></param>
/// <returns></returns>
public async Task<(short NightsBookedQty, short SeparateReservationsQty)> GetYtdValuesOfListingAsync(DateOnly reportPeriodYm, long offeringOrgId, string listingId)
{
var startPeriodYm = new DateOnly(reportPeriodYm.Year, 1, 1);
var startPeriodYm = reportPeriodYm.AddMonths(-11);

var ytdValues = await _dbContext.DssRentalListings.AsNoTracking()
.Where(x => x.OfferingOrganizationId == offeringOrgId
&& x.PlatformListingNo == listingId
Expand Down

0 comments on commit f80e759

Please sign in to comment.