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
4 changes: 4 additions & 0 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ stages:
projects: "$(TestProjects)"
arguments: '--configuration $(BuildConfiguration) --report-xunit-trx --coverage --coverage-output-format cobertura -- --filter-query "/[(Category=UnitTests)|(Mode=Readonly)]"'
env:
AllowedOrigins__0: "5207"
Features__IsScalarEnabled: true
Features__IsHttpsRedirectionEnabled: false
ASPNETCORE_ENVIRONMENT: Development
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
# - task: CmdLine@2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:

markup-lint:
name: Markup
uses: devpro/github-workflow-parts/.github/workflows/reusable-markup-lint.yml@87fc4cf004979998211b2c2126e903e7ea06f9c1
uses: devpro/github-workflow-parts/.github/workflows/reusable-markup-lint.yml@b5937db15c2a060f3c9dd989ca06bac7eccc75a7

code-quality:
name: Code
needs: git-check
if: needs.git-check.outputs.app_changed == 'true' || (github.event_name == 'workflow_dispatch' && inputs.run-code-quality)
uses: devpro/github-workflow-parts/.github/workflows/reusable-dotnet-quality.yml@87fc4cf004979998211b2c2126e903e7ea06f9c1
uses: devpro/github-workflow-parts/.github/workflows/reusable-dotnet-quality.yml@b5937db15c2a060f3c9dd989ca06bac7eccc75a7
with:
custom-commands: |
./scripts/mongodb-install.sh
Expand All @@ -61,7 +61,7 @@ jobs:
sonar-organization: ${{ vars.SONAR_ORG }}
sonar-project-key: ${{ vars.SONAR_PROJECT_KEY }}
sonar-project-name: Keeptrack
workflow-parts-version: 87fc4cf004979998211b2c2126e903e7ea06f9c1
workflow-parts-version: b5937db15c2a060f3c9dd989ca06bac7eccc75a7
secrets:
fossa-api-key: ${{ secrets.FOSSA_API_KEY }}
sonar-token: ${{ secrets.SONAR_TOKEN }}
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- name: "Web Api"
image-name: "keeptrack-webapi"
image-definition: "src/WebApi/Dockerfile"
uses: devpro/github-workflow-parts/.github/workflows/reusable-container-scan.yml@87fc4cf004979998211b2c2126e903e7ea06f9c1
uses: devpro/github-workflow-parts/.github/workflows/reusable-container-scan.yml@b5937db15c2a060f3c9dd989ca06bac7eccc75a7
with:
image-definition: ${{ matrix.image-definition }}
image-name: ${{ matrix.image-name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
permissions:
id-token: write
contents: read
uses: devpro/github-workflow-parts/.github/workflows/reusable-container-publication.yml@87fc4cf004979998211b2c2126e903e7ea06f9c1
uses: devpro/github-workflow-parts/.github/workflows/reusable-container-publication.yml@b5937db15c2a060f3c9dd989ca06bac7eccc75a7
with:
create-latest: ${{ github.ref_name == 'main' }}
image-definition: ${{ matrix.image-definition }}
Expand Down
2 changes: 1 addition & 1 deletion scripts/mongodb-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

echo "Install and start MongoDB 8.2"
curl --tlsv1.2 -sSf -L https://www.mongodb.org/static/pgp/server-8.0.asc | \
curl --proto "=https" --tlsv1.2 -sSf -L https://www.mongodb.org/static/pgp/server-8.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \
--dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.2 multiverse" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public record TokenRequest(string IdToken);
public class AuthenticationController : ControllerBase
{
[HttpPost("callback")]
[IgnoreAntiforgeryToken]
public async Task<IActionResult> Callback([FromBody] TokenRequest request)
{
if (string.IsNullOrWhiteSpace(request?.IdToken))
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorApp/Components/Inventory/Pages/Books.razor
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<input class="form-control" placeholder="Title" @bind="book.Title" />
<input class="form-control" placeholder="Author" @bind="book.Author" />
<input class="form-control" placeholder="Series" @bind="book.Series" />
<input class="form-control" placeholder="Finished at" @bind="book.FinishedAt" />
<input class="form-control" type="date" placeholder="Finished at" @bind="book.FinishedAt" @bind:format="yyyy-MM-dd" />
</FormTemplate>
<InlineEditTemplate Context="book">
<td><input class="form-control form-control-sm" @bind="book.Title" /></td>
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Models/BookModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public class BookModel : IHasIdAndOwnerId

public string? Series { get; set; }

public DateTime? FinishedAt { get; set; }
public DateOnly? FinishedAt { get; set; }
}
2 changes: 1 addition & 1 deletion src/Domain/Models/CarHistoryModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CarHistoryModel : IHasIdAndOwnerId

public required string CarId { get; set; }

public DateTime HistoryDate { get; set; }
public DateOnly HistoryDate { get; set; }

public int? Mileage { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/Domain/Models/VideoGameModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public class VideoGameModel : IHasIdAndOwnerId

public required string Platform { get; set; }

public DateTime? ReleasedAt { get; set; }
public DateOnly? ReleasedAt { get; set; }

public required string State { get; set; }

public DateTime? FinishedAt { get; set; }
public DateOnly? FinishedAt { get; set; }
}
2 changes: 1 addition & 1 deletion src/WebApi.Contracts/Dto/BookDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ public class BookDto : IHasId
/// <summary>
/// Book finished reading date.
/// </summary>
public DateTime? FinishedAt { get; set; }
public DateOnly? FinishedAt { get; set; }
}
2 changes: 1 addition & 1 deletion src/WebApi.Contracts/Dto/CarHistoryDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CarHistoryDto : IHasId
/// <summary>
/// History date.
/// </summary>
public DateTime HistoryDate { get; set; }
public DateOnly HistoryDate { get; set; }

/// <summary>
/// Mileage indicated on the car.
Expand Down
4 changes: 2 additions & 2 deletions src/WebApi.Contracts/Dto/VideoGameDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class VideoGameDto : IHasId
/// <summary>
/// Released date.
/// </summary>
public DateTime? ReleasedAt { get; set; }
public DateOnly? ReleasedAt { get; set; }

/// <summary>
/// Current payling state.
Expand All @@ -36,5 +36,5 @@ public class VideoGameDto : IHasId
/// <summary>
/// Finished date.
/// </summary>
public DateTime? FinishedAt { get; set; }
public DateOnly? FinishedAt { get; set; }
}
2 changes: 1 addition & 1 deletion src/WebApi/Controllers/DataCrudControllerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task<ActionResult<PagedResult<TDto>>> Get([FromQuery] PagedRequest
pagedRequest.PageSize,
pagedRequest.Search,
mapper.Map<TModel>(input));
return Ok(models.Map(model => mapper.Map<TDto>(model)));
return Ok(models.Map(mapper.Map<TDto>));
}

[HttpGet("{id}")]
Expand Down
3 changes: 3 additions & 0 deletions src/WebApi/MappingProfiles/DataStorageMappingProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ public DataStorageMappingProfile()

CreateMap<Infrastructure.MongoDb.Entities.VideoGame, Domain.Models.VideoGameModel>();
CreateMap<Domain.Models.VideoGameModel, Infrastructure.MongoDb.Entities.VideoGame>();

CreateMap<DateTime, DateOnly>().ConvertUsing(dt => DateOnly.FromDateTime(dt));
CreateMap<DateOnly, DateTime>().ConvertUsing(d => d.ToDateTime(TimeOnly.MinValue, DateTimeKind.Utc));
}
}
Loading