Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Forbury.Integrations.API.Models.Configuration;
using Forbury.Integrations.API.v1.Dto.Model;
using Forbury.Integrations.API.v1.Interfaces.Model;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.Extensions.Options;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Forbury.Integrations.API.v1.Dto.Model.Retail.Input;

namespace Forbury.Integrations.API.v1.Clients.Model
{
public class ForburyModelRetailApiClient : ForburyModelApiClient, IForburyModelRetaillApiClient
{
public ForburyModelRetailApiClient(HttpClient httpClient,
IOptions<ForburyConfiguration> configuration) :
base(httpClient, configuration)
{ }

public async Task<ModelDto> CreateModel(RetailValuationInputDto data,
string googlePropertyId,
int? teamId,
string externalId = null,
string fullAddress = null,
CancellationToken cancellationToken = default)
{
QueryBuilder queryBuilder = new QueryBuilder();
if (!string.IsNullOrEmpty(googlePropertyId)) queryBuilder.Add("googlePropertyId", googlePropertyId);
if (teamId.HasValue) queryBuilder.Add("teamId", teamId.ToString());
if (!string.IsNullOrEmpty(externalId)) queryBuilder.Add("externalId", externalId);
if (!string.IsNullOrEmpty(fullAddress)) queryBuilder.Add("fullAddress", fullAddress);

return await PostAsync<RetailValuationInputDto, ModelDto>($"retail/{queryBuilder.ToQueryString()}", data, cancellationToken);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public class SpaceDto
public LeaseDto Lease { get; set; }
public FirstRenewalDto FirstRenewal { get; set; }
public MarketAssumptionDto MarketAssumption { get; set; }

/// <summary>
/// Equivalent to growth/renewal type for each space,
/// It should exist in the future.renewalAssumptions, otherwise ignored
/// </summary>
public string RenewalAssumptionName { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Enums
{
public enum CarLevyType
{
None,
Leasee,
Leaseor
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Enums
{
public enum RecoveryLeaseType
{
Net,
Gross,
SemiGross,
IncreaseOverBase
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Forbury.Integrations.API.v1.Dto.Model.Commercial.Input.Future;
using System.Collections.Generic;

namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Future
{
public class RetailFuturesDto: FuturesDto
{
public new List<RetailRenewalAssumptionDto> RenewalAssumptions { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Collections.Generic;
using Forbury.Integrations.API.v1.Dto.Model.Commercial.Input.Future;

namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Future
{
public class RetailRenewalAssumptionDto: RenewalAssumptionDto
{
/// <summary>
/// Default Market Growth Rate for MAT & Rent
/// </summary>
public decimal? DefaultMarketGrowthRate { get; set; }

/// <summary>
/// Moving Annual Turnover Growth Rates by years (up to 20 years)
/// </summary>
public List<decimal?> MatGrowthRates { get; set; }

/// <summary>
/// Number of months of incentive for renewing lease
/// </summary>
public decimal? IncentiveRenewingMonths { get; set; }

/// <summary>
/// Number of months of incentive for new lease
/// </summary>
public decimal? IncentiveNewLeaseMonths { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Space.Lease.MovingAnnualTurnover;

namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.General
{
public class RetailGeneralDto: Commercial.Input.General.GeneralDto
{
/// <summary>
/// Property level Moving Annual Turnover setting
/// </summary>
public MovingAnnualTurnoverDto MAT { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.GeneralLedger
{
public class GeneralLedgerDto
{
public string Code { get; set; }
public string Description { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections.Generic;
using Forbury.Integrations.API.v1.Dto.Model.Commercial.Input;
using Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Future;
using Forbury.Integrations.API.v1.Dto.Model.Retail.Input.General;
using Forbury.Integrations.API.v1.Dto.Model.Retail.Input.GeneralLedger;
using Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Space;

namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input
{
public class RetailValuationInputDto : ValuationInputDto
{
public new RetailGeneralDto General { get; set; }
public new List<RetailSpaceDto> Spaces { get; set; }
public new RetailFuturesDto Futures { get; set; }

public List<GeneralLedgerDto> GeneralLedgers { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Space.Lease.MovingAnnualTurnover
{
public class MovingAnnualTurnoverDto
{
/// <summary>
/// True - GST Inclusive or False - Exclusive
/// </summary>
public bool Prior12MonthsGstInclusive { get; set; }

/// <summary>
/// True - GST Inclusive or False - Exclusive
/// </summary>
public bool Last12MonthsGstInclusive { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Space.Lease.PercentageRent
{
public class PercentageRentDto
{
/// <summary>
/// The type of percentage rent (supported input - "N" for natural, "U" for unnatural)
/// </summary>
public string Type { get; set; }

/// <summary>
/// The percentage for natural breakeven
/// </summary>
public decimal? Percentage { get; set; }

/// <summary>
/// Type of input for natural breakeven ("Base", "Base+Rec", "Promo")
/// </summary>
public string Basis { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Forbury.Integrations.API.v1.Dto.Model.Commercial.Input.Space.Renewal;
using Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Space.Lease.PercentageRent;

namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Space.Lease
{
public class RetailLeaseDto: Commercial.Input.Space.Lease.LeaseDto
{
/// <summary>
/// The MAT amount prior 12 months (GST inclusive/exclusive based on General.MAT.Prior12MonthsGstInclusive)
/// </summary>
public decimal? MATPrior12Months { get; set; }

/// <summary>
/// The MAT amount last 12 months (GST inclusive/exclusive based on General.MAT.Prior12MonthsGstInclusive)
/// </summary>
public decimal? MATLast12Months { get; set; }

/// <summary>
/// Provide up to 3 future options periods in years
/// </summary>
public new int[] Options { get; set; }

/// <summary>
/// The selected option index (0, 1, 2) zero based index, translated into 1, 2, 3 for the model.
/// </summary>
public int? AdoptedOption { get; set; }

/// <summary>
/// GOC Cap deal until first review
/// </summary>
public decimal? GocCap { get; set; }

/// <summary>
/// Review frequency in years
/// </summary>
public int? DefaultReviewFrequency { get; set; }

/// <summary>
/// Review type (e.g. Fixed % such as 2.5%, CPI, CPI+1.25, %RentAvg2Y, GOC8.5%)
/// </summary>
public string DefaultReviewType { get; set; }

public PercentageRentDto PercentageRent { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

using Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Space.Lease;

namespace Forbury.Integrations.API.v1.Dto.Model.Retail.Input.Space
{
public class RetailSpaceDto: Commercial.Input.Space.SpaceDto
{
/***
* General Ledger code used to lookup on General Ledger list provided
*/
public string GeneralLedgerCode { get; set; }

public new RetailLeaseDto Lease { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Threading;
using System.Threading.Tasks;
using Forbury.Integrations.API.v1.Dto.Model;
using Forbury.Integrations.API.v1.Dto.Model.Retail.Input;

namespace Forbury.Integrations.API.v1.Interfaces.Model
{
public interface IForburyModelRetaillApiClient : IForburyModelApiClient
{
Task<ModelDto> CreateModel(RetailValuationInputDto data,
string googlePropertyId,
int? teamId,
string externalId = null,
string fullAddress = null,
CancellationToken cancellationToken = default);
}
}
1 change: 1 addition & 0 deletions src/Forbury.Integrations/API/v1/ServiceBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal static void AddForburyServices(IServiceCollection services, string uriP
services.AddForburyHttpClient<IForburyModelApiClient, ForburyModelApiClient>(uriPrefix, "model");
services.AddForburyHttpClient<IForburyModelDatumApiClient, ForburyModelDatumApiClient>(uriPrefix, "model");
services.AddForburyHttpClient<IForburyModelCommercialApiClient, ForburyModelCommercialApiClient>(uriPrefix, "model");
services.AddForburyHttpClient<IForburyModelRetaillApiClient, ForburyModelRetailApiClient>(uriPrefix, "model");
services.AddForburyHttpClient<IForburyProductApiClient, ForburyProductApiClient>(uriPrefix, "product");
services.AddForburyHttpClient<IForburyPropertyApiClient, ForburyPropertyApiClient>(uriPrefix, "property");
services.AddForburyHttpClient<IForburyTeamApiClient, ForburyTeamApiClient>(uriPrefix, "team");
Expand Down
5 changes: 5 additions & 0 deletions src/Forbury.Integrations/Forbury.Integrations.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

<ItemGroup>
<Folder Include="API\v1\Dto\Model\Retail\Input\General\" />
<Folder Include="API\v1\Dto\Model\Retail\Input\Reporting\" />
</ItemGroup>

</Project>