Отчет по вакансиям (#20)
Co-authored-by: gorbenko.pavel <gorbenko.pavel@tansu.kz> Reviewed-on: http://git.tnsu.kz/gorbenko.pavel/tnsu-approval-route/pulls/20
This commit was merged in pull request #20.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Tnsu.ApprovalRoute.Application.Reports;
|
||||
|
||||
/// <summary>
|
||||
/// Строка списка «Прием на работу — данные» в том объёме, в каком она нужна отчёту:
|
||||
/// на какую заявку на подбор ссылается, кого и когда приняли.
|
||||
/// </summary>
|
||||
internal sealed record HireLinkRow(
|
||||
int SelectionRequestId,
|
||||
string? SelectionRequestListId,
|
||||
string Status,
|
||||
string? CandidateName,
|
||||
string? ReplacedEmployee,
|
||||
DateOnly? HireDate)
|
||||
{
|
||||
public const string Select =
|
||||
"$select=Id,RequestStatus,SelectionRequestId,SelectionRequestListId," +
|
||||
"CandidateName,ReplacedEmployee,HireDate&$top=5000";
|
||||
|
||||
/// <summary>Заявка на приём без ссылки на подбор отчёту бесполезна — её отбрасываем.</summary>
|
||||
public static HireLinkRow? TryParse(JsonElement item)
|
||||
{
|
||||
var selectionId = SharePointJson.Int(item, "SelectionRequestId");
|
||||
if (selectionId is null or <= 0) return null;
|
||||
|
||||
return new HireLinkRow(
|
||||
selectionId.Value,
|
||||
SharePointJson.String(item, "SelectionRequestListId"),
|
||||
SharePointJson.String(item, "RequestStatus") ?? string.Empty,
|
||||
SharePointJson.String(item, "CandidateName"),
|
||||
SharePointJson.String(item, "ReplacedEmployee"),
|
||||
SharePointJson.Date(item, "HireDate"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user