diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9409310d..1dfeada3 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "mapster.tool": { - "version": "6.5.0", + "version": "8.0.0", "commands": [ "dotnet-mapster" ] diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5d3ece05..e34e38c4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,7 +2,7 @@ # the repo. Unless a later match takes precedence, # @global-owner1 and @global-owner2 will be requested for # review when someone opens a pull request. -* @devinleighsmith @WadeBarnes @seeker25 @marzmehr +* @devinleighsmith @WadeBarnes @marzmehr # Order is important; the last matching pattern takes the most # precedence. When someone opens a pull request that only diff --git a/api/Startup.cs b/api/Startup.cs index af1c8272..4018a482 100644 --- a/api/Startup.cs +++ b/api/Startup.cs @@ -26,6 +26,8 @@ using SS.Api.services.ef; using SS.Db.models; using Microsoft.Extensions.Logging; +using Quartz; +using SS.Api.cronjobs; namespace SS.Api { @@ -137,6 +139,12 @@ public void ConfigureServices(IServiceCollection services) }); services.AddSwaggerGenNewtonsoftSupport(); + + services.AddQuartz(q => + { + q.AddJobAndTrigger(Configuration); + }); + services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) diff --git a/api/api.csproj b/api/api.csproj index 4cb06732..dd4a0c01 100644 --- a/api/api.csproj +++ b/api/api.csproj @@ -1,23 +1,22 @@  - netcoreapp3.1 + net5.0 SS.Api de959767-ede6-4f8a-b6b9-d36aed70339C 6224c484-3e23-4f06-a749-195c1e478110 - bin\$(Configuration)\netcoreapp3.1\api.xml + bin\$(Configuration)\net5.0\api.xml 1701;1702;1591 1701;1702;1591 - bin\$(Configuration)\netcoreapp3.1\api.xml + bin\$(Configuration)\net5.0\api.xml - - + @@ -34,10 +33,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/api/appsettings.json b/api/appsettings.json index 0a918c81..bd01df92 100644 --- a/api/appsettings.json +++ b/api/appsettings.json @@ -1,5 +1,7 @@ { "WebBaseHref": "/sheriff-scheduling/", + "PdfUrl": "http://localhost:5001", + "TrainingNotification": "0 30 5 * * ?", // Hint: Override these in secrets when doing local development. ByPassAuthAndUseImpersonatedUser - only works in development mode. "ByPassAuthAndUseImpersonatedUser": "true", "ImpersonateUser": { diff --git a/api/controllers/scheduling/DistributeScheduleController.cs b/api/controllers/scheduling/DistributeScheduleController.cs index a2019910..63fd880c 100644 --- a/api/controllers/scheduling/DistributeScheduleController.cs +++ b/api/controllers/scheduling/DistributeScheduleController.cs @@ -8,6 +8,7 @@ using SS.Api.helpers; using SS.Api.helpers.extensions; using SS.Api.infrastructure.authorization; +using SS.Api.models.dto; using SS.Api.models.dto.generated; using SS.Api.services.scheduling; using SS.Common.helpers.extensions; @@ -17,6 +18,7 @@ namespace SS.Api.controllers.scheduling { [Route("api/[controller]")] + [ApiController] public class DistributeScheduleController : ControllerBase { private DistributeScheduleService DistributeScheduleService { get; } @@ -24,7 +26,7 @@ public class DistributeScheduleController : ControllerBase private SheriffDbContext Db { get; } private IConfiguration Configuration { get; } - public DistributeScheduleController(DistributeScheduleService distributeSchedule, ShiftService shiftService, SheriffDbContext db, IConfiguration configuration) + public DistributeScheduleController(DistributeScheduleService distributeSchedule, ShiftService shiftService, SheriffDbContext db, IConfiguration configuration) { DistributeScheduleService = distributeSchedule; ShiftService = shiftService; @@ -73,5 +75,25 @@ public async Task>> GetDistributeSchedul return Ok(shiftsWithDuties.Adapt>()); } + + [HttpPost("print")] + [PermissionClaimAuthorize(perm: Permission.ViewDistributeSchedule)] + public async Task Print(PdfHtml pdfhtml) + { + var pdfContent = await DistributeScheduleService.PrintService(pdfhtml.html); + return new FileContentResult(pdfContent, "application/pdf"); + } + + [HttpPost("email")] + [PermissionClaimAuthorize(perm: Permission.ViewDistributeSchedule)] + public async Task Email(PdfHtml pdfhtml) + { + var pdfContent = await DistributeScheduleService.PrintService(pdfhtml.html); + + var senderEmail = $"{User.Email()}"; + await DistributeScheduleService.EmailService(senderEmail, pdfhtml.recipients, pdfhtml.emailSubject, pdfhtml.emailContent, pdfContent); + + return Ok("Email Sent."); + } } -} +} \ No newline at end of file diff --git a/api/controllers/usermanagement/SheriffController.cs b/api/controllers/usermanagement/SheriffController.cs index 72c8b5fe..3778402e 100644 --- a/api/controllers/usermanagement/SheriffController.cs +++ b/api/controllers/usermanagement/SheriffController.cs @@ -32,15 +32,17 @@ public class SheriffController : UserController private ShiftService ShiftService { get; } private DutyRosterService DutyRosterService { get; } private SheriffDbContext Db { get; } + private TrainingService TrainingService { get; } // ReSharper disable once InconsistentNaming private readonly long _uploadPhotoSizeLimitKB; - public SheriffController(SheriffService sheriffService, DutyRosterService dutyRosterService, ShiftService shiftService, UserService userUserService, IConfiguration configuration, SheriffDbContext db) : base(userUserService) + public SheriffController(SheriffService sheriffService, DutyRosterService dutyRosterService, ShiftService shiftService, UserService userUserService,TrainingService trainingService, IConfiguration configuration, SheriffDbContext db) : base(userUserService) { SheriffService = sheriffService; ShiftService = shiftService; DutyRosterService = dutyRosterService; + TrainingService = trainingService; Db = db; _uploadPhotoSizeLimitKB = Convert.ToInt32(configuration.GetNonEmptyValue("UploadPhotoSizeLimitKB")); } @@ -155,6 +157,15 @@ public async Task> UploadPhoto(Guid? id, string badgeNu return Ok(sheriff.Adapt()); } + [HttpPut] + [Route("updateExcused")] + [PermissionClaimAuthorize(perm: Permission.GenerateReports)] + public async Task> UpdateExcused(Sheriff excusedSheriff) + { + var sheriff = await SheriffService.UpdateSheriffExcused(excusedSheriff); + return Ok(sheriff.Adapt()); + } + #endregion Sheriff #region SheriffAwayLocation @@ -268,6 +279,28 @@ public async Task RemoveSheriffLeave(int id, string expiryReason) #endregion SheriffLeave + #region SheriffTrainingReports + + [HttpPost] + [Route("training/reports")] + [PermissionClaimAuthorize(perm: Permission.GenerateReports)] + public async Task> GetSheriffsTrainingReports(TrainingReportSearchDto trainingReportSearch) + { + var sheriffs = await TrainingService.GetSheriffsTrainingReports(trainingReportSearch); + return Ok(sheriffs.Adapt>()); + } + + [HttpGet] + [Route("training/adjust-expiry")] + [PermissionClaimAuthorize(perm: Permission.AdjustTrainingExpiry)] + public async Task TrainingExpiryAdjustment() + { + await TrainingService.TrainingExpiryAdjustment(); + return Ok(new { result = "success"}); + } + + #endregion SheriffTrainingReports + #region SheriffTraining [HttpGet] diff --git a/api/cronjobs/QuartzConfigService.cs b/api/cronjobs/QuartzConfigService.cs new file mode 100644 index 00000000..52e03654 --- /dev/null +++ b/api/cronjobs/QuartzConfigService.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.Extensions.Configuration; +using Quartz; + +namespace SS.Api.cronjobs +{ + public static class QuartzConfigService + { + public static void AddJobAndTrigger( + this IServiceCollectionQuartzConfigurator quartz, + IConfiguration config) + where T : IJob + { + + string jobName = typeof(T).Name; + var configKey = $"{jobName}"; + var cronSchedule = config[configKey]; + + if (string.IsNullOrEmpty(cronSchedule)) + { + throw new Exception($"No Quartz.NET Cron schedule found for job in configuration at {configKey}"); + } + + var jobKey = new JobKey(jobName); + quartz.AddJob(opts => opts.WithIdentity(jobKey)); + + quartz.AddTrigger(opts => opts + .ForJob(jobKey) + .WithIdentity(jobName + "-trigger") + .WithCronSchedule(cronSchedule)); + + } + } +} \ No newline at end of file diff --git a/api/cronjobs/TrainingNotification.cs b/api/cronjobs/TrainingNotification.cs new file mode 100644 index 00000000..25bfaada --- /dev/null +++ b/api/cronjobs/TrainingNotification.cs @@ -0,0 +1,89 @@ + + +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Quartz; +using SS.Api.services; +using SS.Api.services.usermanagement; +using SS.Db.models.sheriff; + +namespace SS.Api.cronjobs +{ + [DisallowConcurrentExecution] + public class TrainingNotification: IJob + { + private readonly ILogger Logger; + public IServiceProvider Services { get; } + + public TrainingNotification(ILogger logger, IServiceProvider services, ManageTypesService manageTypesService) + { + Logger = logger; + Services = services; + } + + public async void ProcessTrainings() + { + using var scope = Services.CreateScope(); + var TrainingService = scope.ServiceProvider.GetRequiredService(); + var ChesEmailService = scope.ServiceProvider.GetRequiredService(); + + var trainings = await TrainingService.GetTrainings(); + foreach(var training in trainings) + { + var noticeDate = DateTimeOffset.UtcNow.AddDays(training.TrainingType.AdvanceNotice); + + Logger.LogInformation(training.TrainingCertificationExpiry.ToString()); + Logger.LogInformation((training.TrainingCertificationExpiry < noticeDate).ToString()); + Logger.LogInformation(training.Sheriff.Email); + + if(training.TrainingCertificationExpiry < noticeDate){ + + bool rotatingTraining = TrainingService.IsRotatingTraining(training.TrainingType); + var emailBody = rotatingTraining? GetEmailRotatingBody(training) : GetEmailEndOfYearBody(training); + var emailTitle = rotatingTraining? "Training Expiry Notice" : "Training Requalification Notice"; + + var emailSent = await ChesEmailService.SendEmail( + emailBody, + emailTitle, + training.Sheriff.Email + ); + if(emailSent) + await TrainingService.UpdateTraining(training.Id); + } + } + Logger.LogInformation("CronJob Done"); + } + + public string GetEmailRotatingBody(SheriffTraining training) + { + var expiryDate = training.TrainingCertificationExpiry.Value.ToString("MMMM dd, yyyy"); + var emailBody = + $"Dear {training.Sheriff.FirstName} {training.Sheriff.LastName}, \n\n"+ + $"Your \'{training.TrainingType.Code}\' certification will expire on \'{expiryDate}\'. \n"+ + "Please ensure your certification is renewed before this date."; + + return emailBody; + } + + public string GetEmailEndOfYearBody(SheriffTraining training) + { + var expiryYear = training.TrainingCertificationExpiry.Value.AddDays(-1).AddYears(1).ToString("yyyy"); + var emailBody = + $"Dear {training.Sheriff.FirstName} {training.Sheriff.LastName}, \n\n"+ + $"Your \'{training.TrainingType.Code}\' certification will require renewal for the calendar year \'{expiryYear}\'. \n"+ + $"Please ensure you renew your certification between January 1st and December 31, {expiryYear}. \n\n" + + "It is recommended to schedule training early in the year to ensure end of year compliance."; + + return emailBody; + } + + public Task Execute(IJobExecutionContext context) + { + Logger.LogInformation("___Running CronJob___"); + ProcessTrainings(); + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/api/helpers/ConfigurationExtensions.cs b/api/helpers/ConfigurationExtensions.cs index 5f8380ce..e6d7d386 100644 --- a/api/helpers/ConfigurationExtensions.cs +++ b/api/helpers/ConfigurationExtensions.cs @@ -12,5 +12,13 @@ public static string GetNonEmptyValue(this IConfiguration configuration, string ? throw new ConfigurationException($"Configuration '{key}' is invalid or missing.") : configurationValue; } + + public static string GetBoolValue(this IConfiguration configuration, string key) + { + var configurationValue = configuration.GetValue(key); + return string.IsNullOrEmpty(configurationValue) + ? "false" + : configurationValue; + } } } \ No newline at end of file diff --git a/api/helpers/extensions/ClaimExtensions.cs b/api/helpers/extensions/ClaimExtensions.cs index 9b6f06f7..3e6fc93b 100644 --- a/api/helpers/extensions/ClaimExtensions.cs +++ b/api/helpers/extensions/ClaimExtensions.cs @@ -11,7 +11,7 @@ public static class ClaimExtensions public static string GetValueByType(this IEnumerable claims, string type) => claims.FirstOrDefault(c => c.Type == type)?.Value; - public static string GetIdirUserName(this IEnumerable claims) => + public static string GetIdirUserName(this IEnumerable claims) => claims.GetValueByType(CustomClaimTypes.IdirUserName).Replace("@idir", "").ToLower(); public static Guid GetIdirId(this IEnumerable claims) => @@ -42,8 +42,11 @@ public static int HomeLocationId(this ClaimsPrincipal user) public static string IdirId(this ClaimsPrincipal user) => user.FindFirstValue(CustomClaimTypes.IdirId); + public static string Email(this ClaimsPrincipal user) => + user.FindFirstValue(ClaimTypes.Email); + public static string IdirUserName(this ClaimsPrincipal user) => - user.FindFirstValue(CustomClaimTypes.IdirUserName).Replace("@idir",""); + user.FindFirstValue(CustomClaimTypes.IdirUserName).Replace("@idir", ""); public static Guid CurrentUserId(this ClaimsPrincipal user) { @@ -52,6 +55,5 @@ public static Guid CurrentUserId(this ClaimsPrincipal user) throw new InvalidOperationException("Missing UserId Guid from claims."); return userId; } - } -} +} \ No newline at end of file diff --git a/api/infrastructure/ServiceCollectionExtensions.cs b/api/infrastructure/ServiceCollectionExtensions.cs index 779d780b..b6b93fc4 100644 --- a/api/infrastructure/ServiceCollectionExtensions.cs +++ b/api/infrastructure/ServiceCollectionExtensions.cs @@ -70,6 +70,7 @@ public static IServiceCollection AddSSServices(this IServiceCollection services, services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); diff --git a/api/models/ches/ChesEmailOptions.cs b/api/models/ches/ChesEmailOptions.cs index 299f8d7e..ef3e72e7 100644 --- a/api/models/ches/ChesEmailOptions.cs +++ b/api/models/ches/ChesEmailOptions.cs @@ -22,4 +22,12 @@ public void ValidateOptions() SenderName.ThrowConfigurationExceptionIfNull($"{Position}:{SenderName}"); } } -} + + public class ChesEmailAttachment + { + public string content { get; set; } + public string contentType { get; set; } + public string encoding { get; set; } + public string filename { get; set; } + } +} \ No newline at end of file diff --git a/api/models/dto/AddLookupCodeDto.cs b/api/models/dto/AddLookupCodeDto.cs index b890cfb1..a378b1df 100644 --- a/api/models/dto/AddLookupCodeDto.cs +++ b/api/models/dto/AddLookupCodeDto.cs @@ -11,6 +11,11 @@ public class AddLookupCodeDto public DateTimeOffset? EffectiveDate { get; set; } public DateTimeOffset? ExpiryDate { get; set; } public int? LocationId { get; set; } + public bool? Mandatory { get; set; } + public bool? Rotating { get; set; } + public int? ValidityPeriod { get; set; } + public string? Category { get; set; } + public int? AdvanceNotice { get; set; } public AddLookupSortOrderDto SortOrderForLocation { get; set; } } } diff --git a/api/models/dto/PdfHtml.cs b/api/models/dto/PdfHtml.cs new file mode 100644 index 00000000..12d5fd14 --- /dev/null +++ b/api/models/dto/PdfHtml.cs @@ -0,0 +1,10 @@ +namespace SS.Api.models.dto +{ + public class PdfHtml + { + public string html { get; set; } + public string recipients { get; set; } + public string emailContent { get; set; } + public string emailSubject { get; set; } + } +} \ No newline at end of file diff --git a/api/models/dto/TrainingReportDto.cs b/api/models/dto/TrainingReportDto.cs new file mode 100644 index 00000000..a29a7501 --- /dev/null +++ b/api/models/dto/TrainingReportDto.cs @@ -0,0 +1,16 @@ +using System; + +namespace SS.Api.models.dto +{ + public class TrainingReportDto + { + public string name { get; set; } + public string trainingType { get; set; } + public DateTimeOffset? end { get; set; } + public DateTimeOffset? expiryDate { get; set; } + public bool excluded { get; set; } + public Guid sheriffId { get; set; } + public string status { get; set; } + public string _rowVariant { get; set; } + } +} \ No newline at end of file diff --git a/api/models/dto/TrainingReportSearchDto.cs b/api/models/dto/TrainingReportSearchDto.cs new file mode 100644 index 00000000..7b52535f --- /dev/null +++ b/api/models/dto/TrainingReportSearchDto.cs @@ -0,0 +1,14 @@ +using System; + + +namespace SS.Api.models.dto +{ + public class TrainingReportSearchDto + { + public int? regionId { get; set; } + public int? locationId { get; set; } + public int? reportSubtypeId { get; set; } + public DateTimeOffset? startDate { get; set; } + public DateTimeOffset? endDate { get; set; } + } +} \ No newline at end of file diff --git a/api/models/dto/generated/DutySlotDto.g.cs b/api/models/dto/generated/DutySlotDto.g.cs index ac0fb893..eb3402a6 100644 --- a/api/models/dto/generated/DutySlotDto.g.cs +++ b/api/models/dto/generated/DutySlotDto.g.cs @@ -20,6 +20,8 @@ public partial class DutySlotDto public bool IsOvertime { get; set; } public bool IsClosed { get; set; } public LookupCodeDto AssignmentLookupCode { get; set; } + public string DutyComment { get; set; } + public string AssignmentComment { get; set; } public uint ConcurrencyToken { get; set; } } } \ No newline at end of file diff --git a/api/models/dto/generated/LookupCodeDto.g.cs b/api/models/dto/generated/LookupCodeDto.g.cs index 16ab386b..5255a645 100644 --- a/api/models/dto/generated/LookupCodeDto.g.cs +++ b/api/models/dto/generated/LookupCodeDto.g.cs @@ -15,6 +15,11 @@ public partial class LookupCodeDto public DateTimeOffset? ExpiryDate { get; set; } public LocationDto Location { get; set; } public int? LocationId { get; set; } + public bool Mandatory { get; set; } + public int ValidityPeriod { get; set; } + public string Category { get; set; } + public int AdvanceNotice { get; set; } + public bool Rotating { get; set; } public uint ConcurrencyToken { get; set; } public LookupSortOrderDto SortOrderForLocation { get; set; } } diff --git a/api/models/dto/generated/SheriffDto.g.cs b/api/models/dto/generated/SheriffDto.g.cs index fe20f847..71982d91 100644 --- a/api/models/dto/generated/SheriffDto.g.cs +++ b/api/models/dto/generated/SheriffDto.g.cs @@ -16,6 +16,7 @@ public partial class SheriffDto public List Training { get; set; } public string PhotoUrl { get; set; } public DateTimeOffset LastPhotoUpdate { get; set; } + public bool Excused { get; set; } public Guid Id { get; set; } public bool IsEnabled { get; set; } public string FirstName { get; set; } diff --git a/api/models/dto/generated/SheriffTrainingDto.g.cs b/api/models/dto/generated/SheriffTrainingDto.g.cs index 3f19255d..7f406248 100644 --- a/api/models/dto/generated/SheriffTrainingDto.g.cs +++ b/api/models/dto/generated/SheriffTrainingDto.g.cs @@ -9,6 +9,7 @@ public partial class SheriffTrainingDto public int? TrainingTypeId { get; set; } public DateTimeOffset? TrainingCertificationExpiry { get; set; } public string Note { get; set; } + public bool FirstNotice { get; set; } public int Id { get; set; } public DateTimeOffset StartDate { get; set; } public DateTimeOffset EndDate { get; set; } diff --git a/api/models/dto/generated/ShiftAvailabilityConflictDto.g.cs b/api/models/dto/generated/ShiftAvailabilityConflictDto.g.cs new file mode 100644 index 00000000..5b17b66c --- /dev/null +++ b/api/models/dto/generated/ShiftAvailabilityConflictDto.g.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using SS.Api.models.dto.generated; +using SS.Db.models.scheduling.notmapped; + +namespace SS.Api.models.dto.generated +{ + public partial class ShiftAvailabilityConflictDto + { + public Guid? SheriffId { get; set; } + public ShiftConflictType Conflict { get; set; } + public DateTimeOffset Start { get; set; } + public DateTimeOffset End { get; set; } + public int? LocationId { get; set; } + public LocationDto Location { get; set; } + public int? ShiftId { get; set; } + public string WorkSection { get; set; } + public string Timezone { get; set; } + public double OvertimeHours { get; set; } + public string SheriffEventType { get; set; } + public string Comment { get; set; } + public ICollection DutySlots { get; set; } + } +} \ No newline at end of file diff --git a/api/models/dto/generated/ShiftAvailabilityDto.g.cs b/api/models/dto/generated/ShiftAvailabilityDto.g.cs index 85411abd..48daf9c3 100644 --- a/api/models/dto/generated/ShiftAvailabilityDto.g.cs +++ b/api/models/dto/generated/ShiftAvailabilityDto.g.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using SS.Api.models.dto.generated; -using SS.Db.models.scheduling.notmapped; namespace SS.Api.models.dto.generated { @@ -9,7 +8,7 @@ public partial class ShiftAvailabilityDto { public DateTimeOffset Start { get; set; } public DateTimeOffset End { get; set; } - public List Conflicts { get; set; } + public List Conflicts { get; set; } public SheriffDto Sheriff { get; set; } public Guid? SheriffId { get; set; } } diff --git a/api/models/types/TrainingStatus.cs b/api/models/types/TrainingStatus.cs new file mode 100644 index 00000000..7ef9de04 --- /dev/null +++ b/api/models/types/TrainingStatus.cs @@ -0,0 +1,8 @@ +namespace SS.Api.models.types +{ + public class TrainingStatus + { + public string status; + public string rowType; + } +} diff --git a/api/models/types/TrainingStatusTypes.cs b/api/models/types/TrainingStatusTypes.cs new file mode 100644 index 00000000..9249ebde --- /dev/null +++ b/api/models/types/TrainingStatusTypes.cs @@ -0,0 +1,10 @@ +namespace SS.Api.models.types +{ + public static class TrainingStatusTypes + { + public static readonly string danger = "Not Taken"; + public static readonly string alert = "Expired"; + public static readonly string warning = "Requalification"; + public static readonly string notify = "Notified"; + } +} diff --git a/api/services/ChesEmailService.cs b/api/services/ChesEmailService.cs index fb8e43c6..7b36c03e 100644 --- a/api/services/ChesEmailService.cs +++ b/api/services/ChesEmailService.cs @@ -56,7 +56,7 @@ public async Task GetEmailServiceToken() return null; } - public async Task SendEmail(string body, string subject, string recipientEmail) + public async Task SendEmail(string body, string subject, string recipientEmail) { body.ThrowIfNullOrEmpty(nameof(body)); subject.ThrowIfNullOrEmpty(nameof(subject)); @@ -81,7 +81,7 @@ public async Task SendEmail(string body, string subject, string recipientEmail) cc = new List(), delayTS = 0, encoding = "utf-8", - from = $@"{_chesEmailOptions.SenderName} <{_chesEmailOptions.SenderEmail}>", //This isn't clear in their documentation. + from = $@"{_chesEmailOptions.SenderName} <{_chesEmailOptions.SenderEmail}>", //This isn't clear in their documentation. priority = "normal", subject, to, @@ -97,12 +97,72 @@ public async Task SendEmail(string body, string subject, string recipientEmail) throw new BadRequestException($"While sending email - Received status code: {response.StatusCode} : {contents}"); Logger.LogInformation($"Email sent to {recipientEmail} successfully."); + return true; } catch (Exception e) { Logger.LogError(e, "Error happened while trying to send email."); + return false; } } - } -} + public async Task SendEmailWithPdfAttachment(string body, string subject, string from, string recipientEmail, byte[] pdfContent) + { + body.ThrowIfNullOrEmpty(nameof(body)); + subject.ThrowIfNullOrEmpty(nameof(subject)); + from.ThrowIfNullOrEmpty(nameof(from)); + recipientEmail.ThrowIfNullOrEmpty(nameof(recipientEmail)); + var attachments = new List(); + attachments.Add( + new ChesEmailAttachment + { + content = Convert.ToBase64String(pdfContent), + contentType = "application/pdf", + encoding = "base64", + filename = "Shift_Schedule.pdf" + } + ); + + var to = recipientEmail.Split(",").ToList(); + var emailServiceToken = await GetEmailServiceToken(); + emailServiceToken.ThrowIfNullOrEmpty(nameof(emailServiceToken)); + + var requestMessage = new HttpRequestMessage(HttpMethod.Post, _chesEmailOptions.EmailUrl); + requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", emailServiceToken); + + Logger.LogDebug($"Attempting to Send email to {recipientEmail}."); + try + { + var email = new + { + bcc = new List(), + bodyType = "text", + body, + cc = new List(), + delayTS = 0, + encoding = "utf-8", + from, + priority = "normal", + subject, + to, + tag = Guid.NewGuid(), + attachments + }; + + requestMessage.Content = + new StringContent(JsonConvert.SerializeObject(email), Encoding.UTF8, "application/json"); + + var response = await HttpClient.SendAsync(requestMessage); + var contents = await response.Content.ReadAsStringAsync(); + if (!response.IsSuccessStatusCode) + throw new BadRequestException($"While sending email - Received status code: {response.StatusCode} : {contents}"); + + Logger.LogInformation($"Email sent to {recipientEmail} successfully."); + } + catch (Exception e) + { + Logger.LogError(e, "Error happened while trying to send email."); + } + } + } +} \ No newline at end of file diff --git a/api/services/JC/JCDataUpdaterService.cs b/api/services/JC/JCDataUpdaterService.cs index a665fdde..9e4fd654 100644 --- a/api/services/JC/JCDataUpdaterService.cs +++ b/api/services/JC/JCDataUpdaterService.cs @@ -28,6 +28,7 @@ public class JCDataUpdaterService private bool ExpireRegions { get; } private bool ExpireLocations { get; } private bool ExpireRooms { get; } + private bool SkipLocationUpdates { get; } private bool AssociateUsersWithNoLocationToVictoria { get; } private TimeSpan UpdateEvery { get; } @@ -36,6 +37,7 @@ public JCDataUpdaterService(SheriffDbContext dbContext, LocationServicesClient l LocationClient = locationClient; Db = dbContext; Configuration = configuration; + SkipLocationUpdates = Configuration.GetBoolValue("SkipLocationUpdates").Equals("true"); ExpireRegions = Configuration.GetNonEmptyValue("JCSynchronization:ExpireRegions").Equals("true"); ExpireLocations = Configuration.GetNonEmptyValue("JCSynchronization:ExpireLocations").Equals("true"); ExpireRooms = Configuration.GetNonEmptyValue("JCSynchronization:ExpireCourtRooms").Equals("true"); @@ -55,6 +57,7 @@ public async Task ShouldSynchronize() return true; } + if(SkipLocationUpdates) return false; if (jcSynchronization.LastSynchronization.Add(UpdateEvery) > DateTimeOffset.UtcNow) return false; jcSynchronization.LastSynchronization = DateTimeOffset.UtcNow; await Db.SaveChangesAsync(); diff --git a/api/services/ManageTypesService.cs b/api/services/ManageTypesService.cs index f5b5fea9..b85e76b1 100644 --- a/api/services/ManageTypesService.cs +++ b/api/services/ManageTypesService.cs @@ -139,6 +139,26 @@ public async Task> GetAll(LookupTypes? codeType, int? locationI return lookupCodes; } + public async Task> GetAllForReports(int? id, LookupTypes? codeType, int? locationId, bool? mandatory, bool showExpired = false) + { + var lookupCodes = await Db.LookupCode.AsNoTracking() + .Include(lc => lc.SortOrder.Where(so => so.LocationId == locationId)) + .Where(lc => + (id == null || lc.Id == id) && + (codeType == null || lc.Type == codeType) && + (locationId == null || lc.LocationId == null || lc.LocationId == locationId) && + (mandatory == null || lc.Mandatory == mandatory) && + (showExpired || lc.ExpiryDate == null)) + .OrderBy(a => (int)a.Type) + .ThenBy(a => a.SortOrder.FirstOrDefault().SortOrder) + .ThenBy(a => a.Id) + .ToListAsync(); + + lookupCodes.ForEach(lc => lc.SortOrderForLocation = lc.SortOrder.FirstOrDefault()); + + return lookupCodes; + } + public async Task Find(int id) => await Db.LookupCode.AsNoTracking().FirstOrDefaultAsync(lc => lc.Id == id); public async Task Expire(int id) diff --git a/api/services/scheduling/DistributeScheduleService.cs b/api/services/scheduling/DistributeScheduleService.cs index 73ba9740..956a9ac3 100644 --- a/api/services/scheduling/DistributeScheduleService.cs +++ b/api/services/scheduling/DistributeScheduleService.cs @@ -1,8 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net.Http; +using System.Text; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using SS.Api.helpers; using SS.Api.helpers.extensions; using SS.Common.helpers.extensions; using SS.Db.models; @@ -14,14 +18,19 @@ namespace SS.Api.services.scheduling public class DistributeScheduleService { private SheriffDbContext Db { get; } - public DistributeScheduleService(SheriffDbContext db) + private IConfiguration Configuration { get; } + private ChesEmailService ChesEmailService { get; } + + public DistributeScheduleService(SheriffDbContext db, IConfiguration configuration, ChesEmailService chesEmailService) { + Configuration = configuration; + ChesEmailService = chesEmailService; Db = db; } public async Task> GetDistributeSchedule(List shiftAvailabilities, bool includeWorkSection, DateTimeOffset start, DateTimeOffset end, int locationId) { - var shiftIds = shiftAvailabilities.SelectMany(s=> s.Conflicts) + var shiftIds = shiftAvailabilities.SelectMany(s => s.Conflicts) .Where(c => c.Conflict == ShiftConflictType.Scheduled).SelectDistinctToList(s => s.ShiftId); var shifts = await Db.Shift.AsSingleQuery().AsNoTracking() @@ -57,13 +66,15 @@ private List CombineShiftAvailability(ShiftAvailabili .Date }); - var newAvailabilityConflict = shiftAvailability.Conflicts.WhereToList(c => c.Conflict != ShiftConflictType.Scheduled); - foreach (var group in shiftsGroupedByDate) - { - var earliestShiftForDate = group.First(s => s.Start == group.Min(s => s.Start)); - earliestShiftForDate.End = group.Max(s => s.End); - newAvailabilityConflict.Add(earliestShiftForDate); - } + var newAvailabilityConflict = shiftAvailability.Conflicts; + // TODO + //.WhereToList(c => c.Conflict != ShiftConflictType.Scheduled); + //foreach (var group in shiftsGroupedByDate) + //{ + // var earliestShiftForDate = group.First(s => s.Start == group.Min(s => s.Start)); + // earliestShiftForDate.End = group.Max(s => s.End); + // newAvailabilityConflict.Add(earliestShiftForDate); + //} if (includeWorkSection) newAvailabilityConflict = DetermineWorkSections(newAvailabilityConflict, shifts); @@ -74,10 +85,29 @@ private List CombineShiftAvailability(ShiftAvailabili private List DetermineWorkSections(List availabilityConflicts, List shifts) { foreach (var availabilityConflict in availabilityConflicts) + { availabilityConflict.WorkSection = shifts.FirstOrDefault(s => s.Id == availabilityConflict.ShiftId)?.WorkSection; + availabilityConflict.DutySlots = + shifts.FirstOrDefault(s => s.Id == availabilityConflict.ShiftId)?.DutySlots; + } return availabilityConflicts; } + + public async Task PrintService(String html) + { + HttpClient HttpClient = new HttpClient(); + var requestMessage = new HttpRequestMessage(HttpMethod.Post, Configuration.GetNonEmptyValue("PdfUrl") + "/pdf?bootstrap=true"); + requestMessage.Content = new StringContent(html, Encoding.UTF8); + var pdfResponse = await HttpClient.SendAsync(requestMessage); + var content = await pdfResponse.Content.ReadAsByteArrayAsync(); + return content; + } + + public async Task EmailService(String senderEmail, String recipientEmails, String emailSubject, String emailContent, byte[] pdfContent) + { + await ChesEmailService.SendEmailWithPdfAttachment(emailContent, emailSubject, senderEmail, recipientEmails, pdfContent); + } } -} +} \ No newline at end of file diff --git a/api/services/usermanagement/SheriffService.cs b/api/services/usermanagement/SheriffService.cs index 77fef0ff..b55f0fff 100644 --- a/api/services/usermanagement/SheriffService.cs +++ b/api/services/usermanagement/SheriffService.cs @@ -164,6 +164,15 @@ public async Task UpdateSheriffPhoto(Guid? id, string badgeNumber, byte return savedSheriff; } + public async Task UpdateSheriffExcused(Sheriff sheriff) + { + var savedSheriff = await Db.Sheriff.FindAsync(sheriff.Id); + savedSheriff.ThrowBusinessExceptionIfNull($"No {nameof(Sheriff)} with Id: {sheriff.Id}"); + savedSheriff.Excused = sheriff.Excused; + await Db.SaveChangesAsync(); + return savedSheriff; + } + public async Task UpdateSheriffHomeLocation(Guid id, int locationId) { var savedSheriff = await Db.Sheriff.FindAsync(id); diff --git a/api/services/usermanagement/TrainingService.cs b/api/services/usermanagement/TrainingService.cs new file mode 100644 index 00000000..5d2feb24 --- /dev/null +++ b/api/services/usermanagement/TrainingService.cs @@ -0,0 +1,230 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using SS.Api.helpers.extensions; +using SS.Api.infrastructure.exceptions; +using SS.Api.models.dto; +using SS.Db.models; +using SS.Db.models.lookupcodes; +using SS.Db.models.sheriff; +using SS.Api.models.types; +using SS.Common.helpers.extensions; +using ss.db.models; +using Microsoft.Extensions.Logging; + +namespace SS.Api.services.usermanagement +{ + + public class TrainingService + { + private SheriffDbContext Db { get; } + private ManageTypesService ManageTypesService { get; } + private ILogger Logger { get; } + public static readonly IList YearsInDays = new List{365, 730, 1095, 1461, 1826, 2191, 2556, 2922, 3287, 3652}; + + public TrainingService(ManageTypesService manageTypesService, SheriffDbContext db, ILogger logger) + { + ManageTypesService = manageTypesService; + Db = db; + Logger = logger; + } + + + #region Training CronJob + public async Task> GetTrainings() + { + var sheriffTrainingQuery = Db.SheriffTraining.AsNoTracking() + .AsSplitQuery() + .Where(t => t.ExpiryDate == null) + .Where(t => t.FirstNotice != true) + .Where(t => t.TrainingType.AdvanceNotice > 0) + .Include(t => t.TrainingType) + .Include(t => t.Sheriff); + + return await sheriffTrainingQuery.ToListAsync(); + } + + public async Task UpdateTraining(int trainingId) + { + var training = await Db.SheriffTraining.FindAsync(trainingId); + training.ThrowBusinessExceptionIfNull( + $"{nameof(SheriffTraining)} with the id: {trainingId} could not be found. "); + + if (training.ExpiryDate.HasValue) + throw new BusinessLayerException($"{nameof(SheriffTraining)} with the id: {trainingId} has been expired"); + + training.FirstNotice = true; + await Db.SaveChangesAsync(); + } + + #endregion Training CronJob + + + + #region Training Reports + public async Task> GetSheriffsTrainingReports(TrainingReportSearchDto trainingReportSearch) + { + Logger.LogInformation("__________Start_Creating_Reports___________"); + var sheriffQuery = Db.Sheriff.AsNoTracking() + .AsSplitQuery() + .Where(s => + s.IsEnabled && + (trainingReportSearch.locationId == null || s.HomeLocationId==trainingReportSearch.locationId) + ) + .Include(s => s.Training.Where(t => t.ExpiryDate == null)) + .ThenInclude(t => t.TrainingType) + .Include(s => s.HomeLocation) + .Where(s => trainingReportSearch.regionId == null || s.HomeLocation.RegionId==trainingReportSearch.regionId); + + var sheriffs = await sheriffQuery.ToListAsync(); + + List mandatoryTrainings = await ManageTypesService.GetAllForReports(trainingReportSearch.reportSubtypeId, LookupTypes.TrainingType, null, true, false); + List optionalTrainings = await ManageTypesService.GetAllForReports(trainingReportSearch.reportSubtypeId, LookupTypes.TrainingType, null, false, false); + + var sheriffTrainings = new List(); + + foreach (var sheriff in sheriffs) + { + var sheriffTrainingsId = sheriff.Training.Select(t => t.TrainingTypeId).ToArray(); + List optionalSheriffTrainings = optionalTrainings.FindAll(t => sheriffTrainingsId.Contains(t.Id)); + List allSheriffTrainings = new List(); + allSheriffTrainings.AddRange(optionalSheriffTrainings); + allSheriffTrainings.AddRange(mandatoryTrainings); + + foreach (var training in allSheriffTrainings) + { + if (!sheriffTrainingsId.Contains(training.Id)) + { + sheriffTrainings.Add(new TrainingReportDto() + { + name = sheriff.FirstName + ' ' + sheriff.LastName, + trainingType = training.Description, + end = null, + expiryDate = null, + excluded = sheriff.Excused, + sheriffId = sheriff.Id, + status = TrainingStatusTypes.danger, + _rowVariant = "danger" + }); + } + else + { + var takenTraining = sheriff.Training.Find(t => t.TrainingTypeId == training.Id); + var timezone = takenTraining.Timezone == null? "America/Vancouver" : takenTraining.Timezone; + var trainingStatus = GetTrainingStatus(takenTraining.TrainingCertificationExpiry, timezone, training.AdvanceNotice, training, takenTraining.FirstNotice); + + sheriffTrainings.Add(new TrainingReportDto() + { + name = sheriff.FirstName + ' ' + sheriff.LastName, + trainingType = training.Description, + end = takenTraining.EndDate.ConvertToTimezone(timezone), + expiryDate = takenTraining.TrainingCertificationExpiry != null ? ((DateTimeOffset)takenTraining.TrainingCertificationExpiry).ConvertToTimezone(timezone): null, + excluded = sheriff.Excused, + sheriffId = sheriff.Id, + status = trainingStatus.status, + _rowVariant = trainingStatus.rowType + }); + } + } + } + + Logger.LogInformation("__________End_Creating_Reports____________"); + + if(trainingReportSearch.startDate != null && trainingReportSearch.endDate != null) + return sheriffTrainings.FindAll(t => + t.end>=trainingReportSearch.startDate && + t.end<=trainingReportSearch.endDate + ); + else + return sheriffTrainings; + } + + #endregion Training Reports + + + #region Training Expiry Adjustment + public async Task TrainingExpiryAdjustment() + { + var trainingsQuery = Db.SheriffTraining + .AsNoTracking() + .Where(t => t.ExpiryDate == null) + .Include(t => t.TrainingType); + var allTrainings = await trainingsQuery.ToListAsync(); + int processCounter = 0; + int allTrainingsCounts = allTrainings.Count(); + + foreach (var training in allTrainings) + { + if(training.TrainingType.ValidityPeriod > 0){ + var timezone = training.Timezone == null? "America/Vancouver" : training.Timezone; + if(!IsRotatingTraining(training.TrainingType)){ + int years = (training.TrainingType.ValidityPeriod / 365) - 1; + training.TrainingCertificationExpiry = training.EndDate.EndOfYearWithTimezone(years, timezone); + }else{ + training.TrainingCertificationExpiry = training.EndDate.AddDays(training.TrainingType.ValidityPeriod).ConvertToTimezone(timezone);//moment(this.selectedEndDate).add(this.selectedTrainingType.validityPeriod, 'days').format("YYYY-MM-DD"); + } + var noticeDate = DateTimeOffset.UtcNow.AddDays(training.TrainingType.AdvanceNotice); + if(training.TrainingCertificationExpiry > noticeDate){ + training.FirstNotice = false; + } + } + else{ + training.TrainingCertificationExpiry = null; + training.FirstNotice = false; + } + Db.Entry(training).Property(x => x.TrainingCertificationExpiry).IsModified = true; + Db.Entry(training).Property(x => x.FirstNotice).IsModified = true; + Db.SaveChanges(); + + processCounter++; + Logger.LogInformation($"_______Training Expiry Adjustment__{processCounter}_of_{allTrainingsCounts}_______"); + } + + } + + #endregion Training Expiry Adjustment + + + #region Help Methods + + private TrainingStatus GetTrainingStatus(DateTimeOffset? requalificationDate, string timezone, int advanceNotice, LookupCode trainingType, bool firstNotice) + { + TrainingStatus trainingStatus = new TrainingStatus(); + + var todayDate = DateTimeOffset.UtcNow.ConvertToTimezone(timezone); + var advanceNoticeDate = DateTimeOffset.UtcNow.AddDays(advanceNotice).ConvertToTimezone(timezone); + var expiryDate = IsRotatingTraining(trainingType)? requalificationDate : requalificationDate?.AddYears(1); + + if(todayDate > expiryDate) + { + trainingStatus.rowType = "alert"; + trainingStatus.status = TrainingStatusTypes.alert; + } + else if(todayDate > requalificationDate) + { + trainingStatus.rowType = "warning"; + trainingStatus.status = TrainingStatusTypes.warning; + } + else if((advanceNoticeDate > requalificationDate) && firstNotice) + { + trainingStatus.rowType = "notify"; + trainingStatus.status = TrainingStatusTypes.notify; + } + else + { + trainingStatus.rowType = "white"; + trainingStatus.status = ""; + } + + return trainingStatus; + } + + public bool IsRotatingTraining(LookupCode trainingType){ + return trainingType.Rotating || !YearsInDays.Contains(trainingType.ValidityPeriod); + } + + #endregion Help Methods + } +} \ No newline at end of file diff --git a/common/common.csproj b/common/common.csproj index 4e601402..c679f236 100644 --- a/common/common.csproj +++ b/common/common.csproj @@ -1,13 +1,13 @@ - netcoreapp3.1 + net5.0 SS.Common SS.Common - + diff --git a/common/helpers/extensions/DateTimeOffsetExtensions.cs b/common/helpers/extensions/DateTimeOffsetExtensions.cs index 05e9beab..e3acf04b 100644 --- a/common/helpers/extensions/DateTimeOffsetExtensions.cs +++ b/common/helpers/extensions/DateTimeOffsetExtensions.cs @@ -40,6 +40,15 @@ public static DateTimeOffset ConvertToTimezone(this DateTimeOffset date, string return zoned.ToDateTimeOffset(); } + public static DateTimeOffset EndOfYearWithTimezone(this DateTimeOffset date, int yearOffset, string timezone) + { + var endDate = new DateTime(date.Year+yearOffset, 12, 31, 23, 59, 59); + var locationTimeZone = DateTimeZoneProviders.Tzdb[timezone]; + var instant = Instant.FromDateTimeOffset(endDate); + var zoned = instant.InZone(locationTimeZone); + return zoned.ToDateTimeOffset(); + } + private static string GetTimezoneAbbreviation(DateTimeOffset date, string timezone) { var abbreviations = TZNames.GetAbbreviationsForTimeZone(timezone, "en-CA"); diff --git a/db/configuration/PermissionConfiguration.cs b/db/configuration/PermissionConfiguration.cs index 4c5a35f0..b5ac2c91 100644 --- a/db/configuration/PermissionConfiguration.cs +++ b/db/configuration/PermissionConfiguration.cs @@ -46,7 +46,8 @@ public override void Configure(EntityTypeBuilder builder) new Permission { Id = 40, Name = Permission.ViewDutyRosterInFuture, Description = "View DutyRoster in the future" }, new Permission { Id = 41, Name = Permission.ViewAllFutureShifts, Description = "View Shifts in the future (not time constrained)" }, new Permission { Id = 42, Name = Permission.ViewOtherProfiles, Description = "View other profiles (beside their own)" }, - new Permission { Id = 43, Name = Permission.GenerateReports, Description = "Generate Reports based on Sheriff's activity" } + new Permission { Id = 43, Name = Permission.GenerateReports, Description = "Generate Reports based on Sheriff's activity" }, + new Permission { Id = 44, Name = Permission.AdjustTrainingExpiry, Description = "Adjust Training Expiry Dates based on new rules" } ); base.Configure(builder); } diff --git a/db/db.csproj b/db/db.csproj index 2015b9b7..e939bf78 100644 --- a/db/db.csproj +++ b/db/db.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 SS.Db true @@ -92,7 +92,7 @@ - + @@ -101,7 +101,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/db/migrations/20230819011757_UpdateLookupCode_TrainingExtra.Designer.cs b/db/migrations/20230819011757_UpdateLookupCode_TrainingExtra.Designer.cs new file mode 100644 index 00000000..00babb55 --- /dev/null +++ b/db/migrations/20230819011757_UpdateLookupCode_TrainingExtra.Designer.cs @@ -0,0 +1,2450 @@ +// +using System; +using System.Text.Json; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using SS.Db.models; + +namespace SS.Db.Migrations +{ + [DbContext(typeof(SheriffDbContext))] + [Migration("20230819011757_UpdateLookupCode_TrainingExtra")] + partial class UpdateLookupCode_TrainingExtra + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityByDefaultColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 63) + .HasAnnotation("ProductVersion", "5.0.1"); + + modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("FriendlyName") + .HasColumnType("text"); + + b.Property("Xml") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("DataProtectionKeys"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AgencyId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinCode") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("ParentLocationId") + .HasColumnType("integer"); + + b.Property("RegionId") + .HasColumnType("integer"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AgencyId") + .IsUnique(); + + b.HasIndex("CreatedById"); + + b.HasIndex("RegionId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Location"); + + b.HasData( + new + { + Id = 1, + AgencyId = "SS1", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of Professional Standards", + Timezone = "America/Vancouver" + }, + new + { + Id = 2, + AgencyId = "SS2", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Sheriff Provincial Operation Centre", + Timezone = "America/Vancouver" + }, + new + { + Id = 3, + AgencyId = "SS3", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Central Float Pool", + Timezone = "America/Vancouver" + }, + new + { + Id = 4, + AgencyId = "SS4", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "ITAU", + Timezone = "America/Vancouver" + }, + new + { + Id = 5, + AgencyId = "SS5", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of the Chief Sheriff", + Timezone = "America/Vancouver" + }, + new + { + Id = 6, + AgencyId = "SS6", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + JustinCode = "4882", + Name = "South Okanagan Escort Centre", + Timezone = "America/Vancouver" + }); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("KeyValues") + .HasColumnType("jsonb"); + + b.Property("NewValues") + .HasColumnType("jsonb"); + + b.Property("OldValues") + .HasColumnType("jsonb"); + + b.Property("TableName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KeyValues"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Permission"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Allows the user to login.", + Name = "Login" + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Profile (User)", + Name = "CreateUsers" + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Profile (User)", + Name = "ExpireUsers" + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Profile (User)", + Name = "EditUsers" + }, + new + { + Id = 8, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View all Roles", + Name = "ViewRoles" + }, + new + { + Id = 9, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Roles", + Name = "CreateAndAssignRoles" + }, + new + { + Id = 10, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Roles", + Name = "ExpireRoles" + }, + new + { + Id = 11, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Roles", + Name = "EditRoles" + }, + new + { + Id = 13, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Types", + Name = "CreateTypes" + }, + new + { + Id = 14, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Types", + Name = "EditTypes" + }, + new + { + Id = 15, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Types", + Name = "ExpireTypes" + }, + new + { + Id = 16, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View shifts", + Name = "ViewShifts" + }, + new + { + Id = 19, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Shifts", + Name = "CreateAndAssignShifts" + }, + new + { + Id = 20, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Shifts", + Name = "ExpireShifts" + }, + new + { + Id = 21, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Shifts", + Name = "EditShifts" + }, + new + { + Id = 22, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Distribute Schedule", + Name = "ViewDistributeSchedule" + }, + new + { + Id = 23, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Assigned Location", + Name = "ViewAssignedLocation" + }, + new + { + Id = 24, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Region (all locations within region)", + Name = "ViewRegion" + }, + new + { + Id = 25, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Province (all regions, all locations)", + Name = "ViewProvince" + }, + new + { + Id = 27, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Home Location", + Name = "ViewHomeLocation" + }, + new + { + Id = 28, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Import Shifts", + Name = "ImportShifts" + }, + new + { + Id = 30, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Assignments", + Name = "CreateAssignments" + }, + new + { + Id = 31, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Assignments", + Name = "EditAssignments" + }, + new + { + Id = 32, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Assignments", + Name = "ExpireAssignments" + }, + new + { + Id = 33, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Duties", + Name = "ViewDutyRoster" + }, + new + { + Id = 34, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Duties", + Name = "CreateAndAssignDuties" + }, + new + { + Id = 35, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Duties", + Name = "EditDuties" + }, + new + { + Id = 36, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Duties", + Name = "ExpireDuties" + }, + new + { + Id = 37, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Idir", + Name = "EditIdir" + }, + new + { + Id = 38, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Past Training", + Name = "EditPastTraining" + }, + new + { + Id = 39, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Remove Past Training", + Name = "RemovePastTraining" + }, + new + { + Id = 40, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View DutyRoster in the future", + Name = "ViewDutyRosterInFuture" + }, + new + { + Id = 41, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Shifts in the future (not time constrained)", + Name = "ViewAllFutureShifts" + }, + new + { + Id = 42, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View other profiles (beside their own)", + Name = "ViewOtherProfiles" + }, + new + { + Id = 43, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Generate Reports based on Sheriff's activity", + Name = "GenerateReports" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(50L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Role"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Administrator", + Name = "Administrator" + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Manager", + Name = "Manager" + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sheriff", + Name = "Sheriff" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(100L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("PermissionId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("PermissionId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("RolePermission"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("FirstName") + .HasColumnType("text"); + + b.Property("HomeLocationId") + .HasColumnType("integer"); + + b.Property("IdirId") + .HasColumnType("uuid"); + + b.Property("IdirName") + .HasColumnType("text"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("KeyCloakId") + .HasColumnType("uuid"); + + b.Property("LastLogin") + .HasColumnType("timestamp with time zone"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("HomeLocationId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("User"); + + b.HasDiscriminator("Discriminator").HasValue("User"); + + b.HasData( + new + { + Id = new Guid("00000000-0000-0000-0000-000000000001"), + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FirstName = "SYSTEM", + IsEnabled = false, + LastName = "SYSTEM" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(5000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("UserId"); + + b.HasIndex("RoleId", "UserId") + .IsUnique(); + + b.ToTable("UserRole"); + }); + + modelBuilder.Entity("SS.Db.models.jc.JcSynchronization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("LastSynchronization") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("JcSynchronization"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("LookupCodeId", "LocationId") + .IsUnique(); + + b.ToTable("LookupSortOrder"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 1, + SortOrder = 1 + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 2, + SortOrder = 2 + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 3, + SortOrder = 3 + }, + new + { + Id = 4, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 4, + SortOrder = 4 + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 5, + SortOrder = 5 + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 6, + SortOrder = 6 + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 7, + SortOrder = 7 + }); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AdhocEndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("AdhocStartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("End") + .HasColumnType("interval"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Friday") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("Monday") + .HasColumnType("boolean"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Saturday") + .HasColumnType("boolean"); + + b.Property("Start") + .HasColumnType("interval"); + + b.Property("Sunday") + .HasColumnType("boolean"); + + b.Property("Thursday") + .HasColumnType("boolean"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("Tuesday") + .HasColumnType("boolean"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Wednesday") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Assignment"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Duty"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DutyId") + .HasColumnType("integer"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("IsClosed") + .HasColumnType("boolean"); + + b.Property("IsNotAvailable") + .HasColumnType("boolean"); + + b.Property("IsNotRequired") + .HasColumnType("boolean"); + + b.Property("IsOvertime") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("DutyId"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("DutySlot"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AnticipatedAssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("OvertimeHours") + .HasColumnType("double precision"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AnticipatedAssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Shift"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Rank") + .HasColumnType("text"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffActingRank"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffAwayLocation"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LeaveTypeId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LeaveTypeId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffLeave"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Note") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("TrainingCertificationExpiry") + .HasColumnType("timestamp with time zone"); + + b.Property("TrainingTypeId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("TrainingTypeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffTraining"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinId") + .HasColumnType("integer"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("JustinId") + .IsUnique(); + + b.HasIndex("UpdatedById"); + + b.ToTable("Region"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("AdvanceNotice") + .HasColumnType("integer"); + + b.Property("Category") + .HasColumnType("text"); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("Mandatory") + .HasColumnType("boolean"); + + b.Property("SubCode") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ValidityPeriod") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("Type", "Code", "LocationId") + .IsUnique(); + + b.ToTable("LookupCode"); + + b.HasData( + new + { + Id = 1, + AdvanceNotice = 0, + Code = "Chief Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Chief Sheriff", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 2, + AdvanceNotice = 0, + Code = "Superintendent", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Superintendent", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 3, + AdvanceNotice = 0, + Code = "Staff Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Inspector", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 4, + AdvanceNotice = 0, + Code = "Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Inspector", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 5, + AdvanceNotice = 0, + Code = "Staff Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Sergeant", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 6, + AdvanceNotice = 0, + Code = "Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sergeant", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 7, + AdvanceNotice = 0, + Code = "Deputy Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Deputy Sheriff", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 8, + AdvanceNotice = 0, + Code = "CEW (Taser)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "CEW (Taser)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 9, + AdvanceNotice = 0, + Code = "DNA", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "DNA", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 10, + AdvanceNotice = 0, + Code = "FRO", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "FRO", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 11, + AdvanceNotice = 0, + Code = "Fire Arm", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Fire Arm", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 12, + AdvanceNotice = 0, + Code = "First Aid", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "First Aid", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 13, + AdvanceNotice = 0, + Code = "Advanced Escort SPC (AESOC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Advanced Escort SPC (AESOC)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 14, + AdvanceNotice = 0, + Code = "Extenuating Circumstances SPC (EXSPC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Extenuating Circumstances SPC (EXSPC)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 15, + AdvanceNotice = 0, + Code = "Search Gate", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Search Gate", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 16, + AdvanceNotice = 0, + Code = "Other", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Other", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 17, + AdvanceNotice = 0, + Code = "STIP", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "STIP", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 18, + AdvanceNotice = 0, + Code = "Annual", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Annual", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 19, + AdvanceNotice = 0, + Code = "Illness", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Illness", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 20, + AdvanceNotice = 0, + Code = "Special", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Special", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.HasBaseType("SS.Db.models.auth.User"); + + b.Property("BadgeNumber") + .HasColumnType("text"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("LastPhotoUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Photo") + .HasColumnType("bytea"); + + b.Property("Rank") + .HasColumnType("text"); + + b.HasIndex("BadgeNumber") + .IsUnique(); + + b.HasDiscriminator().HasValue("Sheriff"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("db.models.Region", "Region") + .WithMany() + .HasForeignKey("RegionId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Region"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Permission", "Permission") + .WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Permission"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "HomeLocation") + .WithMany() + .HasForeignKey("HomeLocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("HomeLocation"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany("SortOrder") + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany() + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "Assignment") + .WithMany() + .HasForeignKey("AssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Assignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.scheduling.Duty", "Duty") + .WithMany("DutySlots") + .HasForeignKey("DutyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Duty"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "AnticipatedAssignment") + .WithMany() + .HasForeignKey("AnticipatedAssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("AnticipatedAssignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("ActingRank") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("AwayLocation") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("ss.db.models.LookupCode", "LeaveType") + .WithMany() + .HasForeignKey("LeaveTypeId"); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Leave") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("LeaveType"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Training") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "TrainingType") + .WithMany() + .HasForeignKey("TrainingTypeId"); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("TrainingType"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Navigation("DutySlots"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Navigation("SortOrder"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.Navigation("ActingRank"); + + b.Navigation("AwayLocation"); + + b.Navigation("Leave"); + + b.Navigation("Training"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/db/migrations/20230819011757_UpdateLookupCode_TrainingExtra.cs b/db/migrations/20230819011757_UpdateLookupCode_TrainingExtra.cs new file mode 100644 index 00000000..d18abd4c --- /dev/null +++ b/db/migrations/20230819011757_UpdateLookupCode_TrainingExtra.cs @@ -0,0 +1,56 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SS.Db.Migrations +{ + public partial class UpdateLookupCode_TrainingExtra : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "AdvanceNotice", + table: "LookupCode", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "Category", + table: "LookupCode", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + name: "Mandatory", + table: "LookupCode", + type: "boolean", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "ValidityPeriod", + table: "LookupCode", + type: "integer", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "AdvanceNotice", + table: "LookupCode"); + + migrationBuilder.DropColumn( + name: "Category", + table: "LookupCode"); + + migrationBuilder.DropColumn( + name: "Mandatory", + table: "LookupCode"); + + migrationBuilder.DropColumn( + name: "ValidityPeriod", + table: "LookupCode"); + } + } +} diff --git a/db/migrations/20230826223829_UpdateSheriffTraining_AddNotice.Designer.cs b/db/migrations/20230826223829_UpdateSheriffTraining_AddNotice.Designer.cs new file mode 100644 index 00000000..64e73491 --- /dev/null +++ b/db/migrations/20230826223829_UpdateSheriffTraining_AddNotice.Designer.cs @@ -0,0 +1,2453 @@ +// +using System; +using System.Text.Json; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using SS.Db.models; + +namespace SS.Db.Migrations +{ + [DbContext(typeof(SheriffDbContext))] + [Migration("20230826223829_UpdateSheriffTraining_AddNotice")] + partial class UpdateSheriffTraining_AddNotice + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityByDefaultColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 63) + .HasAnnotation("ProductVersion", "5.0.1"); + + modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("FriendlyName") + .HasColumnType("text"); + + b.Property("Xml") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("DataProtectionKeys"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AgencyId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinCode") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("ParentLocationId") + .HasColumnType("integer"); + + b.Property("RegionId") + .HasColumnType("integer"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AgencyId") + .IsUnique(); + + b.HasIndex("CreatedById"); + + b.HasIndex("RegionId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Location"); + + b.HasData( + new + { + Id = 1, + AgencyId = "SS1", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of Professional Standards", + Timezone = "America/Vancouver" + }, + new + { + Id = 2, + AgencyId = "SS2", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Sheriff Provincial Operation Centre", + Timezone = "America/Vancouver" + }, + new + { + Id = 3, + AgencyId = "SS3", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Central Float Pool", + Timezone = "America/Vancouver" + }, + new + { + Id = 4, + AgencyId = "SS4", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "ITAU", + Timezone = "America/Vancouver" + }, + new + { + Id = 5, + AgencyId = "SS5", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of the Chief Sheriff", + Timezone = "America/Vancouver" + }, + new + { + Id = 6, + AgencyId = "SS6", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + JustinCode = "4882", + Name = "South Okanagan Escort Centre", + Timezone = "America/Vancouver" + }); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("KeyValues") + .HasColumnType("jsonb"); + + b.Property("NewValues") + .HasColumnType("jsonb"); + + b.Property("OldValues") + .HasColumnType("jsonb"); + + b.Property("TableName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KeyValues"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Permission"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Allows the user to login.", + Name = "Login" + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Profile (User)", + Name = "CreateUsers" + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Profile (User)", + Name = "ExpireUsers" + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Profile (User)", + Name = "EditUsers" + }, + new + { + Id = 8, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View all Roles", + Name = "ViewRoles" + }, + new + { + Id = 9, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Roles", + Name = "CreateAndAssignRoles" + }, + new + { + Id = 10, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Roles", + Name = "ExpireRoles" + }, + new + { + Id = 11, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Roles", + Name = "EditRoles" + }, + new + { + Id = 13, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Types", + Name = "CreateTypes" + }, + new + { + Id = 14, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Types", + Name = "EditTypes" + }, + new + { + Id = 15, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Types", + Name = "ExpireTypes" + }, + new + { + Id = 16, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View shifts", + Name = "ViewShifts" + }, + new + { + Id = 19, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Shifts", + Name = "CreateAndAssignShifts" + }, + new + { + Id = 20, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Shifts", + Name = "ExpireShifts" + }, + new + { + Id = 21, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Shifts", + Name = "EditShifts" + }, + new + { + Id = 22, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Distribute Schedule", + Name = "ViewDistributeSchedule" + }, + new + { + Id = 23, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Assigned Location", + Name = "ViewAssignedLocation" + }, + new + { + Id = 24, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Region (all locations within region)", + Name = "ViewRegion" + }, + new + { + Id = 25, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Province (all regions, all locations)", + Name = "ViewProvince" + }, + new + { + Id = 27, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Home Location", + Name = "ViewHomeLocation" + }, + new + { + Id = 28, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Import Shifts", + Name = "ImportShifts" + }, + new + { + Id = 30, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Assignments", + Name = "CreateAssignments" + }, + new + { + Id = 31, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Assignments", + Name = "EditAssignments" + }, + new + { + Id = 32, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Assignments", + Name = "ExpireAssignments" + }, + new + { + Id = 33, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Duties", + Name = "ViewDutyRoster" + }, + new + { + Id = 34, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Duties", + Name = "CreateAndAssignDuties" + }, + new + { + Id = 35, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Duties", + Name = "EditDuties" + }, + new + { + Id = 36, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Duties", + Name = "ExpireDuties" + }, + new + { + Id = 37, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Idir", + Name = "EditIdir" + }, + new + { + Id = 38, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Past Training", + Name = "EditPastTraining" + }, + new + { + Id = 39, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Remove Past Training", + Name = "RemovePastTraining" + }, + new + { + Id = 40, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View DutyRoster in the future", + Name = "ViewDutyRosterInFuture" + }, + new + { + Id = 41, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Shifts in the future (not time constrained)", + Name = "ViewAllFutureShifts" + }, + new + { + Id = 42, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View other profiles (beside their own)", + Name = "ViewOtherProfiles" + }, + new + { + Id = 43, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Generate Reports based on Sheriff's activity", + Name = "GenerateReports" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(50L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Role"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Administrator", + Name = "Administrator" + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Manager", + Name = "Manager" + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sheriff", + Name = "Sheriff" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(100L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("PermissionId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("PermissionId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("RolePermission"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("FirstName") + .HasColumnType("text"); + + b.Property("HomeLocationId") + .HasColumnType("integer"); + + b.Property("IdirId") + .HasColumnType("uuid"); + + b.Property("IdirName") + .HasColumnType("text"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("KeyCloakId") + .HasColumnType("uuid"); + + b.Property("LastLogin") + .HasColumnType("timestamp with time zone"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("HomeLocationId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("User"); + + b.HasDiscriminator("Discriminator").HasValue("User"); + + b.HasData( + new + { + Id = new Guid("00000000-0000-0000-0000-000000000001"), + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FirstName = "SYSTEM", + IsEnabled = false, + LastName = "SYSTEM" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(5000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("UserId"); + + b.HasIndex("RoleId", "UserId") + .IsUnique(); + + b.ToTable("UserRole"); + }); + + modelBuilder.Entity("SS.Db.models.jc.JcSynchronization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("LastSynchronization") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("JcSynchronization"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("LookupCodeId", "LocationId") + .IsUnique(); + + b.ToTable("LookupSortOrder"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 1, + SortOrder = 1 + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 2, + SortOrder = 2 + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 3, + SortOrder = 3 + }, + new + { + Id = 4, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 4, + SortOrder = 4 + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 5, + SortOrder = 5 + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 6, + SortOrder = 6 + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 7, + SortOrder = 7 + }); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AdhocEndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("AdhocStartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("End") + .HasColumnType("interval"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Friday") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("Monday") + .HasColumnType("boolean"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Saturday") + .HasColumnType("boolean"); + + b.Property("Start") + .HasColumnType("interval"); + + b.Property("Sunday") + .HasColumnType("boolean"); + + b.Property("Thursday") + .HasColumnType("boolean"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("Tuesday") + .HasColumnType("boolean"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Wednesday") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Assignment"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Duty"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DutyId") + .HasColumnType("integer"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("IsClosed") + .HasColumnType("boolean"); + + b.Property("IsNotAvailable") + .HasColumnType("boolean"); + + b.Property("IsNotRequired") + .HasColumnType("boolean"); + + b.Property("IsOvertime") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("DutyId"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("DutySlot"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AnticipatedAssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("OvertimeHours") + .HasColumnType("double precision"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AnticipatedAssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Shift"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Rank") + .HasColumnType("text"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffActingRank"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffAwayLocation"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LeaveTypeId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LeaveTypeId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffLeave"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("FirstNotice") + .HasColumnType("boolean"); + + b.Property("Note") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("TrainingCertificationExpiry") + .HasColumnType("timestamp with time zone"); + + b.Property("TrainingTypeId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("TrainingTypeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffTraining"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinId") + .HasColumnType("integer"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("JustinId") + .IsUnique(); + + b.HasIndex("UpdatedById"); + + b.ToTable("Region"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("AdvanceNotice") + .HasColumnType("integer"); + + b.Property("Category") + .HasColumnType("text"); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("Mandatory") + .HasColumnType("boolean"); + + b.Property("SubCode") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ValidityPeriod") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("Type", "Code", "LocationId") + .IsUnique(); + + b.ToTable("LookupCode"); + + b.HasData( + new + { + Id = 1, + AdvanceNotice = 0, + Code = "Chief Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Chief Sheriff", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 2, + AdvanceNotice = 0, + Code = "Superintendent", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Superintendent", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 3, + AdvanceNotice = 0, + Code = "Staff Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Inspector", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 4, + AdvanceNotice = 0, + Code = "Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Inspector", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 5, + AdvanceNotice = 0, + Code = "Staff Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Sergeant", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 6, + AdvanceNotice = 0, + Code = "Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sergeant", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 7, + AdvanceNotice = 0, + Code = "Deputy Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Deputy Sheriff", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 8, + AdvanceNotice = 0, + Code = "CEW (Taser)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "CEW (Taser)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 9, + AdvanceNotice = 0, + Code = "DNA", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "DNA", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 10, + AdvanceNotice = 0, + Code = "FRO", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "FRO", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 11, + AdvanceNotice = 0, + Code = "Fire Arm", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Fire Arm", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 12, + AdvanceNotice = 0, + Code = "First Aid", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "First Aid", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 13, + AdvanceNotice = 0, + Code = "Advanced Escort SPC (AESOC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Advanced Escort SPC (AESOC)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 14, + AdvanceNotice = 0, + Code = "Extenuating Circumstances SPC (EXSPC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Extenuating Circumstances SPC (EXSPC)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 15, + AdvanceNotice = 0, + Code = "Search Gate", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Search Gate", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 16, + AdvanceNotice = 0, + Code = "Other", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Other", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 17, + AdvanceNotice = 0, + Code = "STIP", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "STIP", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 18, + AdvanceNotice = 0, + Code = "Annual", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Annual", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 19, + AdvanceNotice = 0, + Code = "Illness", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Illness", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 20, + AdvanceNotice = 0, + Code = "Special", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Special", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.HasBaseType("SS.Db.models.auth.User"); + + b.Property("BadgeNumber") + .HasColumnType("text"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("LastPhotoUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Photo") + .HasColumnType("bytea"); + + b.Property("Rank") + .HasColumnType("text"); + + b.HasIndex("BadgeNumber") + .IsUnique(); + + b.HasDiscriminator().HasValue("Sheriff"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("db.models.Region", "Region") + .WithMany() + .HasForeignKey("RegionId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Region"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Permission", "Permission") + .WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Permission"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "HomeLocation") + .WithMany() + .HasForeignKey("HomeLocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("HomeLocation"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany("SortOrder") + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany() + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "Assignment") + .WithMany() + .HasForeignKey("AssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Assignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.scheduling.Duty", "Duty") + .WithMany("DutySlots") + .HasForeignKey("DutyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Duty"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "AnticipatedAssignment") + .WithMany() + .HasForeignKey("AnticipatedAssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("AnticipatedAssignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("ActingRank") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("AwayLocation") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("ss.db.models.LookupCode", "LeaveType") + .WithMany() + .HasForeignKey("LeaveTypeId"); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Leave") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("LeaveType"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Training") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "TrainingType") + .WithMany() + .HasForeignKey("TrainingTypeId"); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("TrainingType"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Navigation("DutySlots"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Navigation("SortOrder"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.Navigation("ActingRank"); + + b.Navigation("AwayLocation"); + + b.Navigation("Leave"); + + b.Navigation("Training"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/db/migrations/20230826223829_UpdateSheriffTraining_AddNotice.cs b/db/migrations/20230826223829_UpdateSheriffTraining_AddNotice.cs new file mode 100644 index 00000000..2d093c8d --- /dev/null +++ b/db/migrations/20230826223829_UpdateSheriffTraining_AddNotice.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SS.Db.Migrations +{ + public partial class UpdateSheriffTraining_AddNotice : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "FirstNotice", + table: "SheriffTraining", + type: "boolean", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "FirstNotice", + table: "SheriffTraining"); + } + } +} diff --git a/db/migrations/20231104164350_UpdateSheriff_Add_Excused.Designer.cs b/db/migrations/20231104164350_UpdateSheriff_Add_Excused.Designer.cs new file mode 100644 index 00000000..1ff2eef8 --- /dev/null +++ b/db/migrations/20231104164350_UpdateSheriff_Add_Excused.Designer.cs @@ -0,0 +1,2456 @@ +// +using System; +using System.Text.Json; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using SS.Db.models; + +namespace SS.Db.Migrations +{ + [DbContext(typeof(SheriffDbContext))] + [Migration("20231104164350_UpdateSheriff_Add_Excused")] + partial class UpdateSheriff_Add_Excused + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityByDefaultColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 63) + .HasAnnotation("ProductVersion", "5.0.1"); + + modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("FriendlyName") + .HasColumnType("text"); + + b.Property("Xml") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("DataProtectionKeys"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AgencyId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinCode") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("ParentLocationId") + .HasColumnType("integer"); + + b.Property("RegionId") + .HasColumnType("integer"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AgencyId") + .IsUnique(); + + b.HasIndex("CreatedById"); + + b.HasIndex("RegionId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Location"); + + b.HasData( + new + { + Id = 1, + AgencyId = "SS1", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of Professional Standards", + Timezone = "America/Vancouver" + }, + new + { + Id = 2, + AgencyId = "SS2", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Sheriff Provincial Operation Centre", + Timezone = "America/Vancouver" + }, + new + { + Id = 3, + AgencyId = "SS3", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Central Float Pool", + Timezone = "America/Vancouver" + }, + new + { + Id = 4, + AgencyId = "SS4", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "ITAU", + Timezone = "America/Vancouver" + }, + new + { + Id = 5, + AgencyId = "SS5", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of the Chief Sheriff", + Timezone = "America/Vancouver" + }, + new + { + Id = 6, + AgencyId = "SS6", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + JustinCode = "4882", + Name = "South Okanagan Escort Centre", + Timezone = "America/Vancouver" + }); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("KeyValues") + .HasColumnType("jsonb"); + + b.Property("NewValues") + .HasColumnType("jsonb"); + + b.Property("OldValues") + .HasColumnType("jsonb"); + + b.Property("TableName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KeyValues"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Permission"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Allows the user to login.", + Name = "Login" + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Profile (User)", + Name = "CreateUsers" + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Profile (User)", + Name = "ExpireUsers" + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Profile (User)", + Name = "EditUsers" + }, + new + { + Id = 8, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View all Roles", + Name = "ViewRoles" + }, + new + { + Id = 9, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Roles", + Name = "CreateAndAssignRoles" + }, + new + { + Id = 10, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Roles", + Name = "ExpireRoles" + }, + new + { + Id = 11, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Roles", + Name = "EditRoles" + }, + new + { + Id = 13, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Types", + Name = "CreateTypes" + }, + new + { + Id = 14, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Types", + Name = "EditTypes" + }, + new + { + Id = 15, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Types", + Name = "ExpireTypes" + }, + new + { + Id = 16, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View shifts", + Name = "ViewShifts" + }, + new + { + Id = 19, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Shifts", + Name = "CreateAndAssignShifts" + }, + new + { + Id = 20, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Shifts", + Name = "ExpireShifts" + }, + new + { + Id = 21, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Shifts", + Name = "EditShifts" + }, + new + { + Id = 22, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Distribute Schedule", + Name = "ViewDistributeSchedule" + }, + new + { + Id = 23, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Assigned Location", + Name = "ViewAssignedLocation" + }, + new + { + Id = 24, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Region (all locations within region)", + Name = "ViewRegion" + }, + new + { + Id = 25, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Province (all regions, all locations)", + Name = "ViewProvince" + }, + new + { + Id = 27, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Home Location", + Name = "ViewHomeLocation" + }, + new + { + Id = 28, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Import Shifts", + Name = "ImportShifts" + }, + new + { + Id = 30, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Assignments", + Name = "CreateAssignments" + }, + new + { + Id = 31, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Assignments", + Name = "EditAssignments" + }, + new + { + Id = 32, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Assignments", + Name = "ExpireAssignments" + }, + new + { + Id = 33, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Duties", + Name = "ViewDutyRoster" + }, + new + { + Id = 34, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Duties", + Name = "CreateAndAssignDuties" + }, + new + { + Id = 35, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Duties", + Name = "EditDuties" + }, + new + { + Id = 36, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Duties", + Name = "ExpireDuties" + }, + new + { + Id = 37, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Idir", + Name = "EditIdir" + }, + new + { + Id = 38, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Past Training", + Name = "EditPastTraining" + }, + new + { + Id = 39, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Remove Past Training", + Name = "RemovePastTraining" + }, + new + { + Id = 40, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View DutyRoster in the future", + Name = "ViewDutyRosterInFuture" + }, + new + { + Id = 41, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Shifts in the future (not time constrained)", + Name = "ViewAllFutureShifts" + }, + new + { + Id = 42, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View other profiles (beside their own)", + Name = "ViewOtherProfiles" + }, + new + { + Id = 43, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Generate Reports based on Sheriff's activity", + Name = "GenerateReports" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(50L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Role"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Administrator", + Name = "Administrator" + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Manager", + Name = "Manager" + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sheriff", + Name = "Sheriff" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(100L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("PermissionId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("PermissionId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("RolePermission"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("FirstName") + .HasColumnType("text"); + + b.Property("HomeLocationId") + .HasColumnType("integer"); + + b.Property("IdirId") + .HasColumnType("uuid"); + + b.Property("IdirName") + .HasColumnType("text"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("KeyCloakId") + .HasColumnType("uuid"); + + b.Property("LastLogin") + .HasColumnType("timestamp with time zone"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("HomeLocationId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("User"); + + b.HasDiscriminator("Discriminator").HasValue("User"); + + b.HasData( + new + { + Id = new Guid("00000000-0000-0000-0000-000000000001"), + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FirstName = "SYSTEM", + IsEnabled = false, + LastName = "SYSTEM" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(5000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("UserId"); + + b.HasIndex("RoleId", "UserId") + .IsUnique(); + + b.ToTable("UserRole"); + }); + + modelBuilder.Entity("SS.Db.models.jc.JcSynchronization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("LastSynchronization") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("JcSynchronization"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("LookupCodeId", "LocationId") + .IsUnique(); + + b.ToTable("LookupSortOrder"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 1, + SortOrder = 1 + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 2, + SortOrder = 2 + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 3, + SortOrder = 3 + }, + new + { + Id = 4, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 4, + SortOrder = 4 + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 5, + SortOrder = 5 + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 6, + SortOrder = 6 + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 7, + SortOrder = 7 + }); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AdhocEndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("AdhocStartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("End") + .HasColumnType("interval"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Friday") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("Monday") + .HasColumnType("boolean"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Saturday") + .HasColumnType("boolean"); + + b.Property("Start") + .HasColumnType("interval"); + + b.Property("Sunday") + .HasColumnType("boolean"); + + b.Property("Thursday") + .HasColumnType("boolean"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("Tuesday") + .HasColumnType("boolean"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Wednesday") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Assignment"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Duty"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DutyId") + .HasColumnType("integer"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("IsClosed") + .HasColumnType("boolean"); + + b.Property("IsNotAvailable") + .HasColumnType("boolean"); + + b.Property("IsNotRequired") + .HasColumnType("boolean"); + + b.Property("IsOvertime") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("DutyId"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("DutySlot"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AnticipatedAssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("OvertimeHours") + .HasColumnType("double precision"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AnticipatedAssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Shift"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Rank") + .HasColumnType("text"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffActingRank"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffAwayLocation"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LeaveTypeId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LeaveTypeId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffLeave"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("FirstNotice") + .HasColumnType("boolean"); + + b.Property("Note") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("TrainingCertificationExpiry") + .HasColumnType("timestamp with time zone"); + + b.Property("TrainingTypeId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("TrainingTypeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffTraining"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinId") + .HasColumnType("integer"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("JustinId") + .IsUnique(); + + b.HasIndex("UpdatedById"); + + b.ToTable("Region"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("AdvanceNotice") + .HasColumnType("integer"); + + b.Property("Category") + .HasColumnType("text"); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("Mandatory") + .HasColumnType("boolean"); + + b.Property("SubCode") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ValidityPeriod") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("Type", "Code", "LocationId") + .IsUnique(); + + b.ToTable("LookupCode"); + + b.HasData( + new + { + Id = 1, + AdvanceNotice = 0, + Code = "Chief Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Chief Sheriff", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 2, + AdvanceNotice = 0, + Code = "Superintendent", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Superintendent", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 3, + AdvanceNotice = 0, + Code = "Staff Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Inspector", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 4, + AdvanceNotice = 0, + Code = "Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Inspector", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 5, + AdvanceNotice = 0, + Code = "Staff Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Sergeant", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 6, + AdvanceNotice = 0, + Code = "Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sergeant", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 7, + AdvanceNotice = 0, + Code = "Deputy Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Deputy Sheriff", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 8, + AdvanceNotice = 0, + Code = "CEW (Taser)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "CEW (Taser)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 9, + AdvanceNotice = 0, + Code = "DNA", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "DNA", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 10, + AdvanceNotice = 0, + Code = "FRO", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "FRO", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 11, + AdvanceNotice = 0, + Code = "Fire Arm", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Fire Arm", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 12, + AdvanceNotice = 0, + Code = "First Aid", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "First Aid", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 13, + AdvanceNotice = 0, + Code = "Advanced Escort SPC (AESOC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Advanced Escort SPC (AESOC)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 14, + AdvanceNotice = 0, + Code = "Extenuating Circumstances SPC (EXSPC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Extenuating Circumstances SPC (EXSPC)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 15, + AdvanceNotice = 0, + Code = "Search Gate", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Search Gate", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 16, + AdvanceNotice = 0, + Code = "Other", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Other", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 17, + AdvanceNotice = 0, + Code = "STIP", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "STIP", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 18, + AdvanceNotice = 0, + Code = "Annual", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Annual", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 19, + AdvanceNotice = 0, + Code = "Illness", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Illness", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 20, + AdvanceNotice = 0, + Code = "Special", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Special", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.HasBaseType("SS.Db.models.auth.User"); + + b.Property("BadgeNumber") + .HasColumnType("text"); + + b.Property("Excused") + .HasColumnType("boolean"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("LastPhotoUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Photo") + .HasColumnType("bytea"); + + b.Property("Rank") + .HasColumnType("text"); + + b.HasIndex("BadgeNumber") + .IsUnique(); + + b.HasDiscriminator().HasValue("Sheriff"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("db.models.Region", "Region") + .WithMany() + .HasForeignKey("RegionId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Region"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Permission", "Permission") + .WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Permission"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "HomeLocation") + .WithMany() + .HasForeignKey("HomeLocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("HomeLocation"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany("SortOrder") + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany() + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "Assignment") + .WithMany() + .HasForeignKey("AssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Assignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.scheduling.Duty", "Duty") + .WithMany("DutySlots") + .HasForeignKey("DutyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Duty"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "AnticipatedAssignment") + .WithMany() + .HasForeignKey("AnticipatedAssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("AnticipatedAssignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("ActingRank") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("AwayLocation") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("ss.db.models.LookupCode", "LeaveType") + .WithMany() + .HasForeignKey("LeaveTypeId"); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Leave") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("LeaveType"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Training") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "TrainingType") + .WithMany() + .HasForeignKey("TrainingTypeId"); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("TrainingType"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Navigation("DutySlots"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Navigation("SortOrder"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.Navigation("ActingRank"); + + b.Navigation("AwayLocation"); + + b.Navigation("Leave"); + + b.Navigation("Training"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/db/migrations/20231104164350_UpdateSheriff_Add_Excused.cs b/db/migrations/20231104164350_UpdateSheriff_Add_Excused.cs new file mode 100644 index 00000000..f16da9c5 --- /dev/null +++ b/db/migrations/20231104164350_UpdateSheriff_Add_Excused.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SS.Db.Migrations +{ + public partial class UpdateSheriff_Add_Excused : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Excused", + table: "User", + type: "boolean", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Excused", + table: "User"); + } + } +} diff --git a/db/migrations/20231119170825_UpdatePermission_AdjTraining.Designer.cs b/db/migrations/20231119170825_UpdatePermission_AdjTraining.Designer.cs new file mode 100644 index 00000000..c6b1c919 --- /dev/null +++ b/db/migrations/20231119170825_UpdatePermission_AdjTraining.Designer.cs @@ -0,0 +1,2464 @@ +// +using System; +using System.Text.Json; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using SS.Db.models; + +namespace SS.Db.Migrations +{ + [DbContext(typeof(SheriffDbContext))] + [Migration("20231119170825_UpdatePermission_AdjTraining")] + partial class UpdatePermission_AdjTraining + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityByDefaultColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 63) + .HasAnnotation("ProductVersion", "5.0.1"); + + modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("FriendlyName") + .HasColumnType("text"); + + b.Property("Xml") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("DataProtectionKeys"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AgencyId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinCode") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("ParentLocationId") + .HasColumnType("integer"); + + b.Property("RegionId") + .HasColumnType("integer"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AgencyId") + .IsUnique(); + + b.HasIndex("CreatedById"); + + b.HasIndex("RegionId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Location"); + + b.HasData( + new + { + Id = 1, + AgencyId = "SS1", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of Professional Standards", + Timezone = "America/Vancouver" + }, + new + { + Id = 2, + AgencyId = "SS2", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Sheriff Provincial Operation Centre", + Timezone = "America/Vancouver" + }, + new + { + Id = 3, + AgencyId = "SS3", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Central Float Pool", + Timezone = "America/Vancouver" + }, + new + { + Id = 4, + AgencyId = "SS4", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "ITAU", + Timezone = "America/Vancouver" + }, + new + { + Id = 5, + AgencyId = "SS5", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of the Chief Sheriff", + Timezone = "America/Vancouver" + }, + new + { + Id = 6, + AgencyId = "SS6", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + JustinCode = "4882", + Name = "South Okanagan Escort Centre", + Timezone = "America/Vancouver" + }); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("KeyValues") + .HasColumnType("jsonb"); + + b.Property("NewValues") + .HasColumnType("jsonb"); + + b.Property("OldValues") + .HasColumnType("jsonb"); + + b.Property("TableName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KeyValues"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Permission"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Allows the user to login.", + Name = "Login" + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Profile (User)", + Name = "CreateUsers" + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Profile (User)", + Name = "ExpireUsers" + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Profile (User)", + Name = "EditUsers" + }, + new + { + Id = 8, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View all Roles", + Name = "ViewRoles" + }, + new + { + Id = 9, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Roles", + Name = "CreateAndAssignRoles" + }, + new + { + Id = 10, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Roles", + Name = "ExpireRoles" + }, + new + { + Id = 11, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Roles", + Name = "EditRoles" + }, + new + { + Id = 13, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Types", + Name = "CreateTypes" + }, + new + { + Id = 14, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Types", + Name = "EditTypes" + }, + new + { + Id = 15, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Types", + Name = "ExpireTypes" + }, + new + { + Id = 16, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View shifts", + Name = "ViewShifts" + }, + new + { + Id = 19, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Shifts", + Name = "CreateAndAssignShifts" + }, + new + { + Id = 20, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Shifts", + Name = "ExpireShifts" + }, + new + { + Id = 21, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Shifts", + Name = "EditShifts" + }, + new + { + Id = 22, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Distribute Schedule", + Name = "ViewDistributeSchedule" + }, + new + { + Id = 23, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Assigned Location", + Name = "ViewAssignedLocation" + }, + new + { + Id = 24, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Region (all locations within region)", + Name = "ViewRegion" + }, + new + { + Id = 25, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Province (all regions, all locations)", + Name = "ViewProvince" + }, + new + { + Id = 27, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Home Location", + Name = "ViewHomeLocation" + }, + new + { + Id = 28, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Import Shifts", + Name = "ImportShifts" + }, + new + { + Id = 30, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Assignments", + Name = "CreateAssignments" + }, + new + { + Id = 31, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Assignments", + Name = "EditAssignments" + }, + new + { + Id = 32, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Assignments", + Name = "ExpireAssignments" + }, + new + { + Id = 33, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Duties", + Name = "ViewDutyRoster" + }, + new + { + Id = 34, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Duties", + Name = "CreateAndAssignDuties" + }, + new + { + Id = 35, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Duties", + Name = "EditDuties" + }, + new + { + Id = 36, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Duties", + Name = "ExpireDuties" + }, + new + { + Id = 37, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Idir", + Name = "EditIdir" + }, + new + { + Id = 38, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Past Training", + Name = "EditPastTraining" + }, + new + { + Id = 39, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Remove Past Training", + Name = "RemovePastTraining" + }, + new + { + Id = 40, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View DutyRoster in the future", + Name = "ViewDutyRosterInFuture" + }, + new + { + Id = 41, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Shifts in the future (not time constrained)", + Name = "ViewAllFutureShifts" + }, + new + { + Id = 42, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View other profiles (beside their own)", + Name = "ViewOtherProfiles" + }, + new + { + Id = 43, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Generate Reports based on Sheriff's activity", + Name = "GenerateReports" + }, + new + { + Id = 44, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Adjust Training Expiry Dates based on new rules", + Name = "AdjustTrainingExpiry" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(50L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Role"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Administrator", + Name = "Administrator" + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Manager", + Name = "Manager" + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sheriff", + Name = "Sheriff" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(100L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("PermissionId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("PermissionId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("RolePermission"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("FirstName") + .HasColumnType("text"); + + b.Property("HomeLocationId") + .HasColumnType("integer"); + + b.Property("IdirId") + .HasColumnType("uuid"); + + b.Property("IdirName") + .HasColumnType("text"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("KeyCloakId") + .HasColumnType("uuid"); + + b.Property("LastLogin") + .HasColumnType("timestamp with time zone"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("HomeLocationId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("User"); + + b.HasDiscriminator("Discriminator").HasValue("User"); + + b.HasData( + new + { + Id = new Guid("00000000-0000-0000-0000-000000000001"), + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FirstName = "SYSTEM", + IsEnabled = false, + LastName = "SYSTEM" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(5000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("UserId"); + + b.HasIndex("RoleId", "UserId") + .IsUnique(); + + b.ToTable("UserRole"); + }); + + modelBuilder.Entity("SS.Db.models.jc.JcSynchronization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("LastSynchronization") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("JcSynchronization"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("LookupCodeId", "LocationId") + .IsUnique(); + + b.ToTable("LookupSortOrder"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 1, + SortOrder = 1 + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 2, + SortOrder = 2 + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 3, + SortOrder = 3 + }, + new + { + Id = 4, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 4, + SortOrder = 4 + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 5, + SortOrder = 5 + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 6, + SortOrder = 6 + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 7, + SortOrder = 7 + }); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AdhocEndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("AdhocStartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("End") + .HasColumnType("interval"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Friday") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("Monday") + .HasColumnType("boolean"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Saturday") + .HasColumnType("boolean"); + + b.Property("Start") + .HasColumnType("interval"); + + b.Property("Sunday") + .HasColumnType("boolean"); + + b.Property("Thursday") + .HasColumnType("boolean"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("Tuesday") + .HasColumnType("boolean"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Wednesday") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Assignment"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Duty"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DutyId") + .HasColumnType("integer"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("IsClosed") + .HasColumnType("boolean"); + + b.Property("IsNotAvailable") + .HasColumnType("boolean"); + + b.Property("IsNotRequired") + .HasColumnType("boolean"); + + b.Property("IsOvertime") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("DutyId"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("DutySlot"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AnticipatedAssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("OvertimeHours") + .HasColumnType("double precision"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AnticipatedAssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Shift"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Rank") + .HasColumnType("text"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffActingRank"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffAwayLocation"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LeaveTypeId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LeaveTypeId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffLeave"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("FirstNotice") + .HasColumnType("boolean"); + + b.Property("Note") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("TrainingCertificationExpiry") + .HasColumnType("timestamp with time zone"); + + b.Property("TrainingTypeId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("TrainingTypeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffTraining"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinId") + .HasColumnType("integer"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("JustinId") + .IsUnique(); + + b.HasIndex("UpdatedById"); + + b.ToTable("Region"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("AdvanceNotice") + .HasColumnType("integer"); + + b.Property("Category") + .HasColumnType("text"); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("Mandatory") + .HasColumnType("boolean"); + + b.Property("SubCode") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ValidityPeriod") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("Type", "Code", "LocationId") + .IsUnique(); + + b.ToTable("LookupCode"); + + b.HasData( + new + { + Id = 1, + AdvanceNotice = 0, + Code = "Chief Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Chief Sheriff", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 2, + AdvanceNotice = 0, + Code = "Superintendent", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Superintendent", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 3, + AdvanceNotice = 0, + Code = "Staff Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Inspector", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 4, + AdvanceNotice = 0, + Code = "Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Inspector", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 5, + AdvanceNotice = 0, + Code = "Staff Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Sergeant", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 6, + AdvanceNotice = 0, + Code = "Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sergeant", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 7, + AdvanceNotice = 0, + Code = "Deputy Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Deputy Sheriff", + Mandatory = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 8, + AdvanceNotice = 0, + Code = "CEW (Taser)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "CEW (Taser)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 9, + AdvanceNotice = 0, + Code = "DNA", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "DNA", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 10, + AdvanceNotice = 0, + Code = "FRO", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "FRO", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 11, + AdvanceNotice = 0, + Code = "Fire Arm", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Fire Arm", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 12, + AdvanceNotice = 0, + Code = "First Aid", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "First Aid", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 13, + AdvanceNotice = 0, + Code = "Advanced Escort SPC (AESOC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Advanced Escort SPC (AESOC)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 14, + AdvanceNotice = 0, + Code = "Extenuating Circumstances SPC (EXSPC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Extenuating Circumstances SPC (EXSPC)", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 15, + AdvanceNotice = 0, + Code = "Search Gate", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Search Gate", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 16, + AdvanceNotice = 0, + Code = "Other", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Other", + Mandatory = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 17, + AdvanceNotice = 0, + Code = "STIP", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "STIP", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 18, + AdvanceNotice = 0, + Code = "Annual", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Annual", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 19, + AdvanceNotice = 0, + Code = "Illness", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Illness", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 20, + AdvanceNotice = 0, + Code = "Special", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Special", + Mandatory = false, + Type = 5, + ValidityPeriod = 0 + }); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.HasBaseType("SS.Db.models.auth.User"); + + b.Property("BadgeNumber") + .HasColumnType("text"); + + b.Property("Excused") + .HasColumnType("boolean"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("LastPhotoUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Photo") + .HasColumnType("bytea"); + + b.Property("Rank") + .HasColumnType("text"); + + b.HasIndex("BadgeNumber") + .IsUnique(); + + b.HasDiscriminator().HasValue("Sheriff"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("db.models.Region", "Region") + .WithMany() + .HasForeignKey("RegionId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Region"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Permission", "Permission") + .WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Permission"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "HomeLocation") + .WithMany() + .HasForeignKey("HomeLocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("HomeLocation"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany("SortOrder") + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany() + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "Assignment") + .WithMany() + .HasForeignKey("AssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Assignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.scheduling.Duty", "Duty") + .WithMany("DutySlots") + .HasForeignKey("DutyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Duty"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "AnticipatedAssignment") + .WithMany() + .HasForeignKey("AnticipatedAssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("AnticipatedAssignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("ActingRank") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("AwayLocation") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("ss.db.models.LookupCode", "LeaveType") + .WithMany() + .HasForeignKey("LeaveTypeId"); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Leave") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("LeaveType"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Training") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "TrainingType") + .WithMany() + .HasForeignKey("TrainingTypeId"); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("TrainingType"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Navigation("DutySlots"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Navigation("SortOrder"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.Navigation("ActingRank"); + + b.Navigation("AwayLocation"); + + b.Navigation("Leave"); + + b.Navigation("Training"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/db/migrations/20231119170825_UpdatePermission_AdjTraining.cs b/db/migrations/20231119170825_UpdatePermission_AdjTraining.cs new file mode 100644 index 00000000..613dfc0e --- /dev/null +++ b/db/migrations/20231119170825_UpdatePermission_AdjTraining.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SS.Db.Migrations +{ + public partial class UpdatePermission_AdjTraining : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "Permission", + columns: new[] { "Id", "CreatedById", "Description", "Name", "UpdatedById", "UpdatedOn" }, + values: new object[] { 44, null, "Adjust Training Expiry Dates based on new rules", "AdjustTrainingExpiry", null, null }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "Permission", + keyColumn: "Id", + keyValue: 44); + } + } +} diff --git a/db/migrations/20231217161823_UpdateLookupCode_Training_RotatingFlag.Designer.cs b/db/migrations/20231217161823_UpdateLookupCode_Training_RotatingFlag.Designer.cs new file mode 100644 index 00000000..7a20114e --- /dev/null +++ b/db/migrations/20231217161823_UpdateLookupCode_Training_RotatingFlag.Designer.cs @@ -0,0 +1,2487 @@ +// +using System; +using System.Text.Json; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using SS.Db.models; + +namespace SS.Db.Migrations +{ + [DbContext(typeof(SheriffDbContext))] + [Migration("20231217161823_UpdateLookupCode_Training_RotatingFlag")] + partial class UpdateLookupCode_Training_RotatingFlag + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityByDefaultColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 63) + .HasAnnotation("ProductVersion", "5.0.1"); + + modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("FriendlyName") + .HasColumnType("text"); + + b.Property("Xml") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("DataProtectionKeys"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AgencyId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinCode") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("ParentLocationId") + .HasColumnType("integer"); + + b.Property("RegionId") + .HasColumnType("integer"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AgencyId") + .IsUnique(); + + b.HasIndex("CreatedById"); + + b.HasIndex("RegionId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Location"); + + b.HasData( + new + { + Id = 1, + AgencyId = "SS1", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of Professional Standards", + Timezone = "America/Vancouver" + }, + new + { + Id = 2, + AgencyId = "SS2", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Sheriff Provincial Operation Centre", + Timezone = "America/Vancouver" + }, + new + { + Id = 3, + AgencyId = "SS3", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Central Float Pool", + Timezone = "America/Vancouver" + }, + new + { + Id = 4, + AgencyId = "SS4", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "ITAU", + Timezone = "America/Vancouver" + }, + new + { + Id = 5, + AgencyId = "SS5", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Office of the Chief Sheriff", + Timezone = "America/Vancouver" + }, + new + { + Id = 6, + AgencyId = "SS6", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + JustinCode = "4882", + Name = "South Okanagan Escort Centre", + Timezone = "America/Vancouver" + }); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("KeyValues") + .HasColumnType("jsonb"); + + b.Property("NewValues") + .HasColumnType("jsonb"); + + b.Property("OldValues") + .HasColumnType("jsonb"); + + b.Property("TableName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KeyValues"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Permission"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Allows the user to login.", + Name = "Login" + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Profile (User)", + Name = "CreateUsers" + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Profile (User)", + Name = "ExpireUsers" + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Profile (User)", + Name = "EditUsers" + }, + new + { + Id = 8, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View all Roles", + Name = "ViewRoles" + }, + new + { + Id = 9, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Roles", + Name = "CreateAndAssignRoles" + }, + new + { + Id = 10, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Roles", + Name = "ExpireRoles" + }, + new + { + Id = 11, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Roles", + Name = "EditRoles" + }, + new + { + Id = 13, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Types", + Name = "CreateTypes" + }, + new + { + Id = 14, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Types", + Name = "EditTypes" + }, + new + { + Id = 15, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Types", + Name = "ExpireTypes" + }, + new + { + Id = 16, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View shifts", + Name = "ViewShifts" + }, + new + { + Id = 19, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create and Assign Shifts", + Name = "CreateAndAssignShifts" + }, + new + { + Id = 20, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Shifts", + Name = "ExpireShifts" + }, + new + { + Id = 21, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Shifts", + Name = "EditShifts" + }, + new + { + Id = 22, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Distribute Schedule", + Name = "ViewDistributeSchedule" + }, + new + { + Id = 23, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Assigned Location", + Name = "ViewAssignedLocation" + }, + new + { + Id = 24, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Region (all locations within region)", + Name = "ViewRegion" + }, + new + { + Id = 25, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Province (all regions, all locations)", + Name = "ViewProvince" + }, + new + { + Id = 27, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Home Location", + Name = "ViewHomeLocation" + }, + new + { + Id = 28, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Import Shifts", + Name = "ImportShifts" + }, + new + { + Id = 30, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Assignments", + Name = "CreateAssignments" + }, + new + { + Id = 31, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Assignments", + Name = "EditAssignments" + }, + new + { + Id = 32, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Assignments", + Name = "ExpireAssignments" + }, + new + { + Id = 33, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Duties", + Name = "ViewDutyRoster" + }, + new + { + Id = 34, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Create Duties", + Name = "CreateAndAssignDuties" + }, + new + { + Id = 35, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Duties", + Name = "EditDuties" + }, + new + { + Id = 36, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Expire Duties", + Name = "ExpireDuties" + }, + new + { + Id = 37, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Idir", + Name = "EditIdir" + }, + new + { + Id = 38, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Edit Past Training", + Name = "EditPastTraining" + }, + new + { + Id = 39, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Remove Past Training", + Name = "RemovePastTraining" + }, + new + { + Id = 40, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View DutyRoster in the future", + Name = "ViewDutyRosterInFuture" + }, + new + { + Id = 41, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View Shifts in the future (not time constrained)", + Name = "ViewAllFutureShifts" + }, + new + { + Id = 42, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "View other profiles (beside their own)", + Name = "ViewOtherProfiles" + }, + new + { + Id = 43, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Generate Reports based on Sheriff's activity", + Name = "GenerateReports" + }, + new + { + Id = 44, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Adjust Training Expiry Dates based on new rules", + Name = "AdjustTrainingExpiry" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(50L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Role"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Administrator", + Name = "Administrator" + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Manager", + Name = "Manager" + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sheriff", + Name = "Sheriff" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(100L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("PermissionId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("PermissionId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("RolePermission"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("FirstName") + .HasColumnType("text"); + + b.Property("HomeLocationId") + .HasColumnType("integer"); + + b.Property("IdirId") + .HasColumnType("uuid"); + + b.Property("IdirName") + .HasColumnType("text"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("KeyCloakId") + .HasColumnType("uuid"); + + b.Property("LastLogin") + .HasColumnType("timestamp with time zone"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("HomeLocationId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("User"); + + b.HasDiscriminator("Discriminator").HasValue("User"); + + b.HasData( + new + { + Id = new Guid("00000000-0000-0000-0000-000000000001"), + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FirstName = "SYSTEM", + IsEnabled = false, + LastName = "SYSTEM" + }); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(5000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("UserId"); + + b.HasIndex("RoleId", "UserId") + .IsUnique(); + + b.ToTable("UserRole"); + }); + + modelBuilder.Entity("SS.Db.models.jc.JcSynchronization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("LastSynchronization") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("JcSynchronization"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("LookupCodeId", "LocationId") + .IsUnique(); + + b.ToTable("LookupSortOrder"); + + b.HasData( + new + { + Id = 1, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 1, + SortOrder = 1 + }, + new + { + Id = 2, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 2, + SortOrder = 2 + }, + new + { + Id = 3, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 3, + SortOrder = 3 + }, + new + { + Id = 4, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 4, + SortOrder = 4 + }, + new + { + Id = 5, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 5, + SortOrder = 5 + }, + new + { + Id = 6, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 6, + SortOrder = 6 + }, + new + { + Id = 7, + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + LookupCodeId = 7, + SortOrder = 7 + }); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AdhocEndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("AdhocStartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("End") + .HasColumnType("interval"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Friday") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("LookupCodeId") + .HasColumnType("integer"); + + b.Property("Monday") + .HasColumnType("boolean"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Saturday") + .HasColumnType("boolean"); + + b.Property("Start") + .HasColumnType("interval"); + + b.Property("Sunday") + .HasColumnType("boolean"); + + b.Property("Thursday") + .HasColumnType("boolean"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("Tuesday") + .HasColumnType("boolean"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Wednesday") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("LookupCodeId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Assignment"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Duty"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DutyId") + .HasColumnType("integer"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("IsClosed") + .HasColumnType("boolean"); + + b.Property("IsNotAvailable") + .HasColumnType("boolean"); + + b.Property("IsNotRequired") + .HasColumnType("boolean"); + + b.Property("IsOvertime") + .HasColumnType("boolean"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("DutyId"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("DutySlot"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(200L, null, null, null, null, null); + + b.Property("AnticipatedAssignmentId") + .HasColumnType("integer"); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("OvertimeHours") + .HasColumnType("double precision"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("AnticipatedAssignmentId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("Shift"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("Rank") + .HasColumnType("text"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffActingRank"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffAwayLocation"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("LeaveTypeId") + .HasColumnType("integer"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LeaveTypeId"); + + b.HasIndex("SheriffId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffLeave"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Comment") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryReason") + .HasColumnType("text"); + + b.Property("FirstNotice") + .HasColumnType("boolean"); + + b.Property("Note") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("SheriffId") + .HasColumnType("uuid"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Timezone") + .HasColumnType("text"); + + b.Property("TrainingCertificationExpiry") + .HasColumnType("timestamp with time zone"); + + b.Property("TrainingTypeId") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("SheriffId"); + + b.HasIndex("TrainingTypeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("StartDate", "EndDate"); + + b.ToTable("SheriffTraining"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn(); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("JustinId") + .HasColumnType("integer"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("JustinId") + .IsUnique(); + + b.HasIndex("UpdatedById"); + + b.ToTable("Region"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .UseIdentityByDefaultColumn() + .HasIdentityOptions(1000L, null, null, null, null, null); + + b.Property("AdvanceNotice") + .HasColumnType("integer"); + + b.Property("Category") + .HasColumnType("text"); + + b.Property("Code") + .HasColumnType("text"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("CreatedById") + .HasColumnType("uuid"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("EffectiveDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("integer"); + + b.Property("Mandatory") + .HasColumnType("boolean"); + + b.Property("Rotating") + .HasColumnType("boolean"); + + b.Property("SubCode") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("UpdatedById") + .HasColumnType("uuid"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("ValidityPeriod") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LocationId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("Type", "Code", "LocationId") + .IsUnique(); + + b.ToTable("LookupCode"); + + b.HasData( + new + { + Id = 1, + AdvanceNotice = 0, + Code = "Chief Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Chief Sheriff", + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 2, + AdvanceNotice = 0, + Code = "Superintendent", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Superintendent", + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 3, + AdvanceNotice = 0, + Code = "Staff Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Inspector", + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 4, + AdvanceNotice = 0, + Code = "Inspector", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Inspector", + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 5, + AdvanceNotice = 0, + Code = "Staff Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Staff Sergeant", + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 6, + AdvanceNotice = 0, + Code = "Sergeant", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Sergeant", + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 7, + AdvanceNotice = 0, + Code = "Deputy Sheriff", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Deputy Sheriff", + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 + }, + new + { + Id = 8, + AdvanceNotice = 0, + Code = "CEW (Taser)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "CEW (Taser)", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 9, + AdvanceNotice = 0, + Code = "DNA", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "DNA", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 10, + AdvanceNotice = 0, + Code = "FRO", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "FRO", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 11, + AdvanceNotice = 0, + Code = "Fire Arm", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Fire Arm", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 12, + AdvanceNotice = 0, + Code = "First Aid", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "First Aid", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 13, + AdvanceNotice = 0, + Code = "Advanced Escort SPC (AESOC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Advanced Escort SPC (AESOC)", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 14, + AdvanceNotice = 0, + Code = "Extenuating Circumstances SPC (EXSPC)", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Extenuating Circumstances SPC (EXSPC)", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 15, + AdvanceNotice = 0, + Code = "Search Gate", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Search Gate", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 16, + AdvanceNotice = 0, + Code = "Other", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Other", + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 + }, + new + { + Id = 17, + AdvanceNotice = 0, + Code = "STIP", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "STIP", + Mandatory = false, + Rotating = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 18, + AdvanceNotice = 0, + Code = "Annual", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Annual", + Mandatory = false, + Rotating = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 19, + AdvanceNotice = 0, + Code = "Illness", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Illness", + Mandatory = false, + Rotating = false, + Type = 5, + ValidityPeriod = 0 + }, + new + { + Id = 20, + AdvanceNotice = 0, + Code = "Special", + ConcurrencyToken = 0u, + CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Special", + Mandatory = false, + Rotating = false, + Type = 5, + ValidityPeriod = 0 + }); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.HasBaseType("SS.Db.models.auth.User"); + + b.Property("BadgeNumber") + .HasColumnType("text"); + + b.Property("Excused") + .HasColumnType("boolean"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("LastPhotoUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Photo") + .HasColumnType("bytea"); + + b.Property("Rank") + .HasColumnType("text"); + + b.HasIndex("BadgeNumber") + .IsUnique(); + + b.HasDiscriminator().HasValue("Sheriff"); + }); + + modelBuilder.Entity("SS.Api.Models.DB.Location", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("db.models.Region", "Region") + .WithMany() + .HasForeignKey("RegionId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Region"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.audit.Audit", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Permission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.RolePermission", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Permission", "Permission") + .WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Permission"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "HomeLocation") + .WithMany() + .HasForeignKey("HomeLocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("HomeLocation"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.UserRole", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Role"); + + b.Navigation("UpdatedBy"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SS.Db.models.lookupcodes.LookupSortOrder", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany("SortOrder") + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Assignment", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "LookupCode") + .WithMany() + .HasForeignKey("LookupCodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("LookupCode"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "Assignment") + .WithMany() + .HasForeignKey("AssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Assignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.DutySlot", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.scheduling.Duty", "Duty") + .WithMany("DutySlots") + .HasForeignKey("DutyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Duty"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Shift", b => + { + b.HasOne("SS.Db.models.scheduling.Assignment", "AnticipatedAssignment") + .WithMany() + .HasForeignKey("AnticipatedAssignmentId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany() + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.SetNull) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("AnticipatedAssignment"); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffActingRank", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("ActingRank") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffAwayLocation", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("AwayLocation") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffLeave", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("ss.db.models.LookupCode", "LeaveType") + .WithMany() + .HasForeignKey("LeaveTypeId"); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Leave") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("LeaveType"); + + b.Navigation("Sheriff"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.SheriffTraining", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.sheriff.Sheriff", "Sheriff") + .WithMany("Training") + .HasForeignKey("SheriffId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ss.db.models.LookupCode", "TrainingType") + .WithMany() + .HasForeignKey("TrainingTypeId"); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Sheriff"); + + b.Navigation("TrainingType"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("db.models.Region", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.HasOne("SS.Db.models.auth.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Api.Models.DB.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("SS.Db.models.auth.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CreatedBy"); + + b.Navigation("Location"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("SS.Db.models.auth.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.auth.User", b => + { + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("SS.Db.models.scheduling.Duty", b => + { + b.Navigation("DutySlots"); + }); + + modelBuilder.Entity("ss.db.models.LookupCode", b => + { + b.Navigation("SortOrder"); + }); + + modelBuilder.Entity("SS.Db.models.sheriff.Sheriff", b => + { + b.Navigation("ActingRank"); + + b.Navigation("AwayLocation"); + + b.Navigation("Leave"); + + b.Navigation("Training"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/db/migrations/20231217161823_UpdateLookupCode_Training_RotatingFlag.cs b/db/migrations/20231217161823_UpdateLookupCode_Training_RotatingFlag.cs new file mode 100644 index 00000000..969a13f6 --- /dev/null +++ b/db/migrations/20231217161823_UpdateLookupCode_Training_RotatingFlag.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SS.Db.Migrations +{ + public partial class UpdateLookupCode_Training_RotatingFlag : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Rotating", + table: "LookupCode", + type: "boolean", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Rotating", + table: "LookupCode"); + } + } +} diff --git a/db/migrations/SheriffDbContextModelSnapshot.cs b/db/migrations/SheriffDbContextModelSnapshot.cs index abcf1f3c..e5b4488d 100644 --- a/db/migrations/SheriffDbContextModelSnapshot.cs +++ b/db/migrations/SheriffDbContextModelSnapshot.cs @@ -523,6 +523,14 @@ protected override void BuildModel(ModelBuilder modelBuilder) CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Generate Reports based on Sheriff's activity", Name = "GenerateReports" + }, + new + { + Id = 44, + ConcurrencyToken = 0u, + CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Adjust Training Expiry Dates based on new rules", + Name = "AdjustTrainingExpiry" }); }); @@ -1462,6 +1470,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ExpiryReason") .HasColumnType("text"); + b.Property("FirstNotice") + .HasColumnType("boolean"); + b.Property("Note") .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -1561,6 +1572,12 @@ protected override void BuildModel(ModelBuilder modelBuilder) .UseIdentityByDefaultColumn() .HasIdentityOptions(1000L, null, null, null, null, null); + b.Property("AdvanceNotice") + .HasColumnType("integer"); + + b.Property("Category") + .HasColumnType("text"); + b.Property("Code") .HasColumnType("text"); @@ -1590,6 +1607,12 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("LocationId") .HasColumnType("integer"); + b.Property("Mandatory") + .HasColumnType("boolean"); + + b.Property("Rotating") + .HasColumnType("boolean"); + b.Property("SubCode") .HasColumnType("text"); @@ -1602,6 +1625,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("UpdatedOn") .HasColumnType("timestamp with time zone"); + b.Property("ValidityPeriod") + .HasColumnType("integer"); + b.HasKey("Id"); b.HasIndex("CreatedById"); @@ -1619,202 +1645,282 @@ protected override void BuildModel(ModelBuilder modelBuilder) new { Id = 1, + AdvanceNotice = 0, Code = "Chief Sheriff", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Chief Sheriff", - Type = 7 + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 }, new { Id = 2, + AdvanceNotice = 0, Code = "Superintendent", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Superintendent", - Type = 7 + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 }, new { Id = 3, + AdvanceNotice = 0, Code = "Staff Inspector", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Staff Inspector", - Type = 7 + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 }, new { Id = 4, + AdvanceNotice = 0, Code = "Inspector", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Inspector", - Type = 7 + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 }, new { Id = 5, + AdvanceNotice = 0, Code = "Staff Sergeant", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Staff Sergeant", - Type = 7 + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 }, new { Id = 6, + AdvanceNotice = 0, Code = "Sergeant", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Sergeant", - Type = 7 + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 }, new { Id = 7, + AdvanceNotice = 0, Code = "Deputy Sheriff", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Deputy Sheriff", - Type = 7 + Mandatory = false, + Rotating = false, + Type = 7, + ValidityPeriod = 0 }, new { Id = 8, + AdvanceNotice = 0, Code = "CEW (Taser)", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "CEW (Taser)", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 9, + AdvanceNotice = 0, Code = "DNA", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "DNA", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 10, + AdvanceNotice = 0, Code = "FRO", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "FRO", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 11, + AdvanceNotice = 0, Code = "Fire Arm", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Fire Arm", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 12, + AdvanceNotice = 0, Code = "First Aid", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "First Aid", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 13, + AdvanceNotice = 0, Code = "Advanced Escort SPC (AESOC)", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Advanced Escort SPC (AESOC)", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 14, + AdvanceNotice = 0, Code = "Extenuating Circumstances SPC (EXSPC)", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Extenuating Circumstances SPC (EXSPC)", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 15, + AdvanceNotice = 0, Code = "Search Gate", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Search Gate", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 16, + AdvanceNotice = 0, Code = "Other", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Other", - Type = 6 + Mandatory = false, + Rotating = false, + Type = 6, + ValidityPeriod = 0 }, new { Id = 17, + AdvanceNotice = 0, Code = "STIP", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "STIP", - Type = 5 + Mandatory = false, + Rotating = false, + Type = 5, + ValidityPeriod = 0 }, new { Id = 18, + AdvanceNotice = 0, Code = "Annual", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Annual", - Type = 5 + Mandatory = false, + Rotating = false, + Type = 5, + ValidityPeriod = 0 }, new { Id = 19, + AdvanceNotice = 0, Code = "Illness", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Illness", - Type = 5 + Mandatory = false, + Rotating = false, + Type = 5, + ValidityPeriod = 0 }, new { Id = 20, + AdvanceNotice = 0, Code = "Special", ConcurrencyToken = 0u, CreatedById = new Guid("00000000-0000-0000-0000-000000000001"), CreatedOn = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Description = "Special", - Type = 5 + Mandatory = false, + Rotating = false, + Type = 5, + ValidityPeriod = 0 }); }); @@ -1825,6 +1931,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BadgeNumber") .HasColumnType("text"); + b.Property("Excused") + .HasColumnType("boolean"); + b.Property("Gender") .HasColumnType("integer"); diff --git a/db/models/auth/Permission.cs b/db/models/auth/Permission.cs index 81e29b8b..47999525 100644 --- a/db/models/auth/Permission.cs +++ b/db/models/auth/Permission.cs @@ -43,6 +43,7 @@ public class Permission : BaseEntity public const string ViewAllFutureShifts = nameof(ViewAllFutureShifts); public const string ViewOtherProfiles = nameof(ViewOtherProfiles); public const string GenerateReports = nameof(GenerateReports); + public const string AdjustTrainingExpiry = nameof(AdjustTrainingExpiry); [Key] public int Id { get; set; } diff --git a/db/models/lookupcodes/LookupCode.cs b/db/models/lookupcodes/LookupCode.cs index 5cb9c7a9..79e4e148 100644 --- a/db/models/lookupcodes/LookupCode.cs +++ b/db/models/lookupcodes/LookupCode.cs @@ -26,5 +26,12 @@ public class LookupCode : BaseEntity public List SortOrder { get; set; } [NotMapped] public LookupSortOrder SortOrderForLocation; + + public Boolean Mandatory { get; set; } + public int ValidityPeriod { get; set; } + public string Category { get; set; } + public int AdvanceNotice { get; set; } + public Boolean Rotating { get; set; } + } } diff --git a/db/models/scheduling/DutySlot.cs b/db/models/scheduling/DutySlot.cs index d7b05f7c..8409f84f 100644 --- a/db/models/scheduling/DutySlot.cs +++ b/db/models/scheduling/DutySlot.cs @@ -16,27 +16,44 @@ public class DutySlot : BaseEntity { [Key, ExcludeFromAddDto] public int Id { get; set; } - public DateTimeOffset StartDate { get; set; } + + public DateTimeOffset StartDate { get; set; } public DateTimeOffset EndDate { get; set; } public DateTimeOffset? ExpiryDate { get; set; } + [ExcludeFromAddAndUpdateDto] [AdaptIgnore] - public Duty Duty { get; set;} + public Duty Duty { get; set; } + public int DutyId { get; set; } + [ExcludeFromAddAndUpdateDto] public Sheriff Sheriff { get; set; } + public Guid? SheriffId { get; set; } + [ExcludeFromAddAndUpdateDto] public Location Location { get; set; } + [ExcludeFromAddAndUpdateDto] public int LocationId { get; set; } + public string Timezone { get; set; } public bool IsNotRequired { get; set; } public bool IsNotAvailable { get; set; } public bool IsOvertime { get; set; } - public bool IsClosed { get;set;} + public bool IsClosed { get; set; } + [NotMapped] [ExcludeFromAddAndUpdateDto] public LookupCode AssignmentLookupCode => Duty?.Assignment?.LookupCode; + + [NotMapped] + [ExcludeFromAddAndUpdateDto] + public string DutyComment => Duty?.Comment; + + [NotMapped] + [ExcludeFromAddAndUpdateDto] + public string AssignmentComment => Duty?.Assignment?.Comment; } -} +} \ No newline at end of file diff --git a/db/models/scheduling/notmapped/ShiftAvailability.cs b/db/models/scheduling/notmapped/ShiftAvailability.cs index 5e488cdc..8d9ec0c5 100644 --- a/db/models/scheduling/notmapped/ShiftAvailability.cs +++ b/db/models/scheduling/notmapped/ShiftAvailability.cs @@ -12,23 +12,28 @@ public class ShiftAvailability { [NotMapped] public DateTimeOffset Start { get; set; } + [NotMapped] public DateTimeOffset End { get; set; } + [NotMapped] public List Conflicts { get; set; } + [NotMapped] public Sheriff Sheriff { get; set; } + [NotMapped] public Guid? SheriffId { get; set; } } + [AdaptTo("[name]Dto")] public class ShiftAvailabilityConflict { public Guid? SheriffId { get; set; } public ShiftConflictType Conflict { get; set; } public DateTimeOffset Start { get; set; } public DateTimeOffset End { get; set; } - public int? LocationId { get; set;} + public int? LocationId { get; set; } public Location Location { get; set; } public int? ShiftId { get; set; } public string WorkSection { get; set; } @@ -36,6 +41,8 @@ public class ShiftAvailabilityConflict public double OvertimeHours { get; set; } public string SheriffEventType { get; set; } public string Comment { get; set; } + + public ICollection DutySlots { get; set; } } public enum ShiftConflictType @@ -45,4 +52,4 @@ public enum ShiftConflictType AwayLocation, Scheduled } -} +} \ No newline at end of file diff --git a/db/models/sheriff/Sheriff.cs b/db/models/sheriff/Sheriff.cs index c06f2031..e8874f6b 100644 --- a/db/models/sheriff/Sheriff.cs +++ b/db/models/sheriff/Sheriff.cs @@ -25,5 +25,6 @@ public class Sheriff : User public string PhotoUrl => Photo?.Length > 0 ? $"/api/sheriff/getPhoto/{Id}?{LastPhotoUpdate.Ticks}" : null; public DateTimeOffset LastPhotoUpdate { get; set; } + public Boolean Excused { get; set; } } } \ No newline at end of file diff --git a/db/models/sheriff/SheriffTraining.cs b/db/models/sheriff/SheriffTraining.cs index 09ef5ce0..4fecc13d 100644 --- a/db/models/sheriff/SheriffTraining.cs +++ b/db/models/sheriff/SheriffTraining.cs @@ -13,5 +13,7 @@ public class SheriffTraining : SheriffEvent public DateTimeOffset? TrainingCertificationExpiry { get; set; } [MaxLength(200)] public string Note { get; set; } + + public Boolean FirstNotice { get; set; } } } diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index ae3f22b8..5f65bab7 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -39,6 +39,10 @@ services: - Logging__LogLevel__Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker=${ControllerLoggingLevel} - Logging__LogLevel__SS.Api.infrastructure.middleware.ErrorHandlingMiddleware=${MiddlewareLoggingLevel} - Logging__LogLevel__Microsoft.EntityFrameworkCore.Database.Command=${DatabaseLoggingLevel} + - ASPNETCORE_Kestrel__Certificates__Default__Password=${KestrelPassword} + - ASPNETCORE_Kestrel__Certificates__Default__Path=${KestrelPath} + - PdfUrl=${PdfUrl} + - TrainingNotification=${TrainingNotification} ports: - 5000:5000 volumes: @@ -62,4 +66,9 @@ services: ports: - 5432:5432 volumes: - - ./tmp:/tmp2 \ No newline at end of file + - ./tmp:/tmp2 + + pdf: + image: hassananv/weasyprint + ports: + - 8083:5001 \ No newline at end of file diff --git a/docker/manage b/docker/manage old mode 100644 new mode 100755 index 293fb15c..d51a187a --- a/docker/manage +++ b/docker/manage @@ -80,7 +80,7 @@ build-api() { -e "CORS_DOMAIN=http://localhost:8080" \ -e "DOTNET_STARTUP_PROJECT=./api/api.csproj" \ '..' \ - 'registry.centos.org/dotnet/dotnet-31-centos7' \ + 'registry.redhat.io/rhel8/dotnet-50' \ 'ss-api' echo -e "====================================================================================================" } @@ -161,10 +161,13 @@ configureEnvironment () { export POSTGRESQL_USER=${POSTGRESQL_USER:-shersched} export POSTGRESQL_PASSWORD=${POSTGRESQL_PASSWORD:-n05dmkFjio1GCUVY} export POSTGRESQL_ADMIN_PASSWORD=${POSTGRESQL_ADMIN_PASSWORD:-A?]qosqxBqNLdesFKWe} - + export TrainingNotification=${TrainingNotification:-"0 0/5 * * * ?"} # ss-web export API_URL=${API_URL-http://api:5000/api/} export WEB_BASE_HREF=${WEB_BASE_HREF-/sheriff-scheduling/} + + # ss-pdf + export PdfUrl=${PdfUrl-http://pdf:5001} } getStartupParams() { diff --git a/jc-interface-client/jc-interface-client.csproj b/jc-interface-client/jc-interface-client.csproj index 62d1ec67..6da6736b 100644 --- a/jc-interface-client/jc-interface-client.csproj +++ b/jc-interface-client/jc-interface-client.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 jc_interface_client @@ -11,7 +11,7 @@ - + diff --git a/tests/tests.csproj b/tests/tests.csproj index d3e24359..cc3d7b7b 100644 --- a/tests/tests.csproj +++ b/tests/tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 de959767-ede6-4f8a-b6b9-d36aed70339C diff --git a/web/package-lock.json b/web/package-lock.json index a484cd21..63ff4525 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -330,6 +330,12 @@ "@babel/types": "^7.16.7" } }, + "@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true + }, "@babel/helper-validator-identifier": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", @@ -1211,48 +1217,123 @@ } }, "@babel/traverse": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", - "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.16.8", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.16.10", - "@babel/types": "^7.16.8", - "debug": "^4.1.0", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", + "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9", + "debug": "^4.3.1", "globals": "^11.1.0" }, "dependencies": { "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "requires": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + } + }, + "@babel/generator": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "dev": true, + "requires": { + "@babel/types": "^7.23.6", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + } + }, + "@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true + }, + "@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "dev": true, + "requires": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dev": true, + "requires": { + "@babel/types": "^7.22.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "dev": true, + "requires": { + "@babel/types": "^7.22.5" } }, "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" } + }, + "@babel/parser": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", + "dev": true + }, + "@babel/template": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", + "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9" + } + }, + "@babel/types": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + } } } }, @@ -1354,6 +1435,45 @@ "postcss": "^7.0.0" } }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", @@ -1387,9 +1507,9 @@ "dev": true }, "@sindresorhus/is": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", - "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==" + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==" }, "@soda/friendly-errors-webpack-plugin": { "version": "1.8.1", @@ -1486,6 +1606,14 @@ "integrity": "sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w==", "dev": true }, + "@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "requires": { + "defer-to-connect": "^2.0.0" + } + }, "@types/body-parser": { "version": "1.19.2", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", @@ -1496,6 +1624,17 @@ "@types/node": "*" } }, + "@types/cacheable-request": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", + "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", + "requires": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" + } + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -1560,6 +1699,11 @@ "@types/node": "*" } }, + "@types/http-cache-semantics": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" + }, "@types/http-proxy": { "version": "1.17.8", "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.8.tgz", @@ -1575,6 +1719,14 @@ "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", "dev": true }, + "@types/keyv": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "requires": { + "@types/node": "*" + } + }, "@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", @@ -1596,8 +1748,7 @@ "@types/node": { "version": "17.0.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.12.tgz", - "integrity": "sha512-4YpbAsnJXWYK/fpTVFlMIcUIho2AYCi4wg5aNPrG1ng7fn/1/RZfCIpRCiBX+12RVa34RluilnvCqD+g3KiSiA==", - "dev": true + "integrity": "sha512-4YpbAsnJXWYK/fpTVFlMIcUIho2AYCi4wg5aNPrG1ng7fn/1/RZfCIpRCiBX+12RVa34RluilnvCqD+g3KiSiA==" }, "@types/normalize-package-data": { "version": "2.4.1", @@ -1606,9 +1757,9 @@ "dev": true }, "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", + "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", "dev": true }, "@types/q": { @@ -1629,6 +1780,14 @@ "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", "dev": true }, + "@types/responselike": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", + "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "requires": { + "@types/node": "*" + } + }, "@types/serve-static": { "version": "1.13.10", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", @@ -2942,12 +3101,9 @@ "dev": true }, "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" }, "async-each": { "version": "1.0.3", @@ -3015,17 +3171,17 @@ "dev": true }, "axios": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.2.tgz", - "integrity": "sha512-87otirqUw3e8CzHTMO+/9kh/FSgXt/eVDvipijwDtEuwbkySWZ9SBm6VEubmJ/kLKEoLQV/POhxXFb66bfekfg==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { "follow-redirects": "^1.14.0" } }, "axios-auth-refresh": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/axios-auth-refresh/-/axios-auth-refresh-3.0.0.tgz", - "integrity": "sha512-0XJnJY711f7opdT+b/au/xw1g4MYrjntXB8Oy5l48plbzOWLjUtJ+m8CtiNLgN3MAvGFJ/Q1NtQ7WKf2euKu6g==" + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/axios-auth-refresh/-/axios-auth-refresh-3.3.6.tgz", + "integrity": "sha512-2CeBUce/SxIfFxow5/n8vApJ97yYF6qoV4gh1UrswT7aEOnlOdBLxxyhOI4IaxGs6BY0l8YujU2jlc4aCmK17Q==" }, "babel-code-frame": { "version": "6.26.0", @@ -3241,8 +3397,7 @@ "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" }, "binary-extensions": { "version": "2.2.0", @@ -3440,26 +3595,32 @@ } }, "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", "dev": true, "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" }, "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -3598,24 +3759,32 @@ "schema-utils": "^2.0.0" } }, + "cacheable-lookup": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==" + }, "cacheable-request": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", - "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", + "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", "requires": { - "clone-response": "1.0.2", - "get-stream": "3.0.0", - "http-cache-semantics": "3.8.1", - "keyv": "3.0.0", - "lowercase-keys": "1.0.0", - "normalize-url": "2.0.1", - "responselike": "1.0.2" + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" }, "dependencies": { - "lowercase-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "requires": { + "pump": "^3.0.0" + } } } }, @@ -4020,9 +4189,9 @@ } }, "clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", + "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", "requires": { "mimic-response": "^1.0.0" } @@ -4430,7 +4599,8 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "cosmiconfig": { "version": "6.0.0", @@ -4876,16 +5046,23 @@ "dev": true }, "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==" }, "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "requires": { - "mimic-response": "^1.0.0" + "mimic-response": "^3.1.0" + }, + "dependencies": { + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" + } } }, "deep-equal": { @@ -4909,9 +5086,9 @@ "dev": true }, "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true }, "default-gateway": { @@ -5038,6 +5215,11 @@ "clone": "^1.0.2" } }, + "defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==" + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -5326,11 +5508,6 @@ "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" - }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -5411,8 +5588,7 @@ "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==" }, "encodeurl": { "version": "1.0.2", @@ -5424,7 +5600,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "requires": { "once": "^1.4.0" } @@ -6344,9 +6519,9 @@ } }, "follow-redirects": { - "version": "1.14.8", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", - "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==" + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==" }, "for-in": { "version": "1.0.2", @@ -6500,12 +6675,13 @@ "from": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" + "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==" }, "from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" @@ -6524,9 +6700,9 @@ } }, "fs-monkey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", - "integrity": "sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz", + "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==", "dev": true }, "fs-write-stream-atomic": { @@ -6592,7 +6768,8 @@ "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true }, "get-symbol-description": { "version": "1.0.0", @@ -6679,27 +6856,21 @@ } }, "got": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", - "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", - "requires": { - "@sindresorhus/is": "^0.7.0", - "cacheable-request": "^2.1.1", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "into-stream": "^3.1.0", - "is-retry-allowed": "^1.1.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "mimic-response": "^1.0.0", - "p-cancelable": "^0.4.0", - "p-timeout": "^2.0.1", - "pify": "^3.0.0", - "safe-buffer": "^5.1.1", - "timed-out": "^4.0.1", - "url-parse-lax": "^3.0.0", - "url-to-options": "^1.0.1" + "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", + "requires": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" } }, "graceful-fs": { @@ -6776,25 +6947,12 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, - "has-symbol-support-x": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", - "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" - }, "has-symbols": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", "dev": true }, - "has-to-string-tag-x": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, "has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", @@ -7076,9 +7234,9 @@ } }, "http-cache-semantics": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", - "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "http-deceiver": { "version": "1.2.7", @@ -7197,6 +7355,15 @@ "sshpk": "^1.7.0" } }, + "http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "requires": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + } + }, "https-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", @@ -7339,7 +7506,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "inquirer": { "version": "7.3.3", @@ -7486,15 +7654,6 @@ "resolved": "https://registry.npmjs.org/intersection-observer/-/intersection-observer-0.10.0.tgz", "integrity": "sha512-fn4bQ0Xq8FTej09YC/jqKZwtijpvARlRp6wxL5WTA6yPe2YWSJ5RJh7Nm79rK2qB0wr6iDQzH60XGq5V/7u8YQ==" }, - "into-stream": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", - "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", - "requires": { - "from2": "^2.1.1", - "p-is-promise": "^1.1.0" - } - }, "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -7746,11 +7905,6 @@ "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" - }, "is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", @@ -7778,7 +7932,8 @@ "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true }, "is-plain-object": { "version": "2.0.4", @@ -7805,11 +7960,6 @@ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, - "is-retry-allowed": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", - "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==" - }, "is-shared-array-buffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", @@ -7870,7 +8020,8 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true }, "isexe": { "version": "2.0.0", @@ -7890,15 +8041,6 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, "jake": { "version": "10.8.5", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", @@ -7918,11 +8060,6 @@ "color-convert": "^2.0.1" } }, - "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -8015,9 +8152,9 @@ "dev": true }, "json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, "json-parse-better-errors": { "version": "1.0.2", @@ -8093,11 +8230,11 @@ } }, "keyv": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", - "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", "requires": { - "json-buffer": "3.0.0" + "json-buffer": "3.0.1" } }, "killable": { @@ -8205,10 +8342,9 @@ "dev": true }, "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "dev": true, + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "requires": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -8216,10 +8352,9 @@ }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "requires": { "minimist": "^1.2.0" } @@ -8239,12 +8374,13 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" }, "lodash.debounce": { "version": "4.0.8", @@ -8310,9 +8446,9 @@ "dev": true }, "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" }, "lru-cache": { "version": "5.1.1", @@ -8349,7 +8485,7 @@ "map-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", - "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=" + "integrity": "sha512-C0X0KQmGm3N2ftbTGBhSyuydQ+vV1LC3f3zPvT3RXHXNZrvfPZcoXp/N5DOa8vedX/rTMm2CjTtivFg2STJMRQ==" }, "map-visit": { "version": "1.0.0", @@ -8384,12 +8520,12 @@ "dev": true }, "memfs": { - "version": "3.4.12", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.12.tgz", - "integrity": "sha512-BcjuQn6vfqP+k100e0E9m61Hyqa//Brp+I3f0OBmN0ATHlFA8vx3Lt8z57R3u2bPqe3WGDBC+nF72fTH7isyEw==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", + "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==", "dev": true, "requires": { - "fs-monkey": "^1.0.3" + "fs-monkey": "^1.0.4" } }, "memory-fs": { @@ -8521,9 +8657,9 @@ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" }, "mingo": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/mingo/-/mingo-1.3.3.tgz", - "integrity": "sha1-aSLE0Ufvx3GgFCWixMj3eER4xUY=" + "version": "6.4.10", + "resolved": "https://registry.npmjs.org/mingo/-/mingo-6.4.10.tgz", + "integrity": "sha512-/pOGeZKcZrKKw8YkCMKn9+XPiUYeNhkfaVbTn9tqvZvfccxf1idk8ezSulecZmPdKJLibNDtp4UBfDK3nzvMrQ==" }, "mini-css-extract-plugin": { "version": "0.9.0", @@ -8600,9 +8736,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } @@ -8610,8 +8746,7 @@ "minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "minipass": { "version": "3.1.6", @@ -8679,16 +8814,16 @@ } }, "moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==" }, "moment-timezone": { - "version": "0.5.35", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.35.tgz", - "integrity": "sha512-cY/pBOEXepQvlgli06ttCTKcIf8cD1nmNwOKQQAdHBqYApQSpAqotBMX0RJZNgMp6i0PlZuf1mFtnlyEkwyvFw==", + "version": "0.5.45", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.45.tgz", + "integrity": "sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ==", "requires": { - "moment": ">= 2.9.0" + "moment": "^2.29.4" } }, "move-concurrently": { @@ -8912,14 +9047,9 @@ "dev": true }, "normalize-url": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", - "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", - "requires": { - "prepend-http": "^2.0.0", - "query-string": "^5.0.1", - "sort-keys": "^2.0.0" - } + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==" }, "npm-run-path": { "version": "2.0.2", @@ -8954,7 +9084,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true }, "object-copy": { "version": "0.1.0", @@ -9092,7 +9223,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -9191,19 +9321,15 @@ "dev": true }, "p-cancelable": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", - "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==" }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-is-promise": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true }, "p-limit": { "version": "2.3.0", @@ -9238,14 +9364,6 @@ "retry": "^0.12.0" } }, - "p-timeout": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", - "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", - "requires": { - "p-finally": "^1.0.0" - } - }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -9415,7 +9533,7 @@ "pause-stream": { "version": "0.0.11", "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", "requires": { "through": "~2.3" } @@ -9454,7 +9572,8 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true }, "pinkie": { "version": "2.0.4", @@ -9546,6 +9665,15 @@ "mkdirp": "^0.5.5" }, "dependencies": { + "async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, "debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", @@ -10193,11 +10321,6 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" - }, "prettier": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", @@ -10228,7 +10351,8 @@ "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, "progress": { "version": "2.0.3", @@ -10296,7 +10420,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -10338,21 +10461,11 @@ "dev": true }, "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true }, - "query-string": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", - "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", - "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - } - }, "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -10371,6 +10484,11 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -10464,6 +10582,7 @@ "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -10477,7 +10596,8 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, @@ -10747,6 +10867,11 @@ "path-parse": "^1.0.6" } }, + "resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" + }, "resolve-cwd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", @@ -10777,11 +10902,11 @@ "dev": true }, "responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", + "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", "requires": { - "lowercase-keys": "^1.0.0" + "lowercase-keys": "^2.0.0" } }, "restore-cursor": { @@ -10864,7 +10989,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "safe-regex": { "version": "1.1.0", @@ -10914,14 +11040,21 @@ } }, "save": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/save/-/save-2.4.0.tgz", - "integrity": "sha512-wd5L2uVnsKYkIUaK6i8Ie66IOHaI328gMF0MPuTJtYOjXgUolC33LSIk7Qr8WVA55QHaGwfiVS8a7EFIeGOR3w==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/save/-/save-2.9.0.tgz", + "integrity": "sha512-eg8+g8CjvehE/2C6EbLdtK1pINVD27pcJLj4M9PjWWhoeha/y5bWf4dp/0RF+OzbKTcG1bae9qi3PAqiR8CJTg==", "requires": { - "async": "^2.6.2", + "async": "^3.2.2", "event-stream": "^4.0.1", "lodash.assign": "^4.2.0", - "mingo": "1" + "mingo": "^6.1.0" + }, + "dependencies": { + "async": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" + } } }, "sax": { @@ -11408,14 +11541,6 @@ } } }, - "sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", - "requires": { - "is-plain-obj": "^1.0.0" - } - }, "sortablejs": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.12.0.tgz", @@ -11649,7 +11774,7 @@ "stream-combiner": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", - "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", + "integrity": "sha512-6yHMqgLYDzQDcAkL+tjJDC5nSNuNIx0vZtRZeiPh7Saef7VHX9H5Ijn9l2VIol2zaNYlYEX6KyuT/237A58qEQ==", "requires": { "duplexer": "~0.1.1", "through": "~2.3.4" @@ -11687,7 +11812,8 @@ "strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true }, "string-width": { "version": "4.2.0", @@ -11724,6 +11850,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, "requires": { "safe-buffer": "~5.1.0" }, @@ -11731,7 +11858,8 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, @@ -11888,9 +12016,9 @@ "dev": true }, "terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", + "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", "dev": true, "requires": { "commander": "^2.20.0", @@ -12040,11 +12168,6 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" - }, "timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", @@ -12455,9 +12578,9 @@ } }, "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true }, "unpipe": { @@ -12578,19 +12701,6 @@ "requires-port": "^1.0.0" } }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "requires": { - "prepend-http": "^2.0.0" - } - }, - "url-to-options": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" - }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -12617,7 +12727,8 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "util.promisify": { "version": "1.0.1", @@ -12793,11 +12904,11 @@ } }, "vue-resource": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/vue-resource/-/vue-resource-1.5.1.tgz", - "integrity": "sha512-o6V4wNgeqP+9v9b2bPXrr20CGNQPEXjpbUWdZWq9GJhqVeAGcYoeTtn/D4q059ZiyN0DIrDv/ADrQUmlUQcsmg==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/vue-resource/-/vue-resource-1.5.3.tgz", + "integrity": "sha512-REhTuEuYSpwmEH/VN4fgDQVC/VXxDK/xsguuiDPnINxOwy1s0CSu//p++osTUkiAXi6d/vptwBpb0AcBIDsXzw==", "requires": { - "got": "^8.0.3" + "got": ">=8.0 <12.0" } }, "vue-router": { @@ -13692,8 +13803,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write": { "version": "1.0.3", diff --git a/web/package.json b/web/package.json index 94f56604..590601f7 100644 --- a/web/package.json +++ b/web/package.json @@ -14,27 +14,35 @@ "@fortawesome/free-solid-svg-icons": "^5.15.1", "@fortawesome/vue-fontawesome": "^2.0.0", "@types/underscore": "^1.10.0", - "axios": "^0.21.2", - "axios-auth-refresh": "^3.0.0", + "ansi-regex": "^6.0.1", + "axios": "^0.21.4", + "axios-auth-refresh": "^3.2.1", "bootstrap": "^4.4.1", "bootstrap-vue": "^2.12.0", "core-js": "^3.6.5", "ejs": "^3.1.8", - "export-to-csv": "^0.2.1", + "export-to-csv": "0.2.1", + "express": "^4.18.2", "intersection-observer": "^0.10.0", "jquery": "^3.5.1", - "moment-timezone": "^0.5.35", + "json5": "^2.2.3", + "loader-utils": "^3.2.1", + "moment-timezone": "^0.5.45", + "node-forge": "^1.3.1", + "postcss": "^8.4.35", "printd": "^1.4.2", + "qs": "^6.11.2", "regenerator-runtime": "^0.13.5", - "save": "^2.4.0", + "save": "^2.9.0", "sortablejs": "^1.10.2", + "tough-cookie": "^4.1.3", "underscore": "^1.12.1", "vue": "2.6.11", "vue-auth-image": "0.0.3", "vue-class-component": "6.3.2", "vue-cookies": "^1.7.4", "vue-property-decorator": "^8.4.2", - "vue-resource": "^1.5.1", + "vue-resource": "^1.5.3", "vue-router": "^3.1.6", "vuex": "^3.3.0", "vuex-class": "^0.3.2", diff --git a/web/public/images/bcss-crest-lw.png b/web/public/images/bcss-crest-lw.png new file mode 100644 index 00000000..8615f924 Binary files /dev/null and b/web/public/images/bcss-crest-lw.png differ diff --git a/web/src/App.vue b/web/src/App.vue index e12a622f..f853f404 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -18,7 +18,7 @@ import NavigationFooter from "@components/NavigationFooter.vue"; import { Component, Vue } from 'vue-property-decorator'; import { namespace } from 'vuex-class'; - import {commonInfoType, locationInfoType, sheriffRankInfoType, userInfoType} from './types/common'; + import {commonInfoType, locationInfoType, sheriffRankInfoType, userInfoType, regionInfoType} from './types/common'; import {sheriffRankJsonType} from './types/common/jsonTypes' import "@store/modules/CommonInformation"; const commonState = namespace("CommonInformation"); @@ -52,6 +52,9 @@ @commonState.Action public UpdateUser!: (newUser: userInfoType) => void + @commonState.Action + public UpdateRegionList!: (newRegionList: regionInfoType[]) => void + @commonState.State public locationList!: locationInfoType[]; @@ -102,7 +105,8 @@ lastName: userData.lastName, roles: userData.roles, homeLocationId: userData.homeLocationId, - permissions: userData.permissions + permissions: userData.permissions, + userId: userData.userId }) this.getAllLocations() } @@ -125,9 +129,11 @@ this.userDetails.roles.length>0 && this.locationList.length>0) { this.isCommonDataReady = true; - if(this.$route.name == 'Home') - this.$router.push({path:'/manage-duty-roster'}) + //console.log(this.$route.path) + if(this.$route.path!='/' && this.$route.name == 'Home') + this.$router.push({path:'/'}) } + this.getRegions(); } },err => { this.errorText = err + ' - ' + moment().format(); @@ -165,6 +171,21 @@ }) } + + public getRegions() { + const url = 'api/region' + this.$http.get(url) + .then(response => { + if(response.data){ + this.extractRegionInfo(response.data); + } + },err => { + this.errorText = err + ' - ' + moment().format(); + if (this.errorText.indexOf('401') == -1) { + this.displayError = true; + } + }) + } public getLocations() { const url = 'api/location' @@ -184,16 +205,28 @@ public extractLocationInfo(locationListJson, allLocations: boolean){ const locations: locationInfoType[] = []; - for(const locationJson of locationListJson){ - const locationInfo: locationInfoType = {id: locationJson.id, name: locationJson.name, regionId: locationJson.regionId, timezone: locationJson.timezone} - locations.push(locationInfo) + for(const locationJson of locationListJson){ + if (locationJson.regionId > 0) { + const locationInfo: locationInfoType = {id: locationJson.id, name: locationJson.name, regionId: locationJson.regionId, timezone: locationJson.timezone} + locations.push(locationInfo); + } } if (allLocations) { this.UpdateAllLocationList(_.sortBy(locations,'name')); } else { this.UpdateLocationList(_.sortBy(locations,'name')); - } + } + } + + public extractRegionInfo(regionListJson){ + + const regions: regionInfoType[] = regionListJson.filter(region=>(region.justinId > 0)); + + const vancouverIndex = regions.findIndex((region => region.name == 'Vancouver')); + + if(vancouverIndex>=0) regions[vancouverIndex].name = 'Coastal'; + this.UpdateRegionList(_.sortBy(regions,'name')); } } diff --git a/web/src/assets/bcss-crest-lw.png b/web/src/assets/bcss-crest-lw.png new file mode 100644 index 00000000..8615f924 Binary files /dev/null and b/web/src/assets/bcss-crest-lw.png differ diff --git a/web/src/components/DutyRoster/DutyRosterDayView.vue b/web/src/components/DutyRoster/DutyRosterDayView.vue index f5b47280..c67aab7a 100644 --- a/web/src/components/DutyRoster/DutyRosterDayView.vue +++ b/web/src/components/DutyRoster/DutyRosterDayView.vue @@ -91,9 +91,9 @@ import "@store/modules/DutyRosterInformation"; const dutyState = namespace("DutyRosterInformation"); - import {locationInfoType, userInfoType, commonInfoType } from '../../types/common'; - import { assignmentCardInfoType, attachedDutyInfoType, dutyRangeInfoType, myTeamShiftInfoType, dutiesDetailInfoType, selectedDutyCardInfoType} from '../../types/DutyRoster'; - import { shiftInfoType } from '../../types/ShiftSchedule'; + import {locationInfoType, userInfoType, commonInfoType } from '@/types/common'; + import { assignmentCardInfoType, attachedDutyInfoType, dutyRangeInfoType, myTeamShiftInfoType, dutiesDetailInfoType, selectedDutyCardInfoType} from '@/types/DutyRoster'; + import { shiftInfoType } from '@/types/ShiftSchedule'; @Component({ components: { diff --git a/web/src/components/DutyRoster/DutyRosterWeekView.vue b/web/src/components/DutyRoster/DutyRosterWeekView.vue index fbca94e2..630564ba 100644 --- a/web/src/components/DutyRoster/DutyRosterWeekView.vue +++ b/web/src/components/DutyRoster/DutyRosterWeekView.vue @@ -77,9 +77,9 @@ import "@store/modules/DutyRosterInformation"; const dutyState = namespace("DutyRosterInformation"); - import {locationInfoType, userInfoType, commonInfoType } from '../../types/common'; - import { assignmentCardWeekInfoType, attachedDutyInfoType, dutyRangeInfoType, myTeamShiftInfoType, dutiesDetailInfoType, selectedDutyCardInfoType} from '../../types/DutyRoster'; - import { shiftInfoType } from '../../types/ShiftSchedule'; + import {locationInfoType, userInfoType, commonInfoType } from '@/types/common'; + import { assignmentCardWeekInfoType, attachedDutyInfoType, dutyRangeInfoType, myTeamShiftInfoType, dutiesDetailInfoType, selectedDutyCardInfoType} from '@/types/DutyRoster'; + import { shiftInfoType } from '@/types/ShiftSchedule'; @Component({ components: { diff --git a/web/src/components/DutyRoster/ManageDutyRoster.vue b/web/src/components/DutyRoster/ManageDutyRoster.vue index b449222a..88beac27 100644 --- a/web/src/components/DutyRoster/ManageDutyRoster.vue +++ b/web/src/components/DutyRoster/ManageDutyRoster.vue @@ -58,8 +58,8 @@ import "@store/modules/DutyRosterInformation"; const dutyState = namespace("DutyRosterInformation"); - import { localTimeInfoType, commonInfoType } from '../../types/common'; - import { dutyRangeInfoType, myTeamShiftInfoType} from '../../types/DutyRoster'; + import { localTimeInfoType, commonInfoType } from '@/types/common'; + import { dutyRangeInfoType, myTeamShiftInfoType} from '@/types/DutyRoster'; @Component({ components: { diff --git a/web/src/components/DutyRoster/ViewDutyRoster.vue b/web/src/components/DutyRoster/ViewDutyRoster.vue index c9137354..e2d21aed 100644 --- a/web/src/components/DutyRoster/ViewDutyRoster.vue +++ b/web/src/components/DutyRoster/ViewDutyRoster.vue @@ -57,7 +57,7 @@ import "@store/modules/CommonInformation"; const commonState = namespace("CommonInformation"); - import { commonInfoType, locationInfoType } from '../../types/common'; + import { commonInfoType, locationInfoType } from '@/types/common'; import moment from 'moment-timezone'; import * as _ from 'underscore'; diff --git a/web/src/components/DutyRoster/components/AddDutySlotForm.vue b/web/src/components/DutyRoster/components/AddDutySlotForm.vue index 0ecd6298..fdbe35ba 100644 --- a/web/src/components/DutyRoster/components/AddDutySlotForm.vue +++ b/web/src/components/DutyRoster/components/AddDutySlotForm.vue @@ -182,10 +182,9 @@ + + \ No newline at end of file diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentCard.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentCard.vue new file mode 100644 index 00000000..adea0961 --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentCard.vue @@ -0,0 +1,374 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/AssignmentModal.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/AssignmentModal.vue new file mode 100644 index 00000000..54580688 --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/AssignmentModal.vue @@ -0,0 +1,665 @@ + + + + diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/AllAssignmentsManagementModal.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/AllAssignmentsManagementModal.vue new file mode 100644 index 00000000..04d110c7 --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/AllAssignmentsManagementModal.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/CreateAssignmentsModal.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/CreateAssignmentsModal.vue new file mode 100644 index 00000000..c5a903f9 --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/CreateAssignmentsModal.vue @@ -0,0 +1,644 @@ + + + + diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/EditAssignmentDutyModal.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/EditAssignmentDutyModal.vue new file mode 100644 index 00000000..fbd0f88b --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/EditAssignmentDutyModal.vue @@ -0,0 +1,182 @@ + + + diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/ManageDutyRosterAssignment.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/ManageDutyRosterAssignment.vue new file mode 100644 index 00000000..c88d92bb --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageAssignment/ManageDutyRosterAssignment.vue @@ -0,0 +1,1056 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/ConfirmOvertimeModal.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/ConfirmOvertimeModal.vue new file mode 100644 index 00000000..fdf1170f --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/ConfirmOvertimeModal.vue @@ -0,0 +1,42 @@ + + + diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/DutySlotForm.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/DutySlotForm.vue new file mode 100644 index 00000000..41ddcf21 --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/DutySlotForm.vue @@ -0,0 +1,236 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/UnassignDutyModal.vue b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/UnassignDutyModal.vue new file mode 100644 index 00000000..d3072e56 --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/AssignmentComponents/ManageDuty/UnassignDutyModal.vue @@ -0,0 +1,49 @@ + + + diff --git a/web/src/components/DutyRoster/manageAssignments/components/ConflictsIcon.vue b/web/src/components/DutyRoster/manageAssignments/components/ConflictsIcon.vue new file mode 100644 index 00000000..d1138d11 --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/ConflictsIcon.vue @@ -0,0 +1,104 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/DutyRoster/manageAssignments/components/ManageAssignmentsHeader.vue b/web/src/components/DutyRoster/manageAssignments/components/ManageAssignmentsHeader.vue new file mode 100644 index 00000000..05ffc0db --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/ManageAssignmentsHeader.vue @@ -0,0 +1,738 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/DutyRoster/manageAssignments/components/TeamMemberCard.vue b/web/src/components/DutyRoster/manageAssignments/components/TeamMemberCard.vue new file mode 100644 index 00000000..09123f84 --- /dev/null +++ b/web/src/components/DutyRoster/manageAssignments/components/TeamMemberCard.vue @@ -0,0 +1,752 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/Home.vue b/web/src/components/Home.vue index eabf27ce..86ae128f 100644 --- a/web/src/components/Home.vue +++ b/web/src/components/Home.vue @@ -1,27 +1,296 @@ diff --git a/web/src/components/ManageTypes/AddAssignmentForm.vue b/web/src/components/ManageTypes/AddAssignmentForm.vue index f65b36e6..dce5c44c 100644 --- a/web/src/components/ManageTypes/AddAssignmentForm.vue +++ b/web/src/components/ManageTypes/AddAssignmentForm.vue @@ -83,8 +83,8 @@ diff --git a/web/src/components/MyTeam/Components/CustomPagination.vue b/web/src/components/MyTeam/Components/CustomPagination.vue new file mode 100644 index 00000000..d1015e59 --- /dev/null +++ b/web/src/components/MyTeam/Components/CustomPagination.vue @@ -0,0 +1,78 @@ + + + diff --git a/web/src/components/MyTeam/Components/DateRange.vue b/web/src/components/MyTeam/Components/DateRange.vue new file mode 100644 index 00000000..d8c48fef --- /dev/null +++ b/web/src/components/MyTeam/Components/DateRange.vue @@ -0,0 +1,150 @@ + + + diff --git a/web/src/components/MyTeam/DefineRolesAccess.vue b/web/src/components/MyTeam/DefineRolesAccess.vue index b3129ab2..cfd363c1 100644 --- a/web/src/components/MyTeam/DefineRolesAccess.vue +++ b/web/src/components/MyTeam/DefineRolesAccess.vue @@ -94,7 +94,7 @@ Save \ No newline at end of file diff --git a/web/src/components/MyTeam/Tabs/IdentificationTab.vue b/web/src/components/MyTeam/Tabs/IdentificationTab.vue index c73d0a07..b32025c9 100644 --- a/web/src/components/MyTeam/Tabs/IdentificationTab.vue +++ b/web/src/components/MyTeam/Tabs/IdentificationTab.vue @@ -99,16 +99,18 @@ @@ -270,4 +450,30 @@ border: white; } - \ No newline at end of file + .search-box { + margin: 0 1.5rem; + background: #c7d6dd; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + } + + .table-box { + margin: 0 1.5rem; + padding: 0 1rem; + background: #f7f8f9; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.09); + } + + .excluded-table-box { + margin: 0 1.5rem; + padding: 0 1rem; + background: #eaf0f7; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.09); + } + + ::v-deep .custom-control-label { + font-size: 13pt; + padding-top: 0.15rem; + padding-right: 1rem; + } + + diff --git a/web/src/components/NavigationTopbar.vue b/web/src/components/NavigationTopbar.vue index addec9d6..4d3896f2 100644 --- a/web/src/components/NavigationTopbar.vue +++ b/web/src/components/NavigationTopbar.vue @@ -23,6 +23,7 @@ Manage Duties View Duties + Manage Assignments Manage Schedule @@ -61,6 +62,7 @@ {{userDetails.firstName}} {{userDetails.lastName}} + Dashboard Sign out @@ -72,7 +74,7 @@ import { Component, Vue} from 'vue-property-decorator'; import { namespace } from "vuex-class"; import "@store/modules/CommonInformation"; - import {commonInfoType, locationInfoType, userInfoType} from '../types/common'; + import {commonInfoType, locationInfoType, userInfoType} from '@/types/common'; const commonState = namespace("CommonInformation"); import store from "@/store"; @@ -162,6 +164,11 @@ window.location.replace(`${process.env.BASE_URL}api/auth/logout`); } + public dashboard(){ + if(this.$route.path!='/' ) + this.$router.push({path:'/'}) + } + } diff --git a/web/src/components/ShiftSchedule/DistributeSchedule.vue b/web/src/components/ShiftSchedule/DistributeSchedule.vue index a59f0815..83bf9e5d 100644 --- a/web/src/components/ShiftSchedule/DistributeSchedule.vue +++ b/web/src/components/ShiftSchedule/DistributeSchedule.vue @@ -1,115 +1,54 @@
@@ -54,18 +54,23 @@ \ No newline at end of file diff --git a/web/src/components/ShiftSchedule/components/ConflictsIcon.vue b/web/src/components/ShiftSchedule/components/ConflictsIcon.vue index a5eb58c9..d1138d11 100644 --- a/web/src/components/ShiftSchedule/components/ConflictsIcon.vue +++ b/web/src/components/ShiftSchedule/components/ConflictsIcon.vue @@ -57,8 +57,7 @@ + + \ No newline at end of file diff --git a/web/src/components/ShiftSchedule/components/DistributeHeader.vue b/web/src/components/ShiftSchedule/components/DistributeHeader.vue index f59b8347..30601a4b 100644 --- a/web/src/components/ShiftSchedule/components/DistributeHeader.vue +++ b/web/src/components/ShiftSchedule/components/DistributeHeader.vue @@ -1,223 +1,493 @@ \ No newline at end of file diff --git a/web/src/components/ShiftSchedule/components/Logo.ts b/web/src/components/ShiftSchedule/components/Logo.ts new file mode 100644 index 00000000..090ec388 --- /dev/null +++ b/web/src/components/ShiftSchedule/components/Logo.ts @@ -0,0 +1 @@ +export const srcFile=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAAB0CAYAAAAFDiVEAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiU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x2kFZ1U5alMlHlklHp84vUS9wOFh3t0AdRVHqCp+L0zZ/jn9m+Bbm6qISltCqaEq4V1yLDy6oUFeERuN6n37E3pc4zzu+Wh8zZQ7emEN2wCpriR9B44hqS4kDOl/GebAkBBUT3ZR3fSXn0EQ/N+jO0/i2hpocUVxqaTqSJSupLT2EEScZTEfoN63dHkzmLauEDefvslKeHP1wCetX8J9Fll89Yz8wht3cPak10lKbkZkprHcKFoReWtNFgnYUycyfCxcyRO/rr+4qwpHFuhTXIqlR38J5nSdLVK/6RiRaUNHNn/E76qzXjrNxHkyic6OgSb5JDoEBe7T3iY8GAtEWG//1dSf2b/1qPP2usPjqV/8Eb/k8ICJxKQcjEXzpilzj38f8WqGuzs2vQdrtrDkqAdjJh0L53Sfl0x9a/svwi0sotGYjNCsfxbzprisQpt+/+qqXPQykzjv7H/FtBnzf/pbGD5/Xf/7zZpqxoG/ZApT074r7Uf/n+CZZuGVXCHhwAAAABJRU5ErkJggg==` \ No newline at end of file diff --git a/web/src/components/ShiftSchedule/components/ScheduleCard.vue b/web/src/components/ShiftSchedule/components/ScheduleCard.vue index 178d4e24..deb81cbe 100644 --- a/web/src/components/ShiftSchedule/components/ScheduleCard.vue +++ b/web/src/components/ShiftSchedule/components/ScheduleCard.vue @@ -39,14 +39,14 @@ const shiftState = namespace("ShiftScheduleInformation"); import "@store/modules/CommonInformation"; const commonState = namespace("CommonInformation"); - import {conflictsInfoType, scheduleBlockInfoType} from '../../../types/ShiftSchedule/index' + import {conflictsInfoType, scheduleBlockInfoType} from '@/types/ShiftSchedule/index' import { userInfoType } from '@/types/common'; @Component export default class ScheduleCard extends Vue { @Prop({required: true}) - scheduleInfo!: conflictsInfoType; + scheduleInfo!: conflictsInfoType[]; @Prop({required: true}) sheriffId!: string; diff --git a/web/src/components/ShiftSchedule/components/ScheduleHeader.vue b/web/src/components/ShiftSchedule/components/ScheduleHeader.vue index 48bbd712..63a6b1aa 100644 --- a/web/src/components/ShiftSchedule/components/ScheduleHeader.vue +++ b/web/src/components/ShiftSchedule/components/ScheduleHeader.vue @@ -1,5 +1,5 @@