diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 76aae6130d..c31aa775e5 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -2,7 +2,7 @@
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
-* @devinleighsmith @jdtoombs @asanchezr @rpbcg @FuriousLlama @rafaelponcedeleon @stairaku
+* @devinleighsmith @asanchezr @FuriousLlama @stairaku @Maheshbabu28
# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
diff --git a/Makefile b/Makefile
index 26abc51204..17eca16787 100644
--- a/Makefile
+++ b/Makefile
@@ -185,7 +185,11 @@ start-infra: ## Starts infrastructure containers (e.g. keycloak, database, geose
@echo "$(P) Starting up infrastructure containers..."
@"$(MAKE)" start n="keycloak database geoserver"
-start up: ## Runs the local containers (n=service name)
+start: ## Starts the local containers (n=service name)
+ @echo "$(P) Starting client and server containers..."
+ @docker-compose start $(n)
+
+up: ## Runs the local containers (n=service name)
@echo "$(P) Running client and server..."
@docker-compose up -d --no-recreate $(n)
diff --git a/auth/keycloak/Dockerfile b/auth/keycloak/Dockerfile
index 010b10e4ee..71a90ab025 100644
--- a/auth/keycloak/Dockerfile
+++ b/auth/keycloak/Dockerfile
@@ -1,7 +1,7 @@
# >docker build -t keycloak .
# >docker run --env-file=../../.env -d keycloak
# https://hub.docker.com/r/jboss/keycloak/
-FROM jboss/keycloak:11.0.0
+FROM jboss/keycloak:16.1.1
EXPOSE 8080
diff --git a/backend/Pims.sln b/backend/Pims.sln
index c51c92af96..b2365f8c86 100644
--- a/backend/Pims.sln
+++ b/backend/Pims.sln
@@ -58,7 +58,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Geocoder", "geocoder\P
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Ltsa", "ltsa\Pims.Ltsa.csproj", "{1ED5DF03-7784-44EC-B02B-516167210CCF}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pims.Dal.Mock.Test", "tests\unit\mockdal\Pims.Dal.Mock.Test.csproj", "{2C31E92C-9C95-45FF-9F95-928C2962F37D}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal.Mock.Test", "tests\unit\mockdal\Pims.Dal.Mock.Test.csproj", "{2C31E92C-9C95-45FF-9F95-928C2962F37D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Av", "clamav\Pims.Av.csproj", "{16C06BDA-112F-4D04-82FF-0BBE45072372}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -214,6 +216,18 @@ Global
{2C31E92C-9C95-45FF-9F95-928C2962F37D}.Release|x64.Build.0 = Release|Any CPU
{2C31E92C-9C95-45FF-9F95-928C2962F37D}.Release|x86.ActiveCfg = Release|Any CPU
{2C31E92C-9C95-45FF-9F95-928C2962F37D}.Release|x86.Build.0 = Release|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Debug|x64.Build.0 = Debug|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Debug|x86.Build.0 = Debug|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Release|Any CPU.Build.0 = Release|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Release|x64.ActiveCfg = Release|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Release|x64.Build.0 = Release|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Release|x86.ActiveCfg = Release|Any CPU
+ {16C06BDA-112F-4D04-82FF-0BBE45072372}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -232,6 +246,7 @@ Global
{BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
{1ED5DF03-7784-44EC-B02B-516167210CCF} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
{2C31E92C-9C95-45FF-9F95-928C2962F37D} = {3D70B211-74A8-484C-9B86-B0A2835C71E7}
+ {16C06BDA-112F-4D04-82FF-0BBE45072372} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3433C5DD-DC49-4A96-A1AE-90C1A1EBA87C}
diff --git a/backend/api/Areas/Notes/Controllers/NoteController.cs b/backend/api/Areas/Notes/Controllers/NoteController.cs
index c81bfeeed1..893e545945 100644
--- a/backend/api/Areas/Notes/Controllers/NoteController.cs
+++ b/backend/api/Areas/Notes/Controllers/NoteController.cs
@@ -1,4 +1,5 @@
+using System.Collections.Generic;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
@@ -8,7 +9,6 @@
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Dal.Security;
-using System.Collections.Generic;
using Swashbuckle.AspNetCore.Annotations;
namespace Pims.Api.Areas.Notes.Controllers
@@ -64,12 +64,12 @@ public IActionResult AddNote(NoteType type, [FromBody] EntityNoteModel noteModel
}
///
- /// Get the notes for the specified type and entity id.
+ /// Gets a collection of notes for the specified type and owner id.
///
/// Used to identify note type.
/// Used to identify note's parent entity.
///
- [HttpGet("{type}/{entityId}")]
+ [HttpGet("{type}/owner/{entityId:long}")]
[Produces("application/json")]
[HasPermission(Permissions.NoteView)]
[ProducesResponseType(typeof(IEnumerable), 200)]
@@ -81,18 +81,53 @@ public IActionResult GetNotes(NoteType type, long entityId)
return new JsonResult(mappedNotes);
}
+ ///
+ /// Retrieves the note with the specified id.
+ ///
+ /// Used to identify note type.
+ /// Used to identify the note.
+ ///
+ [HttpGet("{type}/{noteId:long}")]
+ [Produces("application/json")]
+ [HasPermission(Permissions.NoteView)]
+ [ProducesResponseType(typeof(NoteModel), 200)]
+ [SwaggerOperation(Tags = new[] { "note" })]
+ public IActionResult GetNoteById(NoteType type, long noteId)
+ {
+ var note = _noteService.GetById(noteId);
+ return new JsonResult(note);
+ }
+
+ ///
+ /// Updates the note with the specified id.
+ ///
+ /// Used to identify note type.
+ /// Used to identify the note.
+ /// The updated note values.
+ ///
+ [HttpPut("{type}/{noteId:long}")]
+ [Produces("application/json")]
+ [HasPermission(Permissions.NoteEdit)]
+ [ProducesResponseType(typeof(NoteModel), 200)]
+ [SwaggerOperation(Tags = new[] { "note" })]
+ public IActionResult UpdateNote(NoteType type, long noteId, [FromBody] NoteModel noteModel)
+ {
+ var updatedNote = _noteService.Update(noteModel);
+ return new JsonResult(updatedNote);
+ }
+
///
/// Deletes the note for the specified type.
///
/// Used to identify note type.
/// Used to identify the note and delete it.
///
- [HttpDelete("{type}/{noteId}")]
+ [HttpDelete("{type}/{noteId:long}")]
[Produces("application/json")]
[HasPermission(Permissions.NoteDelete)]
[ProducesResponseType(typeof(bool), 200)]
[SwaggerOperation(Tags = new[] { "note" })]
- public IActionResult DeleteNote(NoteType type, int noteId)
+ public IActionResult DeleteNote(NoteType type, long noteId)
{
_noteService.DeleteNote(type, noteId);
return new JsonResult(true);
diff --git a/backend/api/Areas/Property/Controllers/PropertyController.cs b/backend/api/Areas/Property/Controllers/PropertyController.cs
index 87ab2bc7c4..3cd0de7606 100644
--- a/backend/api/Areas/Property/Controllers/PropertyController.cs
+++ b/backend/api/Areas/Property/Controllers/PropertyController.cs
@@ -78,17 +78,17 @@ public IActionResult GetProperty(int id)
}
///
- /// Get the property associations for the specified unique 'pid'.
+ /// Get the property associations for the specified unique 'id'.
///
///
- [HttpGet("{pid}/associations")]
+ [HttpGet("{id}/associations")]
[HasPermission(Permissions.PropertyView)]
[Produces("application/json")]
[ProducesResponseType(typeof(PropertyAssociationModel), 200)]
[SwaggerOperation(Tags = new[] { "property" })]
- public IActionResult GetPropertyAssociationsWithPid(string pid)
+ public IActionResult GetPropertyAssociationsWithId(long id)
{
- var property = _pimsRepository.Property.GetAssociations(pid);
+ var property = _pimsRepository.Property.GetAssociations(id);
return new JsonResult(_mapper.Map(property));
}
@@ -96,17 +96,17 @@ public IActionResult GetPropertyAssociationsWithPid(string pid)
#region Concept Endpoints
///
- /// Get the property for the specified unique 'pid'.
+ /// Get the property for the specified unique 'id'.
///
///
- [HttpGet("concept/{pid}")]
+ [HttpGet("concept/{id}")]
[HasPermission(Permissions.PropertyView)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable), 200)]
[SwaggerOperation(Tags = new[] { "property" })]
- public IActionResult GetConceptPropertyWithPid(string pid)
+ public IActionResult GetConceptPropertyWithId(long id)
{
- var property = _pimsService.PropertyService.GetByPid(pid);
+ var property = _pimsService.PropertyService.GetById(id);
return new JsonResult(_mapper.Map(property));
}
@@ -114,7 +114,7 @@ public IActionResult GetConceptPropertyWithPid(string pid)
/// Update the specified property, and attached properties.
///
///
- [HttpPut("concept/{pid}")]
+ [HttpPut("concept/{id}")]
[HasPermission(Permissions.PropertyEdit)]
[Produces("application/json")]
[ProducesResponseType(typeof(Pims.Api.Models.Concepts.PropertyModel), 200)]
diff --git a/backend/api/Areas/Tools/Controllers/GeocoderController.cs b/backend/api/Areas/Tools/Controllers/GeocoderController.cs
index 2de58b5cf5..94bf4f4c93 100644
--- a/backend/api/Areas/Tools/Controllers/GeocoderController.cs
+++ b/backend/api/Areas/Tools/Controllers/GeocoderController.cs
@@ -87,7 +87,7 @@ public async Task FindPidsAsync(Guid siteId)
///
/// Make a request to Data BC Geocoder for the property that is the closest to the given lat/lng point.
///
- /// The lat/lng of the desired property.
+ /// The lat/lng of the desired property in the format 'lng,lat'.
/// A single address match.
[HttpGet("nearest")]
[Produces("application/json")]
diff --git a/backend/api/Controllers/DocumentController.cs b/backend/api/Controllers/DocumentController.cs
index b2c30d52ae..bc449f24b3 100644
--- a/backend/api/Controllers/DocumentController.cs
+++ b/backend/api/Controllers/DocumentController.cs
@@ -1,4 +1,4 @@
-using System.Threading.Tasks;
+using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -11,6 +11,9 @@
using Pims.Dal.Entities;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Concepts = Pims.Api.Models.Concepts;
namespace Pims.Api.Controllers
{
@@ -27,6 +30,7 @@ public class DocumentController : ControllerBase
#region Variables
private readonly IDocumentService _documentService;
private readonly IDocumentSyncService _documentSyncService;
+ private readonly IMapper _mapper;
#endregion
#region Constructors
@@ -35,10 +39,12 @@ public class DocumentController : ControllerBase
///
///
///
- public DocumentController(IDocumentService documentService, IDocumentSyncService documentSyncService)
+ ///
+ public DocumentController(IDocumentService documentService, IDocumentSyncService documentSyncService, IMapper mapper)
{
_documentService = documentService;
_documentSyncService = documentSyncService;
+ _mapper = mapper;
}
#endregion
@@ -91,9 +97,9 @@ public IActionResult DownloadFile(int documentId, int fileId)
[HasPermission(Permissions.PropertyAdd)]
[ProducesResponseType(typeof(ExternalResult), 200)]
[SwaggerOperation(Tags = new[] { "documents" })]
- public IActionResult UploadDocument([FromForm] int documentType, [FromForm] IFormFile file)
+ public async Task UploadDocument([FromForm] int documentType, [FromForm] IFormFile file)
{
- var result = _documentService.UploadDocument(documentType, file);
+ var result = await _documentService.UploadDocumentAsync(documentType, file);
return new JsonResult(result);
}
@@ -136,6 +142,22 @@ public async Task SyncDocumentTypes()
return new JsonResult(result);
}
+ ///
+ /// Get the document types.
+ ///
+ ///
+ [HttpGet("document-types")]
+ [HasPermission(Permissions.DocumentView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(List), 200)]
+ [SwaggerOperation(Tags = new[] { "document-types" })]
+ public IActionResult GetDocumentTypeItems()
+ {
+ var documentTypes = _documentService.GetPimsDocumentTypes();
+ var mappedDocumentTypes = _mapper.Map>(documentTypes);
+ return new JsonResult(mappedDocumentTypes);
+ }
+
#endregion
}
}
diff --git a/backend/api/Controllers/LookupController.cs b/backend/api/Controllers/LookupController.cs
index 490ea07b18..ade3ec0aea 100644
--- a/backend/api/Controllers/LookupController.cs
+++ b/backend/api/Controllers/LookupController.cs
@@ -113,6 +113,7 @@ public IActionResult GetAll()
var volumeUnitTypes = _mapper.Map(_pimsService.Lookup.GetPropertyVolumeUnitTypes());
var propertyVolumetricTypes = _mapper.Map(_pimsService.Lookup.GetPropertyVolumetricTypes());
var pphStatusType = _mapper.Map(_pimsService.Lookup.GetPPHStatusType());
+ var documentStatusTypes = _mapper.Map(_pimsService.Lookup.GetDocumentStatusTypes());
var codes = new List