trakker/Models/Client.cs

45 lines
1.0 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
namespace trakker.Models
{
public class Client
{
[Key]
public string ClientId { get; set; } = string.Empty;
[Required]
[MaxLength(200)]
public string Name { get; set; } = string.Empty;
[MaxLength(200)]
public string? Company { get; set; }
[EmailAddress]
[MaxLength(255)]
public string? Email { get; set; }
[Phone]
[MaxLength(50)]
public string? Phone { get; set; }
[MaxLength(500)]
public string? Address { get; set; }
[MaxLength(2000)]
public string? Notes { get; set; }
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
// Optional: Helper method for updating timestamp
public void UpdateTimestamp()
{
UpdatedAt = DateTime.UtcNow;
}
}
}