From 52cde116af94cab2108c7093e2b3e2621590ddcd Mon Sep 17 00:00:00 2001 From: TimaQT <158625845+TimaQT@users.noreply.github.com> Date: Fri, 22 Nov 2024 08:48:37 -0800 Subject: [PATCH] Initial calendar implementation (#29) * Initial calendar setup completed, including the interface and frontend connection to the backend, along with a basic template for the assignment reader. The full integration with PCSS will come later. Features like Jump To Date, assignment displays inside the calendar cells and popups will also be added in the next phase. * Initial Daashboard page implementation - Calendar UI updated as per wireframes - Events were Added - Side panels behavior - Locations, Activities and Presiders Load - Events Filtering added * pcss-client added - New Dashboard Structure; - Initial PCSS Integration; * Update package-lock.json using centos7 nodejs12 --------- Co-authored-by: Timaqt Co-authored-by: Ronaldo Macapobre Co-authored-by: Wade Barnes --- SCV.sln | 15 +- api/Controllers/DashboardController.cs | 127 ++++ api/Helpers/MapperHelper.cs | 21 + .../ServiceCollectionExtensions.cs | 7 + api/Mappers/Mapping.cs | 30 + api/Models/Calendar/CalendarDay.cs | 46 ++ api/Models/Calendar/CalendarSchedule.cs | 12 + api/Models/Lookup/FilterCode.cs | 8 + api/Services/JudicialCalendarService.cs | 73 ++ api/api.csproj | 2 + docker/api/Dockerfile.release | 2 + docker/docker-compose.yaml | 1 + package-lock.json | 17 +- .../Clients/CourtCalendarsServicesClient.cs | 80 ++ .../JudicialCalendarsServicesClient.cs | 189 +++++ .../Models/Infrastructure/Constants.cs | 71 ++ .../Models/REST/ActivityAppearanceDetail.cs | 216 ++++++ pcss-client/Models/REST/Adjudicator.cs | 15 + .../Models/REST/AdjudicatorRestriction.cs | 48 ++ pcss-client/Models/REST/AppearanceMethod.cs | 67 ++ pcss-client/Models/REST/BestDateSearch.cs | 377 ++++++++++ pcss-client/Models/REST/CourtActivities.cs | 19 + pcss-client/Models/REST/CourtCalendar.cs | 465 ++++++++++++ pcss-client/Models/REST/EquipmentBooking.cs | 81 +++ pcss-client/Models/REST/FileDetail.cs | 169 +++++ pcss-client/Models/REST/HearingRestriction.cs | 49 ++ pcss-client/Models/REST/JudicialCalendar.cs | 245 +++++++ pcss-client/Models/REST/OfferedDate.cs | 19 + pcss-client/Models/REST/Person.cs | 475 ++++++++++++ .../Models/REST/PersonalAvailability.cs | 47 ++ pcss-client/Models/REST/PoliceAgencyUpdate.cs | 14 + pcss-client/Models/REST/ScheduleEvent.cs | 343 +++++++++ pcss-client/Models/REST/ScheduleSlot.cs | 88 +++ pcss-client/Models/UserLoginInfo.cs | 17 + pcss-client/Readme.txt | 1 + pcss-client/pcss-client.csproj | 23 + .../Controllers/DashboardControllerTests.cs | 70 ++ web/package-lock.json | 123 +++- web/package.json | 6 +- web/src/assets/arrow-down.svg | 11 + web/src/assets/arrow-left.svg | 11 + web/src/assets/arrow-right.svg | 11 + web/src/assets/arrow-up.svg | 11 + web/src/assets/calendar-select.svg | 5 + web/src/assets/filters.svg | 6 + web/src/assets/more3dots.svg | 6 + web/src/assets/print-icon.svg | 4 + web/src/assets/today-list.svg | 23 + web/src/assets/up-down.svg | 6 + web/src/assets/video.svg | 6 + web/src/components/NavigationTopbar.vue | 2 +- web/src/components/calendar/Calendar.vue | 565 +++++++++++++++ web/src/components/dashboard/Dashboard.vue | 685 +++++++++++++++++- web/web.njsproj | 8 + 54 files changed, 4969 insertions(+), 69 deletions(-) create mode 100644 api/Controllers/DashboardController.cs create mode 100644 api/Helpers/MapperHelper.cs create mode 100644 api/Mappers/Mapping.cs create mode 100644 api/Models/Calendar/CalendarDay.cs create mode 100644 api/Models/Calendar/CalendarSchedule.cs create mode 100644 api/Models/Lookup/FilterCode.cs create mode 100644 api/Services/JudicialCalendarService.cs create mode 100644 pcss-client/Clients/CourtCalendarsServicesClient.cs create mode 100644 pcss-client/Clients/JudicialCalendarsServicesClient.cs create mode 100644 pcss-client/Models/Infrastructure/Constants.cs create mode 100644 pcss-client/Models/REST/ActivityAppearanceDetail.cs create mode 100644 pcss-client/Models/REST/Adjudicator.cs create mode 100644 pcss-client/Models/REST/AdjudicatorRestriction.cs create mode 100644 pcss-client/Models/REST/AppearanceMethod.cs create mode 100644 pcss-client/Models/REST/BestDateSearch.cs create mode 100644 pcss-client/Models/REST/CourtActivities.cs create mode 100644 pcss-client/Models/REST/CourtCalendar.cs create mode 100644 pcss-client/Models/REST/EquipmentBooking.cs create mode 100644 pcss-client/Models/REST/FileDetail.cs create mode 100644 pcss-client/Models/REST/HearingRestriction.cs create mode 100644 pcss-client/Models/REST/JudicialCalendar.cs create mode 100644 pcss-client/Models/REST/OfferedDate.cs create mode 100644 pcss-client/Models/REST/Person.cs create mode 100644 pcss-client/Models/REST/PersonalAvailability.cs create mode 100644 pcss-client/Models/REST/PoliceAgencyUpdate.cs create mode 100644 pcss-client/Models/REST/ScheduleEvent.cs create mode 100644 pcss-client/Models/REST/ScheduleSlot.cs create mode 100644 pcss-client/Models/UserLoginInfo.cs create mode 100644 pcss-client/Readme.txt create mode 100644 pcss-client/pcss-client.csproj create mode 100644 tests/api/Controllers/DashboardControllerTests.cs create mode 100644 web/src/assets/arrow-down.svg create mode 100644 web/src/assets/arrow-left.svg create mode 100644 web/src/assets/arrow-right.svg create mode 100644 web/src/assets/arrow-up.svg create mode 100644 web/src/assets/calendar-select.svg create mode 100644 web/src/assets/filters.svg create mode 100644 web/src/assets/more3dots.svg create mode 100644 web/src/assets/print-icon.svg create mode 100644 web/src/assets/today-list.svg create mode 100644 web/src/assets/up-down.svg create mode 100644 web/src/assets/video.svg create mode 100644 web/src/components/calendar/Calendar.vue diff --git a/SCV.sln b/SCV.sln index fff922d0..a1eda00d 100644 --- a/SCV.sln +++ b/SCV.sln @@ -1,7 +1,6 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30011.22 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34723.18 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "api", "api\api.csproj", "{46FE5ADD-2BAF-47D0-BB0B-912F9ED4F743}" EndProject @@ -11,6 +10,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tests", "tests\tests.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "db", "db\db.csproj", "{E15BEA58-373C-4A12-ABF8-7D1522DC8404}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pcss-client", "pcss-client\pcss-client.csproj", "{C1736008-CC5B-40AC-A0A4-48C85E49067F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,10 +22,6 @@ Global {46FE5ADD-2BAF-47D0-BB0B-912F9ED4F743}.Debug|Any CPU.Build.0 = Debug|Any CPU {46FE5ADD-2BAF-47D0-BB0B-912F9ED4F743}.Release|Any CPU.ActiveCfg = Release|Any CPU {46FE5ADD-2BAF-47D0-BB0B-912F9ED4F743}.Release|Any CPU.Build.0 = Release|Any CPU - {B73D5408-1350-4C28-95D6-6977B2306E32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B73D5408-1350-4C28-95D6-6977B2306E32}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B73D5408-1350-4C28-95D6-6977B2306E32}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B73D5408-1350-4C28-95D6-6977B2306E32}.Release|Any CPU.Build.0 = Release|Any CPU {5F6774A8-016E-4C12-9E00-08AC736FE8EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5F6774A8-016E-4C12-9E00-08AC736FE8EA}.Debug|Any CPU.Build.0 = Debug|Any CPU {5F6774A8-016E-4C12-9E00-08AC736FE8EA}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -37,6 +34,10 @@ Global {E15BEA58-373C-4A12-ABF8-7D1522DC8404}.Debug|Any CPU.Build.0 = Debug|Any CPU {E15BEA58-373C-4A12-ABF8-7D1522DC8404}.Release|Any CPU.ActiveCfg = Release|Any CPU {E15BEA58-373C-4A12-ABF8-7D1522DC8404}.Release|Any CPU.Build.0 = Release|Any CPU + {C1736008-CC5B-40AC-A0A4-48C85E49067F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1736008-CC5B-40AC-A0A4-48C85E49067F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1736008-CC5B-40AC-A0A4-48C85E49067F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1736008-CC5B-40AC-A0A4-48C85E49067F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/api/Controllers/DashboardController.cs b/api/Controllers/DashboardController.cs new file mode 100644 index 00000000..4cf3e63c --- /dev/null +++ b/api/Controllers/DashboardController.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Scv.Api.Helpers.Extensions; +using Scv.Api.Infrastructure.Authorization; +using Scv.Api.Services; +using Scv.Api.Models.Lookup; +using PCSS.Models.REST.JudicialCalendar; +using Scv.Api.Helpers; +using Scv.Api.Models.Calendar; + +namespace Scv.Api.Controllers +{ + [Authorize(AuthenticationSchemes = "SiteMinder, OpenIdConnect", Policy = nameof(ProviderAuthorizationHandler))] + [Route("api/[controller]")] + [ApiController] + public class DashboardController : ControllerBase + { + #region Variables + private readonly LocationService _locationService; + private readonly JudicialCalendarService _judicialCalendarService; + + #endregion Variables + + #region Constructor + public DashboardController(LocationService locationService, JudicialCalendarService judicialCalendarService) + { + _locationService = locationService; + _judicialCalendarService = judicialCalendarService; + } + #endregion Constructor + + /// + /// Returns list of assignemnts for a given month and year for current user. + /// + /// selected year + /// selected month + /// selected month + /// + // [HttpGet("monthly-schedule/{year}/{month}")] + [HttpGet] + [Route("monthly-schedule/{year}/{month}")] + public async Task> GetMonthlySchedule(int year, int month, [FromQuery] string locationId = "") + { + try + { + // first day of the month and a week before the first day of the month + var startDate = new DateTime(year, month, 1).AddDays(-7); + // last day of the month and a week after the last day of the month + var endDate = startDate.AddMonths(1).AddDays(-1).AddDays(7); + var calendars = await _judicialCalendarService.JudicialCalendarsGetAsync(locationId, startDate, endDate); + CalendarSchedule calendarSchedule = new CalendarSchedule(); + + var calendarDays = MapperHelper.CalendarToDays(calendars.ToList()); + if (calendarDays == null) + { + calendarSchedule.Schedule = new List(); + } + else + calendarSchedule.Schedule = calendarDays; + + calendarSchedule.Presiders = calendars.Where(t => t.IsPresider).Select(presider => new FilterCode + { + Text = $"{presider.RotaInitials} - {presider.Name}", + Value = $"{presider.ParticipantId}", + }).DistinctBy(t => t.Value).OrderBy(x => x.Value).ToList(); + + var assignmentsList = calendars.Where(t => t.IsPresider) + .Where(t => t.Days?.Count > 0) + .SelectMany(t => t.Days).Where(day => day.Assignment != null && (day.Assignment.ActivityAm !=null || day.Assignment.ActivityPm != null)) + .Select(day => day.Assignment) + .ToList(); + var activitiesList = assignmentsList + .SelectMany(t => new[] { t.ActivityAm, t.ActivityPm }) + .Where(activity => activity != null) + .Select(activity => new FilterCode + { + Text = activity.ActivityDescription, + Value = activity.ActivityCode + }) + .DistinctBy(t => t.Value) + .OrderBy(x => x.Text) + .ToList(); + calendarSchedule.Activities = activitiesList; + + return Ok(calendarSchedule); + } + catch (Exception ex) + { + // Log the exception + return StatusCode(500, "Internal server error"); + } + } + + //public async Task>> LocationList(int a) + /// + /// Provides locations. + /// + /// IEnumerable{FilterCode} + [HttpGet] + [Route("locations")] + public async Task>> LocationList() + { + try + { + var locations = await _locationService.GetLocations(); + var locationList = locations.Where(t => t.Flex?.Equals("Y") == true).Select(location => new FilterCode + { + Text = location.LongDesc, + Value = location.ShortDesc + }).OrderBy(x => x.Text); + + return Ok(locationList); + } + catch (Exception ex) + { + // Log the exception + return StatusCode(500, "Internal server error" + ex.Message); + } + } + } + + +} \ No newline at end of file diff --git a/api/Helpers/MapperHelper.cs b/api/Helpers/MapperHelper.cs new file mode 100644 index 00000000..802ee4fa --- /dev/null +++ b/api/Helpers/MapperHelper.cs @@ -0,0 +1,21 @@ +using AutoMapper; +using System.Collections.Generic; +using Scv.Api.Models.Calendar; +using Scv.Api.Mappers; +using PCSS.Models.REST.JudicialCalendar; +using System.Linq; + +namespace Scv.Api.Helpers +{ + public static class MapperHelper + { + // Usage + public static List CalendarToDays(List listOfCalendars) + { + var config = new MapperConfiguration(cfg => cfg.AddProfile()); + var mapper = new Mapper(config); + + return listOfCalendars.SelectMany(calendarDays => mapper.Map>(calendarDays)).ToList(); + } + } +} diff --git a/api/Infrastructure/ServiceCollectionExtensions.cs b/api/Infrastructure/ServiceCollectionExtensions.cs index ec229bf1..be117653 100644 --- a/api/Infrastructure/ServiceCollectionExtensions.cs +++ b/api/Infrastructure/ServiceCollectionExtensions.cs @@ -17,6 +17,9 @@ using Scv.Api.Services.Files; using BasicAuthenticationHeaderValue = JCCommon.Framework.BasicAuthenticationHeaderValue; using Scv.Api.Infrastructure.Handler; +using PCSSClient.Clients.JudicialCalendarsServices; +using PCSSClient.Clients.CourtCalendarsServices; + namespace Scv.Api.Infrastructure { @@ -84,6 +87,10 @@ public static IServiceCollection AddHttpClientsAndScvServices(this IServiceColle services.AddScoped(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(); + services.AddSingleton(); return services; } diff --git a/api/Mappers/Mapping.cs b/api/Mappers/Mapping.cs new file mode 100644 index 00000000..d551bbd9 --- /dev/null +++ b/api/Mappers/Mapping.cs @@ -0,0 +1,30 @@ +using System; +using Scv.Api.Controllers; +using Scv.Api.Services; +using Scv.Api.Models; +using static System.Runtime.InteropServices.JavaScript.JSType; +using System.Collections.Generic; +using PCSS.Models.REST.JudicialCalendar; +using Scv.Api.Models.Calendar; +using System.Linq; + +namespace Scv.Api.Mappers +{ + public class MappingProfile : AutoMapper.Profile + { + public MappingProfile() + { + CreateMap(); + + + CreateMap>() + .ConvertUsing((src, dest, context) => + src.Days.Select(b => { + var c = context.Mapper.Map(b); + c.RotaInitials = src.RotaInitials; + return c; + }).ToList()); + } + } + +} \ No newline at end of file diff --git a/api/Models/Calendar/CalendarDay.cs b/api/Models/Calendar/CalendarDay.cs new file mode 100644 index 00000000..142ac3b5 --- /dev/null +++ b/api/Models/Calendar/CalendarDay.cs @@ -0,0 +1,46 @@ +using PCSS.Models.REST.JudicialCalendar; +using System; + +namespace Scv.Api.Models.Calendar +{ + public class CalendarDay : JudicialCalendarDay + { + public string RotaInitials { get; set; } + public DateTime Start + { + get + { + return DateTime.ParseExact(base.Date, "dd-MMM-yyyy", null).AddHours(8); + } + } + + public bool showAM + { + get + { + return showPM; + } + } + public bool showPM + { + get + { + if(showPMLocation || (this.Assignment?.ActivityAm?.CourtRoomCode != this.Assignment?.ActivityPm?.CourtRoomCode) + || (this.Assignment?.ActivityAm?.ActivityDescription != this.Assignment?.ActivityPm?.ActivityDescription)) + return true; + else + return false; + } + } + public bool showPMLocation + { + get + { + if (this.Assignment?.ActivityPm != null && this.Assignment?.ActivityAm?.LocationName != this.Assignment?.ActivityPm?.LocationName) + return true; + else + return false; + } + } + } +} diff --git a/api/Models/Calendar/CalendarSchedule.cs b/api/Models/Calendar/CalendarSchedule.cs new file mode 100644 index 00000000..2f61c550 --- /dev/null +++ b/api/Models/Calendar/CalendarSchedule.cs @@ -0,0 +1,12 @@ +using Scv.Api.Models.Lookup; +using System.Collections.Generic; + +namespace Scv.Api.Models.Calendar +{ + public class CalendarSchedule + { + public List Schedule { get; set; } + public List Activities { get; set; } + public List Presiders { get; set; } + } +} \ No newline at end of file diff --git a/api/Models/Lookup/FilterCode.cs b/api/Models/Lookup/FilterCode.cs new file mode 100644 index 00000000..45f6507c --- /dev/null +++ b/api/Models/Lookup/FilterCode.cs @@ -0,0 +1,8 @@ +namespace Scv.Api.Models.Lookup +{ + public class FilterCode + { + public string Text { get; set; } + public string Value { get; set; } + } +} \ No newline at end of file diff --git a/api/Services/JudicialCalendarService.cs b/api/Services/JudicialCalendarService.cs new file mode 100644 index 00000000..a5cf3146 --- /dev/null +++ b/api/Services/JudicialCalendarService.cs @@ -0,0 +1,73 @@ +using JCCommon.Clients.LocationServices; +using LazyCache; +using Microsoft.Extensions.Configuration; +using Newtonsoft.Json.Serialization; +using PCSSClient.Clients.JudicialCalendarsServices; +using Scv.Api.Helpers; +using Scv.Api.Helpers.ContractResolver; +using System; +using System.Linq; +using System.Threading.Tasks; +using PCSS.Models.REST.JudicialCalendar; +using System.Collections.Generic; +using System.Threading; + +namespace Scv.Api.Services +{ + /// + /// This should handle caching and JudicialCalendarsServicesClient. + /// + public class JudicialCalendarService + { + #region Variables + + private readonly IAppCache _cache; + private readonly IConfiguration _configuration; + private JudicialCalendarsServicesClient _judicialCalendarsClient { get; } + + #endregion Variables + + #region Properties + + #endregion Properties + + #region Constructor + + public JudicialCalendarService(IConfiguration configuration, JudicialCalendarsServicesClient judicialCalendarsClient, + IAppCache cache) + { + _configuration = configuration; + _judicialCalendarsClient = judicialCalendarsClient; + _cache = cache; + _cache.DefaultCachePolicy.DefaultCacheDurationSeconds = int.Parse(configuration.GetNonEmptyValue("Caching:LocationExpiryMinutes")) * 60; + SetupLocationServicesClient(); + } + + #endregion Constructor + + #region Collection Methods + + public async Task> JudicialCalendarsGetAsync(string locationId, DateTime startDate, DateTime endDate) + { + var judicialCalendars = await _judicialCalendarsClient.JudicialCalendarsGetAsync(locationId, startDate, endDate, CancellationToken.None); + + return judicialCalendars; + } + + + #endregion Collection Methods + + #region Lookup Methods + + + #endregion Lookup Methods + + #region Helpers + private void SetupLocationServicesClient() + { + _judicialCalendarsClient.JsonSerializerSettings.ContractResolver = new SafeContractResolver { NamingStrategy = new CamelCaseNamingStrategy() }; + } + + #endregion Helpers + } +} \ No newline at end of file diff --git a/api/api.csproj b/api/api.csproj index b70da5d3..5505cd4b 100644 --- a/api/api.csproj +++ b/api/api.csproj @@ -14,6 +14,7 @@ bin\$(Configuration)\net8.0\api.xml + @@ -34,6 +35,7 @@ + diff --git a/docker/api/Dockerfile.release b/docker/api/Dockerfile.release index df7383e3..0089b4f8 100644 --- a/docker/api/Dockerfile.release +++ b/docker/api/Dockerfile.release @@ -16,9 +16,11 @@ WORKDIR /src COPY ["api/api.csproj", "api/"] COPY ["db/db.csproj", "db/"] COPY ["jc-interface-client/jc-interface-client.csproj", "jc-interface-client/"] +COPY ["pcss-client/pcss-client.csproj", "pcss-client/"] RUN dotnet restore api/api.csproj RUN dotnet restore db/db.csproj RUN dotnet restore jc-interface-client/jc-interface-client.csproj +RUN dotnet restore pcss-client/pcss-client.csproj COPY . . RUN dotnet build "api/api.csproj" -c Release # build diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 4bb2c96a..0c62e361 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -75,6 +75,7 @@ services: - ${LOCAL_WORKSPACE_FOLDER-..}/api/:/opt/app-root/src/api - ${LOCAL_WORKSPACE_FOLDER-..}/db/:/opt/app-root/src/db - ${LOCAL_WORKSPACE_FOLDER-..}/jc-interface-client/:/opt/app-root/src/jc-interface-client + - ${LOCAL_WORKSPACE_FOLDER-..}/pcss-client/:/opt/app-root/src/pcss-client - api-dev-bin:/opt/app-root/src/api/bin - api-dev-obj:/opt/app-root/src/api/obj - ${LOCAL_WORKSPACE_FOLDER-.}/seed:/opt/app-root/data diff --git a/package-lock.json b/package-lock.json index 48e341a0..b839c0ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,3 +1,18 @@ { - "lockfileVersion": 1 + "name": "jasper", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "vue-month-picker": "^1.7.2" + } + }, + "node_modules/vue-month-picker": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/vue-month-picker/-/vue-month-picker-1.7.2.tgz", + "integrity": "sha512-Wov461A/Xk+h2ktfjQHeqCYMk9sRvmBL1uFxOzRTa2XiiUA5L6Cv8QZ0EvlXxkeM2EkmhltnidgWVCUEi9lXYg==", + "license": "MIT" + } + } } diff --git a/pcss-client/Clients/CourtCalendarsServicesClient.cs b/pcss-client/Clients/CourtCalendarsServicesClient.cs new file mode 100644 index 00000000..6c6e689b --- /dev/null +++ b/pcss-client/Clients/CourtCalendarsServicesClient.cs @@ -0,0 +1,80 @@ + + +namespace PCSSClient.Clients.CourtCalendarsServices +{ + using System = global::System; + using PCSS.Models.REST.CourtCalendar; + + + public partial class CourtCalendarsServicesClient + { + private HttpClient _httpClient; + private Lazy _settings; + + public CourtCalendarsServicesClient(System.Net.Http.HttpClient httpClient) + { + _httpClient = httpClient; + _settings = new System.Lazy(CreateSerializerSettings); + } + private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + { + var settings = new Newtonsoft.Json.JsonSerializerSettings(); + UpdateJsonSerializerSettings(settings); + return settings; + } + + public Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + + partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + + public async Task> CourtCalendarLocationsGetAsync(string locationId, DateTime startDate, DateTime endDate, System.Threading.CancellationToken cancellationToken) + { + // currently using locations and grabaing activities from there + // https://wsgw.test.jag.gov.bc.ca/courts/catsAPI/api/v2/calendar/locations?locationIds=5,6,7,8,9,11&startDate=15-Mar-2019&endDate=15-Mar-2019 + + // this could give us the activities for a location, but returns error + // https://wsgw.test.jag.gov.bc.ca/courts/catsAPI/api/calendar/locations/1/activities + //{ + // "responseCd": "500", + // "incidentID": "30737", + // "errors": "An unexpected error occurred. Please inform system support. Incident ID=30737" + // } + var locationIds = locationId.Split(',').ToList(); + +var courtCalendarLocations = new List(); + +if(locationIds.Contains("5871")) + courtCalendarLocations.Add( + new CourtCalendarLocation + { + Id = 5, + Name = "New Westminster Law Courts", + AgencyIdentifierCode = "3581", + RegionCode = "FRSR", + WorkAreaSequenceNo = 2, + IsActive = true, + IsGroupParent = true, + Days = new List + { + new CourtCalendarDay + { + LocationId = 5871, + Date = DateTime.Parse("01-Nov-2024").ToString("yyyy-MM-dd"), + PcjRequired = 1, + PcjMinimum = 2, + PcjMaximum = 3, + } + }, + + }); + + + + return courtCalendarLocations; + } + } +} + + + + diff --git a/pcss-client/Clients/JudicialCalendarsServicesClient.cs b/pcss-client/Clients/JudicialCalendarsServicesClient.cs new file mode 100644 index 00000000..663be35d --- /dev/null +++ b/pcss-client/Clients/JudicialCalendarsServicesClient.cs @@ -0,0 +1,189 @@ + +namespace PCSSClient.Clients.JudicialCalendarsServices +{ + using PCSS.Models.REST.JudicialCalendar; + using System = global::System; + + public partial class JudicialCalendarsServicesClient + { + private HttpClient _httpClient; + private Lazy _settings; + + public JudicialCalendarsServicesClient(System.Net.Http.HttpClient httpClient) + { + _httpClient = httpClient; + _settings = new System.Lazy(CreateSerializerSettings); + } + private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + { + var settings = new Newtonsoft.Json.JsonSerializerSettings(); + UpdateJsonSerializerSettings(settings); + return settings; + } + public Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + + partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + + public async Task> JudicialCalendarsGetAsync(string locationId, DateTime startDate, DateTime endDate, System.Threading.CancellationToken cancellationToken) + { + // [HttpGet("api/calendar/judges")] + // public HttpResponseMessage ReadCalendars([FromUri] int[] locationIds = null, string startDate = null, string endDate = null) + + + var locationIds = locationId.Split(',').ToList(); + + var judicialCalendars = new List(); + var onlyMyEventsFlag = string.IsNullOrWhiteSpace(locationId); + + + if (locationIds.Contains("5871") || onlyMyEventsFlag) + { + judicialCalendars.Add( + new JudicialCalendar + { + Id = 2, + RotaInitials = "MRC", + ParticipantId = 12346, + HomeLocationId = 100, + HomeLocationName = "Home Location", + RegionCode = "RC1", + WorkAreaSequenceNo = 1, + Name = "Melissa R Collins", + PositionTypeCode = "PTC", + PositionTypeDescription = "Position Type", + PositionCode = "PC", + PositionDescription = "Position", + PositionStatusCode = "PSC", + PositionStatusDescription = "Position Status", + IsPresider = true, + IsJudge = true, + IsAdmin = false, + Days = new List + { + new JudicialCalendarDay + { + JudgeId = 12346, + Date = "30-Nov-2024", + Name = "Melissa R Collins", + PositionTypeCode = "PCJ", + PositionTypeDescription = "Provincial Court Judge", + PositionCode = "PJ", + PositionDescription = "Puisne Judge", + PositionStatusCode = "FT", + PositionStatusDescription = "FT", + IsPresider = true, + IsJudge = true, + IsAdmin = false, + Assignment = new JudicialCalendarAssignment + { + Id = 100128, + JudgeId = 12346, + LocationId = 0, + LocationName = "100 Mile House", + Date = "30-Nov-2024", + ActivityCode = "TR", + ActivityDisplayCode = "Trials", + ActivityDescription = "Trials", + IsCommentRequired = false, + ActivityClassCode = "NS", + ActivityClassDescription = "Non Sitting", + IsVideo = true, + Force = false, + ActivityAm = new JudicialCalendarActivity + { + ActivityCode = "TR", + ActivityDescription = "Trials", + ActivityDisplayCode = "Trials", + ActivityClassCode = "NS", + ActivityClassDescription = "Non Sitting", + LocationId = 5871, + LocationName = "100 Mile House", + CourtSittingCode = "AM", + CourtRoomCode = "009" + }, + ActivityPm = new JudicialCalendarActivity + { + ActivityCode = "TR", + ActivityDescription = "Trials", + ActivityDisplayCode = "Trials", + ActivityClassCode = "M", + ActivityClassDescription = "Mixed", + LocationId = 5871, + LocationName = "100 Mile House", + CourtSittingCode = "PM", + CourtRoomCode = "009" + } + } + }, + new JudicialCalendarDay + { + JudgeId = 12346, + Date = "28-Nov-2024", + Name = "Melissa R Collins", + PositionTypeCode = "PCJ", + PositionTypeDescription = "Provincial Court Judge", + PositionCode = "PJ", + PositionDescription = "Puisne Judge", + PositionStatusCode = "FT", + PositionStatusDescription = "FT", + IsPresider = true, + IsJudge = true, + IsAdmin = false, + Assignment = new JudicialCalendarAssignment + { + Id = 100125, + JudgeId = 12346, + LocationId = 0, + LocationName = "100 Mile House", + Date = "28-Nov-2024", + ActivityCode = "TR", + ActivityDisplayCode = "Trials", + ActivityDescription = "Trials", + IsCommentRequired = false, + ActivityClassCode = "NS", + ActivityClassDescription = "Non Sitting", + IsVideo = false, + Force = false, + ActivityAm = new JudicialCalendarActivity + { + + ActivityCode = "TR", + ActivityDescription = "Trials", + ActivityDisplayCode = "Trials", + ActivityClassCode = "NS", + ActivityClassDescription = "Non Sitting", + + LocationId = 5871, + LocationName = "100 Mile House", + CourtSittingCode = "AM", + CourtRoomCode = "009" + }, + ActivityPm = new JudicialCalendarActivity + { + ActivityCode = "A", + ActivityDescription = "CivApp", + ActivityDisplayCode = "CivApp", + ActivityClassCode = "M", + ActivityClassDescription = "Mixed", + LocationId = 5871, + LocationName = "100 Mile House", + CourtRoomCode = "009", + CourtSittingCode = "PM" + } + + } + } + } + } + ); + + } + + judicialCalendars = judicialCalendars.Where(t => t.Days.Count > 0).ToList(); + if (onlyMyEventsFlag) + judicialCalendars = judicialCalendars.Where(t => t.RotaInitials == "MRC").ToList(); + + return judicialCalendars; + } + } +} diff --git a/pcss-client/Models/Infrastructure/Constants.cs b/pcss-client/Models/Infrastructure/Constants.cs new file mode 100644 index 00000000..5d612c86 --- /dev/null +++ b/pcss-client/Models/Infrastructure/Constants.cs @@ -0,0 +1,71 @@ +namespace PCSS.Infrastructure +{ + public class Constants + { + public const string TIME_FORMAT = "hh:mmtt"; + public const string DATE_FORMAT = "dd-MMM-yyyy"; + public const string TIMESTAMP_FORMAT = DATE_FORMAT + " " + TIME_FORMAT; + + //2002-09-23 00:00:00.0 + public const string DATE_FORMAT_WS = "yyyy-MM-dd HH:mm:ss.f"; + public const double HOURS_PER_DAY = 5.0; + + public const string FILE_DIVISION_CRIMINAL = "R"; + public const string FILE_DIVISION_CIVIL = "I"; + public const string MIXED_ACTIVITY_CLASS = "M"; + public const string SPECIALITY_ACTIVITY_CLASS = "S"; + + public static string[] Y_N = new string[] { "Y", "N" }; + + public const double MAGIC_CASE_UNLIMITED_QUANTITY_NO = 100.0; + public const double MAGIC_WITNESS_SCORE = 0.8; + public const double MAX_UNLIMITED_CAPACITY = 0.75; + + + public const string ESTIMATED_UNIT_HOURS = "HRS"; + public const string ESTIMATED_UNIT_MINS = "MINS"; + public const string ESTIMATED_UNIT_DAYS = "DYS"; + + public const string CONTRAINT_HOURS = "HOURS"; + public const string CONTRAINT_CASES = "CASES"; + public const string CONTRAINT_CASES_UNLIMITED = "CASES_UN"; + public const string CONTRAINT_SLOT = "SLOT"; + + public const string HOLIDAY_ACTIVITY_TYPE = "HOL"; + public const string ASSIGNMENT_LIST_ACTIVITY_TYPE = "ASL"; + public const string TBA_ACTIVITY_TYPE = "TBA"; + public const string NOT_WORKING_ACTIVITY_TYPE = "NW"; + public const string SITTING_ACTIVITY_TYPE = "SIT"; + + public const int MAX_SYNC_LOG = 5000; + public const string SEIZED = "S"; + + public const string USER_ROLE = "USER"; + public const string CONTINUATION_REASON = "CNT"; + public static int VIRTUAL_TBA_SLOT_ID = -1; + + + public const string APPEARANCE_STATUS_SCHEDULED = "SCHD"; + public const string APPEARANCE_STATUS_CANCELLED = "CNCL"; + public const string APPEARANCE_STATUS_UNCONFIRMED = "UNCF"; + public const string APPEARANCE_STATUS_TENTATIVE = "TENT"; + + + public static string JUDICIAL_SCHEDULE_RULE_NO_SCHEDULE = "NS"; + public static DateTime EARLIEST_SYNC_DATE = new DateTime(2014, 01, 01); + public static string AVAIL_PROV_COURT = "PC"; + public static string AVAIL_UNKNOWN = "?"; + + + public const string SITTING_FOR_ACTIVITY = "SA"; + public const string SITTING_BUT_NOT_SCHEDULED = "SN"; + public const string SITTING_FOR_OTHER_ACTIVITY = "SO"; + public const string SITTING_IN_OTHER_LOCATION = "SE"; + public const string NOT_SITTING = "NS"; + public const string NOT_SCHEDULED_TO_WORK = "NW"; + + public const string TRIAL_TRACKER_PROCEEDED = "PROC"; + + + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/ActivityAppearanceDetail.cs b/pcss-client/Models/REST/ActivityAppearanceDetail.cs new file mode 100644 index 00000000..72dfd141 --- /dev/null +++ b/pcss-client/Models/REST/ActivityAppearanceDetail.cs @@ -0,0 +1,216 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class ActivityAppearanceResultsCollection + { + public ActivityAppearanceResultsCollection() + { + this.Items = new List(); + } + public List Items { get; set; } + public bool IsCourtListFiltered { get; set; } + public bool isStat { get; set; } + } + + public class ActivityAppearanceResults + { + public string DateStr { get; set; } + public int? LocationId { get; set; } + public string LocationNm { get; set; } + public string ActivityCd { get; set; } + public string ActivityDsc { get; set; } + public string ActivityClassCd { get; set; } + public string ActivityClassDsc { get; set; } + public string[] CourtRooms { get; set; } + public double CapacityTargetNumerator { get; set; } + public double? CapacityTargetDenominator { get; set; } + public int CasesTarget { get; set; } + public double TotalHours { get; set; } + public string CapacityConstraintCd { get; set; } + public string CapacityConstraintDsc { get; set; } + public List Appearances { get; set; } + public List CourtActivityDetails { get; set; } + public List CourtRoomDetails { get; set; } + } + + public class CourtRoomDetail + { + public string CourtRoomCd { get; set; } + public string AssignmentListRoomYn { get; set; } + public int CasesTarget { get; set; } + public double TotalHours { get; set; } + + public string isAM { get; set; } + + public string isPM { get; set; } + public List adjudicatorDetails { get; set; } + } + + public class AdjudicatorDetail + { + public int adjudicatorId { get; set; } + public string adjudicatorNm { get; set; } + public string adjudicatorInitials { get; set; } + public string amPm { get; set; } + } + + + public class CourtActivityDetail + { + public int? CourtActivityId { get; set; } + public string NoAdditionsYn { get; set; } + public string NoAdditionsCommentTxt { get; set; } + public string CourtSittingCd { get; set; } + } + + + + public class ActivityAppearanceDetail + { + public int? AslSortOrder { get; set; } + public string CourtDivisionCd { get; set; } + public string AppearanceDt { get; set; } + public string AppearanceTm { get; set; } + public string CourtRoomCd { get; set; } + public string CourtFileNumber { get; set; } + public int? PcssAppearanceId { get; set; } + + public bool IsComplete { get; set; } + + //For the file instead of the overall type for the court activity + //Only different from the top level if mixed + public string ActivityClassCd { get; set; } + public string ActivityClassDsc { get; set; } + + public string AppearanceReasonCd { get; set; } + public string AppearanceReasonDsc { get; set; } + public AppearanceMethod AppearanceMethod { get; set; } + public EquipmentSearchResults EquipmentBooking { get; set; } + + public string ScheduleNoteTxt { get; set; } + + public string EstimatedTimeHour { get; set; } + public string EstimatedTimeMin { get; set; } + public string EstimatedTimeString { get; set; } + + public string JustinNo { get; set; } + public string PhysicalFileId { get; set; } + public string CourtlistRefNumber { get; set; } + + public string StyleOfCause { get; set; } + public string AdjudicatorInitials { get; set; } + public string AdjudicatorNm { get; set; } + public string CaseAgeDays { get; set; } + public string VideoYn { get; set; } + public string AccusedNm { get; set; } + public string AccusedCounselNm { get; set; } + public string AppearanceId { get; set; } + public string ProfPartId { get; set; } + public string ProfSeqNo { get; set; } + + //Markers + public string InCustodyYn { get; set; } + public string DetainedYn { get; set; } + public string ContinuationYn { get; set; } + public string CondSentenceOrderYn { get; set; } + public string LackCourtTimeYn { get; set; } + public string OtherFactorsYn { get; set; } + public string OtherFactorsComment { get; set; } + public string CfcsaYn { get; set; } + public string SoftYn { get; set; } + + public string ScheduledOnDt { get; set; } + + public string ScheduledByInitials { get; set; } + + public string ScheduledByName { get; set; } + + public string ActivityCd { get; set; } + public string ActivityDsc { get; set; } + + public int? CourtActivityId { get; set; } + + public int? CourtActivitySlotId { get; set; } + + public string RemoteVideoYn { get; set; } + + public string AppearanceStatusCd { get; set; } + + public string AppearanceStatusDsc { get; set; } + + public int? TotalAppearances { get; set; } + public int? AppearanceNumber { get; set; } + + public string TrialTrackerCd { get; set; } + public string TrialTrackerDsc { get; set; } + public string TrialTrackerTrialResultTxt { get; set; } + public string TrialTrackerOtherTxt { get; set; } + + public string AslParentTrialTrackerCd { get; set; } + public string AslParentTrialTrackerDsc { get; set; } + + public string AssignmentListRoomYn { get; set; } + + public AslChildAppearance AslChildAppearance { get; set; } + public List Charges { get; set; } + public List Crown { get; set; } + + public List Counsel { get; set; } + + public JustinCounsel JustinCounsel { get; set; } + + public int? HomeLocationId { get; set; } + public string HomeLocationNm { get; set; } + public int? RemoteLocationId { get; set; } + public string RemoteLocationNm { get; set; } + public dynamic CeisCounsel { get; set; } + + public string JustinApprId { get; set; } + + public string CeisAppearanceId { get; set; } + + public List JcmComments { get; set; } + public List AppearanceAdjudicatorRestriction { get; set; } + + public string StoodDownJCMYn { get; set; } + public string CourtClassCd { get; set; } + public string AppearanceSequenceNumber { get; set; } + + public string AslCourtFileNumber + { + get + { + return string.IsNullOrEmpty(this.CourtClassCd) ? this.CourtFileNumber : string.Format("{0}-{1}", this.CourtClassCd, this.CourtFileNumber); + } + } + + public string SelfRepresentedYn { get; set; } + public string OtherRepresentedYn { get; set; } + public PcssCounsel LinkedCounsel { get; set; } + public List AslFeederAdjudicators { get; set; } + } + + public class AslChildAppearance + { + public string AdjudicatorInitials { get; set; } + public string AdjudicatorNm { get; set; } + public string CourtRoomCd { get; set; } + public string AppearanceDt { get; set; } + public string AppearanceTm { get; set; } + } + + public class UpdateAslSortOrderRequest + { + public List Appearances { get; set; } + } + + public class AslSortOrderAppearance + { + public int? AslSortOrder { get; set; } + public int? PcssAppearanceId { get; set; } + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/Adjudicator.cs b/pcss-client/Models/REST/Adjudicator.cs new file mode 100644 index 00000000..e064066d --- /dev/null +++ b/pcss-client/Models/REST/Adjudicator.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class Adjudicator + { + public int? JudiciaryPersonId { get; set; } + public decimal? PartID { get; set; } + public string AdjudicatorNm { get; set; } + public string AdjudicatorInitials { get; set; } + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/AdjudicatorRestriction.cs b/pcss-client/Models/REST/AdjudicatorRestriction.cs new file mode 100644 index 00000000..dd4c9a86 --- /dev/null +++ b/pcss-client/Models/REST/AdjudicatorRestriction.cs @@ -0,0 +1,48 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class AdjudicatorRestriction + { + public string Pk { get; set; } + public string FileName { get; set; } //no data for this yet. + + public string JudgeName { get; set; } + public string AppearanceReasonCode { get; set; } + public string AppearanceReasonDescription { get; set; } + public string RestrictionCode { get; set; } + public bool HasIssue { get; set; } + public string ActivityCode { get; set; } + public string CourtRoomCode { get; set; } + public string CourtSittingCode { get; set; } + public int LocationId { get; set; } + + public bool IsCivil { get; set; } + public string JustinOrCeisId { get; set; } + public string EstimatedTimeHour { get; set; } + public string EstimatedTimeMin { get; set; } + public string EstimatedTimeString { get; set; } + + public AdjudicatorRestriction() { } + + public override bool Equals(object obj) + { + if (obj == null) return false; + var t = obj as AdjudicatorRestriction; + if (t == null) return false; + if (Pk == t.Pk) return true; + + return false; + } + public override int GetHashCode() + { + int hash = GetType().GetHashCode(); + hash = (hash * 397) ^ Pk.GetHashCode(); + return hash; + } + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/AppearanceMethod.cs b/pcss-client/Models/REST/AppearanceMethod.cs new file mode 100644 index 00000000..3b04f831 --- /dev/null +++ b/pcss-client/Models/REST/AppearanceMethod.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class AppearanceMethod + { + public AppearanceMethod() + { + Details = new List(); + } + public string ResponseMessageTxt { get; set; } + public string ResponseCd { get; set; } + public string CourtDivisionCd { get; set; } + public List Details { get; set; } + } + + public class AppearanceMethodDetail + { + /* Both*/ + public string AppearanceId { get; set; } + /* Both*/ + public string RoleTypeCd { get; set; } + /* Both */ + public string AppearanceMethodCd { get; set; } + + /* Criminal Only */ + public string AssetUsageSeqNo { get; set; } + /* Criminal Only */ + public string PhoneNumberTxt { get; set; } + /* Criminal Only */ + public string InstructionTxt { get; set; } + /* Criminal Only */ + public string ApprMethodCcn { get; set; } + + /* Civil Only */ + public string OrigRoleCd { get; set; } + /* Civil Only */ + public string OrigAppearanceMethodCd { get; set; } + } + + /// + /// A flattened version of the model for saving and updating since the front end only supports one at a time + /// + public class AppearanceMethodSaveAndUpdateModel : AppearanceMethodDetail + { + public string CourtDivisionCd { get; set; } + } + + public class AssetType { + public string AssetTypeCd { get; set; } + public string AssetTypeDsc { get; set; } + } + + public class AppearanceMethodAllowedCombo + { + public AppearanceMethodAllowedCombo() + { + AssetTypes = new List(); + } + public string ParticipantRoleTypeCd { get; set; } + public string ParticipantRoleTypeDsc { get; set; } + public List AssetTypes { get; set; } + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/BestDateSearch.cs b/pcss-client/Models/REST/BestDateSearch.cs new file mode 100644 index 00000000..89475657 --- /dev/null +++ b/pcss-client/Models/REST/BestDateSearch.cs @@ -0,0 +1,377 @@ +using PCSS.Infrastructure; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + + public class RequiredPerson + { + public string PartId { get; set; } + public string PersonTypeCd { get; set; } + } + + public class ActivityType + { + public string ActivityCd { get; set; } + public string ActivityClassCd { get; set; } + } + + public class FindBestDateParameters + { + public FindBestDateParameters() + { + RequiredPersonnel = new List(); + } + + public int LocationId { get; set; } + + public double? AdjPartId { get; set; } + + public double? EstimatedQty { get; set; } + public string EstimatedUnitCd { get; set; } + + public string StartDate { get; set; } + public string EndDate { get; set; } + public int? JustinNo { get; set; } + public double? PhysicalFileId { get; set; } + public List RequiredPersonnel { get; set; } + public List CounselIds { get; set; } + + public List ActivityCds { get; set; } + + public string BestDateYn { get; set; } + public string IncludeAppearancesYn { get; set; } + + + + } + + public class FindBestDateResult + { + public FindBestDateResult() + { + PersonnelAvailability = new List(); + OfferedDates = new List(); + CounselAvailability = new List(); + Restrictions = new List(); + Appearances = new List(); + } + public DateTime Date { get; set; } + public string DateStr { get; set; } + + public bool CapacityFlag { get; set; } + public double? CapacityScore { get; set; } + + public bool WitnessFlag { get; set; } + public double WitnessScore { get; set; } + public bool JudgeFlag { get; set; } + public bool AdditionsAllowedFlag { get; set; } + public string ClosedComments { get; set; } + public bool WrongDurationFlag { get; set; } + public bool CounselAvailabilityFlag { get; set; } + public bool CrownCounselAvailabilityFlag { get; set; } + public bool BestDateFlag { get; set; } + + public double? TotalQuantity { get; set; } + public double? UsedQuantity { get; set; } + public int? NumberOfCases { get; set; } + public double? NumberOfHours { get; set; } + + public List PersonnelAvailability { get; set; } + public List ActivityClassUsages { get; set; } + public string AvailabilityCd + { + get + { + return CounselAvailability.Any(x => x.Details != null && x.Details.Any()) ? Constants.AVAIL_PROV_COURT : Constants.AVAIL_UNKNOWN; + } + } + public string ActivityCd { get; set; } + public string ActivityCdDsc { get; set; } + public string CourtRoomCd { get; set; } + + public string CapacityConstraintCd { get; set; } + public List OfferedDates { get; set; } + public List CounselAvailability { get; set; } + public JudgeAvailability JudgeAvailability { get; set; } + public List Restrictions { get; set; } + public bool HasRestrictions { get { return Restrictions.Count > 0; } } + public bool HasAdjudicatorIssues { get { return Restrictions.Exists(x => x.HasIssue); } } + + // task2658 + public List Appearances { get; set; } + + + public bool CompletedPersonnelSearch { get; set; } + } + + public class ActivityClassUsage + { + public string ActivityClassCd { get; set; } + public int? NumberOfCases { get; set; } + public double? NumberOfHours { get; set; } + + public string ActivityClassDsc { get; set; } + + public double CapacityScore { get; set; } + + public double TotalQuantity { get; set; } + + public double UsedQuantity { get; set; } + } + + public class GetPersonnelAvailabilityParameters + { + public string StartDate { get; set; } + public string EndDate { get; set; } + public string AssignmentDate { get; set; } + public List RequiredPersonnel { get; set; } + public int? LocationId { get; set; } + + } + + public class GetCounselAvailabilityParameters + { + public string StartDate { get; set; } + public string EndDate { get; set; } + public List CounselIds { get; set; } + } + + public class GetJudgeAvailabilityParameters + { + public string StartDate { get; set; } + public string EndDate { get; set; } + public double AdjPartId { get; set; } + public int LocationId { get; set; } + public string ActivityCd { get; set; } + } + + public class Assignment + { + public string AssignmentTypeDsc { get; set; } + public string CreateDt { get; set; } + public string StartDt { get; set; } + public string EndDt { get; set; } + public string PoliceAgencyDsc { get; set; } + } + + public class Commitment + { + public string CommitmentTypeDsc { get; set; } + + public string ActivityTypeCd { get; set; } + public string ActivityTypeDsc { get; set; } + + public string CreatedDt { get; set; } + public string CourtAgencyId { get; set; } + public int? LocationId { get; set; } + public string LocationNm { get; set; } + public string RegionNm { get; set; } + public string CourtRoomCd { get; set; } + public string CommitmentDt { get; set; } + public string CommitmentTm { get; set; } + public string DurationHour { get; set; } + public string DurationMin { get; set; } + public string CourtFileNo { get; set; } + public string CommitmentTxt { get; set; } + + + } + + public class PersonnelAssignmentDetail + { + public string PartId { get; set; } + public string AssignmentDt { get; set; } + public string DutyDsc { get; set; } + public string ShiftLadderDsc { get; set; } + public List Assignments { get; set; } + public List Commitments { get; set; } + } + + public class GetPersonnelAvailabilityResult + { + public GetPersonnelAvailabilityResult() + { + PersonnelDetails = new List(); + WitnessScores = new List(); + } + + public List PersonnelDetails { get; set; } + public List WitnessScores { get; set; } + } + + public class PersonnelWitnessScores + { + public DateTime Date { get; set; } + public double WitnessScore { get; set; } + } + + public class PersonnelAvailabilityAndAssignmentDetails + { + public string FullNm { get; set; } + public string PartId { get; set; } + public string PersonTypeCd { get; set; } + public List PersonnelAvailability { get; set; } + public List AssignmentDetails { get; set; } + + public string PinCodeTxt { get; set; } + + public string AgencyDsc { get; set; } + + public string AgencyCd { get; set; } + } + + public class Personnel + { + public string LastNm { get; set; } + public string FirstNm { get; set; } + public string PinTxt { get; set; } + public string PartId { get; set; } + + public string AgencyDsc { get; set; } + + public string AgencyCd { get; set; } + } + + public class CounselAvailabilityResult + { + public int CounselId { get; set; } + public int? LawSocietyId { get; set; } + public string LastNm { get; set; } + public string GivenNm { get; set; } + public string PrefNm { get; set; } + public string FullNm { get { return LastNm + ", " + GivenNm; } } + public List CounselAvailabilities { get; set; } + } + + public class CounselAvailability + { + public int CounselId { get; set; } + public int? LawSocietyId { get; set; } + public string LastNm { get; set; } + public string GivenNm { get; set; } + public string PrefNm { get; set; } + public string FullNm { get { return LastNm + ", " + GivenNm; } } + public string OrgNm { get; set; } + public DateTime Date { get; set; } + public string DateStr { get; set; } + public List Details { get; set; } + public string AvailabilityCd + { + get + { + return (Details != null && Details.Any()) ? Constants.AVAIL_PROV_COURT : Constants.AVAIL_UNKNOWN; + } + } + } + + public class CounselAvailabilityDetail + { + public string AppearanceTm { get; set; } + public int? LocationId { get; set; } + public string LocationNm { get; set; } + public string CourtRoomCd { get; set; } + public double? EstimatedQty { get; set; } + public string EstimatedUnitCd { get; set; } + + public string CourtFileNumber { get; set; } + public int? PcssAppearanceId { get; set; } + public string JustinNo { get; set; } + public string PhysicalFileId { get; set; } + + public override bool Equals(object obj) + { + if (obj == null) return false; + var t = obj as CounselAvailabilityDetail; + if (t == null) return false; + return true; + } + + public override int GetHashCode() + { + int hash = GetType().GetHashCode(); + return hash; + } + } + + public class JudgeAvailabilityResult + { + public string FullNm { get; set; } + public double AdjPartId { get; set; } + public string HomeLocationSNm { get; set; } + public List JudgeAvailabilities { get; set; } + } + + public class JudgeAvailability + { + public JudgeAvailability() + { + AssignmentDetails = new List(); + Restrictions = new List(); + } + + public string FullNm { get; set; } + public double AdjPartId { get; set; } + public string HomeLocationSNm { get; set; } + public string AvailabilityCd { get; set; } + public string AvailabilityDsc { get; set; } + public DateTime Date { get; set; } + public string DateStr { get; set; } + public List AssignmentDetails { get; set; } + public List Restrictions { get; set; } + } + + public class JudgeAssignmentDetail + { + public int? LocationId { get; set; } + public string LocationNm { get; set; } + public string JudgeActivityCd { get; set; } + public string JudgeActivityDsc { get; set; } + public string CourtActivityCd { get; set; } + public string CourtActivityDsc { get; set; } + public int? CourtLocationId { get; set; } + public string CourtLocationNm { get; set; } + public string CourtRoomCd { get; set; } + public string CommentTxt { get; set; } + public string VideoYn { get; set; } + public string CourtSittingCd { get; set; } + } + + + public class BestDateAppearanceDetail + { + public BestDateAppearanceDetail() + { + AppearanceAdjudicatorRestriction = new List(); + } + public int LocationId { get; set; } + public string CourtRoomCd { get; set; } + + public int AppearanceId { get; set; } + public string AppearanceDt { get; set; } + public string AppearanceTm { get; set; } + + public string CourtFileNumber { get; set; } + public string CourtDivisionCd { get; set; } + + public string ActivityCd { get; set; } + + public string ActivityClassCd { get; set; } + + public string AppearanceReasonCd { get; set; } + + public int TotalAppearances { get; set; } + public int AppearanceNumber { get; set; } + + public string EstimatedTimeHour { get; set; } + public string EstimatedTimeMin { get; set; } + public string EstimatedTimeString { get; set; } + public string JustinNo { get; set; } + public string PhysicalFileId { get; set; } + + public List AppearanceAdjudicatorRestriction { get; set; } + } +} diff --git a/pcss-client/Models/REST/CourtActivities.cs b/pcss-client/Models/REST/CourtActivities.cs new file mode 100644 index 00000000..a91a5a76 --- /dev/null +++ b/pcss-client/Models/REST/CourtActivities.cs @@ -0,0 +1,19 @@ +namespace PCSS.Models.REST +{ + public class CourtActivity + { + public virtual int? CourtActivityId { get; set; } + public virtual int? CourtActivitySlotId { get; set; } + public virtual string CourtActivityDt { get; set; } + public virtual int LocationId { get; set; } + public virtual string CourtRoomCd { get; set; } + public virtual string ActivityCd { get; set; } + public virtual string ActivityDsc { get; set; } + public virtual string CourtSittingCd { get; set; } + public virtual string StartTm { get; set; } + + public string ActivityClassCd { get; set; } + + public string ActivityClassDsc { get; set; } + } +} diff --git a/pcss-client/Models/REST/CourtCalendar.cs b/pcss-client/Models/REST/CourtCalendar.cs new file mode 100644 index 00000000..fd0b6d68 --- /dev/null +++ b/pcss-client/Models/REST/CourtCalendar.cs @@ -0,0 +1,465 @@ +using Newtonsoft.Json; +using PCSS.Infrastructure; +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Globalization; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST.CourtCalendar +{ + + public class CourtCalendarLocation + { + + public int Id { get; set; } + public string Name { get; set; } + + public string AgencyIdentifierCode { get; set; } + + public string RegionCode { get; set; } + public int? WorkAreaSequenceNo { get; set; } + + public bool IsActive { get; set; } + public bool IsGroupParent { get; set; } + + public string PublishDate { get; set; } + public string GenerationDate { get; set; } + + public List Days { get; set; } + + public CourtCalendarLocation() + { + this.Days = new List(); + } + + public DateTime GetStartDate() + { + return DateTime.ParseExact(this.Days[0].Date, Constants.DATE_FORMAT, CultureInfo.CurrentCulture); + } + public DateTime GetEndDate() + { + return DateTime.ParseExact(this.Days[this.Days.Count - 1].Date, Constants.DATE_FORMAT, CultureInfo.CurrentCulture); + } + + public int CourtRoomConflictDayCount + { + get + { + return this.Days.Where(x => x.CourtRoomConflicts.Count > 0).Count(); + } + } + + public int ActivityImbalanceDayCount + { + get + { + return this.Days.Where(x => x.HasActivityImbalance).Count(); + } + } + + public int JudicialImbalanceDayCount + { + get + { + return this.Days.Where(x => x.HasJudicialImbalance).Count(); + } + } + + public int AdjudicatorRestrictionIssuesDayCount + { + get + { + return this.Days.Where(x => x.HasAdjudicatorRestrictionIssues).Count(); + } + } + + public void AddDay(CourtCalendarDay item) + { + item.LocationId = this.Id; + this.Days.Add(item); + } + + public CourtCalendarDay GetDay(DateTime date) + { + CourtCalendarDay item = this.Days.Find(d => d.Date.Equals(date.ToString(Constants.DATE_FORMAT), StringComparison.OrdinalIgnoreCase)); + if (item == null) + { + item = new CourtCalendarDay(this.Id, date); + AddDay(item); + } + return item; + } + + public void CalculateCourtRoomConflicts() + { + // flatten out days/sittings/rooms and activities... + List items = new List(); + foreach (CourtCalendarDay day in this.Days) + { + foreach (CourtCalendarActivity activity in day.Activities) + { + foreach (CourtCalendarSlot slot in activity.Slots.Where(x => x.IsAssignmentListRoom == false)) + { + CourtCalendarConflict item = items.Find(x => (x.LocationId == this.Id) && (x.Date == day.Date) && (x.CourtSittingCode == activity.CourtSittingCode) && (x.CourtRoomCode == slot.CourtRoomCode)); + if (item == null) + { + item = new CourtCalendarConflict() + { + LocationId = this.Id, + Name = this.Name, + Date = day.Date, + CourtSittingCode = activity.CourtSittingCode, + CourtRoomCode = slot.CourtRoomCode + }; + items.Add(item); + } + if (!item.ActivityCodes.Contains(activity.ActivityCode)) + { + item.ActivityCodes.Add(activity.ActivityCode); + } + } + } + } + // + // ok, now for each day update set the conflicts and mark the location flag (if any conflicts)... + // + foreach (CourtCalendarDay day in this.Days) + { + day.CourtRoomConflicts = items.Where(x => (x.ActivityCodes.Count > 1) && (x.Date == day.Date)).ToList(); + } + } + + + } + + public class CourtCalendarDay + { + private CourtCalendarActivityImbalance _activityImbalance; + private CourtCalendarJudicialImbalance _judicialImbalance; + private List _activities = new List(); + private List _conflicts = new List(); + + public int LocationId { get; set; } + public string Date { get; set; } + public List DayLocationNotes { get; set; } + + public int PcjRequired { get; set; } + public int PcjMinimum { get; set; } + public int PcjMaximum { get; set; } + + public CourtCalendarDay() { + this._activityImbalance = new CourtCalendarActivityImbalance(); + this._judicialImbalance = new CourtCalendarJudicialImbalance(); + TrialTrackingMissingCount = 0; + } + + public CourtCalendarDay(int locationId, DateTime date) + { + this.LocationId = locationId; + this.Date = date.ToString(Constants.DATE_FORMAT); + this._activityImbalance = new CourtCalendarActivityImbalance() { LocationId = this.LocationId, Date = this.Date }; + this._judicialImbalance = new CourtCalendarJudicialImbalance() { LocationId = this.LocationId, Date = this.Date }; + TrialTrackingMissingCount = 0; + } + + public DateTime GetDate() + { + return DateTime.ParseExact(Date, Constants.DATE_FORMAT, CultureInfo.CurrentCulture); + } + + public List Activities { get { return _activities; } } + + public List CourtRoomConflicts { get { return _conflicts; } set { _conflicts = value; } } + public CourtCalendarActivityImbalance ActivityImbalance + { + get { return (_activityImbalance.IsBalanced) ? null : _activityImbalance; } + set { if (value != null) this._activityImbalance = value; } + } + public CourtCalendarJudicialImbalance JudicialImbalance + { + get { return (_judicialImbalance.IsBalanced) ? null : _judicialImbalance; } + set { if (value != null) this._judicialImbalance = value; } + } + public bool HasActivityImbalance { get { return !_activityImbalance.IsBalanced; } } + public bool HasJudicialImbalance { get { return !_judicialImbalance.IsBalanced; } } + public bool IsReconciliationRequired { get; set; } + public bool HasAdjudicatorRestrictionIssues { get { return _activities.Exists(x => x.HasAdjudicatorIssues); } } + + public void AddActivity(CourtCalendarActivity item) + { + item.Date = this.Date; + item.LocationId = this.LocationId; + _activities.Add(item); + } + + public CourtCalendarActivity GetActivity(string activityCode, string courtSittingCode) + { + CourtCalendarActivity item = _activities.Find(a => a.ActivityCode.Equals(activityCode, StringComparison.OrdinalIgnoreCase) && a.CourtSittingCode.Equals(courtSittingCode, StringComparison.OrdinalIgnoreCase)); + if (item == null) + { + item = new CourtCalendarActivity() { ActivityCode = activityCode, CourtSittingCode = courtSittingCode }; + AddActivity(item); + } + return item; + } + + + public int PcjActivitiesCountAm { get; set; } + + public int PcjActivitiesCountPm { get; set; } + + public int PcjSittingCount { get; set; } + + public int TrialTrackingMissingCount { get; set; } + } + + public class CourtCalendarActivity + { + private List _slots = new List(); + private List _capacitySettings = new List(); + private List _restrictions = new List(); + public int? Id { get; set; } + public int LocationId { get; set; } + public string Date { get; set; } + + public string ActivityCode { get; set; } + public string ActivityDescription { get; set; } + + public string ActivityClassCode { get; set; } + public string ActivityClassDescription { get; set; } + + public string CourtSittingCode { get; set; } + public string CapacityConstraintCode { get; set; } + + public double? PCJRequiredQuantity { get; set; } + public string JudiciaryTypeCode { get; set; } + + [JsonProperty(PropertyName = "IsJj")] + public bool IsJJ { get { return "JJ" == this.JudiciaryTypeCode; } } + [JsonProperty(PropertyName = "IsPcj")] + public bool IsPCJ { get { return "PCJ" == this.JudiciaryTypeCode; } } + [JsonProperty(PropertyName = "IsJp")] + public bool IsJP { get { return "JP" == this.JudiciaryTypeCode; } } + [JsonProperty(PropertyName = "IsOther")] + public bool IsOther { get { return !(IsJJ || IsPCJ || IsJP || IsIAR); } } + [JsonProperty(PropertyName = "IsIar")] + public bool IsIAR { get { return !(IsJJ || IsPCJ || IsJP) && "IA" == this.ActivityCode; } } + public bool IsHearingStartSameTime { get; set; } + public bool IsPreCourtActivity { get; set; } + + public bool IsStartLessThanDay { get; set; } + public bool IsStartSingleDay { get; set; } + public bool IsStartMultiDayLong { get; set; } + public bool IsStartMultiDayShort { get; set; } + + public bool IsClosedForBooking { get; set; } + public string ClosedComments { get; set; } + + public double? CurrentCapacityPercentage { get; set; } + public double? CurrentCapacity { get; set; } + public double? TotalCapacity { get; set; } + public int? NumberOfCases { get; set; } + public double? NumberOfHours { get; set; } + public List ActivityClassUsages { get; set; } + + public List Restrictions { get{ return _restrictions; } } + public bool HasRestrictions { get { return Restrictions.Count > 0; } } + public bool HasAdjudicatorIssues { get { return Restrictions.Exists(x => x.HasIssue); } } + + public List NeedJudgeDetails { get; set; } + + public CourtCalendarActivity() { this.NeedJudgeDetails = new List(); } + public CourtCalendarActivity(int locationId, DateTime date, string activityCode, string activityDesc, string activityClassCode, string activityClassDesc) + { + this.LocationId = locationId; + this.Date = date.ToString(Constants.DATE_FORMAT); + this.ActivityCode = activityCode; + this.ActivityDescription = activityDesc; + this.ActivityClassCode = activityClassCode; + this.ActivityClassDescription = activityClassDesc; + this.NeedJudgeDetails = new List(); + } + + public List Slots { get { return _slots; } } + + public void AddSlot(CourtCalendarSlot item) + { + item.CourtCalendarActivityId = this.Id; + item.LocationId = this.LocationId; + // only add a slot once... + if (_slots.Find(x => x.CourtRoomCode == item.CourtRoomCode && x.IsAssignmentListRoom == item.IsAssignmentListRoom && x.StartTime == item.StartTime) == null) + { + _slots.Add(item); + } + } + + public void RemoveSlot(CourtCalendarSlot item) + { + _slots.Remove(item); + + } + + public List CapacitySettings { get { return _capacitySettings; } } + + public void AddCapacity(CourtCalendarCapacity item) + { + item.CourtCalendarActivityId = this.Id; + _capacitySettings.Add(item); + } + + public void RemoveCapacity(CourtCalendarCapacity item) + { + _capacitySettings.Remove(item); + } + + + } + + public class CourtCalendarCapacity + { + public int? Id { get; set; } + public int? CourtCalendarActivityId { get; set; } + + public string ActivityClassCode { get; set; } + public double? Quantity { get; set; } + } + + public class CourtCalendarSlot + { + public int? Id { get; set; } + public int? CourtCalendarActivityId { get; set; } + + public int? LocationId { get; set; } + public string CourtRoomCode { get; set; } + public bool IsAssignmentListRoom { get; set; } + public string StartTime { get; set; } + public int? JudicialScheduleId { get; set; } + } + + public class CourtCalendarConflict + { + public int LocationId { get; set; } + public string Name { get; set; } + public string Date { get; set; } + public string CourtRoomCode { get; set; } + public string CourtSittingCode { get; set; } + public List ActivityCodes { get; set; } + + public CourtCalendarConflict() { this.ActivityCodes = new List(); } + } + + public class CourtCalendarActivityImbalance + { + public int LocationId { get; set; } + public string Name { get; set; } + public string Date { get; set; } + + public int ActivityCount { get; set; } + public List PcjActivityCodes { get; set; } + + public int PcjScheduled { get; set; } + + public int PcjMinimum { get; set; } + public int PcjMaximum { get; set; } + + public bool IsAboveRange { get { return this.ActivityCount > this.PcjMaximum; } } + public bool IsBelowRange { get { return this.ActivityCount < this.PcjMinimum; } } + public bool IsBalanced { get { return !IsAboveRange && !IsBelowRange;} } + + + public CourtCalendarActivityImbalance() { this.PcjActivityCodes = new List(); } + } + + public class CourtCalendarJudicialImbalance + { + public int LocationId { get; set; } + public string Name { get; set; } + public string Date { get; set; } + + public int ActivityCount { get; set; } + public List SittingActivityCodes { get; set; } + + public int PcjSitting { get; set; } + + public int PcjMinimum { get; set; } + public int PcjMaximum { get; set; } + + public bool IsAboveRange { get { return this.PcjSitting > this.PcjMaximum; } } + public bool IsBelowRange { get { return this.PcjSitting < this.PcjMinimum; } } + public bool IsBalanced { get { return !IsAboveRange && !IsBelowRange;} } + + public CourtCalendarJudicialImbalance() { this.SittingActivityCodes = new List(); } + } + + public class PresiderQuantityRange + { + public int Quantity { get; set; } + public int Min { get; set; } + public int Max { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + } + + public class DayLocationNote + { + public int? DayLocationNoteId { get; set; } + public string NoteDt { get; set; } + public int LocationId { get; set; } + public string NoteTxt { get; set; } + public string EntDtm { get; set; } + public string EntUserName { get; set; } + public string UpdDtm { get; set; } + public string UpdUserName { get; set; } + public string UpdName { get; set; } + } + + public class Utils + { + + public static int DayOfCourtCalendarWeek(DateTime dt) + { + // our Court Calendar starts with Monday as the First day of the week... + switch (dt.DayOfWeek) + { + case DayOfWeek.Monday: + return 1; + case DayOfWeek.Tuesday: + return 2; + case DayOfWeek.Wednesday: + return 3; + case DayOfWeek.Thursday: + return 4; + case DayOfWeek.Friday: + return 5; + case DayOfWeek.Saturday: + return 6; + default: + // must be sunday + return 7; + } + } + + + } + + + + public class NeedJudgeResponse + { + + public int? NeedJudgeId { get; set; } + public int? LocationId { get; set; } + public int? CourtActivityId { get; set; } + public string ActivityCd { get; set; } + public string ActivityDsc { get; set; } + public string LocationNm { get; set; } + public DateTime CalendarDt { get; set; } + public string CourtSittingCd { get; set; } + public virtual string CourtSittingDsc { get; set; } + public string CourtRoomCd { get; set; } + public string NeedJudgeTypeCd { get; set; } + public virtual string NeedJudgeTypeDsc { get; set; } + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/EquipmentBooking.cs b/pcss-client/Models/REST/EquipmentBooking.cs new file mode 100644 index 00000000..7908a977 --- /dev/null +++ b/pcss-client/Models/REST/EquipmentBooking.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + + public class EquipmentBooking + { + public string AppearanceId { get; set; } + public string CourtDivisionCd { get; set; } + public string ResourceId { get; set; } + public string BookingDt { get; set; } + public string BookingFromTm { get; set; } + public string BookingToTm { get; set; } + + public int? LocationId { get; set; } + public string LocationNm { get; set; } + + public string CourtRoomCd { get; set; } + + public string BookingCommentTxt { get; set; } + + public string CourtFileNumberTxt { get; set; } + public string BookedByNm { get; set; } + + //Only for edits + public string BookingId { get; set; } + public string BookingCcn { get; set; } + + //For the return values form the web service + public string ResponseMessageTxt { get; set; } + public string ResponseCd { get; set; } + } + + /// + /// Class to hold the search parameters for booking equipment + /// + public class EquipmentSearch + { + public string BookingDt { get; set; } + public string CourtDivisionCd { get; set; } + public string AssetTypeCd { get; set; } + public string BookingFromTm { get; set; } + public string BookingToTm { get; set; } + + public int? PrimaryLocationId { get; set; } + public string PrimaryCourtRoomCd { get; set; } + public int? SecondaryLocationId { get; set; } + public string SecondaryCourtRoomCd { get; set; } + } + + /// + /// For Equipment Search results + /// + public class Equipment + { + public int? LocationId { get; set; } + public string ResourceId { get; set; } + public string ResourceNm { get; set; } + public string AssetTypeCd { get; set; } + public string AssetUsageRuleCd { get; set; } + public string CommentTxt { get; set; } + public string PhoneNumberTxt { get; set; } + public List AvailableRooms { get; set; } + public List EquipmentBookings { get; set; } + } + + public class EquipmentSearchResults + { + //For the return values form the web service + public string AppearanceId { get; set; } + public string ResponseMessageTxt { get; set; } + public string ResponseCd { get; set; } + public List PrimaryResource { get; set; } + public List SecondaryResource { get; set; } + } + + +} \ No newline at end of file diff --git a/pcss-client/Models/REST/FileDetail.cs b/pcss-client/Models/REST/FileDetail.cs new file mode 100644 index 00000000..89f6f2b1 --- /dev/null +++ b/pcss-client/Models/REST/FileDetail.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class Ban + { + public string BanSeqNo { get; set; } + public string CommentTxt { get; set; } + public string BanTypeCd { get; set; } + public string BanTypeDsc { get; set; } + public string BanTypeAct { get; set; } + public string BanTypeSection { get; set; } + public string BanTypeSubSection { get; set; } + public string BanStatuteId { get; set; } + public string BanOrderDate { get; set; } + public string PartId { get; set; } + } + + public class AppearanceCount + { + public string AppearanceDate { get; set; } + public string ChargeTxt { get; set; } + public string ChargeDscTxt { get; set; } + public string CountNumber { get; set; } + public string Finding { get; set; } + public string AppearanceResult { get; set; } + public string ParticipantId { get; set; } + public List Sentences { get; set; } + } + + public class Sentence + { + public string AppearanceDate { get; set; } + public string Charge { get; set; } + public string CountNumber { get; set; } + public string Finding { get; set; } + public string ParticipantId { get; set; } + public string SntpCd { get; set; } + public string SentTermPeriodQty { get; set; } + public string SentTermCd { get; set; } + public string SentSubtermPeriodQty { get; set; } + public string SentSubtermCd { get; set; } + public string SentTertiaryTermPeriodQty { get; set; } + public string SentTertiaryTermCd { get; set; } + public string SentIntermittentYn { get; set; } + public string SentMonetaryAmt { get; set; } + public string SentDueTtpDt { get; set; } + public string SentEffectiveDt { get; set; } + public string SentDetailTxt { get; set; } + public string SentRecTxt { get; set; } + public string SentYcjaAdultYouthCd { get; set; } + public string SentCustodySecureYn { get; set; } + public List DocmIds { get; set; } + } + + public class Seal + { + public string SealTypeCd { get; set; } + public string SealTypeDsc { get; set; } + } + + public class Charge + { + public string SectionTxt { get; set; } + public string SectionDscTxt { get; set; } + } + + public class Crown + { + public string PartId { get; set; } + public string LastNm { get; set; } + public string GivenNm { get; set; } + public string AssignedYn { get; set; } + + } + + public class JustinCounsel + { + public string LastNm { get; set; } + public string GivenNm { get; set; } + public string CounselEnteredDt { get; set; } + public string CounselPartId { get; set; } + public string CounselRelatedRepTypeCd { get; set; } + public string CounselRrepId { get; set; } + } + + public class PcssCounsel + { + public int? CounselId { get; set; } + public int? LawSocietyId { get; set; } + public string LastNm { get; set; } + public string GivenNm { get; set; } + public string PrefNm { get; set; } + public string AddressLine1Txt { get; set; } + public string AddressLine2Txt { get; set; } + public string CityTxt { get; set; } + public string Province { get; set; } + public string PostalCode { get; set; } + public string PhoneNoTxt { get; set; } + public string EmailAddressTxt { get; set; } + public string ActiveYn { get; set; } + public string CounselType { get; set; } + public string OrgNm { get; set; } + } + + public class JcmComment + { + public int? JcmCommentId { get; set; } + public string JustinNo { get; set; } + public string PhysicalFileId { get; set; } + public string CommentTxt { get; set; } + public string EntDtm { get; set; } + public string UpdDtm { get; set;} + public string RotaInitialsCd { get; set; } + public string FullName { get; set; } + } + + public class CivilDocumentDetail + { + public string ImageId { get; set; } + public string CivilDocumentId { get; set; } + public string FileSeqNo { get; set; } + public string DocumentTypeCd { get; set; } + public string DocumentTypeDsc { get; set; } + public string OrderMadeDt { get; set; } + public string FiledDt { get; set; } + public string FiledByName { get; set; } + public string Category { get; set; } + public string CommentTxt { get; set; } + public string ConcludedYn { get; set; } + public bool? HasFutureAppearance { get; set; } + public string LastAppearanceDt { get; set; } + public string NextAppearanceDt { get; set; } + public string CeisAppearanceId { get; set; } + public string JcDocument { get; set; } + public string PageNumberTotal { get; set; } + public string SealedYN { get; set; } + public string SwornByNm { get;set;} + public string AffidavitNo { get;set;} + public IEnumerable DocumentSupport { get; set; } + public IEnumerable Issue { get; set; } + public IEnumerable ReferenceDocumentInterest { get;set; } + + } + + public class ReferenceDocumentInterest + { + public string PartyId { get;set; } + public string PartyName { get;set; } + public string NonPartyName { get;set; } + } + + public class DocumentSupport + { + public string ActCd { get; set; } + public string ActDsc { get; set; } + } + + public class Issue + { + public string IssueTypeCd { get; set; } + public string IssueNumber { get; set; } + public string IssueDsc { get; set; } + public string ConcludedYn { get; set; } + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/HearingRestriction.cs b/pcss-client/Models/REST/HearingRestriction.cs new file mode 100644 index 00000000..4118edf9 --- /dev/null +++ b/pcss-client/Models/REST/HearingRestriction.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public abstract class BaseHearingRestriction + { + public string HearingRestrictionId { get; set; } + public int? PcssHearingRestrictionId { get; set; } + public string AdjPartId { get; set; } + public string AdjFullNm { get; set; } + public string AdjInitialsTxt { get; set; } + public string HearingRestrictionTypeCd { get; set; } + public string HearingRestrictionTypeDsc { get; set; } + public string HearingRestrictionCcn { get; set; } + public string ResponseMessageTxt { get; set; } + public string ResponseCd { get; set; } + public string FileNoTxt { get; set; } + } + + public class CriminalHearingRestriction : BaseHearingRestriction + { + public string JustinNo { get; set; } + public string PartId { get; set; } + public string ProfSeqNo { get; set; } + public string PartNm { get; set; } + } + + public class CivilHearingRestriction : BaseHearingRestriction + { + public string PhysicalFileId { get; set; } + public string CivilDocumentId { get; set; } + public string ApplyToNm { get; set; } + } + + public class AppearanceAdjudicatorRestriction + { + public int? AppearanceAdjudicatorRestrictionId { get; set; } + public int? HearingRestrictionId { get; set; } + public string HearingRestrictionCd { get; set; } + public int? JudgeId { get; set; } + public string JudgesInitials { get; set; } + public string FileNoTxt { get; set; } + public string HearingRestrictionTxt { get; set; } + public bool HasIssue { get; set; } + } +} diff --git a/pcss-client/Models/REST/JudicialCalendar.cs b/pcss-client/Models/REST/JudicialCalendar.cs new file mode 100644 index 00000000..63bd9e82 --- /dev/null +++ b/pcss-client/Models/REST/JudicialCalendar.cs @@ -0,0 +1,245 @@ +using Newtonsoft.Json; +using PCSS.Infrastructure; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST.JudicialCalendar +{ + public class JudicialCalendar + { + public int Id { get; set; } + public string RotaInitials { get; set; } + public double ParticipantId { get; set; } + + public int HomeLocationId { get; set; } + public string HomeLocationName { get; set; } + + public string RegionCode { get; set; } + public int? WorkAreaSequenceNo { get; set; } + + public string LastName { get; set; } + public string Name { get; set; } + public string PositionTypeCode { get; set; } + public string PositionTypeDescription { get; set; } + public string PositionCode { get; set; } + public string PositionDescription { get; set; } + public string PositionStatusCode { get; set; } + public string PositionStatusDescription { get; set; } + public bool IsPresider { get; set; } + public bool IsJudge { get; set; } + public bool IsAdmin { get; set; } + + public JudicialCalendar() + { + this.Days = new List(); + } + + public List Days { get; set; } + public void AddDay(JudicialCalendarDay day) + { + day.JudgeId = this.Id; + this.Days.Add(day); + } + public JudicialCalendarDay GetDay(DateTime date) + { + JudicialCalendarDay item = this.Days.Find(d => d.Date.Equals(date.ToString(Constants.DATE_FORMAT), StringComparison.OrdinalIgnoreCase)); + if (item == null) + { + item = new JudicialCalendarDay(this.Id, date); + AddDay(item); + } + return item; + } + + public JudicialCalendarDay GetDay(String dateStr) + { + JudicialCalendarDay item = this.Days.Find(d => d.Date.Equals(dateStr, StringComparison.OrdinalIgnoreCase)); + if (item == null) + { + item = new JudicialCalendarDay(this.Id, DateTime.ParseExact(dateStr, Constants.DATE_FORMAT, CultureInfo.CurrentCulture)); + AddDay(item); + } + return item; + } + } + + public class JudicialCalendarDay + { + private JudicialCalendarAssignment _assignment; + private List _restrictions = new List(); + public int JudgeId { get; set; } + public string Date { get; set; } + + // these things can change from day to day.... + public string Name { get; set; } + public string LastName { get; set; } + public string PositionTypeCode { get; set; } + public string PositionTypeDescription { get; set; } + public string PositionCode { get; set; } + public string PositionDescription { get; set; } + public string PositionStatusCode { get; set; } + public string PositionStatusDescription { get; set; } + public bool IsPresider { get; set; } + public bool IsJudge { get; set; } + public bool IsAdmin { get; set; } + + public List Restrictions { get { return _restrictions; } } + public bool HasRestrictions { get { return Restrictions.Count > 0; } } + public bool HasAdjudicatorIssues { get { return Restrictions.Exists(x => x.HasIssue); } } + + public List HaveJudgeDetails { get; set; } + + public JudicialCalendarDay() { } + + public JudicialCalendarDay(int judgeId, DateTime date) + { + this.JudgeId = judgeId; + this.Date = date.ToString(Constants.DATE_FORMAT); + } + + public JudicialCalendarAssignment Assignment + { + get { return _assignment; } + set + { + value.JudgeId = this.JudgeId; + value.Date = this.Date; + this._assignment = value; + } + } + + public DateTime GetDate() + { + return DateTime.ParseExact(Date, Constants.DATE_FORMAT, CultureInfo.CurrentCulture); + } + + } + + public class JudicialCalendarAssignment + { + public int? Id { get; set; } + public int? TentativeScheduleId { get; set; } + public string TentativeScheduleName { get; set; } + + public int JudgeId { get; set; } + + public int? LocationId { get; set; } + public string LocationName { get; set; } + + public string Date { get; set; } + + public string ActivityCode { get; set; } + public string ActivityDisplayCode { get; set; } + public string ActivityDescription { get; set; } + public bool IsCommentRequired { get; set; } + + public string ActivityClassCode { get; set; } + public string ActivityClassDescription { get; set; } + + public string Comments { get; set; } + public bool IsVideo { get; set; } + public int? FromLocationId { get; set; } + public string FromLocationName { get; set; } + public bool IsExtraSeniorDay { get; set; } + + public bool Force { get; set; } // force this assignment regardless of GNSD or Weekend. + public bool IgnoreWeekendUpdate { get; set; } // don't validate GSND or weekend, as we won't save them... + + public JudicialCalendarActivity ActivityAm { get; set; } + public JudicialCalendarActivity ActivityPm { get; set; } + + [JsonProperty(PropertyName = "IsJj")] + public bool IsJJ { get; set; } + [JsonProperty(PropertyName = "IsPcj")] + public bool IsPCJ { get; set; } + [JsonProperty(PropertyName = "IsJp")] + public bool IsJP { get; set; } + [JsonProperty(PropertyName = "IsOther")] + public bool IsOther { get { return !(IsJJ || IsPCJ || IsJP || IsIAR); } } + [JsonProperty(PropertyName = "IsIar")] + public bool IsIAR { get { return !(IsJJ || IsPCJ || IsJP) && "IA" == this.ActivityCode; } } + [JsonIgnore] + public bool IsPublished { get; set; } + + // only used on save... + public bool RemoveFromActivityAm { get; set; } + public bool RemoveFromActivityPm { get; set; } + public string UpdateDate { get; set; } + + public string UpdateTime { get; set; } + public string UpdJcmInitials { get; set; } + } + public class JudicialCalendarActivity + { + public int CourtActivityId { get; set; } + public string ActivityCode { get; set; } + public string ActivityDescription { get; set; } + public string ActivityDisplayCode { get; set; } + public string ActivityClassCode { get; set; } + public string ActivityClassDescription { get; set; } + public string JudiciaryTypeCode { get; set; } + + public int LocationId { get; set; } + public string LocationName { get; set; } + public int? FromLocationId { get; set; } + public string FromLocationName { get; set; } + public string CourtRoomCode { get; set; } + public string CourtSittingCode { get; set; } + + public bool IsVideo { get { return this.FromLocationId != null && this.FromLocationId > 0; } } + public bool IsJJ { get { return "JJ" == this.JudiciaryTypeCode; } } + public bool IsPCJ { get { return "PCJ" == this.JudiciaryTypeCode; } } + public bool IsJP { get { return "JP" == this.JudiciaryTypeCode; } } + public bool IsOther { get { return !(IsJJ || IsPCJ || IsJP || IsIAR); } } + public bool IsIAR { get { return !(IsJJ || IsPCJ || IsJP) && "IA" == this.ActivityCode; } } + public bool IsWithinLookaheadWindow { get; set; } + + } + + public class Case + { + //Both + public string FileNumberTxt { get; set; } + public int LocationId { get; set; } + public string LocationNm { get; set; } + + public string NextApprDt { get; set; } + public string CourtDivisionCd { get; set; } + public List Participants { get; set; } + + //Criminal Only + public int? JustinNo { get; set; } + public double? ProfPartId { get; set; } + public double? ProfSeqNo { get; set; } + + //Civil Only + public double? PhysicalFileId { get; set; } + public double? CivilDocumentId { get; set; } + } + + public class Participant + { + public string FullName { get; set; } + public List Charges { get; set; } + } + + public class HaveJudgeResponse + { + + public int? HaveJudgeId { get; set; } + public int? JudiciaryPersonId { get; set; } + public int? JudicialScheduleId { get; set; } + public string RotaInitialsCd { get; set; } + public string FullNm { get; set; } + public int? LocationId { get; set; } + public string LocationNm { get; set; } + public DateTime CalendarDt { get; set; } + public string CourtSittingCd { get; set; } + public virtual string CourtSittingDsc { get; set; } + public string HaveJudgeTypeCd { get; set; } + public virtual string HaveJudgeTypeDsc { get; set; } + } +} diff --git a/pcss-client/Models/REST/OfferedDate.cs b/pcss-client/Models/REST/OfferedDate.cs new file mode 100644 index 00000000..fbf738ce --- /dev/null +++ b/pcss-client/Models/REST/OfferedDate.cs @@ -0,0 +1,19 @@ +using PCSS.Infrastructure; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class OfferedDate + { + public string DeclineRoleCd { get; set; } + public DateTime OfferedDt { get; set; } + public string DeclineReasonTxt { get; set; } + public int? JustinNo { get; set; } + public double? PhysicalFileId { get; set; } + + + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/Person.cs b/pcss-client/Models/REST/Person.cs new file mode 100644 index 00000000..74abf26a --- /dev/null +++ b/pcss-client/Models/REST/Person.cs @@ -0,0 +1,475 @@ +using PCSS.Infrastructure; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class Person + { + public int? Id { get; set; } + + public int? UserId { get; set; } + public double? ParticipantId { get; set; } + public int? HomeLocationId { get; set; } + public string HomeLocationName { get; set; } + + public string GenderTypeCode { get; set; } + public string GenderTypeDescription { get; set; } + public string MaritalStatusCode { get; set; } + public string MaritalStatusDescription { get; set; } + public string RotaInitials { get; set; } + public string JudicialNo { get; set; } + public string SocialInsuranceNo { get; set; } + public string EmployeeNo { get; set; } + public string ScheduleGeneratedDate { get; set; } + public string SchedulePublishedDate { get; set; } + + public Person() + { + this.Names = new List(); + this.Statuses = new List(); + this.Addresses = new List(); + this.Communications = new List(); + this.Contacts = new List(); + this.Entitlements = new List(); + this.HomeLocations = new List(); + } + + public List Names { get; set; } + public void AddName(PersonName item) + { + item.PersonId = this.Id; + if (item.Id != null && this.Names.Exists(x => x.Id != null && x.Id.Value == item.Id.Value)) + { + this.Names.RemoveAll(x => x.Id.Value == item.Id.Value); + } + List casted = this.Names.Cast().ToList(); + item.AddToList(casted); + this.Names = casted.Cast().ToList(); + } + + + public List Statuses { get; set; } + public void AddStatus(PersonStatus item) + { + item.PersonId = this.Id; + if (item.Id != null && this.Statuses.Exists(x => x.Id != null && x.Id.Value == item.Id.Value) ) + { + this.Statuses.RemoveAll(x => x.Id.Value == item.Id.Value); + } + List casted = this.Statuses.Cast().ToList(); + item.AddToList(casted); + this.Statuses = casted.Cast().ToList(); + } + + + + public List HomeLocations { get; set; } + public void AddHomeLocation(HomeLocation item) + { + item.PersonId = this.Id; + if (item.Id != null && this.HomeLocations.Exists(x => x.Id != null && x.Id.Value == item.Id.Value)) + { + this.HomeLocations.RemoveAll(x => x.Id.Value == item.Id.Value); + } + List casted = this.HomeLocations.Cast().ToList(); + item.PlaceInList(casted); + this.HomeLocations = casted.Cast().ToList(); + } + + + + public List Addresses { get; set; } + public void AddAddress(PersonAddress item) + { + item.PersonId = this.Id; + this.Addresses.Add(item); + } + + public List Communications { get; set; } + public void AddCommunication(PersonCommunication item) + { + item.PersonId = this.Id; + this.Communications.Add(item); + } + + public List Contacts { get; set; } + public void AddContact(PersonContact item) + { + item.PersonId = this.Id; + this.Contacts.Add(item); + } + + public List Entitlements { get; set; } + public void AddEntitlement(PersonEntitlement item) + { + item.PersonId = this.Id; + this.Entitlements.Add(item); + } + + + public string CurrentJudiciaryTypeCode { get; set; } + public string CurrentIsSenior { get; set; } + + public string CurrentEntitlementCalcType { get; set; } + public bool CurrentIsHours { get { return "H".Equals(CurrentEntitlementCalcType, StringComparison.OrdinalIgnoreCase); } } + } + public class PersonAddress + { + public int? Id { get; set; } + public int? PersonId { get; set; } + + public string AddressTypeCode { get; set; } + public string AddressTypeDescription { get; set; } + + public string AddressLine1 { get; set; } + public string AddressLine2 { get; set; } + public string PostalCode { get; set; } + public string PhoneNumber { get; set; } + public bool IsActive { get; set; } + + public int? CityId { get; set; } + public string CityName { get; set; } + + public virtual string ProvinceCode { get; set; } + public virtual string ProvinceDescription { get; set; } + + public int? CountryId { get; set; } + public string CountryName { get; set; } + + } + public class PersonContact + { + public int? Id { get; set; } + public int? PersonId { get; set; } + + public string RelationshipCode { get; set; } + public string RelationshipDescription { get; set; } + + public string ContactName { get; set; } + public string PhoneNumber { get; set; } + } + public class PersonEntitlement + { + public int? Id { get; set; } + public int? PersonId { get; set; } + + public double? Hours { get; set; } + public double? Days { get; set; } + + public string Title { get; set; } + + public string EffectiveDate { get; set; } + public string ExpiryDate { get; set; } + + public DateTime? GetEffectiveDate() + { + try + { + return DateTime.ParseExact(EffectiveDate, Constants.DATE_FORMAT, CultureInfo.CurrentCulture); + } + catch (Exception) + { + return null; + } + } + + public DateTime? GetExpiryDate() + { + try + { + return DateTime.ParseExact(ExpiryDate, Constants.DATE_FORMAT, CultureInfo.CurrentCulture); + } + catch (Exception) + { + return null; + } + } + } + public class PersonName : EffectiveRange + { + public int? Id { get; set; } + public int? PersonId { get; set; } + public string LastName { get; set; } + public string FirstName { get; set; } + public string Initials { get; set; } + } + public class PersonStatus : EffectiveRange + { + public int? Id { get; set; } + public int? PersonId { get; set; } + + // position status... + public int? PositionStatusId { get; set; } + //... position type + public int? PositionTypeId { get; set; } + public string PositionCode { get; set; } + public string PositionDescription { get; set; } + //... judiciary type + public string JudiciaryTypeCode { get; set; } + public string JudiciaryTypeDescription { get; set; } + //... status + public string StatusCode { get; set; } + public string StatusDescription { get; set; } + + public string InactiveReasonCode { get; set; } + public string InactiveReasonDescription { get; set; } + + public string EntitlementCalcType { get; set; } + public bool IsHours { get { return "H".Equals(EntitlementCalcType, StringComparison.OrdinalIgnoreCase); } } + } + public class PersonCommunication + { + public int? Id { get; set; } + public int? PersonId { get; set; } + public string CommunicationTypeCode { get; set; } + public string CommunicationTypeDescription { get; set; } + public string IdentifierText { get; set; } + public bool IsActive { get; set; } + } + + public class HomeLocation : EffectiveRange + { + public int? Id { get; set; } + public int? UserId { get; set; } + public int? PersonId { get; set; } + public int? LocationId { get; set; } + public string LocationName { get; set; } + } + + public interface IEffectiveRange + { + string EffectiveDate { get; set; } + string ExpiryDate { get; set; } + + DateTime EffDate { get; } + DateTime ExpDate { get; } + + bool IsEffective(DateTime date); + + void AddToList(List list); + } + + public class EffectiveRange: IEffectiveRange + { + private string _effectiveDate; + private string _expiryDate; + private DateTime _effDate = DateTime.MinValue; + private DateTime _expDate = DateTime.MaxValue; + private bool _effectiveValid = false; + + //Disable the warning for now. + #pragma warning disable 0414 + private bool _expiryValid = false; + #pragma warning restore 0414 + + + public string EffectiveDate + { + get { return _effectiveDate; } + set + { + _effDate = DateTime.MinValue; + _effectiveValid = false; + _effectiveDate = value; + if (IsValidDateFormat(_effectiveDate)) + { + _effDate = GetDate(_effectiveDate, DateTime.MinValue).Value; + _effectiveValid = true; + } + } + } + public string ExpiryDate + { + get { return _expiryDate; } + set + { + _expDate = DateTime.MaxValue; + _expiryValid = false; + _expiryDate = value; + if (IsValidDateFormat(_expiryDate)) + { + _expDate = GetDate(_expiryDate, DateTime.MaxValue).Value; + _expiryValid = true; + } + } + } + + + public DateTime EffDate { get { return _effDate; } } + public DateTime ExpDate { get { return _expDate; } } + + public bool IsEffective(DateTime date) + { + if (string.IsNullOrEmpty(EffectiveDate)) { return false; } + return date.Date.Ticks >= EffDate.Ticks && date.Date.Ticks <= ExpDate.Ticks; + } + + public void AddToList(List items) + { + if (!_effectiveValid) + return; + + if (items.Count > 0) + { + //do we predate existing???? + DateTime minEff = items.Min(x => x.EffDate); + if (this.EffDate.Ticks <= minEff.Ticks) + { + items.Clear(); + } + else + { + IEffectiveRange eff = items.Find(x => x.IsEffective(this.EffDate)); + DateTime exp = this.EffDate.Date.AddDays(-1); + eff.ExpiryDate = exp.ToString(Constants.DATE_FORMAT); + } + } + this.ExpiryDate = null; + items.Add(this); + } + + public void PlaceInList(List items) + { + // only use for home locations... + + // find the exact place where this range item would fit in... + if (!_effectiveValid) + return; + if (items.Count == 0) + { + items.Add(this); + } + else + { + // if this doesn't expire... wipe out any thing after this... + if (string.IsNullOrEmpty(this._expiryDate)) + { + items.RemoveAll(x => x.EffDate >= this.EffDate); + // also, find the one that is effective when this starts and expire it... + IEffectiveRange eff = items.FirstOrDefault(x => x.IsEffective(this.EffDate)); + if (eff != null) + { + DateTime exp = this.EffDate.Date.AddDays(-1); + eff.ExpiryDate = exp.ToString(Constants.DATE_FORMAT); + } + } + else + { + // has effective and expiry... + // remove any that completely fall in the range + items.RemoveAll(x => x.EffDate.Date >= this.EffDate.Date && x.ExpDate.Date <= this.ExpDate.Date); + + + IEffectiveRange er = items.FirstOrDefault(x => x.IsEffective(this.EffDate)); + if (er != null) + { + HomeLocation hl = (HomeLocation)er; + if (string.IsNullOrEmpty(er.ExpiryDate)) + { + items.Add(new HomeLocation() { ExpiryDate = null, EffectiveDate = this.ExpDate.Date.AddDays(1).ToString(Constants.DATE_FORMAT), LocationId = hl.LocationId, UserId = hl.UserId }); + } + else if (er.ExpDate.Date > this.ExpDate.Date) + { + items.Add(new HomeLocation() { ExpiryDate = er.ExpiryDate, EffectiveDate = this.ExpDate.Date.AddDays(1).ToString(Constants.DATE_FORMAT), LocationId = hl.LocationId, UserId = hl.UserId }); + } + + // make it end the day before this starts + DateTime d = this.EffDate.Date.AddDays(-1); + er.ExpiryDate = d.ToString(Constants.DATE_FORMAT); + } + + er = items.FirstOrDefault(x => x.IsEffective(this.ExpDate)); + if (er != null) + { + HomeLocation hl = (HomeLocation)er; + if (er.EffDate.Date < this.EffDate.Date) + { + items.Add(new HomeLocation() { ExpiryDate = this.EffDate.Date.AddDays(-1).ToString(Constants.DATE_FORMAT), EffectiveDate = er.EffectiveDate, LocationId = hl.LocationId, UserId = hl.UserId }); + } + + // make it start the day after this ends + DateTime d = this.ExpDate.Date.AddDays(1); + er.EffectiveDate = d.ToString(Constants.DATE_FORMAT); + } + } + items.Add(this); + } + } + + private DateTime? GetDate(string value, DateTime? defaultValue) + { + if (string.IsNullOrEmpty(value)) + { + return defaultValue; + } + + try + { + return DateTime.ParseExact(value, Constants.DATE_FORMAT, CultureInfo.CurrentCulture); + } + catch (Exception) + { + return defaultValue; + } + } + + private bool IsValidDateFormat(string value) + { + if (string.IsNullOrEmpty(EffectiveDate)) + { + return false; + } + if (GetDate(value, null) == null) + { + return false; + } + return true; + } + } + + + #region PersonSearchItem + + public class PersonSearchItem + { + public int PersonId { get; set; } + + public int UserId { get; set; } + public double? ParticipantId { get; set; } + + public int HomeLocationId { get; set; } + public string HomeLocationName { get; set; } + public string RegionCode { get; set; } + public string RegionDescription { get; set; } + public int WorkAreaSeqNo { get; set; } + public string WorkAreaDescription { get; set; } + + public string RotaInitials { get; set; } + + public string LastName { get; set; } + public string FirstName { get; set; } + public string Initials { get; set; } + public string FullName { get; set; } + + public string JudiciaryTypeCode { get; set; } + public string JudiciaryTypeDescription { get; set; } + public string PositionCode { get; set; } + public string PositionDescription { get; set; } + public string StatusCode { get; set; } + public string StatusDescription { get; set; } + + public string InactiveReasonCode { get; set; } + public string InactiveReasonDescription { get; set; } + + public bool IsNonStatus { get; set; } + + public string ScheduleGeneratedDate { get; set; } + public string SchedulePublishedDate { get; set; } + } + #endregion + +} \ No newline at end of file diff --git a/pcss-client/Models/REST/PersonalAvailability.cs b/pcss-client/Models/REST/PersonalAvailability.cs new file mode 100644 index 00000000..35993df4 --- /dev/null +++ b/pcss-client/Models/REST/PersonalAvailability.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class PersonnelAvailability + { + public string PartId { get; set; } + public string FullNm { get; set; } + public string AvailabilityCd { get; set; } + public string AvailabilityDsc { get; set; } + public int? AvailabilityWeightFactorCd { get; set; } + public DateTime? Date { get; set; } + public string DateStr { get; set;} + public string PersonTypeCd { get; set; } + + //task 2651 - extend personnel availability to include commitments/counts + public List Commitments { get; set; } + + public PersonnelAvailability() + { + Commitments = new List(); + } + + public string PinCodeTxt { get; set; } + public string AgencyDsc { get; set; } + public string AgencyCd { get; set; } + + public string CCSSAvailabilityCode { get; set; } + public string CCSSAvailabilityNoteToJCM { get; set; } + + public static string ConvertToShortDesc(string ccssAvailCode) + { + if (ccssAvailCode == "AVAILABLE_ALL") return "A"; + if (ccssAvailCode == "AVAILABLE_AM") return "AA"; + if (ccssAvailCode == "AVAILABLE_PM") return "AP"; + if (ccssAvailCode == "LIMITED") return "LA"; + return "NA"; + } + } + + public class PersonnelCommitment : Commitment { + public string CommitmentCount { get; set; } + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/PoliceAgencyUpdate.cs b/pcss-client/Models/REST/PoliceAgencyUpdate.cs new file mode 100644 index 00000000..d2b3066b --- /dev/null +++ b/pcss-client/Models/REST/PoliceAgencyUpdate.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace PCSS.Models.REST +{ + public class PoliceAgencyUpdate + { + public double AgenId { get; set; } + public string AgenAgencyNm { get; set; } + public string AgenAgencyIdentifierCd { get; set; } + } +} diff --git a/pcss-client/Models/REST/ScheduleEvent.cs b/pcss-client/Models/REST/ScheduleEvent.cs new file mode 100644 index 00000000..a6de9404 --- /dev/null +++ b/pcss-client/Models/REST/ScheduleEvent.cs @@ -0,0 +1,343 @@ +using PCSS.Infrastructure; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class Accused + { + public double? ProfSeqNo { get; set; } + public double? PartId { get; set; } + + public string LastNm { get; set; } + + public string GivenNm { get; set; } + + public string OrgNm { get; set; } + + public string InCustodyYn { get; set; } + + public string WarrantYn { get; set; } + + public string BirthDt { get; set; } + + public object Charge { get; set; } + } + + public class CivilDocument + { + public string CivilDocumentId { get; set; } + + public string FileSeqNo { get; set; } + + public string DocumentTypeCd { get; set; } + + public string DocumentTypeDsc { get; set; } + + public string FiledDt { get; set; } + + public string ConcludedYn { get; set; } + + public bool Selected { get; set; } + } + + public class CivilParty + { + public double? PartyId { get; set; } + + public string LastNm { get; set; } + + public string GivenNm { get; set; } + + public string OrgNm { get; set; } + + public string RoleTypeCd { get; set; } + + public string RoleTypeDesc { get; set; } + + public bool Selected { get; set; } + } + + public abstract class AbstractScheduleEvent + { + //Used in most cases except for TBA special processing when we need to create the activity on the fly + public int CourtActivitySlotId { get; set; } + + //Only used when the slot is -1 and looking at TBA + public string ActivityCd { get; set; } + public string AppearanceDt { get; set; } + public int LocationId { get; set; } + + //Rest is used as appropriate + public double EstimatedQty { get; set; } + public string EstimatedUnitCd { get; set; } + public string AppearanceTm { get; set; } + public string AppearanceReasonCd { get; set; } + + public string ActivityClassCd { get; set; } + + public string ScheduleNoteTxt { get; set; } + + public string TentativeYn { get; set; } + public string TentativeExpiryDt { get; set; } + + public string SupplementalEquipmentTxt { get; set; } + public string SecurityRestrictionTxt { get; set; } + public string OutOfTownJudgeTxt { get; set; } + + public string BulkLoadFlag { get; set; } + + public dynamic EditAppearanceSupportingData { get; set; } + + //Logging features + public string SearchedForDate { get; set; } + public double? WitnessScore { get; set; } + public double? CapacityScore { get; set; } + + public string FileNumberTxt { get; set; } + + public virtual List Validate() + { + var errors = new List(); + DateTime dt; + + if (CourtActivitySlotId == 0) + { + errors.Add("Court Activity Slot cannot be 0"); + } + if (String.IsNullOrEmpty(AppearanceReasonCd)) + { + errors.Add("AppearanceReasonCd cannot be null or empty"); + } + if (String.IsNullOrEmpty(TentativeYn) || !(Constants.Y_N.Contains(TentativeYn))) + { + errors.Add("TentativeYn must be Y or N"); + } + if (!DateTime.TryParseExact(AppearanceTm, Constants.TIME_FORMAT, CultureInfo.InvariantCulture, DateTimeStyles.None, out dt)) + { + errors.Add("AppearanceTm must be in the format " + Constants.TIME_FORMAT); + } + if (TentativeYn == "Y" && !DateTime.TryParseExact(TentativeExpiryDt, Constants.DATE_FORMAT, CultureInfo.InvariantCulture, DateTimeStyles.None, out dt)) + { + errors.Add("TentativeExpiryDt must be in the format " + Constants.DATE_FORMAT); + } + if (String.IsNullOrEmpty(ActivityClassCd) || !(new string[] { "R", "I", "F" }.Contains(ActivityClassCd))) + { + errors.Add("ActivityClassCd must be R, I, or F"); + } + + return errors; + } + } + + /// + /// Rest api model for setting the date for a criminal file + /// + public class CriminalScheduleEvent: AbstractScheduleEvent + { + public int? JustinNo { get; set; } + public IList Accused { get; set; } + + public string BulkLoadJustinApprID { get; set; } + public List HearingRestrictions { get; set; } + + public override List Validate() + { + var errors = base.Validate(); + + if (JustinNo == null) + { + errors.Add("JustinNo is required"); + } + + if (TentativeYn == "N") + { + if (Accused == null || !Accused.Any()) + { + errors.Add("Accused is required"); + } + else if (Accused.Any(x => x.PartId == null || x.ProfSeqNo == null)) + { + errors.Add("PartId and ProfSeqNo is required for every accused"); + } + } + return errors; + } + } + + /// + /// Rest api model for setting the date for a criminal file + /// + public class CivilScheduleEvent : AbstractScheduleEvent + { + public string PcssCourtDivisionCd { get; set; } //Bug 2562 - ui is setting this to the proper class cd, so let's accept it and use it. + + public double? PhysicalFileId { get; set; } + public IList Documents { get; set; } + public IList Parties { get; set; } + public List HearingRestrictions { get; set; } + public string BulkLoadCeisApprID { get; set; } + + public override List Validate() + { + var errors = base.Validate(); + + if (PhysicalFileId == null) + { + errors.Add("PhysicalFileId is required"); + } + + if (TentativeYn == "N") + { + if (Documents == null || !Documents.Any()) + { + errors.Add("Documents is required"); + } + else if (Documents.Any(x => String.IsNullOrEmpty(x.CivilDocumentId))) + { + errors.Add("CivilDocumentId is required for every document"); + } + + if (Parties == null || !Parties.Any()) + { + errors.Add("Parties is required"); + } + else if (Parties.Any(x => x.PartyId == null)) + { + errors.Add("PartyId is required for every party"); + } + } + return errors; + + + } + } + + public class SchedulingEvents + { + //Only used for TBA activities + public string ActivityCd { get; set; } + public int LocationId { get; set; } + + public List criminalFiles { get; set; } + public List civilFiles { get; set; } + + public List Validate() + { + var errorList = new List(); + + if (criminalFiles == null && civilFiles == null) + { + errorList.Add("Both the criminal and civil file list is null"); + //Stop here + return errorList; + } + + if ((criminalFiles != null && !criminalFiles.Any()) + && (civilFiles != null && !civilFiles.Any())) + { + errorList.Add("Both the criminal and civil file list is empty"); + //Stop here + return errorList; + } + + if ((criminalFiles != null && criminalFiles.Any()) + && (civilFiles != null && civilFiles.Any())) + { + errorList.Add("Both the criminal and civil file list have items. Only one is supported at a time"); + //Stop here + return errorList; + } + + if (criminalFiles != null) + { + foreach (var file in criminalFiles) + { + errorList.AddRange(file.Validate()); + } + } + + if (civilFiles != null) + { + foreach (var file in civilFiles) + { + errorList.AddRange(file.Validate()); + } + } + + return errorList; + } + } + + public class AssignmentListScheduling + { + public int? CourtActivityId { get; set; } + public string CourtRoomCd { get; set; } + public int PcssAppearanceId { get; set; } + public string TrialTrackerCd { get; set; } + public double? EstimatedQty { get; set; } + public string EstimatedUnitCd { get; set; } + public string AppearanceReasonCd { get; set; } + public string JcmComments { get; set; } + } + + public class AssignmentListSchedulingEmail + { + public int CourtActivityId { get; set; } + public string CourtRoomCd { get; set; } + public string JcmComments { get; set; } + public string AppearanceReasonCd { get; set; } + public string AdjToPCJYn { get; set; } + public List Appearances { get; set; } + } + + public class JustinCeisSchedulingResponseDetail + { + public string PcssAppearanceId { get; set; } + public string AppearanceId { get; set; } + public string AppearanceCcn { get; set; } + public int? LocationId { get; set; } + public string JustinNo { get; set; } + public string PhysicalFileId { get; set; } + public string ProfSeqNo { get; set; } + public string ProfPartId { get; set; } + public string ActivityClassCd { get; set; } + } + + public class JustinCeisSchedulingResponse + { + public string ResponseCd { get; set; } + public string ResponseMessageTxt { get; set; } + public List Details { get; set; } + public override string ToString() + { + var detailsStr = ""; + if (Details != null) + { + foreach (var detail in Details) + { + if (!string.IsNullOrWhiteSpace(detailsStr)) { + detailsStr = detailsStr + ","; + } + detailsStr = detailsStr + string.Format(" PCSS AppearanceId = {0}, Justin/Ceis Id = {1} ", detail.PcssAppearanceId, detail.AppearanceId); + } + } + return string.Format("JustinCeisSchedulingResponse - {0} - {1} [{2}]", ResponseCd, ResponseMessageTxt, detailsStr); + } + } + + public class AlternativeCourtRoom + { + public int CourtActivitySlotId { get; set; } + public string CourtRoomCd { get; set; } + public string ActivityCd { get; set; } + public string ActivityDisplayCd { get; set; } + public string ActivityDsc { get; set; } + public string RotaInitialsCd { get; set; } + public string CourtSittingTypeCd { get; set; } + public string AssignmentListRoomYn { get; set; } + } +} \ No newline at end of file diff --git a/pcss-client/Models/REST/ScheduleSlot.cs b/pcss-client/Models/REST/ScheduleSlot.cs new file mode 100644 index 00000000..281233fb --- /dev/null +++ b/pcss-client/Models/REST/ScheduleSlot.cs @@ -0,0 +1,88 @@ +using PCSS.Infrastructure; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace PCSS.Models.REST +{ + public class ScheduleSlotRoom + { + public int? Id { get; set; } + public string CourtRoomCode { get; set; } + public bool IsAssignmentListRoom{ get; set;} + + public ScheduleSlotRoom() + { + } + public ScheduleSlotRoom(int? id, string courtRoomCode, bool isAssignmentListRoom) + { + this.Id = id; + this.CourtRoomCode = courtRoomCode; + this.IsAssignmentListRoom = isAssignmentListRoom; + } + } + + public class ScheduleSlotTime + { + public string StartTime { get; set; } + public List Rooms { get; set; } + + public ScheduleSlotTime() + { + this.Rooms = new List(); + } + } + + public class ScheduleSlotSitting + { + public string CourtSittingCode { get; set; } + public List Times { get; set; } + + public ScheduleSlotSitting() + { + this.Times = new List(); + } + } + + public class ScheduleSlotActivity + { + public string ActivityCode { get; set; } + public string ActivityDescription { get; set; } + public string ActivityClassCode { get; set; } + public string ActivityClassDescription { get; set; } + public string CapacityConstraintCode { get; set; } + public List Sittings { get; set; } + + public ScheduleSlotActivity() + { + this.Sittings = new List(); + } + } + + public class ScheduleSlotDay + { + public string Date { get; set; } + public List Activities { get; set; } + + public ScheduleSlotDay(DateTime date) + { + this.Date = date.ToString(Constants.DATE_FORMAT); + this.Activities = new List(); + } + } + + public class ScheduleSlotLocation + { + public int Id { get; set; } + public string Name { get; set; } + public List Days { get; set; } + + public ScheduleSlotLocation(int id, string name) + { + this.Id = id; + this.Name = name; + this.Days = new List(); + } + } +} \ No newline at end of file diff --git a/pcss-client/Models/UserLoginInfo.cs b/pcss-client/Models/UserLoginInfo.cs new file mode 100644 index 00000000..41830e92 --- /dev/null +++ b/pcss-client/Models/UserLoginInfo.cs @@ -0,0 +1,17 @@ +namespace PCSS.Models +{ + public class UserLoginInfo + { + public string TemporaryAccessGUID { get; set; } + public string GivenName { get; set; } + public string Surname { get; set; } + + public string GUID { get; set; } + public string AuthorizationDirectory { get; set; } + public string AccountName { get; set; } + + public double ParticipantId { get; set; } + + public string Name { get { return string.Format("{0} {1}", GivenName, Surname); } } + } +} \ No newline at end of file diff --git a/pcss-client/Readme.txt b/pcss-client/Readme.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/pcss-client/Readme.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pcss-client/pcss-client.csproj b/pcss-client/pcss-client.csproj new file mode 100644 index 00000000..fee4f5ff --- /dev/null +++ b/pcss-client/pcss-client.csproj @@ -0,0 +1,23 @@ + + + + net8.0 + pcss_client + enable + enable + + + + + + + true + + + + + + + + + diff --git a/tests/api/Controllers/DashboardControllerTests.cs b/tests/api/Controllers/DashboardControllerTests.cs new file mode 100644 index 00000000..4c3eaacc --- /dev/null +++ b/tests/api/Controllers/DashboardControllerTests.cs @@ -0,0 +1,70 @@ +using System; +using System.Linq; +using System.Security.Claims; +using JCCommon.Clients.FileServices; +using JCCommon.Clients.LocationServices; +using JCCommon.Clients.LookupCodeServices; +using Microsoft.Extensions.Logging; +using LazyCache; +using MapsterMapper; +using Scv.Api.Controllers; +using Scv.Api.Helpers; +using Scv.Api.Services; +using tests.api.Helpers; +using Xunit; +using System.Threading; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; + +namespace tests.api.Controllers +{ + public class DashboardControllerTests + { + #region Variables + + private readonly DashboardController _controller; + + private ClaimsIdentity _identity; + + #endregion Variables + + #region Constructor + + public DashboardControllerTests() + { + var fileServices = new EnvironmentBuilder("FileServicesClient:Username", "FileServicesClient:Password", "FileServicesClient:Url"); + var lookupServices = new EnvironmentBuilder("LookupServicesClient:Username", "LookupServicesClient:Password", "LookupServicesClient:Url"); + var locationServices = new EnvironmentBuilder("LocationServicesClient:Username", "LocationServicesClient:Password", "LocationServicesClient:Url"); + var pcssServices = new EnvironmentBuilder("PCSSServicesClient:Username", "PCSSServicesClient:Password", "PCSSServicesClient:Url"); + + var lookupServiceClient = new LookupCodeServicesClient(lookupServices.HttpClient); + var locationServiceClient = new LocationServicesClient(locationServices.HttpClient); + // var pcssServiceClient = new PCSSServicesClient(locationServices.HttpClient); + + var fileServicesClient = new FileServicesClient(fileServices.HttpClient); + var lookupService = new LookupService(lookupServices.Configuration, lookupServiceClient, new CachingService()); + // var pcssService = new PCSSService(pcssServices.Cosnfiguration, pcssServiceClient, new CachingService()); + var locationService = new LocationService(locationServices.Configuration, locationServiceClient, new CachingService()); + + var claims = new[] { + new Claim(CustomClaimTypes.ApplicationCode, "SCV"), + new Claim(CustomClaimTypes.JcParticipantId, fileServices.Configuration.GetNonEmptyValue("Request:PartId")), + new Claim(CustomClaimTypes.JcAgencyCode, fileServices.Configuration.GetNonEmptyValue("Request:AgencyIdentifierId")), + new Claim(CustomClaimTypes.IsSupremeUser, "True"), + }; + _identity = new ClaimsIdentity(claims, "Cookies"); + var principal = new ClaimsPrincipal(_identity); + + //var assignmentService = new AssignmentService(fileServices.Configuration, fileServices.LogFactory.CreateLogger(), fileServicesClient, new Mapper(), lookupService, locationService,null, new CachingService(), principal); + //_controller = new DashboardController(assignmentService, locationService, null, null) + //{ + // ControllerContext = HttpResponseTest.SetupMockControllerContext(fileServices.Configuration) + //}; + } + + #endregion Constructor + + + + } +} diff --git a/web/package-lock.json b/web/package-lock.json index 3f901b78..4b3526ed 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1458,8 +1458,7 @@ "@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" }, "@types/keyv": { "version": "3.1.4", @@ -2665,7 +2664,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2682,8 +2680,7 @@ "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==" }, "alphanum-sort": { "version": "1.0.2", @@ -3121,6 +3118,19 @@ "loader-utils": "^2.0.4", "make-dir": "^3.1.0", "schema-utils": "^2.6.5" + }, + "dependencies": { + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + } } }, "babel-plugin-dynamic-import-node": { @@ -3253,8 +3263,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.3.0", @@ -3632,6 +3641,17 @@ "emojis-list": "^3.0.0", "json5": "^1.0.1" } + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } } } }, @@ -4714,6 +4734,17 @@ "source-map": "^0.6.1" } }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + }, "semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -5528,8 +5559,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": "2.0.0", @@ -6406,8 +6436,7 @@ "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { "version": "2.2.7", @@ -6449,8 +6478,7 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", @@ -6520,6 +6548,17 @@ "emojis-list": "^3.0.0", "json5": "^1.0.1" } + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } } } }, @@ -8441,8 +8480,7 @@ "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -8459,8 +8497,7 @@ "json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==" }, "jsonfile": { "version": "6.1.0", @@ -8631,7 +8668,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, "requires": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -11506,8 +11542,7 @@ "punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" }, "q": { "version": "1.5.1", @@ -12342,6 +12377,17 @@ "json5": "^1.0.1" } }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + }, "semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -12356,13 +12402,12 @@ "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" }, "schema-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", - "dev": true, + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "requires": { - "@types/json-schema": "^7.0.5", - "ajv": "^6.12.4", + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" } }, @@ -13279,6 +13324,15 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "style-loader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-2.0.0.tgz", + "integrity": "sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ==", + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + } + }, "stylehacks": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", @@ -14339,7 +14393,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "requires": { "punycode": "^2.1.0" } @@ -14407,6 +14460,17 @@ "emojis-list": "^3.0.0", "json5": "^1.0.1" } + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } } } }, @@ -14633,6 +14697,11 @@ "loader-utils": "^2.0.0" } }, + "vue-month-picker": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/vue-month-picker/-/vue-month-picker-1.7.2.tgz", + "integrity": "sha512-Wov461A/Xk+h2ktfjQHeqCYMk9sRvmBL1uFxOzRTa2XiiUA5L6Cv8QZ0EvlXxkeM2EkmhltnidgWVCUEi9lXYg==" + }, "vue-property-decorator": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-8.5.1.tgz", diff --git a/web/package.json b/web/package.json index 7f37c339..fc7f1b00 100644 --- a/web/package.json +++ b/web/package.json @@ -45,7 +45,9 @@ "@fullcalendar/interaction": "^6.1.15", "@fullcalendar/vue": "^6.1.15", "@fullcalendar/daygrid": "^6.1.15", - "@fullcalendar/timegrid": "^6.1.15" + "@fullcalendar/timegrid": "^6.1.15", + "style-loader": "^2.0.0", + "vue-month-picker": "^1.7.2" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.34.0", @@ -95,4 +97,4 @@ "last 2 versions", "not ie <= 8" ] -} +} \ No newline at end of file diff --git a/web/src/assets/arrow-down.svg b/web/src/assets/arrow-down.svg new file mode 100644 index 00000000..4aa3d556 --- /dev/null +++ b/web/src/assets/arrow-down.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/web/src/assets/arrow-left.svg b/web/src/assets/arrow-left.svg new file mode 100644 index 00000000..851bb564 --- /dev/null +++ b/web/src/assets/arrow-left.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/web/src/assets/arrow-right.svg b/web/src/assets/arrow-right.svg new file mode 100644 index 00000000..43b28f07 --- /dev/null +++ b/web/src/assets/arrow-right.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/web/src/assets/arrow-up.svg b/web/src/assets/arrow-up.svg new file mode 100644 index 00000000..73657ad9 --- /dev/null +++ b/web/src/assets/arrow-up.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/web/src/assets/calendar-select.svg b/web/src/assets/calendar-select.svg new file mode 100644 index 00000000..2a7f24e4 --- /dev/null +++ b/web/src/assets/calendar-select.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/web/src/assets/filters.svg b/web/src/assets/filters.svg new file mode 100644 index 00000000..97e16b2b --- /dev/null +++ b/web/src/assets/filters.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/web/src/assets/more3dots.svg b/web/src/assets/more3dots.svg new file mode 100644 index 00000000..e8e5dde6 --- /dev/null +++ b/web/src/assets/more3dots.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/web/src/assets/print-icon.svg b/web/src/assets/print-icon.svg new file mode 100644 index 00000000..b7af4b92 --- /dev/null +++ b/web/src/assets/print-icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/web/src/assets/today-list.svg b/web/src/assets/today-list.svg new file mode 100644 index 00000000..c427b81c --- /dev/null +++ b/web/src/assets/today-list.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + diff --git a/web/src/assets/up-down.svg b/web/src/assets/up-down.svg new file mode 100644 index 00000000..2f422331 --- /dev/null +++ b/web/src/assets/up-down.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/web/src/assets/video.svg b/web/src/assets/video.svg new file mode 100644 index 00000000..b8627bd8 --- /dev/null +++ b/web/src/assets/video.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/web/src/components/NavigationTopbar.vue b/web/src/components/NavigationTopbar.vue index 3a3c5f64..8184da55 100644 --- a/web/src/components/NavigationTopbar.vue +++ b/web/src/components/NavigationTopbar.vue @@ -24,7 +24,7 @@
  • - Dashboard + Dashboard
  • Court Calendar diff --git a/web/src/components/calendar/Calendar.vue b/web/src/components/calendar/Calendar.vue new file mode 100644 index 00000000..b407b8fa --- /dev/null +++ b/web/src/components/calendar/Calendar.vue @@ -0,0 +1,565 @@ + + + diff --git a/web/src/components/dashboard/Dashboard.vue b/web/src/components/dashboard/Dashboard.vue index 054bfa4b..3a2abede 100644 --- a/web/src/components/dashboard/Dashboard.vue +++ b/web/src/components/dashboard/Dashboard.vue @@ -11,27 +11,301 @@
-
Calendar
-
-
 
-
 
+
+ +
+
+
+
+ + + + + + + + + +
+ +
+ + + + + + + All Persiders + + + + + +
+
+ + + + + + + All Activities + + + + + +
+
+ + Show sitting activities + +
+
+ + Show non-sitting activities + +
+ +
+ + + +
+ + +
+
+ +
+
+
 
+
 
+
+
+
-
Reserved Judgement (4)
+
Reserved Judgement (5)
Reserved Judgement (5)
+ +
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ +
+
+ +
+
+ +
+
+ - \ No newline at end of file diff --git a/web/web.njsproj b/web/web.njsproj index ae59ad3f..172ee2eb 100644 --- a/web/web.njsproj +++ b/web/web.njsproj @@ -57,6 +57,14 @@ + + + + + + + +