mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 13:03:12 +00:00
* Align EntityFrameworkCore.SqlServer and Tools to 8.0.8
* Add calendar/events backend API
Cherry-picked from main-backup (19994ef); scratch notes file removed.
* Require authentication on CalendarController
Security review found [Authorize] commented out, leaving all 6 calendar
endpoints anonymous. Enforce auth to match the API convention (17/23
controllers).
* Add CalendarController unit tests (xUnit + EF InMemory)
49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Data.SeaHavenIndustries
|
|
{
|
|
/// <summary>
|
|
/// Events entity for Calendar/Events module
|
|
/// Tracks calendar events, appointments, meetings, etc.
|
|
/// </summary>
|
|
public class Events : FullAuditEntity
|
|
{
|
|
[Required]
|
|
[StringLength(100)]
|
|
public string Title { get; set; } = null!;
|
|
|
|
public string? Description { get; set; }
|
|
|
|
[StringLength(150)]
|
|
public string? Location { get; set; }
|
|
|
|
// Related Record (can link to Accounts, Contacts, Work Orders, etc.)
|
|
public int? RecordID { get; set; }
|
|
public string? RecordName { get; set; }
|
|
public string? RecordTargetType { get; set; }
|
|
|
|
// Reminder Settings
|
|
public int ReminderMinutes { get; set; } = 15; // Default: 15 minutes before
|
|
|
|
// Color for calendar display
|
|
[StringLength(20)]
|
|
public string EventColor { get; set; } = "primary"; // primary, success, info, warning, danger
|
|
|
|
// Schedule
|
|
[Required]
|
|
public DateTime StartDate { get; set; }
|
|
|
|
[StringLength(10)]
|
|
public string? StartTime { get; set; } // e.g., "08:00 AM"
|
|
|
|
[Required]
|
|
public DateTime EndDate { get; set; }
|
|
|
|
[StringLength(10)]
|
|
public string? EndTime { get; set; } // e.g., "08:30 AM"
|
|
|
|
public bool AllDay { get; set; } = false;
|
|
}
|
|
}
|
|
|