feat(jobs): expose discovery provenance
This commit is contained in:
@@ -28,6 +28,7 @@ public sealed class JobDiscoveryController : ControllerBase
|
||||
{
|
||||
try
|
||||
{
|
||||
var retrievedAt = DateTimeOffset.UtcNow;
|
||||
var token = await GetTokenAsync(cancellationToken);
|
||||
var client = _clients.CreateClient();
|
||||
var entries = new Dictionary<string, DiscoveredJob>(StringComparer.OrdinalIgnoreCase);
|
||||
@@ -65,8 +66,12 @@ public sealed class JobDiscoveryController : ControllerBase
|
||||
feed.TryGetProperty("businessName", out var company) ? company.GetString() : null,
|
||||
feed.TryGetProperty("municipal", out var municipal) ? municipal.GetString() : null,
|
||||
item.TryGetProperty("date_modified", out var modified) && modified.TryGetDateTimeOffset(out var date) ? date : null,
|
||||
feed.TryGetProperty("applicationDue", out var applicationDue) && applicationDue.TryGetDateTimeOffset(out var deadline) ? deadline : null,
|
||||
$"https://arbeidsplassen.nav.no/stillinger/stilling/{id}",
|
||||
"nav",
|
||||
"NAV Arbeidsplassen",
|
||||
"searched",
|
||||
retrievedAt,
|
||||
"NO");
|
||||
}
|
||||
}
|
||||
@@ -106,5 +111,17 @@ public sealed class JobDiscoveryController : ControllerBase
|
||||
private static bool Contains(string? value, string filter) =>
|
||||
filter.Length == 0 || (value?.Contains(filter, StringComparison.OrdinalIgnoreCase) ?? false);
|
||||
|
||||
public sealed record DiscoveredJob(string Id, string Title, string? Company, string? Location, DateTimeOffset? ModifiedAt, string Url, string Source, string CountryCode);
|
||||
public sealed record DiscoveredJob(
|
||||
string Id,
|
||||
string Title,
|
||||
string? Company,
|
||||
string? Location,
|
||||
DateTimeOffset? ModifiedAt,
|
||||
DateTimeOffset? Deadline,
|
||||
string Url,
|
||||
string Source,
|
||||
string SourceName,
|
||||
string AcquisitionType,
|
||||
DateTimeOffset RetrievedAt,
|
||||
string CountryCode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user