2026-04-28 18:55:14 -05:00
|
|
|
namespace SeaHaven.Services.DTOs
|
|
|
|
|
{
|
|
|
|
|
public class ContactDTO
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
public string? FirstName { get; set; }
|
|
|
|
|
public string? LastName { get; set; }
|
|
|
|
|
public string? Email { get; set; }
|
|
|
|
|
public string? Phone { get; set; }
|
|
|
|
|
public string? Mobile { get; set; }
|
|
|
|
|
public string? Title { get; set; }
|
|
|
|
|
public string? Type { get; set; }
|
|
|
|
|
public int? AccountId { get; set; }
|
|
|
|
|
public string? AccountName { get; set; }
|
|
|
|
|
public DateTime? CreatedDate { get; set; }
|
|
|
|
|
public string? CreatedBy { get; set; }
|
|
|
|
|
public DateTime? ModifiedDate { get; set; }
|
|
|
|
|
public string? ModifiedBy { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class CreateContactDTO
|
|
|
|
|
{
|
|
|
|
|
public required string FirstName { get; set; }
|
|
|
|
|
public required string LastName { get; set; }
|
|
|
|
|
public required string Email { get; set; }
|
|
|
|
|
public string? Phone { get; set; }
|
|
|
|
|
public string? Mobile { get; set; }
|
|
|
|
|
public string? Title { get; set; }
|
|
|
|
|
public string? Type { get; set; }
|
|
|
|
|
public int? AccountId { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class UpdateContactDTO
|
|
|
|
|
{
|
|
|
|
|
public string? FirstName { get; set; }
|
|
|
|
|
public string? LastName { get; set; }
|
|
|
|
|
public string? Email { get; set; }
|
|
|
|
|
public string? Phone { get; set; }
|
|
|
|
|
public string? Mobile { get; set; }
|
|
|
|
|
public string? Title { get; set; }
|
|
|
|
|
public string? Type { get; set; }
|
|
|
|
|
public int? AccountId { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class PagedResult<T>
|
|
|
|
|
{
|
|
|
|
|
public IEnumerable<T> Items { get; set; } = new List<T>();
|
|
|
|
|
public int TotalCount { get; set; }
|
|
|
|
|
public int Page { get; set; }
|
|
|
|
|
public int PageSize { get; set; }
|
2026-07-24 18:12:03 -03:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Page numbering base for <see cref="HasPrevious"/> / <see cref="HasNext"/>.
|
|
|
|
|
/// Default <c>1</c> (classic APIs). Work-order advanced search sets <c>0</c>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int PageBase { get; set; } = 1;
|
|
|
|
|
|
|
|
|
|
public int TotalPages => PageSize <= 0 ? 0 : (int)Math.Ceiling(TotalCount / (double)PageSize);
|
|
|
|
|
|
|
|
|
|
public bool HasPrevious => PageBase <= 0 ? Page > 0 : Page > 1;
|
|
|
|
|
|
|
|
|
|
public bool HasNext => PageBase <= 0 ? Page + 1 < TotalPages : Page < TotalPages;
|
2026-04-28 18:55:14 -05:00
|
|
|
}
|
|
|
|
|
}
|