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
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -70,4 +70,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
6 changes: 5 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test --no-build --verbosity normal --framework net8.0
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Forbury.Integrations.API.Models.Configuration;
using Forbury.Integrations.API.Models.Configuration;
using Forbury.Integrations.API.v1.Dto.Model;
using Forbury.Integrations.API.v1.Dto.Model.Commercial;
using Forbury.Integrations.API.v1.Dto.Model.Commercial.Input;
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;

namespace Forbury.Integrations.API.v1.Clients.Model
{
Expand All @@ -20,5 +23,21 @@ public async Task<ModelCommercialDetailedDto> GetModelById(int modelId,
{
return await GetAsync<ModelCommercialDetailedDto>($"commercial/{modelId}", cancellationToken);
}

public async Task<ModelDto> CreateModel(ValuationInputDto 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.ToString());
if (!string.IsNullOrEmpty(fullAddress)) queryBuilder.Add("fullAddress", fullAddress.ToString());

return await PostAsync<ValuationInputDto, ModelDto>($"commercial/{queryBuilder.ToQueryString()}", data, cancellationToken);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Forbury.Integrations.API.v1.Dto.Model.Commercial.Input.Enums
{
public enum LeaseType
{
G,
IOB,
S,
N
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class LeaseDto
{
public decimal BaseRent { get; set; }

[JsonConverter(typeof(StringEnumConverter))]
public LeaseType LeaseType { get; set; }

[JsonConverter(typeof(DateFormatConverter), JsonFormats.DateFormat)]
public DateTime? StartDate { get; set; }
[JsonConverter(typeof(DateFormatConverter), JsonFormats.DateFormat)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
using System.Threading;
using System.Threading.Tasks;
using Forbury.Integrations.API.v1.Dto.Model;
using Forbury.Integrations.API.v1.Dto.Model.Commercial;
using Forbury.Integrations.API.v1.Dto.Model.Commercial.Input;

namespace Forbury.Integrations.API.v1.Interfaces.Model
{
public interface IForburyModelCommercialApiClient : IForburyModelApiClient
{
Task<ModelCommercialDetailedDto> GetModelById(int modelId,
CancellationToken cancellationToken = default);

Task<ModelDto> CreateModel(ValuationInputDto data,
string googlePropertyId,
int? teamId,
string externalId = null,
string fullAddress = null,
CancellationToken cancellationToken = default);
}
}
2 changes: 1 addition & 1 deletion src/Forbury.Integrations/Forbury.Integrations.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.7.4</Version>
<Version>1.8.0</Version>
<Authors>Forbury Development Team</Authors>
<Company>Forbury</Company>
<PackageDescription>This .NET client library provides a quick and easy option for integrating with Forbury APIs.</PackageDescription>
Expand Down