2024-07-04 11:02:45 +05:00
|
|
|
using System;
|
2024-02-27 13:44:14 +05:00
|
|
|
using System.Collections.Generic;
|
2024-01-16 13:24:42 +05:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
2022-05-22 21:18:43 +05:00
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
namespace AsbCloudApp.Data;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Описание данных графика работ
|
|
|
|
/// </summary>
|
|
|
|
public class ScheduleDto : IId, IWellRelated, IValidatableObject
|
2022-05-22 21:18:43 +05:00
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
/// <inheritdoc/>
|
|
|
|
[Required]
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
[Required]
|
|
|
|
public int IdWell { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Идентификатор бурильщика
|
|
|
|
/// </summary>
|
|
|
|
[Required]
|
|
|
|
public int IdDriller { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Начало смены
|
|
|
|
/// </summary>
|
|
|
|
[Required]
|
|
|
|
public TimeDto ShiftStart { get; set; } = null!;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Конец смены
|
|
|
|
/// </summary>
|
|
|
|
[Required]
|
|
|
|
public TimeDto ShiftEnd { get; set; } = null!;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Начало бурения
|
|
|
|
/// </summary>
|
|
|
|
[Required]
|
|
|
|
public DateTimeOffset DrillStart { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Конец бурения
|
|
|
|
/// </summary>
|
|
|
|
[Required]
|
|
|
|
public DateTimeOffset DrillEnd { get; set; }
|
|
|
|
|
2022-05-22 21:18:43 +05:00
|
|
|
/// <summary>
|
2024-08-19 10:01:07 +05:00
|
|
|
/// Бурильщик
|
2022-05-22 21:18:43 +05:00
|
|
|
/// </summary>
|
2024-08-19 10:01:07 +05:00
|
|
|
public DrillerDto? Driller { get; set; }
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
2022-05-22 21:18:43 +05:00
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
if(DrillStart >= DrillEnd)
|
|
|
|
yield return new ValidationResult($"DrillStart > DrillEnd");
|
2022-05-22 21:18:43 +05:00
|
|
|
}
|
|
|
|
}
|