├── .idea └── .idea.AccraCity │ └── .idea │ └── .name ├── AccraCityApi ├── obj │ ├── Debug │ │ └── net7.0 │ │ │ ├── AccraCityApi.MvcApplicationPartsAssemblyInfo.cache │ │ │ ├── AccraCityApi.AssemblyInfoInputs.cache │ │ │ ├── AccraCityApi.genruntimeconfig.cache │ │ │ ├── apphost │ │ │ ├── AccraCityApi.csproj.CoreCompileInputs.cache │ │ │ ├── AccraCityApi.dll │ │ │ ├── AccraCityApi.pdb │ │ │ ├── ref │ │ │ └── AccraCityApi.dll │ │ │ ├── refint │ │ │ └── AccraCityApi.dll │ │ │ ├── staticwebassets │ │ │ ├── msbuild.build.AccraCityApi.props │ │ │ ├── msbuild.buildMultiTargeting.AccraCityApi.props │ │ │ └── msbuild.buildTransitive.AccraCityApi.props │ │ │ ├── AccraCityApi.assets.cache │ │ │ ├── AccraCityApi.csproj.AssemblyReference.cache │ │ │ ├── .NETCoreApp,Version=v7.0.AssemblyAttributes.cs │ │ │ ├── staticwebassets.build.json │ │ │ ├── AccraCityApi.MvcApplicationPartsAssemblyInfo.cs │ │ │ ├── AccraCityApi.GlobalUsings.g.cs │ │ │ ├── AccraCityApi.GeneratedMSBuildEditorConfig.editorconfig │ │ │ ├── AccraCityApi.AssemblyInfo.cs │ │ │ └── AccraCityApi.csproj.FileListAbsolute.txt │ ├── AccraCityApi.csproj.nuget.g.targets │ ├── AccraCityApi.csproj.nuget.g.props │ ├── AccraCityApi.csproj.nuget.dgspec.json │ └── project.nuget.cache ├── bin │ └── Debug │ │ └── net7.0 │ │ ├── AccraCityApi │ │ ├── AccraCityApi.dll │ │ ├── AccraCityApi.pdb │ │ ├── Microsoft.OpenApi.dll │ │ ├── AccraCity.Application.dll │ │ ├── AccraCityApi.Contracts.dll │ │ ├── AccraCityApi.Contracts.pdb │ │ ├── Microsoft.AspNetCore.OpenApi.dll │ │ ├── Swashbuckle.AspNetCore.Swagger.dll │ │ ├── Swashbuckle.AspNetCore.SwaggerGen.dll │ │ ├── Swashbuckle.AspNetCore.SwaggerUI.dll │ │ ├── appsettings.Development.json │ │ ├── AccraCityApi.runtimeconfig.json │ │ └── appsettings.json ├── appsettings.Development.json ├── appsettings.json ├── Properties │ └── launchSettings.json ├── ContractMappings │ ├── RegionContractMapping.cs │ ├── DistrictContractMapping.cs │ └── TownContractMapping.cs ├── AccraCityApi.csproj ├── ApiEndpoints.cs ├── Controllers │ ├── AuthController.cs │ ├── TownController.cs │ ├── RegionController.cs │ └── DistrictController.cs └── Program.cs ├── Request └── CityApi │ ├── DeleteTown.http │ ├── CreateTown.http │ ├── GetTownRequest.http │ └── UpdateTown.http ├── AccraCity.Application ├── obj │ ├── Debug │ │ └── net7.0 │ │ │ ├── AccraCity.Application.AssemblyInfoInputs.cache │ │ │ ├── AccraCity.Application.csproj.CoreCompileInputs.cache │ │ │ ├── AccraCity.Application.dll │ │ │ ├── ref │ │ │ └── AccraCity.Application.dll │ │ │ ├── refint │ │ │ └── AccraCity.Application.dll │ │ │ ├── AccraCity.Application.assets.cache │ │ │ ├── AccraCity.Application.csproj.AssemblyReference.cache │ │ │ ├── .NETCoreApp,Version=v7.0.AssemblyAttributes.cs │ │ │ ├── AccraCity.Application.GlobalUsings.g.cs │ │ │ ├── AccraCity.Application.GeneratedMSBuildEditorConfig.editorconfig │ │ │ ├── AccraCity.Application.AssemblyInfo.cs │ │ │ └── AccraCity.Application.csproj.FileListAbsolute.txt │ ├── AccraCity.Application.csproj.nuget.g.targets │ ├── AccraCity.Application.csproj.EntityFrameworkCore.targets │ ├── AccraCity.Application.csproj.nuget.g.props │ └── AccraCity.Application.csproj.nuget.dgspec.json ├── bin │ └── Debug │ │ └── net7.0 │ │ └── AccraCity.Application.dll ├── OtherObjects │ └── StaticUserRoles.cs ├── Models │ ├── User.cs │ ├── Region.cs │ ├── District.cs │ └── AccraCity.cs ├── Dto │ ├── UpdatePermissionDto.cs │ ├── AuthServiceResponseDto.cs │ ├── LoginDto.cs │ └── RegisterDto.cs ├── ApplicationCollectionExtensions.cs ├── Interface │ ├── IAuthRepository.cs │ ├── ITownRepository.cs │ ├── IRegionRepository.cs │ └── IDistrictRepository.cs ├── AccraCity.Application.csproj ├── Database │ └── AppDbContext.cs ├── Repository │ ├── RegionRepository.cs │ ├── DistrictRepository.cs │ └── TownRepository.cs └── Service │ └── AuthService.cs ├── AccraCityApi.Contracts ├── obj │ ├── Debug │ │ └── net7.0 │ │ │ ├── AccraCityApi.Contracts.AssemblyInfoInputs.cache │ │ │ ├── AccraCityApi.Contracts.csproj.CoreCompileInputs.cache │ │ │ ├── AccraCityApi.Contracts.dll │ │ │ ├── AccraCityApi.Contracts.pdb │ │ │ ├── ref │ │ │ └── AccraCityApi.Contracts.dll │ │ │ ├── refint │ │ │ └── AccraCityApi.Contracts.dll │ │ │ ├── AccraCityApi.Contracts.assets.cache │ │ │ ├── AccraCityApi.Contracts.csproj.AssemblyReference.cache │ │ │ ├── .NETCoreApp,Version=v7.0.AssemblyAttributes.cs │ │ │ ├── AccraCityApi.Contracts.GlobalUsings.g.cs │ │ │ ├── AccraCityApi.Contracts.GeneratedMSBuildEditorConfig.editorconfig │ │ │ ├── AccraCityApi.Contracts.AssemblyInfo.cs │ │ │ └── AccraCityApi.Contracts.csproj.FileListAbsolute.txt │ ├── AccraCityApi.Contracts.csproj.nuget.g.targets │ ├── AccraCityApi.Contracts.csproj.nuget.g.props │ ├── AccraCityApi.Contracts.csproj.nuget.dgspec.json │ └── project.nuget.cache ├── bin │ └── Debug │ │ └── net7.0 │ │ ├── AccraCity.Application.dll │ │ ├── AccraCityApi.Contracts.dll │ │ └── AccraCityApi.Contracts.pdb ├── Requests │ ├── RegionRequests │ │ ├── CreateRegionRequest.cs │ │ └── UpdateRegionRequest.cs │ ├── DistrictRequests │ │ ├── CreateDistrictRequest.cs │ │ └── UpdateDistrictRequest.cs │ └── TownRequests │ │ ├── CreateTownRequest.cs │ │ └── UpdateTownRequest.cs ├── Response │ ├── FinalResponse.cs │ ├── TownResponses │ │ ├── TownsResponse.cs │ │ └── TownResponse.cs │ ├── RegionResponses │ │ ├── RegionsResponse.cs │ │ └── RegionResponse.cs │ └── DistrictResponse │ │ ├── DistrictsResponse.cs │ │ └── DistrictResponse.cs └── AccraCityApi.Contracts.csproj ├── LICENSE ├── AccraCity.sln ├── Docs └── Api.md ├── README.md ├── CODE_OF_CONDUCT.md └── .gitignore /.idea/.idea.AccraCity/.idea/.name: -------------------------------------------------------------------------------- 1 | AccraCity -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.MvcApplicationPartsAssemblyInfo.cache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Request/CityApi/DeleteTown.http: -------------------------------------------------------------------------------- 1 | 2 | DELETE http://localhost:5235/town/1 3 | Content-Type: application/json 4 | -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 3aec0258bcb26a18974c1608537d4abcf3570892457934e53a4d9c2d359923b5 2 | -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.genruntimeconfig.cache: -------------------------------------------------------------------------------- 1 | 43fc75fbc330d57b5f3189ddbec82e246419c469599420d85ea4b68373dbf2a7 2 | -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/apphost: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/obj/Debug/net7.0/apphost -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 567f100f396538ba46df8e7fae053bc6ab939740808908bbc6a428b4391bee34 2 | -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/AccraCityApi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/AccraCityApi -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 15b41af1a5579d7fc76ea9b0da0d8b6b389415faa810e7e06337c6ab42032dbf 2 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | d13322c8a01036b0b1fff2202ec3295b7d2613327f45052279ebba6fb14010b4 2 | -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/AccraCityApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/AccraCityApi.dll -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/AccraCityApi.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/AccraCityApi.pdb -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/obj/Debug/net7.0/AccraCityApi.dll -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/obj/Debug/net7.0/AccraCityApi.pdb -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 7ab3326cbeb52bfe8f6e14c20579c32d13d07653c6549efcf479351985d6f902 2 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | ca6b27b5e667fea7e16071212889440ecd24cf8142d90522af4fd59acf685a79 2 | -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/Microsoft.OpenApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/Microsoft.OpenApi.dll -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/ref/AccraCityApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/obj/Debug/net7.0/ref/AccraCityApi.dll -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/refint/AccraCityApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/obj/Debug/net7.0/refint/AccraCityApi.dll -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.build.AccraCityApi.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.buildMultiTargeting.AccraCityApi.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/AccraCity.Application.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/AccraCity.Application.dll -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/AccraCityApi.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/AccraCityApi.Contracts.dll -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/AccraCityApi.Contracts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/AccraCityApi.Contracts.pdb -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/obj/Debug/net7.0/AccraCityApi.assets.cache -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.buildTransitive.AccraCityApi.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/Microsoft.AspNetCore.OpenApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/Microsoft.AspNetCore.OpenApi.dll -------------------------------------------------------------------------------- /AccraCity.Application/bin/Debug/net7.0/AccraCity.Application.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCity.Application/bin/Debug/net7.0/AccraCity.Application.dll -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.dll -------------------------------------------------------------------------------- /AccraCityApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.Swagger.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.Swagger.dll -------------------------------------------------------------------------------- /AccraCityApi.Contracts/bin/Debug/net7.0/AccraCity.Application.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCity.Application.dll -------------------------------------------------------------------------------- /AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.dll -------------------------------------------------------------------------------- /AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.pdb -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.dll -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.pdb -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.SwaggerGen.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.SwaggerGen.dll -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.SwaggerUI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.SwaggerUI.dll -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/ref/AccraCity.Application.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCity.Application/obj/Debug/net7.0/ref/AccraCity.Application.dll -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/refint/AccraCity.Application.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCity.Application/obj/Debug/net7.0/refint/AccraCity.Application.dll -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/ref/AccraCityApi.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/obj/Debug/net7.0/ref/AccraCityApi.Contracts.dll -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.assets.cache -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/refint/AccraCityApi.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/obj/Debug/net7.0/refint/AccraCityApi.Contracts.dll -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.assets.cache -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Requests/RegionRequests/CreateRegionRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Requests.RegionRequests; 2 | 3 | public class CreateRegionRequest 4 | { 5 | public required string RegionName { get; set; } 6 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Requests/RegionRequests/UpdateRegionRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Requests.RegionRequests; 2 | 3 | public class UpdateRegionRequest 4 | { 5 | public required string RegionName { get; set; } 6 | } -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niiwade/Accra-City-Towns-Api/HEAD/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Response/FinalResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Response; 2 | 3 | public class FinalResponse 4 | { 5 | public int StatusCode { get; set; } 6 | public string? Message { get; set; } 7 | public T? Data { get; set; } 8 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Response/TownResponses/TownsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Response.TownResponses; 2 | 3 | public class TownsResponse 4 | { 5 | public required IEnumerable Towns { get; init; } = Enumerable.Empty(); 6 | } -------------------------------------------------------------------------------- /AccraCity.Application/OtherObjects/StaticUserRoles.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCity.Application.OtherObjects; 2 | 3 | public class StaticUserRoles 4 | { 5 | public const string OWNER = "OWNER"; 6 | public const string ADMIN = "ADMIN"; 7 | public const string USER = "USER"; 8 | } -------------------------------------------------------------------------------- /AccraCity.Application/Models/User.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace AccraCity.Application.Models; 4 | 5 | public class User : IdentityUser 6 | { 7 | public required string FirstName { get; set; } 8 | public required string LastName { get; set; } 9 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Response/RegionResponses/RegionsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Response.RegionResponses; 2 | 3 | public class RegionsResponse 4 | { 5 | public required IEnumerable Regions { get; init; } = Enumerable.Empty(); 6 | } -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")] 5 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Requests/DistrictRequests/CreateDistrictRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Requests.DistrictRequests; 2 | 3 | public class CreateDistrictRequest 4 | { 5 | public required string DistrictName { get; set; } 6 | public Guid RegionId { get; set; } 7 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Requests/DistrictRequests/UpdateDistrictRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Requests.DistrictRequests; 2 | 3 | public class UpdateDistrictRequest 4 | { 5 | public required string DistrictName { get; set; } 6 | public Guid RegionId { get; set; } 7 | } -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")] 5 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")] 5 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Response/DistrictResponse/DistrictsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Response.DistrictResponse; 2 | 3 | public class DistrictsResponse 4 | { 5 | public required IEnumerable Districts { get; init; } = Enumerable.Empty(); 6 | } -------------------------------------------------------------------------------- /AccraCity.Application/Dto/UpdatePermissionDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AccraCity.Application.Dto; 4 | 5 | public class UpdatePermissionDto 6 | { 7 | [Required(ErrorMessage = "Username is required")] 8 | public required string UserName { get; set; } 9 | } -------------------------------------------------------------------------------- /AccraCity.Application/Dto/AuthServiceResponseDto.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCity.Application.Dto; 2 | 3 | public class AuthServiceResponseDto 4 | { 5 | public int? StatusCode { get; set; } 6 | public bool IsSucceed { get; set; } 7 | public string? Message { get; set; } 8 | public string? Data { get; set; } 9 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Response/DistrictResponse/DistrictResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Response.DistrictResponse; 2 | 3 | public class DistrictResponse 4 | { 5 | public required Guid Id { get; set; } 6 | public required string DistrictName { get; set; } 7 | public Guid RegionId { get; set; } 8 | } -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/staticwebassets.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": 1, 3 | "Hash": "sqLnhEbClVaS5jfBCi5qnVrTtrnRy8rkw3H5nW0QE+0=", 4 | "Source": "AccraCityApi", 5 | "BasePath": "_content/AccraCityApi", 6 | "Mode": "Default", 7 | "ManifestType": "Build", 8 | "ReferencedProjectsConfiguration": [], 9 | "DiscoveryPatterns": [], 10 | "Assets": [] 11 | } -------------------------------------------------------------------------------- /AccraCity.Application/Models/Region.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCity.Application.Models; 2 | 3 | public class Region 4 | { 5 | public required Guid Id { get; set; } 6 | public required string RegionName { get; set; } 7 | public ICollection Districts { get; set; } = new List(); 8 | public ICollection Towns { get; set; } = new List(); 9 | } -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.GlobalUsings.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | global using global::System; 3 | global using global::System.Collections.Generic; 4 | global using global::System.IO; 5 | global using global::System.Linq; 6 | global using global::System.Net.Http; 7 | global using global::System.Threading; 8 | global using global::System.Threading.Tasks; 9 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.GlobalUsings.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | global using global::System; 3 | global using global::System.Collections.Generic; 4 | global using global::System.IO; 5 | global using global::System.Linq; 6 | global using global::System.Net.Http; 7 | global using global::System.Threading; 8 | global using global::System.Threading.Tasks; 9 | -------------------------------------------------------------------------------- /AccraCity.Application/Dto/LoginDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AccraCity.Application.Dto; 4 | 5 | public class LoginDto 6 | { 7 | [Required (ErrorMessage = "Username is required")] 8 | public required string UserName { get; set; } 9 | [Required (ErrorMessage = "Password is required")] 10 | public required string Password { get; set; } 11 | } -------------------------------------------------------------------------------- /AccraCity.Application/Models/District.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCity.Application.Models; 2 | 3 | public class District 4 | { 5 | public required Guid Id { get; set; } 6 | public required string DistrictName { get; set; } 7 | public Guid RegionId { get; set; } 8 | public Region Region { get; set; } = null!; 9 | public ICollection Towns { get; set; } = new List(); 10 | 11 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/AccraCityApi.Contracts.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Response/RegionResponses/RegionResponse.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Models; 2 | 3 | namespace AccraCityApi.Contracts.Response.RegionResponses; 4 | public class RegionResponse 5 | { 6 | public required Guid Id { get; set; } 7 | public required string RegionName { get; set; } 8 | // public ICollection Districts { get; set; } = new List(); 9 | // public ICollection Towns { get; set; } = new List(); 10 | 11 | } -------------------------------------------------------------------------------- /Request/CityApi/CreateTown.http: -------------------------------------------------------------------------------- 1 | 2 | POST http://localhost:5235/town 3 | Content-Type: application/json 4 | 5 | { 6 | "TownName": "Mamprobi", 7 | "District":"dfdfsf", 8 | "Category":"fsdsdfs", 9 | "Region":"sdfsdf", 10 | "Population":"121121", 11 | "Latitude": "12.1", 12 | "Longitude": "0.2", 13 | "startDateTime": "2022-04-08T08:00:00", 14 | "NearbyTowns": [ 15 | "sasadsd", 16 | "adasfef", 17 | "Thaow", 18 | "trqpe" 19 | 20 | ], 21 | "NotableLandMarks": [ 22 | "sasadsd", 23 | "adasfef" 24 | ] 25 | } -------------------------------------------------------------------------------- /Request/CityApi/GetTownRequest.http: -------------------------------------------------------------------------------- 1 | 2 | GET http://localhost:5235/town/ 3 | Content-Type: application/json 4 | 5 | { 6 | "TownName": "Mamprobi", 7 | "District":"dfdfsf", 8 | "Category":"fsdsdfs", 9 | "Region":"sdfsdf", 10 | "Population":"121121", 11 | "Latitude": "12.1", 12 | "Longitude": "0.2", 13 | "startDateTime": "2022-04-08T08:00:00", 14 | "NearbyTowns": [ 15 | "sasadsd", 16 | "adasfef", 17 | "Thaow", 18 | "trqpe" 19 | 20 | ], 21 | "NotableLandMarks": [ 22 | "sasadsd", 23 | "adasfef" 24 | ] 25 | } -------------------------------------------------------------------------------- /Request/CityApi/UpdateTown.http: -------------------------------------------------------------------------------- 1 | 2 | PUT http://localhost:5235/town/1 3 | Content-Type: application/json 4 | 5 | { 6 | "TownName": "Mamprobi", 7 | "District":"dfdfsf", 8 | "Category":"fsdsdfs", 9 | "Region":"sdfsdf", 10 | "Population":"121121", 11 | "Latitude": "12.1", 12 | "Longitude": "0.2", 13 | "startDateTime": "2022-04-08T08:00:00", 14 | "NearbyTowns": [ 15 | "sasadsd", 16 | "adasfef", 17 | "Thaow", 18 | "trqpe" 19 | 20 | ], 21 | "NotableLandMarks": [ 22 | "sasadsd", 23 | "adasfef" 24 | ] 25 | } -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/AccraCityApi.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "net7.0", 4 | "frameworks": [ 5 | { 6 | "name": "Microsoft.NETCore.App", 7 | "version": "7.0.0" 8 | }, 9 | { 10 | "name": "Microsoft.AspNetCore.App", 11 | "version": "7.0.0" 12 | } 13 | ], 14 | "configProperties": { 15 | "System.GC.Server": true, 16 | "System.Reflection.NullabilityInfoContext.IsSupported": true, 17 | "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /AccraCity.Application/Dto/RegisterDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AccraCity.Application.Dto; 4 | 5 | public class RegisterDto 6 | { 7 | [Required (ErrorMessage = "FirstName is required")] 8 | public required string FirstName { get; set; } 9 | 10 | [Required (ErrorMessage = "LastName is required")] 11 | public required string LastName { get; set; } 12 | 13 | [Required (ErrorMessage = "Username is required")] 14 | public required string UserName { get; set; } 15 | [Required (ErrorMessage = "Email is required")] 16 | public required string Email { get; set; } 17 | [Required (ErrorMessage = "Password is required")] 18 | public required string Password { get; set; } 19 | } -------------------------------------------------------------------------------- /AccraCity.Application/ApplicationCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Interface; 2 | using AccraCity.Application.Repository; 3 | using AccraCity.Application.Service; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace AccraCity.Application; 7 | 8 | public static class ApplicationCollectionExtensions 9 | { 10 | public static IServiceCollection AddApplication(this IServiceCollection service) 11 | { 12 | service.AddScoped(); 13 | service.AddScoped(); 14 | service.AddScoped(); 15 | service.AddScoped(); 16 | return service; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = net7.0 3 | build_property.TargetPlatformMinVersion = 4 | build_property.UsingMicrosoftNETSdkWeb = 5 | build_property.ProjectTypeGuids = 6 | build_property.InvariantGlobalization = 7 | build_property.PlatformNeutralAssembly = 8 | build_property.EnforceExtendedAnalyzerRules = 9 | build_property._SupportedPlatformList = Linux,macOS,Windows 10 | build_property.RootNamespace = AccraCity.Application 11 | build_property.ProjectDir = /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/ 12 | build_property.EnableComHosting = 13 | build_property.EnableGeneratedComInterfaceComImportInterop = 14 | -------------------------------------------------------------------------------- /AccraCity.Application/Interface/IAuthRepository.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Dto; 2 | 3 | namespace AccraCity.Application.Interface; 4 | 5 | public interface IAuthRepository 6 | { 7 | Task SeedRolesAsync(); 8 | Task RegisterAsync (RegisterDto registerDto); 9 | Task LoginAsync (LoginDto loginDto); 10 | Task MakeAdminAsync (UpdatePermissionDto updatePermissionDto); 11 | Task MakeOwnerAsync (UpdatePermissionDto updatePermissionDto); 12 | Task RemoveAdminRoleAsync (UpdatePermissionDto updatePermissionDto); 13 | Task RemoveOwnerRoleAsync (UpdatePermissionDto updatePermissionDto); 14 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Requests/TownRequests/CreateTownRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.AccraCity; 2 | 3 | 4 | public class CreateTownRequest 5 | { 6 | public required string TownName { get; set; } 7 | public required string Category { get; set; } 8 | public required int Population { get; set; } 9 | public required float Latitude { get; set; } 10 | public required float Longitude { get; set; } 11 | public DateTime CreatedAt { get; set; } 12 | //public DateTime LastModifiedAt { get; set; } 13 | public List NearbyTowns { get; set; } = new List(); 14 | public List NotableLandMarks { get; set; } = new List(); 15 | public Guid DistrictId { get; set; } 16 | public Guid RegionId { get; set; } 17 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Requests/TownRequests/UpdateTownRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Requests.TownRequests; 2 | public class UpdateTownRequest 3 | { 4 | public required string TownName { get; set; } 5 | public required string Category { get; set; } 6 | public required int Population { get; set; } 7 | public required float Latitude { get; set; } 8 | public required float Longitude { get; set; } 9 | //public DateTime CreatedAt { get; set; } 10 | public DateTime LastModifiedAt { get; set; } 11 | public List NearbyTowns { get; set; } = new List(); 12 | public List NotableLandMarks { get; set; } = new List(); 13 | public Guid DistrictId { get; set; } 14 | public Guid RegionId { get; set; } 15 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = net7.0 3 | build_property.TargetPlatformMinVersion = 4 | build_property.UsingMicrosoftNETSdkWeb = 5 | build_property.ProjectTypeGuids = 6 | build_property.InvariantGlobalization = 7 | build_property.PlatformNeutralAssembly = 8 | build_property.EnforceExtendedAnalyzerRules = 9 | build_property._SupportedPlatformList = Linux,macOS,Windows 10 | build_property.RootNamespace = AccraCityApi.Contracts 11 | build_property.ProjectDir = /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/ 12 | build_property.EnableComHosting = 13 | build_property.EnableGeneratedComInterfaceComImportInterop = 14 | -------------------------------------------------------------------------------- /AccraCity.Application/Interface/ITownRepository.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Models; 2 | 3 | namespace AccraCity.Application.Interface; 4 | 5 | public interface ITownRepository 6 | { 7 | Task> GetTownAsync(CancellationToken token = default); 8 | Task GetTownById(Guid id, CancellationToken token = default); 9 | Task CreateTown(Town town, CancellationToken token = default); 10 | Task UpdateTown(Town town, CancellationToken token = default); 11 | Task DeleteTown(Guid id, CancellationToken token = default); 12 | Task TownExists(Guid id, CancellationToken token = default); 13 | Task TownExistsByName(string townName, CancellationToken token = default); 14 | Task Save(CancellationToken token = default); 15 | } -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.MvcApplicationPartsAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | using System; 11 | using System.Reflection; 12 | 13 | [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Microsoft.AspNetCore.OpenApi")] 14 | [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.SwaggerGen")] 15 | 16 | // Generated by the MSBuild WriteCodeFragment class. 17 | 18 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/Response/TownResponses/TownResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi.Contracts.Response.TownResponses; 2 | 3 | 4 | public class TownResponse 5 | { 6 | public required Guid Id { get; set; } 7 | public required string TownName { get; set; } 8 | public required string Category { get; set; } 9 | public required int Population { get; set; } 10 | public required float Latitude { get; set; } 11 | public required float Longitude { get; set; } 12 | public DateTime CreatedAt { get; set; } 13 | public DateTime LastModifiedAt { get; set; } 14 | public List NearbyTowns { get; set; } = new List(); 15 | public List NotableLandMarks { get; set; } = new List(); 16 | public Guid DistrictId { get; set; } 17 | public Guid RegionId { get; set; } 18 | } -------------------------------------------------------------------------------- /AccraCity.Application/Interface/IRegionRepository.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Models; 2 | 3 | namespace AccraCity.Application.Interface; 4 | 5 | public interface IRegionRepository 6 | { 7 | Task> GetRegionAsync(CancellationToken token = default); 8 | Task GetRegionById(Guid id, CancellationToken token = default); 9 | Task CreateRegion(Region region, CancellationToken token = default); 10 | Task UpdateRegion(Region region, CancellationToken token = default); 11 | Task DeleteRegion(Guid id, CancellationToken token = default); 12 | Task RegionExists(Guid id, CancellationToken token = default); 13 | Task RegionExistsByName(string regionName, CancellationToken token = default); 14 | Task Save(CancellationToken token = default); 15 | } -------------------------------------------------------------------------------- /AccraCity.Application/Interface/IDistrictRepository.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Models; 2 | 3 | namespace AccraCity.Application.Interface; 4 | 5 | public interface IDistrictRepository 6 | { 7 | Task> GetDistrictAsync(CancellationToken token = default); 8 | Task GetDistrictById(Guid id, CancellationToken token = default); 9 | Task CreateDistrict(District district, CancellationToken token = default); 10 | Task UpdateDistrict(District district, CancellationToken token = default); 11 | Task DeleteDistrict(Guid id, CancellationToken token = default); 12 | Task DistrictExists(Guid id, CancellationToken token = default); 13 | Task DistrictExistsByName(string districtName, CancellationToken token = default); 14 | Task Save(CancellationToken token = default); 15 | } -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.GlobalUsings.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | global using global::Microsoft.AspNetCore.Builder; 3 | global using global::Microsoft.AspNetCore.Hosting; 4 | global using global::Microsoft.AspNetCore.Http; 5 | global using global::Microsoft.AspNetCore.Routing; 6 | global using global::Microsoft.Extensions.Configuration; 7 | global using global::Microsoft.Extensions.DependencyInjection; 8 | global using global::Microsoft.Extensions.Hosting; 9 | global using global::Microsoft.Extensions.Logging; 10 | global using global::System; 11 | global using global::System.Collections.Generic; 12 | global using global::System.IO; 13 | global using global::System.Linq; 14 | global using global::System.Net.Http; 15 | global using global::System.Net.Http.Json; 16 | global using global::System.Threading; 17 | global using global::System.Threading.Tasks; 18 | -------------------------------------------------------------------------------- /AccraCity.Application/Models/AccraCity.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCity.Application.Models; 2 | 3 | public class Town 4 | { 5 | public required Guid Id { get; set; } 6 | public required string TownName { get; set; } 7 | public required string Category { get; set; } 8 | public required int Population { get; set; } 9 | public required float Latitude { get; set; } 10 | public required float Longitude { get; set; } 11 | public DateTime CreatedAt { get; set; } 12 | public DateTime LastModifiedAt { get; set; } 13 | public List NearbyTowns { get; set; } = new List(); 14 | public List NotableLandMarks { get; set; } = new List(); 15 | public Guid DistrictId { get; set; } 16 | public District District { get; set; } = null!; 17 | public Guid RegionId { get; set; } 18 | public Region Region { get; set; } = null!; 19 | 20 | } -------------------------------------------------------------------------------- /AccraCityApi/bin/Debug/net7.0/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "User ID=postgres;Password=123;Host=localhost;Port=5432;Database=AccraCities;Pooling=true;" 4 | 5 | }, 6 | 7 | "Logging": { 8 | "LogLevel": { 9 | "Default": "Information", 10 | "Microsoft.AspNetCore": "Warning" 11 | } 12 | }, 13 | 14 | "Serilog": { 15 | "Using": [ "Serilog.Sinks.File" ], 16 | "MinimumLevel": { 17 | "Default": "Information" 18 | }, 19 | "WriteTo": [ 20 | { 21 | "Name": "File", 22 | "Args": { 23 | "path": "../logs/webapi-.log", 24 | "rollingInterval": "Day", 25 | "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {CorrelationId} {Level:u3} {Username} {Message:lj}{Exception}{NewLine}" 26 | } 27 | } 28 | ] 29 | }, 30 | 31 | "AllowedHosts": "*" 32 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/AccraCityApi.Contracts.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /AccraCityApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "User ID=postgres;Password=123;Host=localhost;Port=5432;Database=AccraCities;Pooling=true;" 4 | 5 | }, 6 | 7 | "Logging": { 8 | "LogLevel": { 9 | "Default": "Information", 10 | "Microsoft.AspNetCore": "Warning" 11 | } 12 | }, 13 | 14 | "Serilog": { 15 | "Using": [ "Serilog.Sinks.File" ], 16 | "MinimumLevel": { 17 | "Default": "Information" 18 | }, 19 | "WriteTo": [ 20 | { 21 | "Name": "File", 22 | "Args": { 23 | "path": "../logs/webapi-.log", 24 | "rollingInterval": "Day", 25 | "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {CorrelationId} {Level:u3} {Username} {Message:lj}{Exception}{NewLine}" 26 | } 27 | } 28 | ] 29 | }, 30 | 31 | "JWT" :{ 32 | "Issuer": "https://localhost:7034", 33 | "Audience": "https://localhost:7035", 34 | "SecretKey": "88w8j8ushaaamao1983j921128821929922iskssooklk1lsksmmdkjd" 35 | }, 36 | 37 | "AllowedHosts": "*" 38 | } -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = net7.0 3 | build_property.TargetPlatformMinVersion = 4 | build_property.UsingMicrosoftNETSdkWeb = true 5 | build_property.ProjectTypeGuids = 6 | build_property.InvariantGlobalization = 7 | build_property.PlatformNeutralAssembly = 8 | build_property.EnforceExtendedAnalyzerRules = 9 | build_property._SupportedPlatformList = Linux,macOS,Windows 10 | build_property.RootNamespace = AccraCityApi 11 | build_property.RootNamespace = AccraCityApi 12 | build_property.ProjectDir = /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/ 13 | build_property.EnableComHosting = 14 | build_property.EnableGeneratedComInterfaceComImportInterop = 15 | build_property.RazorLangVersion = 7.0 16 | build_property.SupportLocalizedComponentNames = 17 | build_property.GenerateRazorMetadataSourceChecksumAttributes = 18 | build_property.MSBuildProjectDirectory = /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi 19 | build_property._RazorSourceGeneratorDebug = 20 | -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | using System; 11 | using System.Reflection; 12 | 13 | [assembly: System.Reflection.AssemblyCompanyAttribute("AccraCityApi")] 14 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 15 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 16 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f24e56dffa2d2658c23d4329669add422753c512")] 17 | [assembly: System.Reflection.AssemblyProductAttribute("AccraCityApi")] 18 | [assembly: System.Reflection.AssemblyTitleAttribute("AccraCityApi")] 19 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 20 | 21 | // Generated by the MSBuild WriteCodeFragment class. 22 | 23 | -------------------------------------------------------------------------------- /AccraCity.Application/obj/AccraCity.Application.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Joseph Nii Lante Lamptey 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | using System; 11 | using System.Reflection; 12 | 13 | [assembly: System.Reflection.AssemblyCompanyAttribute("AccraCity.Application")] 14 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 15 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 16 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+21db8216bc15515f2a7232f1f473ba278099453b")] 17 | [assembly: System.Reflection.AssemblyProductAttribute("AccraCity.Application")] 18 | [assembly: System.Reflection.AssemblyTitleAttribute("AccraCity.Application")] 19 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 20 | 21 | // Generated by the MSBuild WriteCodeFragment class. 22 | 23 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | using System; 11 | using System.Reflection; 12 | 13 | [assembly: System.Reflection.AssemblyCompanyAttribute("AccraCityApi.Contracts")] 14 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 15 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 16 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+21db8216bc15515f2a7232f1f473ba278099453b")] 17 | [assembly: System.Reflection.AssemblyProductAttribute("AccraCityApi.Contracts")] 18 | [assembly: System.Reflection.AssemblyTitleAttribute("AccraCityApi.Contracts")] 19 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 20 | 21 | // Generated by the MSBuild WriteCodeFragment class. 22 | 23 | -------------------------------------------------------------------------------- /AccraCityApi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:34331", 8 | "sslPort": 44366 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "swagger", 17 | "applicationUrl": "http://localhost:5235", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "swagger", 27 | "applicationUrl": "https://localhost:7093;http://localhost:5235", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "IIS Express": { 33 | "commandName": "IISExpress", 34 | "launchBrowser": true, 35 | "launchUrl": "swagger", 36 | "environmentVariables": { 37 | "ASPNETCORE_ENVIRONMENT": "Development" 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /AccraCityApi/obj/AccraCityApi.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AccraCity.Application/AccraCity.Application.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | all 20 | runtime; build; native; contentfiles; analyzers; buildtransitive 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /AccraCityApi/ContractMappings/RegionContractMapping.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Models; 2 | using AccraCityApi.Contracts.Requests.RegionRequests; 3 | using AccraCityApi.Contracts.Response.RegionResponses; 4 | 5 | namespace AccraCityApi.ContractMappings; 6 | 7 | public static class RegionContractMapping 8 | { 9 | public static Region MapToRegion(this CreateRegionRequest request) //This maps the CreateRegionDto to Region 10 | { 11 | return new Region() 12 | { 13 | Id = Guid.NewGuid(), 14 | RegionName = request.RegionName 15 | }; 16 | 17 | } 18 | 19 | public static Region MapToRegion(this UpdateRegionRequest request, Guid id) //This maps the UpdateRegionDto to Region 20 | { 21 | return new Region() 22 | { 23 | Id = id, 24 | RegionName = request.RegionName 25 | }; 26 | 27 | } 28 | 29 | 30 | public static RegionResponse MapsToResponse(this Region region) //This maps the Region to RegionResponseDto 31 | { 32 | return new RegionResponse() 33 | { 34 | Id = region.Id, 35 | RegionName = region.RegionName 36 | }; 37 | } 38 | 39 | public static RegionsResponse MapsToResponse(this IEnumerable regions) //This maps the list of districts to the DistrictsResponses 40 | { 41 | return new RegionsResponse() 42 | { 43 | Regions = regions.Select(MapsToResponse) 44 | }; 45 | } 46 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/AccraCityApi.Contracts.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | $(MSBuildThisFileDirectory)project.assets.json 7 | /Users/perigrinobruce/.nuget/packages/ 8 | /Users/perigrinobruce/.nuget/packages/ 9 | PackageReference 10 | 6.9.1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /AccraCityApi/ContractMappings/DistrictContractMapping.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Models; 2 | using AccraCityApi.Contracts.Requests.DistrictRequests; 3 | using AccraCityApi.Contracts.Response.DistrictResponse; 4 | 5 | namespace AccraCityApi.ContractMappings; 6 | 7 | public static class DistrictContractMapping 8 | { 9 | public static District MapToDistrict(this CreateDistrictRequest request) //This maps the CreateDistrictDto to Region 10 | { 11 | return new District() 12 | { 13 | Id = Guid.NewGuid(), 14 | DistrictName = request.DistrictName, 15 | RegionId = request.RegionId 16 | }; 17 | 18 | } 19 | 20 | public static District MapToDistrict(this UpdateDistrictRequest request, Guid id) //This maps the UpdateDistrictDto to Region 21 | { 22 | return new District() 23 | { 24 | Id = id, 25 | DistrictName = request.DistrictName, 26 | RegionId = request.RegionId 27 | }; 28 | 29 | } 30 | 31 | 32 | public static DistrictResponse MapsToResponse(this District district) //This maps the District to DistrictResponseDto 33 | { 34 | return new DistrictResponse() 35 | { 36 | Id = district.Id, 37 | DistrictName = district.DistrictName, 38 | RegionId = district.RegionId 39 | }; 40 | } 41 | 42 | public static DistrictsResponse MapsToResponse(this IEnumerable districts) //This maps the list of Districts to the DistrictsResponses 43 | { 44 | return new DistrictsResponse() 45 | { 46 | Districts = districts.Select(MapsToResponse) 47 | }; 48 | } 49 | } -------------------------------------------------------------------------------- /AccraCity.Application/obj/AccraCity.Application.csproj.EntityFrameworkCore.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /AccraCityApi/AccraCityApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | net8.0 10 | enable 11 | enable 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | all 21 | runtime; build; native; contentfiles; analyzers; buildtransitive 22 | 23 | 24 | all 25 | runtime; build; native; contentfiles; analyzers; buildtransitive 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/bin/Debug/net7.0/AccraCity.Application.deps.json 2 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/bin/Debug/net7.0/AccraCity.Application.runtimeconfig.json 3 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/bin/Debug/net7.0/AccraCity.Application.dll 4 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/bin/Debug/net7.0/AccraCity.Application.pdb 5 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.csproj.AssemblyReference.cache 6 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.GeneratedMSBuildEditorConfig.editorconfig 7 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.AssemblyInfoInputs.cache 8 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.AssemblyInfo.cs 9 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.csproj.CoreCompileInputs.cache 10 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.sourcelink.json 11 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.dll 12 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/refint/AccraCity.Application.dll 13 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.pdb 14 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/AccraCity.Application.genruntimeconfig.cache 15 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/Debug/net7.0/ref/AccraCity.Application.dll 16 | -------------------------------------------------------------------------------- /AccraCity.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccraCityApi.Contracts", "AccraCityApi.Contracts\AccraCityApi.Contracts.csproj", "{B8D9F013-0BB9-40CD-92FC-0A071AD80C3B}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccraCityApi", "AccraCityApi\AccraCityApi.csproj", "{1C35B840-B613-4FD7-BC77-F3B8F4009D1C}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccraCity.Application", "AccraCity.Application\AccraCity.Application.csproj", "{D5C8EDCA-769E-4ADA-8DFB-6290F03926AA}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {B8D9F013-0BB9-40CD-92FC-0A071AD80C3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {B8D9F013-0BB9-40CD-92FC-0A071AD80C3B}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {B8D9F013-0BB9-40CD-92FC-0A071AD80C3B}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {B8D9F013-0BB9-40CD-92FC-0A071AD80C3B}.Release|Any CPU.Build.0 = Release|Any CPU 25 | {1C35B840-B613-4FD7-BC77-F3B8F4009D1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {1C35B840-B613-4FD7-BC77-F3B8F4009D1C}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {1C35B840-B613-4FD7-BC77-F3B8F4009D1C}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {1C35B840-B613-4FD7-BC77-F3B8F4009D1C}.Release|Any CPU.Build.0 = Release|Any CPU 29 | {D5C8EDCA-769E-4ADA-8DFB-6290F03926AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {D5C8EDCA-769E-4ADA-8DFB-6290F03926AA}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {D5C8EDCA-769E-4ADA-8DFB-6290F03926AA}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {D5C8EDCA-769E-4ADA-8DFB-6290F03926AA}.Release|Any CPU.Build.0 = Release|Any CPU 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /AccraCityApi/ApiEndpoints.cs: -------------------------------------------------------------------------------- 1 | namespace AccraCityApi; 2 | 3 | public static class ApiEndpoints 4 | { 5 | private const string ApiBase = "api"; 6 | 7 | public static class Region 8 | { 9 | private const string Base = $"{ApiBase}/region"; 10 | 11 | public const string Get = $"{Base}/{{id:guid}}"; 12 | 13 | public const string GetRegion = $"{Base}/region/{{id:guid}}"; 14 | public const string GetAll = Base; 15 | public const string Create = Base; 16 | public const string Update = $"{Base}/{{id:guid}}"; 17 | public const string Delete = $"{Base}/{{id:guid}}"; 18 | } 19 | 20 | 21 | public static class District 22 | { 23 | private const string Base = $"{ApiBase}/district"; 24 | 25 | public const string Get = $"{Base}/{{id:guid}}"; 26 | 27 | public const string GetDistrict = $"{Base}/district/{{id:guid}}"; 28 | public const string GetAll = Base; 29 | public const string Create = Base; 30 | public const string Update = $"{Base}/{{id:guid}}"; 31 | public const string Delete = $"{Base}/{{id:guid}}"; 32 | } 33 | 34 | public static class Town 35 | { 36 | private const string Base = $"{ApiBase}/town"; 37 | 38 | public const string Get = $"{Base}/{{id:guid}}"; 39 | 40 | public const string GetTown = $"{Base}/town/{{id:guid}}"; 41 | public const string GetAll = Base; 42 | public const string Create = Base; 43 | public const string Update = $"{Base}/{{id:guid}}"; 44 | public const string Delete = $"{Base}/{{id:guid}}"; 45 | } 46 | 47 | public static class Auth 48 | { 49 | private const string Base = $"{ApiBase}/Auth"; 50 | 51 | public const string SeedRoles = $"{Base}/seed-roles"; 52 | //public const string GetWallet = $"{Base}/wallets/{{id:guid}}"; 53 | public const string Register = $"{Base}/register"; 54 | public const string Login = $"{Base}/login"; 55 | public const string MakeAdmin = $"{Base}/make_user_admin"; 56 | public const string MakeOwner = $"{Base}/make_user_owner"; 57 | public const string RemoveOwnerRole = $"{Base}/remove_owner_role"; 58 | public const string RemoveAdminRole = $"{Base}/remove_admin_role"; 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /AccraCity.Application/Database/AppDbContext.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Models; 2 | using Microsoft.AspNetCore.Identity; 3 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.Design; 6 | using Microsoft.Extensions.Configuration; 7 | 8 | namespace AccraCity.Application.Database; 9 | 10 | public class AppDbContext : IdentityDbContext 11 | { 12 | public AppDbContext(DbContextOptions options) : base(options) 13 | { 14 | 15 | } 16 | protected override void OnModelCreating(ModelBuilder modelBuilder) 17 | { 18 | modelBuilder.Entity() 19 | .HasMany(e => e.Districts) 20 | .WithOne(e => e.Region) 21 | .HasForeignKey(e => e.RegionId) 22 | .IsRequired(); 23 | 24 | modelBuilder.Entity() 25 | .HasMany(e => e.Towns) 26 | .WithOne(e => e.Region) 27 | .HasForeignKey(e => e.RegionId) 28 | .IsRequired(); 29 | 30 | modelBuilder.Entity() 31 | .HasMany(e => e.Towns) 32 | .WithOne(e => e.District) 33 | .HasForeignKey(e => e.DistrictId) 34 | .IsRequired(); 35 | 36 | modelBuilder.Entity>().HasNoKey(); 37 | modelBuilder.Entity>().HasNoKey(); 38 | modelBuilder.Entity>().HasNoKey(); 39 | } 40 | public DbSet Town { get; set; } 41 | public DbSet Regions { get; set; } 42 | public DbSet Districts { get; set; } 43 | } 44 | 45 | public class AppDbContextFactory : IDesignTimeDbContextFactory 46 | { 47 | public AppDbContext CreateDbContext(string[] args) 48 | { 49 | var configuration = new ConfigurationBuilder() 50 | .SetBasePath(Directory.GetCurrentDirectory()) // Assuming the appsettings.json file is in the same directory 51 | .AddJsonFile(@Directory.GetCurrentDirectory() + "/../AccraCityApi/appsettings.json") 52 | .Build(); 53 | var connectionString = configuration.GetConnectionString("Default"); 54 | var optionsBuilder = new DbContextOptionsBuilder(); 55 | optionsBuilder.UseNpgsql(connectionString); 56 | 57 | return new AppDbContext(optionsBuilder.Options); 58 | } 59 | } -------------------------------------------------------------------------------- /AccraCity.Application/obj/AccraCity.Application.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | $(MSBuildThisFileDirectory)project.assets.json 7 | /Users/perigrinobruce/.nuget/packages/ 8 | /Users/perigrinobruce/.nuget/packages/ 9 | PackageReference 10 | 6.9.1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | /Users/perigrinobruce/.nuget/packages/microsoft.codeanalysis.analyzers/3.3.3 21 | /Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.tools/8.0.7 22 | 23 | -------------------------------------------------------------------------------- /AccraCityApi/ContractMappings/TownContractMapping.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Models; 2 | using AccraCityApi.Contracts.AccraCity; 3 | using AccraCityApi.Contracts.Requests.TownRequests; 4 | using AccraCityApi.Contracts.Response.TownResponses; 5 | 6 | namespace AccraCityApi.ContractMappings; 7 | 8 | public static class TownContractMapping 9 | { 10 | public static Town MapToTown(this CreateTownRequest request) //This maps the CreateTownDto to Town 11 | { 12 | return new Town() 13 | { 14 | Id = Guid.NewGuid(), 15 | TownName = request.TownName, 16 | Category = request.Category, 17 | Population =request.Population, 18 | Latitude = request.Latitude, 19 | Longitude =request.Longitude, 20 | CreatedAt = DateTime.UtcNow, 21 | //LastModifiedAt = request.LastModifiedAt, 22 | NearbyTowns = request.NearbyTowns, 23 | NotableLandMarks = request.NotableLandMarks, 24 | DistrictId = request.DistrictId, 25 | RegionId = request.RegionId 26 | }; 27 | 28 | } 29 | 30 | public static Town MapToTown(this UpdateTownRequest request, Guid id) //This maps the UpdateTownDto to Town 31 | { 32 | return new Town() 33 | { 34 | Id = id, 35 | TownName = request.TownName, 36 | Category = request.Category, 37 | Population =request.Population, 38 | Latitude = request.Latitude, 39 | Longitude = request.Longitude, 40 | //CreatedAt = request.CreatedAt, 41 | LastModifiedAt = DateTime.UtcNow, 42 | NearbyTowns = request.NearbyTowns, 43 | NotableLandMarks = request.NotableLandMarks, 44 | DistrictId = request.DistrictId, 45 | RegionId = request.RegionId 46 | }; 47 | 48 | } 49 | 50 | 51 | public static TownResponse MapsToResponse(this Town town) //This maps the Town to TownResponseDto 52 | { 53 | return new TownResponse() 54 | { 55 | Id = town.Id, 56 | TownName = town.TownName, 57 | Category = town.Category, 58 | Population =town.Population, 59 | Latitude = town.Latitude, 60 | Longitude =town.Longitude, 61 | CreatedAt = town.CreatedAt, 62 | LastModifiedAt = town.LastModifiedAt, 63 | NearbyTowns = town.NearbyTowns, 64 | NotableLandMarks = town.NotableLandMarks, 65 | DistrictId = town.DistrictId, 66 | RegionId = town.RegionId 67 | }; 68 | } 69 | 70 | public static TownsResponse MapsToResponse(this IEnumerable regions) //This maps the list of Towns to the TownsResponses 71 | { 72 | return new TownsResponse() 73 | { 74 | Towns = regions.Select(MapsToResponse) 75 | }; 76 | } 77 | } -------------------------------------------------------------------------------- /AccraCity.Application/Repository/RegionRepository.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Database; 2 | using AccraCity.Application.Interface; 3 | using AccraCity.Application.Models; 4 | using Microsoft.EntityFrameworkCore; 5 | 6 | namespace AccraCity.Application.Repository; 7 | 8 | public class RegionRepository: IRegionRepository 9 | { 10 | private readonly AppDbContext _context; 11 | 12 | public RegionRepository(AppDbContext context) 13 | { 14 | _context = context; 15 | } 16 | 17 | public async Task> GetRegionAsync(CancellationToken token = default) 18 | { 19 | var region = await _context.Regions.ToListAsync(cancellationToken: token); 20 | return region; 21 | } 22 | 23 | public async Task GetRegionById(Guid id, CancellationToken token = default) 24 | { 25 | var region = await _context.Regions.FirstOrDefaultAsync(i => i.Id == id, cancellationToken: token); 26 | return region; 27 | } 28 | 29 | public async Task CreateRegion(Region region, CancellationToken token = default) 30 | { 31 | var newRegion = new Region() 32 | { 33 | Id = region.Id, 34 | RegionName = region.RegionName 35 | }; 36 | await _context.AddAsync(newRegion, token); 37 | return await Save(token); 38 | } 39 | 40 | public async Task UpdateRegion(Region region, CancellationToken token = default) 41 | { 42 | var result = await _context.Regions.FirstOrDefaultAsync(r => 43 | r.Id == region.Id, cancellationToken: token); 44 | 45 | if (result != null) 46 | { 47 | result.RegionName = region.RegionName; 48 | } 49 | return await Save(token); 50 | } 51 | 52 | public async Task DeleteRegion(Guid id, CancellationToken token = default) 53 | { 54 | var result = await _context.Regions.FirstOrDefaultAsync(i => 55 | i.Id == id, cancellationToken: token); 56 | 57 | if (result == null) 58 | { 59 | return false; // Region not found or already deleted 60 | } 61 | _context.Remove(result); 62 | return await Save(token); 63 | } 64 | 65 | public async Task RegionExists(Guid id, CancellationToken token = default) 66 | { 67 | var region = await _context.Regions.AnyAsync(r => r.Id == id, cancellationToken: token); 68 | return region; 69 | } 70 | 71 | public async Task RegionExistsByName(string regionName, CancellationToken token = default) 72 | { 73 | var region = await _context.Regions.AnyAsync(r => r.RegionName == regionName, cancellationToken: token); 74 | return region; 75 | } 76 | 77 | public async Task Save(CancellationToken token = default) 78 | { 79 | var saved = await _context.SaveChangesAsync(token); 80 | return saved > 0; 81 | } 82 | } -------------------------------------------------------------------------------- /AccraCityApi/Controllers/AuthController.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Dto; 2 | using AccraCity.Application.Interface; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | namespace AccraCityApi.Controllers 6 | { 7 | [Route("api/[controller]")] 8 | [ApiController] 9 | public class AuthController : ControllerBase 10 | { 11 | private readonly IAuthRepository _authService; 12 | 13 | public AuthController(IAuthRepository authService) 14 | { 15 | _authService = authService; 16 | } 17 | 18 | // Route For Seeding My Roles to DB 19 | [HttpPost(ApiEndpoints.Auth.SeedRoles)] 20 | public async Task SeedRoles () 21 | { 22 | var seedData = await _authService.SeedRolesAsync(); 23 | return Ok(seedData); 24 | } 25 | 26 | 27 | // Route -> Register 28 | [HttpPost(ApiEndpoints.Auth.Register)] 29 | public async Task Register([FromBody] RegisterDto registerDto) 30 | { 31 | var user = await _authService.RegisterAsync(registerDto); 32 | return Ok(user); 33 | } 34 | 35 | // Route -> Login 36 | [HttpPost(ApiEndpoints.Auth.Login)] 37 | public async Task Login ([FromBody] LoginDto loginRequest) 38 | { 39 | var userLogin = await _authService.LoginAsync(loginRequest); 40 | return Ok(userLogin); 41 | } 42 | 43 | 44 | // Route -> Make User -> ADMIN 45 | [HttpPost(ApiEndpoints.Auth.MakeAdmin)] 46 | public async Task MakeAdmin([FromBody] UpdatePermissionDto updatePermissionRequest) 47 | { 48 | var user = await _authService.MakeAdminAsync(updatePermissionRequest); 49 | return Ok(user); 50 | } 51 | 52 | 53 | // Route -> Make User -> Owner 54 | [HttpPost(ApiEndpoints.Auth.MakeOwner)] 55 | public async Task MakeOwner([FromBody] UpdatePermissionDto updatePermissionRequest) 56 | { 57 | var user = await _authService.MakeOwnerAsync(updatePermissionRequest); 58 | return Ok(user); 59 | } 60 | 61 | 62 | // Route -> Remove Owner Role 63 | [HttpPost(ApiEndpoints.Auth.RemoveOwnerRole)] 64 | public async Task RemoveOwnerRole([FromBody] UpdatePermissionDto updatePermissionRequest) 65 | { 66 | var user = await _authService.RemoveOwnerRoleAsync(updatePermissionRequest); 67 | return Ok(user); 68 | } 69 | 70 | 71 | // Route -> Remove Admin Role 72 | [HttpPost(ApiEndpoints.Auth.RemoveAdminRole)] 73 | public async Task RemoveAdminRole([FromBody] UpdatePermissionDto updatePermissionRequest) 74 | { 75 | var user = await _authService.RemoveAdminRoleAsync(updatePermissionRequest); 76 | return Ok(user); 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /AccraCity.Application/Repository/DistrictRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using AccraCity.Application.Database; 3 | using AccraCity.Application.Interface; 4 | using AccraCity.Application.Models; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace AccraCity.Application.Repository; 8 | 9 | 10 | public class DistrictRepository : IDistrictRepository 11 | { 12 | private readonly AppDbContext _context; 13 | 14 | public DistrictRepository(AppDbContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | 20 | public async Task> GetDistrictAsync(CancellationToken token = default) 21 | { 22 | var district = await _context.Districts.ToListAsync(cancellationToken: token); 23 | return district; 24 | } 25 | 26 | public async Task GetDistrictById(Guid id, CancellationToken token = default) 27 | { 28 | var district = await _context.Districts.FirstOrDefaultAsync(i => i.Id == id, cancellationToken: token); 29 | return district; 30 | } 31 | 32 | public async Task CreateDistrict(District district, CancellationToken token = default) 33 | { 34 | var newDistrict = new District() 35 | { 36 | Id = district.Id, 37 | DistrictName = district.DistrictName, 38 | RegionId = district.RegionId 39 | }; 40 | await _context.AddAsync(newDistrict, token); 41 | return await Save(token); 42 | } 43 | 44 | public async Task UpdateDistrict(District district, CancellationToken token = default) 45 | { 46 | var result = await _context.Districts.FirstOrDefaultAsync(d => 47 | d.Id == district.Id, cancellationToken: token); 48 | 49 | if (result != null) 50 | { 51 | result.DistrictName = district.DistrictName; 52 | result.RegionId = district.RegionId; 53 | } 54 | return await Save(token); 55 | } 56 | 57 | public async Task DeleteDistrict(Guid id, CancellationToken token = default) 58 | { 59 | var result = await _context.Districts.FirstOrDefaultAsync(i => 60 | i.Id == id, cancellationToken: token); 61 | 62 | if (result == null) 63 | { 64 | return false; // District not found or already deleted 65 | } 66 | _context.Remove(result); 67 | return await Save(token); 68 | } 69 | 70 | public async Task DistrictExists(Guid id, CancellationToken token = default) 71 | { 72 | var district = await _context.Districts.AnyAsync(r => r.Id == id, cancellationToken: token); 73 | return district; 74 | } 75 | 76 | public async Task DistrictExistsByName(string districtName, CancellationToken token = default) 77 | { 78 | var region = await _context.Districts.AnyAsync(r => r.DistrictName == districtName, cancellationToken: token); 79 | return region; 80 | } 81 | 82 | public async Task Save(CancellationToken token = default) 83 | { 84 | var saved = await _context.SaveChangesAsync(token); 85 | return saved > 0; 86 | } 87 | } -------------------------------------------------------------------------------- /AccraCityApi/obj/AccraCityApi.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | $(MSBuildThisFileDirectory)project.assets.json 7 | /Users/perigrinobruce/.nuget/packages/ 8 | /Users/perigrinobruce/.nuget/packages/ 9 | PackageReference 10 | 6.9.1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | /Users/perigrinobruce/.nuget/packages/microsoft.extensions.apidescription.server/6.0.5 23 | /Users/perigrinobruce/.nuget/packages/awssdk.core/3.7.100.14 24 | /Users/perigrinobruce/.nuget/packages/awssdk.securitytoken/3.7.100.14 25 | /Users/perigrinobruce/.nuget/packages/microsoft.codeanalysis.analyzers/3.3.3 26 | /Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.tools/8.0.7 27 | 28 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.csproj.AssemblyReference.cache 2 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.GeneratedMSBuildEditorConfig.editorconfig 3 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.AssemblyInfoInputs.cache 4 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.AssemblyInfo.cs 5 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.csproj.CoreCompileInputs.cache 6 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.deps.json 7 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.dll 8 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.pdb 9 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.dll 10 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/refint/AccraCityApi.Contracts.dll 11 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.pdb 12 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi.Contracts/obj/Debug/net7.0/ref/AccraCityApi.Contracts.dll 13 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.deps.json 14 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.dll 15 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCityApi.Contracts.pdb 16 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.csproj.AssemblyReference.cache 17 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.GeneratedMSBuildEditorConfig.editorconfig 18 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.AssemblyInfoInputs.cache 19 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.AssemblyInfo.cs 20 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.csproj.CoreCompileInputs.cache 21 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.sourcelink.json 22 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.dll 23 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/refint/AccraCityApi.Contracts.dll 24 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCityApi.Contracts.pdb 25 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/ref/AccraCityApi.Contracts.dll 26 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCity.Application.dll 27 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/bin/Debug/net7.0/AccraCity.Application.pdb 28 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/Debug/net7.0/AccraCit.F3F06EC5.Up2Date 29 | -------------------------------------------------------------------------------- /AccraCity.Application/obj/AccraCity.Application.csproj.nuget.dgspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "format": 1, 3 | "restore": { 4 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj": {} 5 | }, 6 | "projects": { 7 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj": { 8 | "version": "1.0.0", 9 | "restore": { 10 | "projectUniqueName": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj", 11 | "projectName": "AccraCity.Application", 12 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj", 13 | "packagesPath": "/Users/perigrinobruce/.nuget/packages/", 14 | "outputPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/", 15 | "projectStyle": "PackageReference", 16 | "configFilePaths": [ 17 | "/Users/perigrinobruce/.nuget/NuGet/NuGet.Config" 18 | ], 19 | "originalTargetFrameworks": [ 20 | "net8.0" 21 | ], 22 | "sources": { 23 | "https://api.nuget.org/v3/index.json": {} 24 | }, 25 | "frameworks": { 26 | "net8.0": { 27 | "targetAlias": "net8.0", 28 | "projectReferences": {} 29 | } 30 | }, 31 | "warningProperties": { 32 | "warnAsError": [ 33 | "NU1605" 34 | ] 35 | } 36 | }, 37 | "frameworks": { 38 | "net8.0": { 39 | "targetAlias": "net8.0", 40 | "dependencies": { 41 | "Microsoft.AspNetCore.Authentication.JwtBearer": { 42 | "target": "Package", 43 | "version": "[8.0.7, )" 44 | }, 45 | "Microsoft.AspNetCore.Identity.EntityFrameworkCore": { 46 | "target": "Package", 47 | "version": "[8.0.7, )" 48 | }, 49 | "Microsoft.AspNetCore.Mvc.NewtonsoftJson": { 50 | "target": "Package", 51 | "version": "[8.0.7, )" 52 | }, 53 | "Microsoft.EntityFrameworkCore": { 54 | "target": "Package", 55 | "version": "[8.0.7, )" 56 | }, 57 | "Microsoft.EntityFrameworkCore.Design": { 58 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 59 | "suppressParent": "All", 60 | "target": "Package", 61 | "version": "[8.0.7, )" 62 | }, 63 | "Microsoft.EntityFrameworkCore.Tools": { 64 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 65 | "suppressParent": "All", 66 | "target": "Package", 67 | "version": "[8.0.7, )" 68 | }, 69 | "Npgsql.EntityFrameworkCore.PostgreSQL": { 70 | "target": "Package", 71 | "version": "[8.0.4, )" 72 | }, 73 | "Serilog.AspNetCore": { 74 | "target": "Package", 75 | "version": "[5.0.0, )" 76 | } 77 | }, 78 | "imports": [ 79 | "net461", 80 | "net462", 81 | "net47", 82 | "net471", 83 | "net472", 84 | "net48", 85 | "net481" 86 | ], 87 | "assetTargetFallback": true, 88 | "warn": true, 89 | "frameworkReferences": { 90 | "Microsoft.NETCore.App": { 91 | "privateAssets": "all" 92 | } 93 | }, 94 | "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.302/PortableRuntimeIdentifierGraph.json" 95 | } 96 | } 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /AccraCity.Application/Repository/TownRepository.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Database; 2 | using AccraCity.Application.Interface; 3 | using AccraCity.Application.Models; 4 | using Microsoft.EntityFrameworkCore; 5 | 6 | namespace AccraCity.Application.Repository; 7 | 8 | public class TownRepository : ITownRepository 9 | { 10 | private readonly AppDbContext _context; 11 | 12 | public TownRepository(AppDbContext context) 13 | { 14 | _context = context; 15 | } 16 | 17 | public async Task> GetTownAsync(CancellationToken token = default) 18 | { 19 | var town = await _context.Town.ToListAsync(cancellationToken: token); 20 | return town; 21 | } 22 | 23 | public async Task GetTownById(Guid id, CancellationToken token = default) 24 | { 25 | var result = await _context.Town.FirstOrDefaultAsync(t => t.Id == id, cancellationToken: 26 | token); 27 | return result; 28 | } 29 | 30 | public async Task CreateTown(Town town, CancellationToken token = default) 31 | { 32 | var newTown = new Town() 33 | { 34 | Id = Guid.NewGuid(), 35 | TownName = town.TownName, 36 | Category = town.Category, 37 | Population =town.Population, 38 | Latitude = town.Latitude, 39 | Longitude =town.Longitude, 40 | CreatedAt = town.CreatedAt, 41 | //LastModifiedAt = town.LastModifiedAt, 42 | NearbyTowns = town.NearbyTowns, 43 | NotableLandMarks = town.NotableLandMarks, 44 | DistrictId = town.DistrictId, 45 | RegionId = town.RegionId 46 | }; 47 | await _context.AddAsync(newTown, token); 48 | return await Save(token); 49 | } 50 | 51 | public async Task UpdateTown(Town town, CancellationToken token = default) 52 | { 53 | var result = await _context.Town.FirstOrDefaultAsync(t => 54 | t.Id == town.Id, cancellationToken: token); 55 | 56 | if (result != null) 57 | { 58 | result.Id = town.Id; 59 | result.TownName = town.TownName; 60 | result.Category = town.Category; 61 | result.Population =town.Population; 62 | result.Latitude = town.Latitude; 63 | result.Longitude =town.Longitude; 64 | //result.CreatedAt = town.CreatedAt; 65 | result.LastModifiedAt = town.LastModifiedAt; 66 | result.NearbyTowns = town.NearbyTowns; 67 | result.NotableLandMarks = town.NotableLandMarks; 68 | result.DistrictId = town.DistrictId; 69 | result.RegionId = town.RegionId; 70 | } 71 | return await Save(token); 72 | } 73 | 74 | public async Task DeleteTown(Guid id, CancellationToken token = default) 75 | { 76 | var result = await _context.Town.FirstOrDefaultAsync(i => 77 | i.Id == id, cancellationToken: token); 78 | 79 | if (result == null) 80 | { 81 | return false; // Town not found or already deleted 82 | } 83 | _context.Remove(result); 84 | return await Save(token); 85 | } 86 | 87 | public async Task TownExists(Guid id, CancellationToken token = default) 88 | { 89 | var town = await _context.Town.AnyAsync(r => r.Id == id, cancellationToken: token); 90 | return town; 91 | } 92 | 93 | public async Task TownExistsByName(string townName, CancellationToken token = default) 94 | { 95 | var town = await _context.Town.AnyAsync(r => r.TownName == townName, cancellationToken: token); 96 | return town; 97 | } 98 | 99 | public async Task Save(CancellationToken token = default) 100 | { 101 | var saved = await _context.SaveChangesAsync(token); 102 | return saved > 0; 103 | } 104 | } -------------------------------------------------------------------------------- /AccraCityApi/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using System.Text.Json.Serialization; 3 | using AccraCity.Application; 4 | using AccraCity.Application.Database; 5 | using AccraCity.Application.Models; 6 | using Microsoft.AspNetCore.Authentication.JwtBearer; 7 | using Microsoft.AspNetCore.Identity; 8 | using Microsoft.EntityFrameworkCore; 9 | using Microsoft.IdentityModel.Tokens; 10 | using Microsoft.OpenApi.Models; 11 | using Serilog; 12 | 13 | 14 | var builder = WebApplication.CreateBuilder(args); 15 | 16 | builder.Services.AddApplication(); 17 | builder.Services.AddDbContext(options => options.UseNpgsql(builder.Configuration.GetConnectionString("Default"))); 18 | builder.Services.AddControllers().AddNewtonsoftJson(options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore); 19 | builder.Services.Configure(options => { options.SerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles; }); 20 | 21 | //Serilog Config 22 | var logger = new LoggerConfiguration().ReadFrom.Configuration(builder.Configuration).Enrich.FromLogContext().CreateLogger(); ; 23 | builder.Logging.AddSerilog(logger); 24 | 25 | // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle 26 | builder.Services.AddEndpointsApiExplorer(); 27 | builder.Services.AddSwaggerGen(opt => 28 | { 29 | opt.SwaggerDoc("v1", new OpenApiInfo { Title = "AccraCity_API", Version = "v1" }); 30 | opt.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme 31 | { 32 | In = ParameterLocation.Header, 33 | Description = "Please enter token", 34 | Name = "Authorization", 35 | Type = SecuritySchemeType.Http, 36 | BearerFormat = "JWT", 37 | Scheme = "bearer" 38 | }); 39 | opt.AddSecurityRequirement(new OpenApiSecurityRequirement 40 | { 41 | { 42 | new OpenApiSecurityScheme 43 | { 44 | Reference = new OpenApiReference 45 | { 46 | Type=ReferenceType.SecurityScheme, 47 | Id="Bearer" 48 | } 49 | }, 50 | new string[]{} 51 | } 52 | }); 53 | });; 54 | 55 | 56 | // Add Identity 57 | builder.Services 58 | .AddIdentity() //User in this case is adding more custom fields to the Identity 59 | .AddEntityFrameworkStores() 60 | .AddDefaultTokenProviders(); 61 | 62 | // Config Identity 63 | builder.Services.Configure(options => 64 | { 65 | options.Password.RequiredLength = 8; 66 | options.Password.RequireDigit = false; 67 | options.Password.RequireLowercase = false; 68 | options.Password.RequireNonAlphanumeric = false; 69 | options.Password.RequireUppercase = false; 70 | options.Password.RequiredUniqueChars = 0; 71 | options.SignIn.RequireConfirmedEmail = false; 72 | }); 73 | 74 | 75 | // Add Authentication and JwtBearer 76 | builder.Services.AddAuthentication(options => 77 | { 78 | options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; 79 | options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; 80 | options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; 81 | }) 82 | .AddJwtBearer(options => 83 | { 84 | options.SaveToken = true; 85 | options.RequireHttpsMetadata = false; 86 | options.TokenValidationParameters = new TokenValidationParameters 87 | { 88 | ValidateIssuer = true, 89 | ValidateAudience = true, 90 | ValidateLifetime = true, 91 | ValidateIssuerSigningKey = true, 92 | ValidIssuer = builder.Configuration["JWT:Issuer"], 93 | ValidAudience = builder.Configuration["JWT:Audience"], 94 | IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(builder.Configuration["JWT:SecretKey"] ?? throw new InvalidOperationException())) 95 | }; 96 | }); 97 | 98 | 99 | var app = builder.Build(); 100 | 101 | // Configure the HTTP request pipeline. 102 | if (app.Environment.IsDevelopment()) 103 | { 104 | app.UseSwagger(); 105 | app.UseSwaggerUI(); 106 | } 107 | 108 | app.UseHttpsRedirection(); 109 | app.UseAuthentication(); 110 | app.UseAuthorization(); 111 | app.MapControllers(); 112 | app.Run(); -------------------------------------------------------------------------------- /Docs/Api.md: -------------------------------------------------------------------------------- 1 | # Accra City Api 2 | 3 | 4 | The Accra-City-Towns API is a RESTful web service that offers comprehensive information about towns across various regions. 5 | It allows users to retrieve data such as population, geographical coordinates, notable landmarks, demographics, and more for a wide range of towns. 6 | Whether you need to research towns for travel planning, business expansion, or demographic analysis, this API provides access to valuable town-specific data to meet your informational needs. 7 | Explore and access town details effortlessly with this API to make informed decisions and gain insights into different townships. 8 | 9 | - [Accra City Api](#accra-city-api) 10 | - [Create Town](#create-town) 11 | - [Create Town Request](#create-town-request) 12 | - [Create Town Response](#create-town-response) 13 | - [Get Towns](#get-towns) 14 | - [Get Towns Request](#get-towns-request) 15 | - [Get Towns Response](#get-towns-response) 16 | - [Update Town](#update-town) 17 | - [Update Town Request](#update-town-request) 18 | - [Update Towns Response](#update-towns-response) 19 | - [Delete Town](#delete-town) 20 | - [Delete Town Request](#delete-town-request) 21 | - [Delete Town Response](#delete-town-response) 22 | 23 | ## Create Town 24 | 25 | ### Create Town Request 26 | 27 | ```js 28 | POST /api/town 29 | ``` 30 | 31 | ```json 32 | { 33 | "townName": "API Town", 34 | "category": "", 35 | "population": "", 36 | "latitude": "", 37 | "longitude": "", 38 | "createdAt": "", 39 | "nearbyTowns": [ 40 | "", 41 | "" 42 | ], 43 | "notableLandMarks": [ 44 | "", 45 | "" 46 | ], 47 | "districtId": "", 48 | "regionId": "" 49 | } 50 | ``` 51 | 52 | ### Create Town Response 53 | 54 | ```js 55 | 201 Created 56 | ``` 57 | 58 | ```yml 59 | Location: {{host}}/api/town/{{id}} 60 | ``` 61 | 62 | ```json 63 | { 64 | "statusCode": 201, 65 | "message": "Town retrieved successfully.", 66 | "data": { 67 | "id": "79282fbd-e975-4574-9449-2d5808439754", 68 | "townName": "Gold Town", 69 | "category": "", 70 | "population": 4444444, 71 | "latitude": 37.421024, 72 | "longitude": 122.142105, 73 | "createdAt": "2023-09-27T02:43:16.379Z", 74 | "lastModifiedAt": "2023-09-27T02:43:16.379Z", 75 | "nearbyTowns": [ 76 | "nearbyTowns 1", 77 | "nearbyTowns 2", 78 | "nearbyTowns 3" 79 | ], 80 | "notableLandMarks": [ 81 | "notableLandMarks 1", 82 | "notableLandMarks 2", 83 | "notableLandMarks 3" 84 | ], 85 | "districtId": "3cc068fd-e22d-4dd2-81fb-8775de3d2fe9", 86 | "regionId": "7e05c998-d190-4381-bc8a-08d1e41ba624" 87 | } 88 | } 89 | ``` 90 | 91 | ## Get Towns 92 | 93 | ### Get Towns Request 94 | 95 | ```js 96 | GET /api/town/town/id 97 | ``` 98 | 99 | ### Get Towns Response 100 | 101 | ```js 102 | 200 Ok 103 | ``` 104 | 105 | ```json 106 | { 107 | "statusCode": 200, 108 | "message": "Towns retrieved successfully.", 109 | "data": { 110 | "towns": [ 111 | { 112 | "id": "79282fbd-e975-4574-9449-2d5808439754", 113 | "townName": "Gold Town", 114 | "category": "", 115 | "population": 4444444, 116 | "latitude": 37.421024, 117 | "longitude": 122.142105, 118 | "createdAt": "2023-09-27T02:43:16.379Z", 119 | "lastModifiedAt": "2023-09-27T02:43:16.379Z", 120 | "nearbyTowns": [ 121 | "nearbyTowns 1", 122 | "nearbyTowns 2", 123 | "nearbyTowns 3" 124 | ], 125 | "notableLandMarks": [ 126 | "notableLandMarks 1", 127 | "notableLandMarks 2", 128 | "notableLandMarks 3" 129 | ], 130 | "districtId": "3cc068fd-e22d-4dd2-81fb-8775de3d2fe9", 131 | "regionId": "7e05c998-d190-4381-bc8a-08d1e41ba624" 132 | }, 133 | { 134 | "id": "60cd59d5-b2fe-481b-9bc9-024310a4e7b6", 135 | "townName": "Sliver-Town", 136 | "category": "", 137 | "population": 50000, 138 | "latitude": 334.998, 139 | "longitude": 223.889, 140 | "createdAt": "2023-09-29T11:48:42.919355Z", 141 | "lastModifiedAt": "0001-01-01T00:00:00", 142 | "nearbyTowns": [ 143 | "nearbyTowns 1", 144 | "nearbyTowns 2", 145 | "nearbyTowns 3" 146 | ], 147 | "notableLandMarks": [ 148 | "notableLandMarks 1", 149 | "notableLandMarks 2" 150 | ], 151 | "districtId": "b5dcafed-fff1-4326-b3d2-5e53f31c8bee", 152 | "regionId": "8f531844-4f73-4271-9d40-c98cda9a856f" 153 | } 154 | ] 155 | } 156 | } 157 | ``` 158 | 159 | ## Update Town 160 | 161 | ### Update Town Request 162 | 163 | ```js 164 | PUT /api/town/id 165 | ``` 166 | 167 | ```json 168 | { 169 | "townName": "API Town", 170 | "category": "", 171 | "population": "", 172 | "latitude": "", 173 | "longitude": "", 174 | "lastModifiedAt": "", 175 | "nearbyTowns": [ 176 | "", 177 | "" 178 | ], 179 | "notableLandMarks": [ 180 | "", 181 | "" 182 | ], 183 | "districtId": "", 184 | "regionId": "" 185 | } 186 | ``` 187 | 188 | ### Update Towns Response 189 | 190 | ```js 191 | 204 No Content 192 | ``` 193 | 194 | or 195 | 196 | ```js 197 | 201 Created 198 | ``` 199 | 200 | ```yml 201 | Location: {{host}}/town/{{id}} 202 | ``` 203 | 204 | ## Delete Town 205 | 206 | ### Delete Town Request 207 | 208 | ```js 209 | DELETE /api/town/id 210 | ``` 211 | 212 | ### Delete Town Response 213 | 214 | ```js 215 | 204 No Content 216 | ``` -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Accra-City-Towns-Api 2 | The Accra-City-Towns API is a RESTful web service that offers comprehensive information about towns across various regions. It allows users to retrieve data such as population, geographical coordinates, notable landmarks, demographics, and more for a wide range of towns. Whether you need to research towns for travel planning, business expansion, or demographic analysis, this API provides access to valuable town-specific data to meet your informational needs. Explore and access town details effortlessly with this API to make informed decisions and gain insights into different townships. 3 | 4 | # Accra City Api 5 | 6 | - [Accra City Api](#accra-city-api) 7 | - [Create Town](#create-town) 8 | - [Create Town Request](#create-town-request) 9 | - [Create Town Response](#create-town-response) 10 | - [Get Towns](#get-towns) 11 | - [Get Towns Request](#get-towns-request) 12 | - [Get Towns Response](#get-towns-response) 13 | - [Update Town](#update-town) 14 | - [Update Town Request](#update-town-request) 15 | - [Update Towns Response](#update-towns-response) 16 | - [Delete Town](#delete-town) 17 | - [Delete Town Request](#delete-town-request) 18 | - [Delete Town Response](#delete-town-response) 19 | 20 | ## Create Town 21 | 22 | ### Create Town Request 23 | 24 | ```js 25 | POST api/town 26 | ``` 27 | 28 | ```json 29 | { 30 | "townName": "API Town", 31 | "category": "", 32 | "population": "", 33 | "latitude": "", 34 | "longitude": "", 35 | "createdAt": "", 36 | "nearbyTowns": [ 37 | "", 38 | "" 39 | ], 40 | "notableLandMarks": [ 41 | "", 42 | "" 43 | ], 44 | "districtId": "", 45 | "regionId": "" 46 | } 47 | ``` 48 | 49 | ### Create Town Response 50 | 51 | ```js 52 | 201 Created 53 | ``` 54 | 55 | ```yml 56 | Location: {{host}}/town/{{id}} 57 | ``` 58 | 59 | ```json 60 | { 61 | "statusCode": 201, 62 | "message": "Town retrieved successfully.", 63 | "data": { 64 | "id": "79282fbd-e975-4574-9449-2d5808439754", 65 | "townName": "Gold Town", 66 | "category": "", 67 | "population": 4444444, 68 | "latitude": 37.421024, 69 | "longitude": 122.142105, 70 | "createdAt": "2023-09-27T02:43:16.379Z", 71 | "lastModifiedAt": "2023-09-27T02:43:16.379Z", 72 | "nearbyTowns": [ 73 | "nearbyTowns 1", 74 | "nearbyTowns 2", 75 | "nearbyTowns 3" 76 | ], 77 | "notableLandMarks": [ 78 | "notableLandMarks 1", 79 | "notableLandMarks 2", 80 | "notableLandMarks 3" 81 | ], 82 | "districtId": "3cc068fd-e22d-4dd2-81fb-8775de3d2fe9", 83 | "regionId": "7e05c998-d190-4381-bc8a-08d1e41ba624" 84 | } 85 | ``` 86 | 87 | ## Get Towns 88 | 89 | ### Get Towns Request 90 | 91 | ```js 92 | GET api/town/{{id}} 93 | ``` 94 | 95 | ### Get Towns Response 96 | 97 | ```js 98 | 200 Ok 99 | ``` 100 | 101 | ```json 102 | { 103 | "statusCode": 200, 104 | "message": "Towns retrieved successfully.", 105 | "data": { 106 | "towns": [ 107 | { 108 | "id": "79282fbd-e975-4574-9449-2d5808439754", 109 | "townName": "Gold Town", 110 | "category": "", 111 | "population": 4444444, 112 | "latitude": 37.421024, 113 | "longitude": 122.142105, 114 | "createdAt": "2023-09-27T02:43:16.379Z", 115 | "lastModifiedAt": "2023-09-27T02:43:16.379Z", 116 | "nearbyTowns": [ 117 | "nearbyTowns 1", 118 | "nearbyTowns 2", 119 | "nearbyTowns 3" 120 | ], 121 | "notableLandMarks": [ 122 | "notableLandMarks 1", 123 | "notableLandMarks 2", 124 | "notableLandMarks 3" 125 | ], 126 | "districtId": "3cc068fd-e22d-4dd2-81fb-8775de3d2fe9", 127 | "regionId": "7e05c998-d190-4381-bc8a-08d1e41ba624" 128 | }, 129 | { 130 | "id": "60cd59d5-b2fe-481b-9bc9-024310a4e7b6", 131 | "townName": "Sliver-Town", 132 | "category": "", 133 | "population": 50000, 134 | "latitude": 334.998, 135 | "longitude": 223.889, 136 | "createdAt": "2023-09-29T11:48:42.919355Z", 137 | "lastModifiedAt": "0001-01-01T00:00:00", 138 | "nearbyTowns": [ 139 | "nearbyTowns 1", 140 | "nearbyTowns 2", 141 | "nearbyTowns 3" 142 | ], 143 | "notableLandMarks": [ 144 | "notableLandMarks 1", 145 | "notableLandMarks 2" 146 | ], 147 | "districtId": "b5dcafed-fff1-4326-b3d2-5e53f31c8bee", 148 | "regionId": "8f531844-4f73-4271-9d40-c98cda9a856f" 149 | } 150 | ] 151 | } 152 | } 153 | ``` 154 | 155 | ## Update Town 156 | 157 | ### Update Town Request 158 | 159 | ```js 160 | PUT api/town/{{id}} 161 | ``` 162 | 163 | ```json 164 | { 165 | "townName": "API Town", 166 | "category": "", 167 | "population": "", 168 | "latitude": "", 169 | "longitude": "", 170 | "lastModifiedAt": "", 171 | "nearbyTowns": [ 172 | "", 173 | "" 174 | ], 175 | "notableLandMarks": [ 176 | "", 177 | "" 178 | ], 179 | "districtId": "", 180 | "regionId": "" 181 | } 182 | ``` 183 | 184 | ### Update Towns Response 185 | 186 | ```js 187 | 204 No Content 188 | ``` 189 | 190 | or 191 | 192 | ```js 193 | 201 Created 194 | ``` 195 | 196 | ```yml 197 | Location: {{host}}/api/town/{{id}} 198 | ``` 199 | 200 | ## Delete Town 201 | 202 | ### Delete Town Request 203 | 204 | ```js 205 | DELETE api/town/{{id}} 206 | ``` 207 | 208 | ### Delete Town Response 209 | 210 | ```js 211 | 204 No Content 212 | ``` 213 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | . 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/AccraCityApi.Contracts.csproj.nuget.dgspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "format": 1, 3 | "restore": { 4 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj": {} 5 | }, 6 | "projects": { 7 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj": { 8 | "version": "1.0.0", 9 | "restore": { 10 | "projectUniqueName": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj", 11 | "projectName": "AccraCity.Application", 12 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj", 13 | "packagesPath": "/Users/perigrinobruce/.nuget/packages/", 14 | "outputPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/", 15 | "projectStyle": "PackageReference", 16 | "configFilePaths": [ 17 | "/Users/perigrinobruce/.nuget/NuGet/NuGet.Config" 18 | ], 19 | "originalTargetFrameworks": [ 20 | "net8.0" 21 | ], 22 | "sources": { 23 | "https://api.nuget.org/v3/index.json": {} 24 | }, 25 | "frameworks": { 26 | "net8.0": { 27 | "targetAlias": "net8.0", 28 | "projectReferences": {} 29 | } 30 | }, 31 | "warningProperties": { 32 | "warnAsError": [ 33 | "NU1605" 34 | ] 35 | } 36 | }, 37 | "frameworks": { 38 | "net8.0": { 39 | "targetAlias": "net8.0", 40 | "dependencies": { 41 | "Microsoft.AspNetCore.Authentication.JwtBearer": { 42 | "target": "Package", 43 | "version": "[8.0.7, )" 44 | }, 45 | "Microsoft.AspNetCore.Identity.EntityFrameworkCore": { 46 | "target": "Package", 47 | "version": "[8.0.7, )" 48 | }, 49 | "Microsoft.AspNetCore.Mvc.NewtonsoftJson": { 50 | "target": "Package", 51 | "version": "[8.0.7, )" 52 | }, 53 | "Microsoft.EntityFrameworkCore": { 54 | "target": "Package", 55 | "version": "[8.0.7, )" 56 | }, 57 | "Microsoft.EntityFrameworkCore.Design": { 58 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 59 | "suppressParent": "All", 60 | "target": "Package", 61 | "version": "[8.0.7, )" 62 | }, 63 | "Microsoft.EntityFrameworkCore.Tools": { 64 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 65 | "suppressParent": "All", 66 | "target": "Package", 67 | "version": "[8.0.7, )" 68 | }, 69 | "Npgsql.EntityFrameworkCore.PostgreSQL": { 70 | "target": "Package", 71 | "version": "[8.0.4, )" 72 | }, 73 | "Serilog.AspNetCore": { 74 | "target": "Package", 75 | "version": "[5.0.0, )" 76 | } 77 | }, 78 | "imports": [ 79 | "net461", 80 | "net462", 81 | "net47", 82 | "net471", 83 | "net472", 84 | "net48", 85 | "net481" 86 | ], 87 | "assetTargetFallback": true, 88 | "warn": true, 89 | "frameworkReferences": { 90 | "Microsoft.NETCore.App": { 91 | "privateAssets": "all" 92 | } 93 | }, 94 | "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.302/PortableRuntimeIdentifierGraph.json" 95 | } 96 | } 97 | }, 98 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj": { 99 | "version": "1.0.0", 100 | "restore": { 101 | "projectUniqueName": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj", 102 | "projectName": "AccraCityApi.Contracts", 103 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj", 104 | "packagesPath": "/Users/perigrinobruce/.nuget/packages/", 105 | "outputPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/", 106 | "projectStyle": "PackageReference", 107 | "configFilePaths": [ 108 | "/Users/perigrinobruce/.nuget/NuGet/NuGet.Config" 109 | ], 110 | "originalTargetFrameworks": [ 111 | "net8.0" 112 | ], 113 | "sources": { 114 | "https://api.nuget.org/v3/index.json": {} 115 | }, 116 | "frameworks": { 117 | "net8.0": { 118 | "targetAlias": "net8.0", 119 | "projectReferences": { 120 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj": { 121 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj" 122 | } 123 | } 124 | } 125 | }, 126 | "warningProperties": { 127 | "warnAsError": [ 128 | "NU1605" 129 | ] 130 | } 131 | }, 132 | "frameworks": { 133 | "net8.0": { 134 | "targetAlias": "net8.0", 135 | "imports": [ 136 | "net461", 137 | "net462", 138 | "net47", 139 | "net471", 140 | "net472", 141 | "net48", 142 | "net481" 143 | ], 144 | "assetTargetFallback": true, 145 | "warn": true, 146 | "frameworkReferences": { 147 | "Microsoft.NETCore.App": { 148 | "privateAssets": "all" 149 | } 150 | }, 151 | "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.302/PortableRuntimeIdentifierGraph.json" 152 | } 153 | } 154 | } 155 | } 156 | } -------------------------------------------------------------------------------- /AccraCityApi.Contracts/obj/project.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "dgSpecHash": "/FgfQ87bo6OkK62JzpSH8Kw6kr6hpbuJuMFHp6P3RSw1DM5lNX17RGfmrS09DSmujiRtHfWwapCgaZAuf9Braw==", 4 | "success": true, 5 | "projectFilePath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj", 6 | "expectedPackageFiles": [ 7 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.authentication.jwtbearer/8.0.7/microsoft.aspnetcore.authentication.jwtbearer.8.0.7.nupkg.sha512", 8 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.cryptography.internal/8.0.7/microsoft.aspnetcore.cryptography.internal.8.0.7.nupkg.sha512", 9 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.cryptography.keyderivation/8.0.7/microsoft.aspnetcore.cryptography.keyderivation.8.0.7.nupkg.sha512", 10 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.identity.entityframeworkcore/8.0.7/microsoft.aspnetcore.identity.entityframeworkcore.8.0.7.nupkg.sha512", 11 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.jsonpatch/8.0.7/microsoft.aspnetcore.jsonpatch.8.0.7.nupkg.sha512", 12 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.mvc.newtonsoftjson/8.0.7/microsoft.aspnetcore.mvc.newtonsoftjson.8.0.7.nupkg.sha512", 13 | "/Users/perigrinobruce/.nuget/packages/microsoft.csharp/4.7.0/microsoft.csharp.4.7.0.nupkg.sha512", 14 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore/8.0.7/microsoft.entityframeworkcore.8.0.7.nupkg.sha512", 15 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.abstractions/8.0.7/microsoft.entityframeworkcore.abstractions.8.0.7.nupkg.sha512", 16 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.analyzers/8.0.7/microsoft.entityframeworkcore.analyzers.8.0.7.nupkg.sha512", 17 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.relational/8.0.7/microsoft.entityframeworkcore.relational.8.0.7.nupkg.sha512", 18 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.caching.abstractions/8.0.0/microsoft.extensions.caching.abstractions.8.0.0.nupkg.sha512", 19 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.caching.memory/8.0.0/microsoft.extensions.caching.memory.8.0.0.nupkg.sha512", 20 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.configuration/2.0.0/microsoft.extensions.configuration.2.0.0.nupkg.sha512", 21 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.configuration.abstractions/8.0.0/microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512", 22 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.configuration.binder/2.0.0/microsoft.extensions.configuration.binder.2.0.0.nupkg.sha512", 23 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.dependencyinjection/8.0.0/microsoft.extensions.dependencyinjection.8.0.0.nupkg.sha512", 24 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.dependencyinjection.abstractions/8.0.0/microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512", 25 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.dependencymodel/3.0.0/microsoft.extensions.dependencymodel.3.0.0.nupkg.sha512", 26 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.fileproviders.abstractions/3.1.8/microsoft.extensions.fileproviders.abstractions.3.1.8.nupkg.sha512", 27 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.hosting.abstractions/3.1.8/microsoft.extensions.hosting.abstractions.3.1.8.nupkg.sha512", 28 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.identity.core/8.0.7/microsoft.extensions.identity.core.8.0.7.nupkg.sha512", 29 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.identity.stores/8.0.7/microsoft.extensions.identity.stores.8.0.7.nupkg.sha512", 30 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.logging/8.0.0/microsoft.extensions.logging.8.0.0.nupkg.sha512", 31 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.logging.abstractions/8.0.0/microsoft.extensions.logging.abstractions.8.0.0.nupkg.sha512", 32 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.options/8.0.2/microsoft.extensions.options.8.0.2.nupkg.sha512", 33 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.options.configurationextensions/2.0.0/microsoft.extensions.options.configurationextensions.2.0.0.nupkg.sha512", 34 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.primitives/8.0.0/microsoft.extensions.primitives.8.0.0.nupkg.sha512", 35 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.abstractions/7.1.2/microsoft.identitymodel.abstractions.7.1.2.nupkg.sha512", 36 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.jsonwebtokens/7.1.2/microsoft.identitymodel.jsonwebtokens.7.1.2.nupkg.sha512", 37 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.logging/7.1.2/microsoft.identitymodel.logging.7.1.2.nupkg.sha512", 38 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.protocols/7.1.2/microsoft.identitymodel.protocols.7.1.2.nupkg.sha512", 39 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.protocols.openidconnect/7.1.2/microsoft.identitymodel.protocols.openidconnect.7.1.2.nupkg.sha512", 40 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.tokens/7.1.2/microsoft.identitymodel.tokens.7.1.2.nupkg.sha512", 41 | "/Users/perigrinobruce/.nuget/packages/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg.sha512", 42 | "/Users/perigrinobruce/.nuget/packages/newtonsoft.json.bson/1.0.2/newtonsoft.json.bson.1.0.2.nupkg.sha512", 43 | "/Users/perigrinobruce/.nuget/packages/npgsql/8.0.3/npgsql.8.0.3.nupkg.sha512", 44 | "/Users/perigrinobruce/.nuget/packages/npgsql.entityframeworkcore.postgresql/8.0.4/npgsql.entityframeworkcore.postgresql.8.0.4.nupkg.sha512", 45 | "/Users/perigrinobruce/.nuget/packages/serilog/2.10.0/serilog.2.10.0.nupkg.sha512", 46 | "/Users/perigrinobruce/.nuget/packages/serilog.aspnetcore/5.0.0/serilog.aspnetcore.5.0.0.nupkg.sha512", 47 | "/Users/perigrinobruce/.nuget/packages/serilog.extensions.hosting/4.2.0/serilog.extensions.hosting.4.2.0.nupkg.sha512", 48 | "/Users/perigrinobruce/.nuget/packages/serilog.extensions.logging/3.1.0/serilog.extensions.logging.3.1.0.nupkg.sha512", 49 | "/Users/perigrinobruce/.nuget/packages/serilog.formatting.compact/1.1.0/serilog.formatting.compact.1.1.0.nupkg.sha512", 50 | "/Users/perigrinobruce/.nuget/packages/serilog.settings.configuration/3.3.0/serilog.settings.configuration.3.3.0.nupkg.sha512", 51 | "/Users/perigrinobruce/.nuget/packages/serilog.sinks.console/4.0.1/serilog.sinks.console.4.0.1.nupkg.sha512", 52 | "/Users/perigrinobruce/.nuget/packages/serilog.sinks.debug/2.0.0/serilog.sinks.debug.2.0.0.nupkg.sha512", 53 | "/Users/perigrinobruce/.nuget/packages/serilog.sinks.file/5.0.0/serilog.sinks.file.5.0.0.nupkg.sha512", 54 | "/Users/perigrinobruce/.nuget/packages/system.identitymodel.tokens.jwt/7.1.2/system.identitymodel.tokens.jwt.7.1.2.nupkg.sha512", 55 | "/Users/perigrinobruce/.nuget/packages/system.text.json/4.6.0/system.text.json.4.6.0.nupkg.sha512" 56 | ], 57 | "logs": [] 58 | } -------------------------------------------------------------------------------- /AccraCityApi/Controllers/TownController.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Interface; 2 | using AccraCityApi.ContractMappings; 3 | using AccraCityApi.Contracts.AccraCity; 4 | using AccraCityApi.Contracts.Requests.TownRequests; 5 | using AccraCityApi.Contracts.Response; 6 | using AccraCityApi.Contracts.Response.TownResponses; 7 | using Microsoft.AspNetCore.Mvc; 8 | 9 | namespace AccraCityApi.Controllers; 10 | 11 | 12 | [ApiController] 13 | public class TownController : Controller 14 | { 15 | private readonly ITownRepository _townRepository; 16 | private readonly ILogger _logger; 17 | 18 | 19 | public TownController(ITownRepository townRepository, ILogger logger) 20 | { 21 | _townRepository = townRepository; 22 | _logger = logger; 23 | } 24 | 25 | //GET all Towns 26 | [HttpGet(ApiEndpoints.Town.GetAll)] 27 | public async Task GetTowns(CancellationToken token) 28 | { 29 | try 30 | { 31 | _logger.LogInformation("Get All towns method executing"); 32 | var towns = await _townRepository.GetTownAsync(token); 33 | var townsResponse = new FinalResponse 34 | { 35 | StatusCode = 200, 36 | Message = "Towns retrieved successfully.", 37 | Data = towns.MapsToResponse() 38 | }; 39 | _logger.LogInformation("Get All towns method successful"); 40 | return Ok(townsResponse); 41 | } 42 | catch (Exception ex) 43 | { 44 | _logger.LogInformation("Error in Get Towns Method"); 45 | _logger.LogError(ex, "Error in Get Towns Method"); 46 | return Ok(); 47 | } 48 | } 49 | 50 | //GET TownById 51 | [HttpGet(ApiEndpoints.Town.GetTown)] 52 | public async Task GetTown([FromRoute] Guid id, CancellationToken token) 53 | { 54 | try 55 | { 56 | _logger.LogInformation("GetTown method executing"); 57 | var town = await _townRepository.GetTownById(id, token); 58 | if (town == null) 59 | { 60 | return NotFound(new FinalResponse 61 | { 62 | StatusCode = 404, 63 | Message = "Town not found." 64 | }); 65 | } 66 | 67 | var townResponse = new FinalResponse 68 | { 69 | StatusCode = 200, 70 | Message = "Town retrieved successfully.", 71 | Data = town.MapsToResponse() 72 | }; 73 | _logger.LogInformation("GetTown method : success"); 74 | return Ok(townResponse); 75 | } 76 | catch (Exception ex) 77 | { 78 | _logger.LogInformation("Error in Get Town Method"); 79 | _logger.LogError(ex, "Error in Get Town Method"); 80 | return Ok(); 81 | } 82 | } 83 | 84 | //POST Create Town 85 | [HttpPost(ApiEndpoints.Town.Create)] 86 | public async Task CreateTown([FromBody] CreateTownRequest request, CancellationToken token) 87 | { 88 | try 89 | { 90 | if (request == null) 91 | { 92 | return BadRequest(new FinalResponse() { StatusCode = 400, Message = "Town data is invalid." }); 93 | } 94 | 95 | if (!ModelState.IsValid) 96 | { 97 | return BadRequest(new FinalResponse { StatusCode = 400, Message = "Validation failed.", Data = ModelState }); 98 | } 99 | 100 | var townExists = _townRepository.TownExistsByName(request.TownName, token); 101 | if (await townExists) 102 | { 103 | return Conflict(new FinalResponse { StatusCode = 409, Message = "Town already exists." }); 104 | } 105 | 106 | var mapToTown = request.MapToTown(); 107 | 108 | _logger.LogInformation("CreateTown method executing"); 109 | await _townRepository.CreateTown(mapToTown, token); 110 | var townResponse = new FinalResponse 111 | { 112 | StatusCode = 201, 113 | Message = "Town created successfully.", 114 | Data = mapToTown.MapsToResponse() 115 | }; 116 | _logger.LogInformation("CreateTown method success"); 117 | return CreatedAtAction(nameof(GetTown), new { id = mapToTown.Id }, townResponse); 118 | } 119 | catch (Exception ex) 120 | { 121 | _logger.LogInformation("Error in Create Town Method"); 122 | _logger.LogError(ex, "Error in Create Town Method"); 123 | return Ok(); 124 | } 125 | 126 | } 127 | 128 | //UPDATE Update Town Details 129 | [HttpPut(ApiEndpoints.Town.Update)] 130 | public async Task Update([FromRoute] Guid id, [FromBody] UpdateTownRequest request, CancellationToken token) 131 | { 132 | try 133 | { 134 | if (request == null) 135 | { 136 | return BadRequest(new FinalResponse() { StatusCode = 400, Message = "Town data is invalid." }); 137 | } 138 | 139 | if (!ModelState.IsValid) 140 | { 141 | return BadRequest(new FinalResponse { StatusCode = 400, Message = "Validation failed.", Data = ModelState }); 142 | } 143 | 144 | var mapToTown = request.MapToTown(id); 145 | 146 | _logger.LogInformation("UpdateTown method executing"); 147 | var updatedTown = await _townRepository.UpdateTown(mapToTown, token); 148 | if (updatedTown is false) 149 | { 150 | return NotFound(new FinalResponse 151 | { 152 | StatusCode = 404, 153 | Message = "Town not found." 154 | }); 155 | } 156 | 157 | var response = new FinalResponse 158 | { 159 | StatusCode = 200, 160 | Message = "Town details updated successfully.", 161 | Data = mapToTown.MapsToResponse() 162 | }; 163 | _logger.LogInformation("UpdateTown method success"); 164 | return Ok(response); 165 | } 166 | catch (Exception ex) 167 | { 168 | _logger.LogInformation("Error in Update Town Method"); 169 | _logger.LogError(ex, "Error in Update Town Method"); 170 | return Ok(); 171 | } 172 | } 173 | 174 | //DELETE Town 175 | [HttpDelete(ApiEndpoints.Town.Delete)] 176 | public async Task Delete(Guid id, CancellationToken token) 177 | { 178 | try 179 | { 180 | await _townRepository.TownExists(id, token); 181 | _logger.LogInformation("DeleteTown method executing"); 182 | var deleteTown = await _townRepository.DeleteTown(id, token); 183 | if (!deleteTown) 184 | { 185 | return NotFound(new FinalResponse 186 | { 187 | StatusCode = 404, 188 | Message = "Town not found or already deleted", 189 | Data = null 190 | }); 191 | } 192 | 193 | _logger.LogInformation("DeleteTown method success"); 194 | return Ok(new FinalResponse 195 | { 196 | StatusCode = 200, 197 | Message = "Town deleted successfully", 198 | Data = null 199 | }); 200 | } 201 | catch (Exception ex) 202 | { 203 | _logger.LogInformation("Error in Delete Town Method"); 204 | _logger.LogError(ex, "Error in Delete Town Method"); 205 | return Ok(); 206 | } 207 | } 208 | } -------------------------------------------------------------------------------- /AccraCityApi/Controllers/RegionController.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Interface; 2 | using AccraCityApi.ContractMappings; 3 | using AccraCityApi.Contracts.Requests.RegionRequests; 4 | using AccraCityApi.Contracts.Response; 5 | using AccraCityApi.Contracts.Response.RegionResponses; 6 | using Microsoft.AspNetCore.Mvc; 7 | 8 | namespace AccraCityApi.Controllers; 9 | 10 | [ApiController] 11 | public class RegionController : Controller 12 | { 13 | private readonly IRegionRepository _regionRepository; 14 | private readonly ILogger _logger; 15 | 16 | public RegionController(IRegionRepository regionRepository, ILogger logger) 17 | { 18 | _regionRepository = regionRepository; 19 | _logger = logger; 20 | } 21 | 22 | //GET all Regions 23 | [HttpGet(ApiEndpoints.Region.GetAll)] 24 | public async Task GetRegions(CancellationToken token) 25 | { 26 | try 27 | { 28 | _logger.LogInformation("Get All Regions method executing"); 29 | var region = await _regionRepository.GetRegionAsync(token); 30 | var regionsResponse = new FinalResponse 31 | { 32 | StatusCode = 200, 33 | Message = "Regions retrieved successfully.", 34 | Data = region.MapsToResponse() 35 | }; 36 | _logger.LogInformation("Get All Regions method successful"); 37 | return Ok(regionsResponse); 38 | } 39 | catch (Exception ex) 40 | { 41 | _logger.LogInformation("Error in Get Regions Method"); 42 | _logger.LogError(ex, "Error in Get Regions Method"); 43 | return Ok(); 44 | } 45 | } 46 | 47 | //GET RegionById 48 | [HttpGet(ApiEndpoints.Region.GetRegion)] 49 | public async Task GetRegion([FromRoute] Guid id, CancellationToken token) 50 | { 51 | try 52 | { 53 | _logger.LogInformation("GetRegion method executing"); 54 | var region = await _regionRepository.GetRegionById(id, token); 55 | if (region == null) 56 | { 57 | return NotFound(new FinalResponse 58 | { 59 | StatusCode = 404, 60 | Message = "Region not found." 61 | }); 62 | } 63 | 64 | var regionResponse = new FinalResponse 65 | { 66 | StatusCode = 200, 67 | Message = "Region retrieved successfully.", 68 | Data = region.MapsToResponse() 69 | }; 70 | _logger.LogInformation("GetRegion method successful"); 71 | return Ok(regionResponse); 72 | } 73 | catch (Exception ex) 74 | { 75 | _logger.LogInformation("Error in Get Region Method"); 76 | _logger.LogError(ex, "Error in Get Region Method"); 77 | return Ok(); 78 | } 79 | } 80 | 81 | //POST Create Region 82 | [HttpPost(ApiEndpoints.Region.Create)] 83 | public async Task CreateRegion([FromBody] CreateRegionRequest request, CancellationToken token) 84 | { 85 | try 86 | { 87 | if (request == null) 88 | { 89 | return BadRequest(new FinalResponse() { StatusCode = 400, Message = "Region data is invalid." }); 90 | } 91 | 92 | if (!ModelState.IsValid) 93 | { 94 | return BadRequest(new FinalResponse { StatusCode = 400, Message = "Validation failed.", Data = ModelState }); 95 | } 96 | 97 | var doesRegionExists = _regionRepository.RegionExistsByName(request.RegionName, token); 98 | if (await doesRegionExists) 99 | { 100 | return Conflict(new FinalResponse { StatusCode = 409, Message = "Region already exists." }); 101 | } 102 | 103 | var mapToRegion = request.MapToRegion(); 104 | _logger.LogInformation("CreateRegion method executing"); 105 | await _regionRepository.CreateRegion(mapToRegion, token); 106 | var regionResponse = new FinalResponse 107 | { 108 | StatusCode = 201, 109 | Message = "Region created successfully.", 110 | Data = mapToRegion.MapsToResponse() 111 | }; 112 | _logger.LogInformation("CreateRegion method successful"); 113 | return CreatedAtAction(nameof(GetRegion), new { id = mapToRegion.Id }, regionResponse); 114 | } 115 | catch (Exception ex) 116 | { 117 | _logger.LogInformation("Error in Create Region Method"); 118 | _logger.LogError(ex, "Error in Create Method"); 119 | return Ok(); 120 | } 121 | } 122 | 123 | //UPDATE Update Region Details 124 | [HttpPut(ApiEndpoints.Region.Update)] 125 | public async Task Update([FromRoute] Guid id, [FromBody] UpdateRegionRequest request, CancellationToken token) 126 | { 127 | try 128 | { 129 | if (request == null) 130 | { 131 | return BadRequest(new FinalResponse() { StatusCode = 400, Message = "Region data is invalid." }); 132 | } 133 | 134 | if (!ModelState.IsValid) 135 | { 136 | return BadRequest(new FinalResponse { StatusCode = 400, Message = "Validation failed.", Data = ModelState }); 137 | } 138 | 139 | var mapToRegion = request.MapToRegion(id); 140 | 141 | _logger.LogInformation("UpdateRegion method executing"); 142 | var updatedRegion = await _regionRepository.UpdateRegion(mapToRegion, token); 143 | if (updatedRegion is false) 144 | { 145 | return NotFound(new FinalResponse 146 | { 147 | StatusCode = 404, 148 | Message = "Region not found." 149 | }); 150 | } 151 | 152 | var response = new FinalResponse 153 | { 154 | StatusCode = 200, 155 | Message = "Region details updated successfully.", 156 | Data = mapToRegion.MapsToResponse() 157 | }; 158 | _logger.LogInformation("UpdateRegion method success"); 159 | return Ok(response); 160 | } 161 | catch (Exception ex) 162 | { 163 | _logger.LogInformation("Error in Update Region Method"); 164 | _logger.LogError(ex, "Error in Update Method"); 165 | return Ok(); 166 | } 167 | 168 | } 169 | 170 | //DELETE Region 171 | [HttpDelete(ApiEndpoints.Region.Delete)] 172 | public async Task Delete(Guid id, CancellationToken token) 173 | { 174 | try 175 | { 176 | await _regionRepository.RegionExists(id, token); 177 | _logger.LogInformation("DeleteRegion method executing"); 178 | var deleteRegion = await _regionRepository.DeleteRegion(id, token); 179 | if (!deleteRegion) 180 | { 181 | return NotFound(new FinalResponse 182 | { 183 | StatusCode = 404, 184 | Message = "Region not found or already deleted", 185 | Data = null 186 | }); 187 | } 188 | 189 | _logger.LogInformation("DeleteRegion method success"); 190 | return Ok(new FinalResponse 191 | { 192 | StatusCode = 200, 193 | Message = "Region deleted successfully", 194 | Data = null 195 | }); 196 | } 197 | catch (Exception ex) 198 | { 199 | _logger.LogInformation("Error in Delete Region Method"); 200 | _logger.LogError(ex, "Error in Delete Method"); 201 | return Ok(); 202 | } 203 | } 204 | } -------------------------------------------------------------------------------- /AccraCityApi/Controllers/DistrictController.cs: -------------------------------------------------------------------------------- 1 | using AccraCity.Application.Interface; 2 | using AccraCity.Application.Models; 3 | using AccraCityApi.ContractMappings; 4 | using AccraCityApi.Contracts.Requests.DistrictRequests; 5 | using AccraCityApi.Contracts.Response; 6 | using AccraCityApi.Contracts.Response.DistrictResponse; 7 | using Microsoft.AspNetCore.Mvc; 8 | 9 | namespace AccraCityApi.Controllers; 10 | 11 | [ApiController] 12 | public class DistrictController : Controller 13 | { 14 | private readonly IDistrictRepository _districtRepository; 15 | private readonly ILogger _logger; 16 | 17 | public DistrictController(IDistrictRepository districtRepository, ILogger logger) 18 | { 19 | _districtRepository = districtRepository; 20 | _logger = logger; 21 | } 22 | 23 | //GET all Districts 24 | [HttpGet(ApiEndpoints.District.GetAll)] 25 | public async Task GetDistricts(CancellationToken token) 26 | { 27 | try 28 | { 29 | _logger.LogInformation("Get All Districts method executing"); 30 | var district = await _districtRepository.GetDistrictAsync(token); 31 | var districtsResponse = new FinalResponse 32 | { 33 | StatusCode = 200, 34 | Message = "Districts retrieved successfully.", 35 | Data = district.MapsToResponse() 36 | }; 37 | _logger.LogInformation("Get All Districts method success"); 38 | return Ok(districtsResponse); 39 | } 40 | catch (Exception ex) 41 | { 42 | _logger.LogInformation("Error in Get Districts Method"); 43 | _logger.LogError(ex, "Error in Get Districts Method"); 44 | return Ok(); 45 | } 46 | } 47 | 48 | //GET DistrictById 49 | [HttpGet(ApiEndpoints.District.GetDistrict)] 50 | public async Task GetDistrict([FromRoute] Guid id, CancellationToken token) 51 | { 52 | try 53 | { 54 | _logger.LogInformation("GetDistrict method executing"); 55 | var district = await _districtRepository.GetDistrictById(id, token); 56 | if (district == null) 57 | { 58 | return NotFound(new FinalResponse 59 | { 60 | StatusCode = 404, 61 | Message = "District not found." 62 | }); 63 | } 64 | 65 | var districtResponse = new FinalResponse 66 | { 67 | StatusCode = 200, 68 | Message = "District retrieved successfully.", 69 | Data = district.MapsToResponse() 70 | }; 71 | _logger.LogInformation("GetDistrict method success"); 72 | return Ok(districtResponse); 73 | } 74 | catch (Exception ex) 75 | { 76 | _logger.LogInformation("Error in Get District Method"); 77 | _logger.LogError(ex, "Error in Get District Method"); 78 | return Ok(); 79 | } 80 | } 81 | 82 | //POST Create District 83 | [HttpPost(ApiEndpoints.District.Create)] 84 | public async Task CreateDistrict([FromBody] CreateDistrictRequest request, CancellationToken token) 85 | { 86 | try 87 | { 88 | if (request == null) 89 | { 90 | return BadRequest(new FinalResponse() { StatusCode = 400, Message = "District data is invalid." }); 91 | } 92 | 93 | if (!ModelState.IsValid) 94 | { 95 | return BadRequest(new FinalResponse { StatusCode = 400, Message = "Validation failed.", Data = ModelState }); 96 | } 97 | 98 | var doesDistrictExists = _districtRepository.DistrictExistsByName(request.DistrictName, token); 99 | if (await doesDistrictExists) 100 | { 101 | return Conflict(new FinalResponse { StatusCode = 409, Message = "District already exists." }); 102 | } 103 | 104 | var mapToDistrict = request.MapToDistrict(); 105 | 106 | _logger.LogInformation("CreateRegion method executing"); 107 | await _districtRepository.CreateDistrict(mapToDistrict, token); 108 | var districtResponse = new FinalResponse 109 | { 110 | StatusCode = 201, 111 | Message = "District created successfully.", 112 | Data = mapToDistrict.MapsToResponse() 113 | }; 114 | _logger.LogInformation("CreateRegion method success"); 115 | return CreatedAtAction(nameof(GetDistrict), new { id = mapToDistrict.Id }, districtResponse); 116 | } 117 | catch (Exception ex) 118 | { 119 | _logger.LogInformation("CreateDistrict Method"); 120 | _logger.LogError(ex, "Error in Get District Method"); 121 | return Ok(); 122 | } 123 | } 124 | 125 | //UPDATE Update District Details 126 | [HttpPut(ApiEndpoints.District.Update)] 127 | public async Task Update([FromRoute] Guid id, [FromBody] UpdateDistrictRequest request, CancellationToken token) 128 | { 129 | try 130 | { 131 | if (request == null) 132 | { 133 | return BadRequest(new FinalResponse() { StatusCode = 400, Message = "District data is invalid." }); 134 | } 135 | 136 | if (!ModelState.IsValid) 137 | { 138 | return BadRequest(new FinalResponse { StatusCode = 400, Message = "Validation failed.", Data = ModelState }); 139 | } 140 | 141 | var mapToDistrict = request.MapToDistrict(id); 142 | 143 | _logger.LogInformation("UpdateDistrict method executing"); 144 | var updatedDistrict = await _districtRepository.UpdateDistrict(mapToDistrict, token); 145 | if (updatedDistrict is false) 146 | { 147 | return NotFound(new FinalResponse 148 | { 149 | StatusCode = 404, 150 | Message = "District not found." 151 | }); 152 | } 153 | 154 | var response = new FinalResponse 155 | { 156 | StatusCode = 200, 157 | Message = "District details updated successfully.", 158 | Data = mapToDistrict.MapsToResponse() 159 | }; 160 | _logger.LogInformation("UpdateDistrict method success"); 161 | return Ok(response); 162 | } 163 | catch (Exception ex) 164 | { 165 | _logger.LogInformation("Error in UpdateDistrict Method"); 166 | _logger.LogError(ex, "Error in UpdateDistrict Method"); 167 | return Ok(); 168 | } 169 | 170 | } 171 | 172 | //DELETE District 173 | [HttpDelete(ApiEndpoints.District.Delete)] 174 | public async Task Delete(Guid id, CancellationToken token) 175 | { 176 | try 177 | { 178 | await _districtRepository.DistrictExists(id, token); 179 | 180 | _logger.LogInformation("DeleteDistrict method executing"); 181 | var deleteDistrict = await _districtRepository.DeleteDistrict(id, token); 182 | if (!deleteDistrict) 183 | { 184 | return NotFound(new FinalResponse 185 | { 186 | StatusCode = 404, 187 | Message = "District not found or already deleted", 188 | Data = null 189 | }); 190 | } 191 | 192 | _logger.LogInformation("DeleteDistrict method success"); 193 | return Ok(new FinalResponse 194 | { 195 | StatusCode = 200, 196 | Message = "District deleted successfully", 197 | Data = null 198 | }); 199 | } 200 | catch (Exception ex) 201 | { 202 | _logger.LogInformation("Error in DeleteDistrict Method"); 203 | _logger.LogError(ex, "Error in DeleteDistrict Method"); 204 | return Ok(); 205 | } 206 | } 207 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | 33 | # Visual Studio 2015/2017 cache/options directory 34 | .vs/ 35 | # Uncomment if you have tasks that create the project's static files in wwwroot 36 | #wwwroot/ 37 | 38 | # Visual Studio 2017 auto generated files 39 | Generated\ Files/ 40 | 41 | # MSTest test Results 42 | [Tt]est[Rr]esult*/ 43 | [Bb]uild[Ll]og.* 44 | 45 | # NUNIT 46 | *.VisualState.xml 47 | TestResult.xml 48 | 49 | # Build Results of an ATL Project 50 | [Dd]ebugPS/ 51 | [Rr]eleasePS/ 52 | dlldata.c 53 | 54 | # Benchmark Results 55 | BenchmarkDotNet.Artifacts/ 56 | 57 | # .NET Core 58 | project.lock.json 59 | project.fragment.lock.json 60 | artifacts/ 61 | 62 | # StyleCop 63 | StyleCopReport.xml 64 | 65 | # Files built by Visual Studio 66 | *_i.c 67 | *_p.c 68 | *_h.h 69 | *.ilk 70 | *.meta 71 | *.obj 72 | *.iobj 73 | *.pch 74 | *.pdb 75 | *.ipdb 76 | *.pgc 77 | *.pgd 78 | *.rsp 79 | *.sbr 80 | *.tlb 81 | *.tli 82 | *.tlh 83 | *.tmp 84 | *.tmp_proj 85 | *_wpftmp.csproj 86 | *.log 87 | *.vspscc 88 | *.vssscc 89 | .builds 90 | *.pidb 91 | *.svclog 92 | *.scc 93 | 94 | # Chutzpah Test files 95 | _Chutzpah* 96 | 97 | # Visual C++ cache files 98 | ipch/ 99 | *.aps 100 | *.ncb 101 | *.opendb 102 | *.opensdf 103 | *.sdf 104 | *.cachefile 105 | *.VC.db 106 | *.VC.VC.opendb 107 | 108 | # Visual Studio profiler 109 | *.psess 110 | *.vsp 111 | *.vspx 112 | *.sap 113 | 114 | # Visual Studio Trace Files 115 | *.e2e 116 | 117 | # TFS 2012 Local Workspace 118 | $tf/ 119 | 120 | # Guidance Automation Toolkit 121 | *.gpState 122 | 123 | # ReSharper is a .NET coding add-in 124 | _ReSharper*/ 125 | *.[Rr]e[Ss]harper 126 | *.DotSettings.user 127 | 128 | # JustCode is a .NET coding add-in 129 | .JustCode 130 | 131 | # TeamCity is a build add-in 132 | _TeamCity* 133 | 134 | # DotCover is a Code Coverage Tool 135 | *.dotCover 136 | 137 | # AxoCover is a Code Coverage Tool 138 | .axoCover/* 139 | !.axoCover/settings.json 140 | 141 | # Visual Studio code coverage results 142 | *.coverage 143 | *.coveragexml 144 | 145 | # NCrunch 146 | _NCrunch_* 147 | .*crunch*.local.xml 148 | nCrunchTemp_* 149 | 150 | # MightyMoose 151 | *.mm.* 152 | AutoTest.Net/ 153 | 154 | # Web workbench (sass) 155 | .sass-cache/ 156 | 157 | # Installshield output folder 158 | [Ee]xpress/ 159 | 160 | # DocProject is a documentation generator add-in 161 | DocProject/buildhelp/ 162 | DocProject/Help/*.HxT 163 | DocProject/Help/*.HxC 164 | DocProject/Help/*.hhc 165 | DocProject/Help/*.hhk 166 | DocProject/Help/*.hhp 167 | DocProject/Help/Html2 168 | DocProject/Help/html 169 | 170 | # Click-Once directory 171 | publish/ 172 | 173 | # Publish Web Output 174 | *.[Pp]ublish.xml 175 | *.azurePubxml 176 | # Note: Comment the next line if you want to checkin your web deploy settings, 177 | # but database connection strings (with potential passwords) will be unencrypted 178 | *.pubxml 179 | *.publishproj 180 | 181 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 182 | # checkin your Azure Web App publish settings, but sensitive information contained 183 | # in these scripts will be unencrypted 184 | PublishScripts/ 185 | 186 | # NuGet Packages 187 | *.nupkg 188 | # The packages folder can be ignored because of Package Restore 189 | **/[Pp]ackages/* 190 | # except build/, which is used as an MSBuild target. 191 | !**/[Pp]ackages/build/ 192 | # Uncomment if necessary however generally it will be regenerated when needed 193 | #!**/[Pp]ackages/repositories.config 194 | # NuGet v3's project.json files produces more ignorable files 195 | *.nuget.props 196 | *.nuget.targets 197 | 198 | # Microsoft Azure Build Output 199 | csx/ 200 | *.build.csdef 201 | 202 | # Microsoft Azure Emulator 203 | ecf/ 204 | rcf/ 205 | 206 | # Windows Store app package directories and files 207 | AppPackages/ 208 | BundleArtifacts/ 209 | Package.StoreAssociation.xml 210 | _pkginfo.txt 211 | *.appx 212 | *.appxbundle 213 | *.appxupload 214 | 215 | # Visual Studio cache files 216 | # files ending in .cache can be ignored 217 | *.[Cc]ache 218 | # but keep track of directories ending in .cache 219 | !?*.[Cc]ache/ 220 | 221 | # Others 222 | ClientBin/ 223 | ~$* 224 | *~ 225 | *.dbmdl 226 | *.dbproj.schemaview 227 | *.jfm 228 | *.pfx 229 | *.publishsettings 230 | orleans.codegen.cs 231 | 232 | # Including strong name files can present a security risk 233 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 234 | #*.snk 235 | 236 | # Since there are multiple workflows, uncomment next line to ignore bower_components 237 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 238 | #bower_components/ 239 | 240 | # RIA/Silverlight projects 241 | Generated_Code/ 242 | 243 | # Backup & report files from converting an old project file 244 | # to a newer Visual Studio version. Backup files are not needed, 245 | # because we have git ;-) 246 | _UpgradeReport_Files/ 247 | Backup*/ 248 | UpgradeLog*.XML 249 | UpgradeLog*.htm 250 | ServiceFabricBackup/ 251 | *.rptproj.bak 252 | 253 | # SQL Server files 254 | *.mdf 255 | *.ldf 256 | *.ndf 257 | 258 | # Business Intelligence projects 259 | *.rdl.data 260 | *.bim.layout 261 | *.bim_*.settings 262 | *.rptproj.rsuser 263 | *- Backup*.rdl 264 | 265 | # Microsoft Fakes 266 | FakesAssemblies/ 267 | 268 | # GhostDoc plugin setting file 269 | *.GhostDoc.xml 270 | 271 | # Node.js Tools for Visual Studio 272 | .ntvs_analysis.dat 273 | node_modules/ 274 | 275 | # Visual Studio 6 build log 276 | *.plg 277 | 278 | # Visual Studio 6 workspace options file 279 | *.opt 280 | 281 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 282 | *.vbw 283 | 284 | # Visual Studio LightSwitch build output 285 | **/*.HTMLClient/GeneratedArtifacts 286 | **/*.DesktopClient/GeneratedArtifacts 287 | **/*.DesktopClient/ModelManifest.xml 288 | **/*.Server/GeneratedArtifacts 289 | **/*.Server/ModelManifest.xml 290 | _Pvt_Extensions 291 | 292 | # Paket dependency manager 293 | .paket/paket.exe 294 | paket-files/ 295 | 296 | # FAKE - F# Make 297 | .fake/ 298 | 299 | # CodeRush personal settings 300 | .cr/personal 301 | 302 | # Python Tools for Visual Studio (PTVS) 303 | __pycache__/ 304 | *.pyc 305 | 306 | # Cake - Uncomment if you are using it 307 | # tools/** 308 | # !tools/packages.config 309 | 310 | # Tabs Studio 311 | *.tss 312 | 313 | # Telerik's JustMock configuration file 314 | *.jmconfig 315 | 316 | # BizTalk build output 317 | *.btp.cs 318 | *.btm.cs 319 | *.odx.cs 320 | *.xsd.cs 321 | 322 | # OpenCover UI analysis results 323 | OpenCover/ 324 | 325 | # Azure Stream Analytics local run output 326 | ASALocalRun/ 327 | 328 | # MSBuild Binary and Structured Log 329 | *.binlog 330 | 331 | # NVidia Nsight GPU debugger configuration file 332 | *.nvuser 333 | 334 | # MFractors (Xamarin productivity tool) working folder 335 | .mfractor/ 336 | 337 | # Local History for Visual Studio 338 | .localhistory/ 339 | 340 | # BeatPulse healthcheck temp database 341 | healthchecksdb 342 | 343 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 344 | MigrationBackup/ 345 | 346 | ## 347 | ## Visual studio for Mac 348 | ## 349 | 350 | 351 | # globs 352 | Makefile.in 353 | *.userprefs 354 | *.usertasks 355 | config.make 356 | config.status 357 | aclocal.m4 358 | install-sh 359 | autom4te.cache/ 360 | *.tar.gz 361 | tarballs/ 362 | test-results/ 363 | 364 | # Ignore any files in /bin and /obj Folders 365 | **/bin/* 366 | **/obj/* 367 | 368 | # Mac bundle stuff 369 | *.dmg 370 | *.app 371 | 372 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 373 | # General 374 | .DS_Store 375 | .AppleDouble 376 | .LSOverride 377 | 378 | # Icon must end with two \r 379 | Icon 380 | 381 | 382 | # Thumbnails 383 | ._* 384 | 385 | # Files that might appear in the root of a volume 386 | .DocumentRevisions-V100 387 | .fseventsd 388 | .Spotlight-V100 389 | .TemporaryItems 390 | .Trashes 391 | .VolumeIcon.icns 392 | .com.apple.timemachine.donotpresent 393 | 394 | # Directories potentially created on remote AFP share 395 | .AppleDB 396 | .AppleDesktop 397 | Network Trash Folder 398 | Temporary Items 399 | .apdisk 400 | 401 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 402 | # Windows thumbnail cache files 403 | Thumbs.db 404 | ehthumbs.db 405 | ehthumbs_vista.db 406 | 407 | # Dump file 408 | *.stackdump 409 | 410 | # Folder config file 411 | [Dd]esktop.ini 412 | 413 | # Recycle Bin used on file shares 414 | $RECYCLE.BIN/ 415 | 416 | # Windows Installer files 417 | *.cab 418 | *.msi 419 | *.msix 420 | *.msm 421 | *.msp 422 | 423 | # Windows shortcuts 424 | *.lnk 425 | 426 | # JetBrains Rider 427 | .idea/ 428 | *.sln.iml 429 | 430 | ## 431 | ## Visual Studio Code 432 | ## 433 | .vscode/* 434 | !.vscode/settings.json 435 | !.vscode/tasks.json 436 | !.vscode/launch.json 437 | !.vscode/extensions.json -------------------------------------------------------------------------------- /AccraCity.Application/Service/AuthService.cs: -------------------------------------------------------------------------------- 1 | using System.IdentityModel.Tokens.Jwt; 2 | using System.Security.Claims; 3 | using System.Text; 4 | using AccraCity.Application.Dto; 5 | using AccraCity.Application.Interface; 6 | using AccraCity.Application.Models; 7 | using AccraCity.Application.OtherObjects; 8 | using Microsoft.AspNetCore.Identity; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.IdentityModel.Tokens; 11 | 12 | namespace AccraCity.Application.Service; 13 | 14 | public class AuthService : IAuthRepository 15 | { 16 | 17 | private readonly UserManager _userManager; 18 | private readonly RoleManager _roleManager; 19 | private readonly IConfiguration _configuration; 20 | 21 | public AuthService(UserManager userManager, RoleManager roleManager, IConfiguration configuration) 22 | { 23 | _userManager = userManager; 24 | _roleManager = roleManager; 25 | _configuration = configuration; 26 | } 27 | 28 | public async Task SeedRolesAsync() 29 | { 30 | bool ownerRoleExists = await _roleManager.RoleExistsAsync(StaticUserRoles.OWNER); 31 | bool userRoleExists = await _roleManager.RoleExistsAsync(StaticUserRoles.USER); 32 | bool adminRoleExists = await _roleManager.RoleExistsAsync(StaticUserRoles.ADMIN); 33 | 34 | if (adminRoleExists && userRoleExists && ownerRoleExists) 35 | return new AuthServiceResponseDto() 36 | { 37 | StatusCode = 400, 38 | IsSucceed = false, 39 | Message = "Role Seeding Already Done", 40 | Data = null 41 | }; 42 | 43 | await _roleManager.CreateAsync(new IdentityRole(StaticUserRoles.USER)); 44 | await _roleManager.CreateAsync(new IdentityRole(StaticUserRoles.ADMIN)); 45 | await _roleManager.CreateAsync(new IdentityRole(StaticUserRoles.OWNER)); 46 | return new AuthServiceResponseDto() 47 | { 48 | StatusCode = 200, 49 | IsSucceed = true, 50 | Message = "Role Seeding Done Successfully", 51 | Data = null 52 | }; 53 | } 54 | 55 | public async Task RegisterAsync(RegisterDto registerDto) 56 | { 57 | var isExistUser = await _userManager.FindByEmailAsync(registerDto.UserName); 58 | if (isExistUser != null) 59 | return new AuthServiceResponseDto() 60 | { 61 | StatusCode = 400, 62 | IsSucceed = false, 63 | Message = "Username already exists", 64 | Data = null 65 | }; 66 | 67 | User newUser = new User() 68 | { 69 | FirstName = registerDto.FirstName, 70 | LastName = registerDto.LastName, 71 | Email = registerDto.Email, 72 | UserName = registerDto.UserName, 73 | SecurityStamp = Guid.NewGuid().ToString() 74 | }; 75 | 76 | var createUserResult = await _userManager.CreateAsync(newUser, registerDto.Password); 77 | if (!createUserResult.Succeeded) 78 | { 79 | var errorString = "User creation failed because:"; 80 | foreach (var error in createUserResult.Errors) 81 | { 82 | errorString += " # " + error.Description; 83 | } 84 | return new AuthServiceResponseDto() 85 | { 86 | StatusCode = 400, 87 | IsSucceed = false, 88 | Message = errorString, 89 | Data = null 90 | }; 91 | } 92 | //Add a default User to all users 93 | await _userManager.AddToRoleAsync(newUser, StaticUserRoles.USER); 94 | 95 | return new AuthServiceResponseDto() 96 | { 97 | StatusCode = 201, 98 | IsSucceed = true, 99 | Message = "User Created Successfully", 100 | Data = null 101 | }; 102 | } 103 | public async Task LoginAsync(LoginDto loginDto) 104 | { 105 | var user = await _userManager.FindByNameAsync(loginDto.UserName); 106 | if (user is null) 107 | return new AuthServiceResponseDto() 108 | { 109 | StatusCode = 400, 110 | IsSucceed = false, 111 | Message = "Invalid Credentials", 112 | Data = null 113 | }; 114 | 115 | var isPasswordCorrect = await _userManager.CheckPasswordAsync(user,loginDto.Password); 116 | if (!isPasswordCorrect) 117 | return new AuthServiceResponseDto() 118 | { 119 | StatusCode = 400, 120 | IsSucceed = false, 121 | Message = "Invalid Credentials", 122 | Data = null 123 | }; 124 | 125 | 126 | var userRoles = await _userManager.GetRolesAsync(user); 127 | var authClaims = new List() 128 | { 129 | new Claim(ClaimTypes.Name, user.UserName ?? throw new InvalidOperationException()), 130 | new Claim(ClaimTypes.NameIdentifier, user.Id), 131 | new Claim("JWTID", Guid.NewGuid().ToString()), 132 | new Claim("FirstName", user.FirstName), 133 | new Claim("LastName", user.LastName) 134 | }; 135 | 136 | foreach (var userRole in userRoles) 137 | { 138 | authClaims.Add(new Claim(ClaimTypes.Role, userRole)); 139 | } 140 | var token = GenerateNewJsonWebToken(authClaims); 141 | return new AuthServiceResponseDto() 142 | { 143 | StatusCode = 201, 144 | IsSucceed = true, 145 | Message = "User token generated successfully", 146 | Data = token 147 | }; 148 | } 149 | public async Task MakeAdminAsync(UpdatePermissionDto updatePermissionDto) 150 | { 151 | var user = await _userManager.FindByNameAsync(updatePermissionDto.UserName); 152 | if (user is null) 153 | return new AuthServiceResponseDto() 154 | { 155 | StatusCode = 400, 156 | IsSucceed = false, 157 | Message = "Username does not exist", 158 | Data = null 159 | }; 160 | await _userManager.AddToRoleAsync(user, StaticUserRoles.ADMIN); 161 | return new AuthServiceResponseDto() 162 | { 163 | StatusCode = 200, 164 | IsSucceed = true, 165 | Message = "User is now an Admin", 166 | Data = null 167 | }; 168 | } 169 | public async Task MakeOwnerAsync(UpdatePermissionDto updatePermissionDto) 170 | { 171 | var user = await _userManager.FindByNameAsync(updatePermissionDto.UserName); 172 | if (user is null) 173 | return new AuthServiceResponseDto() 174 | { 175 | StatusCode = 400, 176 | IsSucceed = false, 177 | Message = "Username does not exist", 178 | Data = null 179 | }; 180 | 181 | await _userManager.AddToRoleAsync(user, StaticUserRoles.OWNER); 182 | return new AuthServiceResponseDto() 183 | { 184 | StatusCode = 200, 185 | IsSucceed = true, 186 | Message = "User is now an Owner", 187 | Data = null 188 | }; 189 | } 190 | public async Task RemoveAdminRoleAsync (UpdatePermissionDto updatePermissionDto) 191 | { 192 | var user = await _userManager.FindByNameAsync(updatePermissionDto.UserName); 193 | if (user is null) 194 | return new AuthServiceResponseDto() 195 | { 196 | StatusCode = 400, 197 | IsSucceed = false, 198 | Message = "Username does not exist", 199 | Data = null 200 | }; 201 | 202 | await _userManager.RemoveFromRoleAsync(user, StaticUserRoles.ADMIN); 203 | return new AuthServiceResponseDto() 204 | { 205 | StatusCode = 200, 206 | IsSucceed = true, 207 | Message = "User is no longer an Admin", 208 | Data = null 209 | }; 210 | } 211 | public async Task RemoveOwnerRoleAsync (UpdatePermissionDto updatePermissionDto) 212 | { 213 | var user = await _userManager.FindByNameAsync(updatePermissionDto.UserName); 214 | if (user is null) 215 | return new AuthServiceResponseDto() 216 | { 217 | StatusCode = 400, 218 | IsSucceed = false, 219 | Message = "Username does not exist", 220 | Data = null 221 | }; 222 | 223 | await _userManager.RemoveFromRoleAsync(user, StaticUserRoles.OWNER); 224 | return new AuthServiceResponseDto() 225 | { 226 | StatusCode = 200, 227 | IsSucceed = true, 228 | Message = "User is no longer an Owner", 229 | Data = null 230 | }; 231 | } 232 | 233 | 234 | private string GenerateNewJsonWebToken(List authClaims) 235 | { 236 | var authSecret = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["JWT:SecretKey"] ?? throw new InvalidOperationException())); 237 | var tokenObject = new JwtSecurityToken( 238 | issuer: _configuration["JWT:Issuer"], 239 | audience: _configuration["JWT:Audience"], 240 | expires: DateTime.Now.AddHours(1), 241 | claims: authClaims, 242 | signingCredentials: new SigningCredentials(authSecret, SecurityAlgorithms.HmacSha256) 243 | ); 244 | 245 | var token = new JwtSecurityTokenHandler().WriteToken(tokenObject); 246 | return token; 247 | } 248 | } -------------------------------------------------------------------------------- /AccraCityApi/obj/AccraCityApi.csproj.nuget.dgspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "format": 1, 3 | "restore": { 4 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/AccraCityApi.csproj": {} 5 | }, 6 | "projects": { 7 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj": { 8 | "version": "1.0.0", 9 | "restore": { 10 | "projectUniqueName": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj", 11 | "projectName": "AccraCity.Application", 12 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj", 13 | "packagesPath": "/Users/perigrinobruce/.nuget/packages/", 14 | "outputPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/obj/", 15 | "projectStyle": "PackageReference", 16 | "configFilePaths": [ 17 | "/Users/perigrinobruce/.nuget/NuGet/NuGet.Config" 18 | ], 19 | "originalTargetFrameworks": [ 20 | "net8.0" 21 | ], 22 | "sources": { 23 | "https://api.nuget.org/v3/index.json": {} 24 | }, 25 | "frameworks": { 26 | "net8.0": { 27 | "targetAlias": "net8.0", 28 | "projectReferences": {} 29 | } 30 | }, 31 | "warningProperties": { 32 | "warnAsError": [ 33 | "NU1605" 34 | ] 35 | } 36 | }, 37 | "frameworks": { 38 | "net8.0": { 39 | "targetAlias": "net8.0", 40 | "dependencies": { 41 | "Microsoft.AspNetCore.Authentication.JwtBearer": { 42 | "target": "Package", 43 | "version": "[8.0.7, )" 44 | }, 45 | "Microsoft.AspNetCore.Identity.EntityFrameworkCore": { 46 | "target": "Package", 47 | "version": "[8.0.7, )" 48 | }, 49 | "Microsoft.AspNetCore.Mvc.NewtonsoftJson": { 50 | "target": "Package", 51 | "version": "[8.0.7, )" 52 | }, 53 | "Microsoft.EntityFrameworkCore": { 54 | "target": "Package", 55 | "version": "[8.0.7, )" 56 | }, 57 | "Microsoft.EntityFrameworkCore.Design": { 58 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 59 | "suppressParent": "All", 60 | "target": "Package", 61 | "version": "[8.0.7, )" 62 | }, 63 | "Microsoft.EntityFrameworkCore.Tools": { 64 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 65 | "suppressParent": "All", 66 | "target": "Package", 67 | "version": "[8.0.7, )" 68 | }, 69 | "Npgsql.EntityFrameworkCore.PostgreSQL": { 70 | "target": "Package", 71 | "version": "[8.0.4, )" 72 | }, 73 | "Serilog.AspNetCore": { 74 | "target": "Package", 75 | "version": "[5.0.0, )" 76 | } 77 | }, 78 | "imports": [ 79 | "net461", 80 | "net462", 81 | "net47", 82 | "net471", 83 | "net472", 84 | "net48", 85 | "net481" 86 | ], 87 | "assetTargetFallback": true, 88 | "warn": true, 89 | "frameworkReferences": { 90 | "Microsoft.NETCore.App": { 91 | "privateAssets": "all" 92 | } 93 | }, 94 | "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.302/PortableRuntimeIdentifierGraph.json" 95 | } 96 | } 97 | }, 98 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj": { 99 | "version": "1.0.0", 100 | "restore": { 101 | "projectUniqueName": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj", 102 | "projectName": "AccraCityApi.Contracts", 103 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj", 104 | "packagesPath": "/Users/perigrinobruce/.nuget/packages/", 105 | "outputPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/obj/", 106 | "projectStyle": "PackageReference", 107 | "configFilePaths": [ 108 | "/Users/perigrinobruce/.nuget/NuGet/NuGet.Config" 109 | ], 110 | "originalTargetFrameworks": [ 111 | "net8.0" 112 | ], 113 | "sources": { 114 | "https://api.nuget.org/v3/index.json": {} 115 | }, 116 | "frameworks": { 117 | "net8.0": { 118 | "targetAlias": "net8.0", 119 | "projectReferences": { 120 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj": { 121 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj" 122 | } 123 | } 124 | } 125 | }, 126 | "warningProperties": { 127 | "warnAsError": [ 128 | "NU1605" 129 | ] 130 | } 131 | }, 132 | "frameworks": { 133 | "net8.0": { 134 | "targetAlias": "net8.0", 135 | "imports": [ 136 | "net461", 137 | "net462", 138 | "net47", 139 | "net471", 140 | "net472", 141 | "net48", 142 | "net481" 143 | ], 144 | "assetTargetFallback": true, 145 | "warn": true, 146 | "frameworkReferences": { 147 | "Microsoft.NETCore.App": { 148 | "privateAssets": "all" 149 | } 150 | }, 151 | "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.302/PortableRuntimeIdentifierGraph.json" 152 | } 153 | } 154 | }, 155 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/AccraCityApi.csproj": { 156 | "version": "1.0.0", 157 | "restore": { 158 | "projectUniqueName": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/AccraCityApi.csproj", 159 | "projectName": "AccraCityApi", 160 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/AccraCityApi.csproj", 161 | "packagesPath": "/Users/perigrinobruce/.nuget/packages/", 162 | "outputPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/", 163 | "projectStyle": "PackageReference", 164 | "configFilePaths": [ 165 | "/Users/perigrinobruce/.nuget/NuGet/NuGet.Config" 166 | ], 167 | "originalTargetFrameworks": [ 168 | "net8.0" 169 | ], 170 | "sources": { 171 | "https://api.nuget.org/v3/index.json": {} 172 | }, 173 | "frameworks": { 174 | "net8.0": { 175 | "targetAlias": "net8.0", 176 | "projectReferences": { 177 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj": { 178 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCity.Application/AccraCity.Application.csproj" 179 | }, 180 | "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj": { 181 | "projectPath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi.Contracts/AccraCityApi.Contracts.csproj" 182 | } 183 | } 184 | } 185 | }, 186 | "warningProperties": { 187 | "warnAsError": [ 188 | "NU1605" 189 | ] 190 | } 191 | }, 192 | "frameworks": { 193 | "net8.0": { 194 | "targetAlias": "net8.0", 195 | "dependencies": { 196 | "Microsoft.AspNetCore.Authentication.JwtBearer": { 197 | "target": "Package", 198 | "version": "[8.0.7, )" 199 | }, 200 | "Microsoft.AspNetCore.Identity.EntityFrameworkCore": { 201 | "target": "Package", 202 | "version": "[8.0.7, )" 203 | }, 204 | "Microsoft.AspNetCore.Mvc.NewtonsoftJson": { 205 | "target": "Package", 206 | "version": "[8.0.7, )" 207 | }, 208 | "Microsoft.AspNetCore.OpenApi": { 209 | "target": "Package", 210 | "version": "[8.0.7, )" 211 | }, 212 | "Microsoft.EntityFrameworkCore.Design": { 213 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 214 | "suppressParent": "All", 215 | "target": "Package", 216 | "version": "[8.0.7, )" 217 | }, 218 | "Microsoft.EntityFrameworkCore.Tools": { 219 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 220 | "suppressParent": "All", 221 | "target": "Package", 222 | "version": "[8.0.7, )" 223 | }, 224 | "MongoDB.driver": { 225 | "target": "Package", 226 | "version": "[2.21.0, )" 227 | }, 228 | "Npgsql.EntityFrameworkCore.PostgreSQL": { 229 | "target": "Package", 230 | "version": "[8.0.4, )" 231 | }, 232 | "Serilog.AspNetCore": { 233 | "target": "Package", 234 | "version": "[5.0.0, )" 235 | }, 236 | "Serilog.Sinks.Console": { 237 | "target": "Package", 238 | "version": "[4.1.0, )" 239 | }, 240 | "Serilog.Sinks.File": { 241 | "target": "Package", 242 | "version": "[6.0.0, )" 243 | }, 244 | "Swashbuckle.AspNetCore": { 245 | "target": "Package", 246 | "version": "[6.5.0, )" 247 | } 248 | }, 249 | "imports": [ 250 | "net461", 251 | "net462", 252 | "net47", 253 | "net471", 254 | "net472", 255 | "net48", 256 | "net481" 257 | ], 258 | "assetTargetFallback": true, 259 | "warn": true, 260 | "frameworkReferences": { 261 | "Microsoft.AspNetCore.App": { 262 | "privateAssets": "none" 263 | }, 264 | "Microsoft.NETCore.App": { 265 | "privateAssets": "all" 266 | } 267 | }, 268 | "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.302/PortableRuntimeIdentifierGraph.json" 269 | } 270 | } 271 | } 272 | } 273 | } -------------------------------------------------------------------------------- /AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/appsettings.Development.json 2 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/appsettings.json 3 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/AccraCityApi 4 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/AccraCityApi.deps.json 5 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/AccraCityApi.runtimeconfig.json 6 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/AccraCityApi.dll 7 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/AccraCityApi.pdb 8 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/Microsoft.AspNetCore.OpenApi.dll 9 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/Microsoft.OpenApi.dll 10 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.Swagger.dll 11 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.SwaggerGen.dll 12 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.SwaggerUI.dll 13 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/AccraCityApi.Contracts.dll 14 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/bin/Debug/net7.0/AccraCityApi.Contracts.pdb 15 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.AssemblyReference.cache 16 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.GeneratedMSBuildEditorConfig.editorconfig 17 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.AssemblyInfoInputs.cache 18 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.AssemblyInfo.cs 19 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.CoreCompileInputs.cache 20 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.MvcApplicationPartsAssemblyInfo.cs 21 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.MvcApplicationPartsAssemblyInfo.cache 22 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.AccraCityApi.Microsoft.AspNetCore.StaticWebAssets.props 23 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.build.AccraCityApi.props 24 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.buildMultiTargeting.AccraCityApi.props 25 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.buildTransitive.AccraCityApi.props 26 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/staticwebassets.pack.json 27 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/staticwebassets.build.json 28 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/staticwebassets.development.json 29 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/scopedcss/bundle/AccraCityApi.styles.css 30 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.CopyComplete 31 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.dll 32 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/refint/AccraCityApi.dll 33 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.pdb 34 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/AccraCityApi.genruntimeconfig.cache 35 | /home/wade/Documents/acs work/c# api/AccraCity/AccraCityApi/obj/Debug/net7.0/ref/AccraCityApi.dll 36 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/appsettings.Development.json 37 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/appsettings.json 38 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCityApi 39 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCityApi.deps.json 40 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCityApi.runtimeconfig.json 41 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCityApi.dll 42 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCityApi.pdb 43 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AWSSDK.Core.dll 44 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AWSSDK.SecurityToken.dll 45 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/DnsClient.dll 46 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Humanizer.dll 47 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.AspNetCore.JsonPatch.dll 48 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll 49 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.AspNetCore.OpenApi.dll 50 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.EntityFrameworkCore.dll 51 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.EntityFrameworkCore.Abstractions.dll 52 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.EntityFrameworkCore.Design.dll 53 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.EntityFrameworkCore.Relational.dll 54 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.Extensions.DependencyModel.dll 55 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Microsoft.OpenApi.dll 56 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/MongoDB.Bson.dll 57 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/MongoDB.Driver.dll 58 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/MongoDB.Driver.Core.dll 59 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/MongoDB.Libmongocrypt.dll 60 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Mono.TextTemplating.dll 61 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Newtonsoft.Json.dll 62 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Newtonsoft.Json.Bson.dll 63 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Npgsql.dll 64 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll 65 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/SharpCompress.dll 66 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Snappier.dll 67 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.Swagger.dll 68 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.SwaggerGen.dll 69 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Swashbuckle.AspNetCore.SwaggerUI.dll 70 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/System.CodeDom.dll 71 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/ZstdSharp.dll 72 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/runtimes/linux/native/libmongocrypt.so 73 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/runtimes/osx/native/libmongocrypt.dylib 74 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/runtimes/win/native/mongocrypt.dll 75 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCity.Application.dll 76 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCityApi.Contracts.dll 77 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCity.Application.pdb 78 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/AccraCityApi.Contracts.pdb 79 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.AssemblyReference.cache 80 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.GeneratedMSBuildEditorConfig.editorconfig 81 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.AssemblyInfoInputs.cache 82 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.AssemblyInfo.cs 83 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.csproj.CoreCompileInputs.cache 84 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.MvcApplicationPartsAssemblyInfo.cs 85 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.MvcApplicationPartsAssemblyInfo.cache 86 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.sourcelink.json 87 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.AccraCityApi.Microsoft.AspNetCore.StaticWebAssets.props 88 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.build.AccraCityApi.props 89 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.buildMultiTargeting.AccraCityApi.props 90 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/staticwebassets/msbuild.buildTransitive.AccraCityApi.props 91 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/staticwebassets.pack.json 92 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/staticwebassets.build.json 93 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/staticwebassets.development.json 94 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/scopedcss/bundle/AccraCityApi.styles.css 95 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.dll 96 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/refint/AccraCityApi.dll 97 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.pdb 98 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCityApi.genruntimeconfig.cache 99 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/ref/AccraCityApi.dll 100 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.dll 101 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.AspNetCore.dll 102 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.Extensions.Hosting.dll 103 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.Extensions.Logging.dll 104 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.Formatting.Compact.dll 105 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.Settings.Configuration.dll 106 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.Sinks.Console.dll 107 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.Sinks.Debug.dll 108 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/bin/Debug/net7.0/Serilog.Sinks.File.dll 109 | /Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/obj/Debug/net7.0/AccraCit.351976BD.Up2Date 110 | -------------------------------------------------------------------------------- /AccraCityApi/obj/project.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "dgSpecHash": "u8fQsWb9PDTD13RIlQzYV2WCppqUos243XFvNit0jG0wOJYL9GpC1e2dQ2LesCUQ6+1yGt24Yu6yqJEwwSfiXg==", 4 | "success": true, 5 | "projectFilePath": "/Users/perigrinobruce/RiderProjects/Accra-City-Towns-Api/AccraCityApi/AccraCityApi.csproj", 6 | "expectedPackageFiles": [ 7 | "/Users/perigrinobruce/.nuget/packages/awssdk.core/3.7.100.14/awssdk.core.3.7.100.14.nupkg.sha512", 8 | "/Users/perigrinobruce/.nuget/packages/awssdk.securitytoken/3.7.100.14/awssdk.securitytoken.3.7.100.14.nupkg.sha512", 9 | "/Users/perigrinobruce/.nuget/packages/dnsclient/1.6.1/dnsclient.1.6.1.nupkg.sha512", 10 | "/Users/perigrinobruce/.nuget/packages/humanizer.core/2.14.1/humanizer.core.2.14.1.nupkg.sha512", 11 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.authentication.jwtbearer/8.0.7/microsoft.aspnetcore.authentication.jwtbearer.8.0.7.nupkg.sha512", 12 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.cryptography.internal/8.0.7/microsoft.aspnetcore.cryptography.internal.8.0.7.nupkg.sha512", 13 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.cryptography.keyderivation/8.0.7/microsoft.aspnetcore.cryptography.keyderivation.8.0.7.nupkg.sha512", 14 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.identity.entityframeworkcore/8.0.7/microsoft.aspnetcore.identity.entityframeworkcore.8.0.7.nupkg.sha512", 15 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.jsonpatch/8.0.7/microsoft.aspnetcore.jsonpatch.8.0.7.nupkg.sha512", 16 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.mvc.newtonsoftjson/8.0.7/microsoft.aspnetcore.mvc.newtonsoftjson.8.0.7.nupkg.sha512", 17 | "/Users/perigrinobruce/.nuget/packages/microsoft.aspnetcore.openapi/8.0.7/microsoft.aspnetcore.openapi.8.0.7.nupkg.sha512", 18 | "/Users/perigrinobruce/.nuget/packages/microsoft.bcl.asyncinterfaces/6.0.0/microsoft.bcl.asyncinterfaces.6.0.0.nupkg.sha512", 19 | "/Users/perigrinobruce/.nuget/packages/microsoft.codeanalysis.analyzers/3.3.3/microsoft.codeanalysis.analyzers.3.3.3.nupkg.sha512", 20 | "/Users/perigrinobruce/.nuget/packages/microsoft.codeanalysis.common/4.5.0/microsoft.codeanalysis.common.4.5.0.nupkg.sha512", 21 | "/Users/perigrinobruce/.nuget/packages/microsoft.codeanalysis.csharp/4.5.0/microsoft.codeanalysis.csharp.4.5.0.nupkg.sha512", 22 | "/Users/perigrinobruce/.nuget/packages/microsoft.codeanalysis.csharp.workspaces/4.5.0/microsoft.codeanalysis.csharp.workspaces.4.5.0.nupkg.sha512", 23 | "/Users/perigrinobruce/.nuget/packages/microsoft.codeanalysis.workspaces.common/4.5.0/microsoft.codeanalysis.workspaces.common.4.5.0.nupkg.sha512", 24 | "/Users/perigrinobruce/.nuget/packages/microsoft.csharp/4.7.0/microsoft.csharp.4.7.0.nupkg.sha512", 25 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore/8.0.7/microsoft.entityframeworkcore.8.0.7.nupkg.sha512", 26 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.abstractions/8.0.7/microsoft.entityframeworkcore.abstractions.8.0.7.nupkg.sha512", 27 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.analyzers/8.0.7/microsoft.entityframeworkcore.analyzers.8.0.7.nupkg.sha512", 28 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.design/8.0.7/microsoft.entityframeworkcore.design.8.0.7.nupkg.sha512", 29 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.relational/8.0.7/microsoft.entityframeworkcore.relational.8.0.7.nupkg.sha512", 30 | "/Users/perigrinobruce/.nuget/packages/microsoft.entityframeworkcore.tools/8.0.7/microsoft.entityframeworkcore.tools.8.0.7.nupkg.sha512", 31 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.apidescription.server/6.0.5/microsoft.extensions.apidescription.server.6.0.5.nupkg.sha512", 32 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.caching.abstractions/8.0.0/microsoft.extensions.caching.abstractions.8.0.0.nupkg.sha512", 33 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.caching.memory/8.0.0/microsoft.extensions.caching.memory.8.0.0.nupkg.sha512", 34 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.configuration/2.0.0/microsoft.extensions.configuration.2.0.0.nupkg.sha512", 35 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.configuration.abstractions/8.0.0/microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512", 36 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.configuration.binder/2.0.0/microsoft.extensions.configuration.binder.2.0.0.nupkg.sha512", 37 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.dependencyinjection/8.0.0/microsoft.extensions.dependencyinjection.8.0.0.nupkg.sha512", 38 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.dependencyinjection.abstractions/8.0.0/microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512", 39 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.dependencymodel/8.0.1/microsoft.extensions.dependencymodel.8.0.1.nupkg.sha512", 40 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.fileproviders.abstractions/3.1.8/microsoft.extensions.fileproviders.abstractions.3.1.8.nupkg.sha512", 41 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.hosting.abstractions/3.1.8/microsoft.extensions.hosting.abstractions.3.1.8.nupkg.sha512", 42 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.identity.core/8.0.7/microsoft.extensions.identity.core.8.0.7.nupkg.sha512", 43 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.identity.stores/8.0.7/microsoft.extensions.identity.stores.8.0.7.nupkg.sha512", 44 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.logging/8.0.0/microsoft.extensions.logging.8.0.0.nupkg.sha512", 45 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.logging.abstractions/8.0.0/microsoft.extensions.logging.abstractions.8.0.0.nupkg.sha512", 46 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.options/8.0.2/microsoft.extensions.options.8.0.2.nupkg.sha512", 47 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.options.configurationextensions/2.0.0/microsoft.extensions.options.configurationextensions.2.0.0.nupkg.sha512", 48 | "/Users/perigrinobruce/.nuget/packages/microsoft.extensions.primitives/8.0.0/microsoft.extensions.primitives.8.0.0.nupkg.sha512", 49 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.abstractions/7.1.2/microsoft.identitymodel.abstractions.7.1.2.nupkg.sha512", 50 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.jsonwebtokens/7.1.2/microsoft.identitymodel.jsonwebtokens.7.1.2.nupkg.sha512", 51 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.logging/7.1.2/microsoft.identitymodel.logging.7.1.2.nupkg.sha512", 52 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.protocols/7.1.2/microsoft.identitymodel.protocols.7.1.2.nupkg.sha512", 53 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.protocols.openidconnect/7.1.2/microsoft.identitymodel.protocols.openidconnect.7.1.2.nupkg.sha512", 54 | "/Users/perigrinobruce/.nuget/packages/microsoft.identitymodel.tokens/7.1.2/microsoft.identitymodel.tokens.7.1.2.nupkg.sha512", 55 | "/Users/perigrinobruce/.nuget/packages/microsoft.netcore.platforms/5.0.0/microsoft.netcore.platforms.5.0.0.nupkg.sha512", 56 | "/Users/perigrinobruce/.nuget/packages/microsoft.openapi/1.4.3/microsoft.openapi.1.4.3.nupkg.sha512", 57 | "/Users/perigrinobruce/.nuget/packages/microsoft.win32.registry/5.0.0/microsoft.win32.registry.5.0.0.nupkg.sha512", 58 | "/Users/perigrinobruce/.nuget/packages/mongodb.bson/2.21.0/mongodb.bson.2.21.0.nupkg.sha512", 59 | "/Users/perigrinobruce/.nuget/packages/mongodb.driver/2.21.0/mongodb.driver.2.21.0.nupkg.sha512", 60 | "/Users/perigrinobruce/.nuget/packages/mongodb.driver.core/2.21.0/mongodb.driver.core.2.21.0.nupkg.sha512", 61 | "/Users/perigrinobruce/.nuget/packages/mongodb.libmongocrypt/1.8.0/mongodb.libmongocrypt.1.8.0.nupkg.sha512", 62 | "/Users/perigrinobruce/.nuget/packages/mono.texttemplating/2.2.1/mono.texttemplating.2.2.1.nupkg.sha512", 63 | "/Users/perigrinobruce/.nuget/packages/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg.sha512", 64 | "/Users/perigrinobruce/.nuget/packages/newtonsoft.json.bson/1.0.2/newtonsoft.json.bson.1.0.2.nupkg.sha512", 65 | "/Users/perigrinobruce/.nuget/packages/npgsql/8.0.3/npgsql.8.0.3.nupkg.sha512", 66 | "/Users/perigrinobruce/.nuget/packages/npgsql.entityframeworkcore.postgresql/8.0.4/npgsql.entityframeworkcore.postgresql.8.0.4.nupkg.sha512", 67 | "/Users/perigrinobruce/.nuget/packages/serilog/4.0.0/serilog.4.0.0.nupkg.sha512", 68 | "/Users/perigrinobruce/.nuget/packages/serilog.aspnetcore/5.0.0/serilog.aspnetcore.5.0.0.nupkg.sha512", 69 | "/Users/perigrinobruce/.nuget/packages/serilog.extensions.hosting/4.2.0/serilog.extensions.hosting.4.2.0.nupkg.sha512", 70 | "/Users/perigrinobruce/.nuget/packages/serilog.extensions.logging/3.1.0/serilog.extensions.logging.3.1.0.nupkg.sha512", 71 | "/Users/perigrinobruce/.nuget/packages/serilog.formatting.compact/1.1.0/serilog.formatting.compact.1.1.0.nupkg.sha512", 72 | "/Users/perigrinobruce/.nuget/packages/serilog.settings.configuration/3.3.0/serilog.settings.configuration.3.3.0.nupkg.sha512", 73 | "/Users/perigrinobruce/.nuget/packages/serilog.sinks.console/4.1.0/serilog.sinks.console.4.1.0.nupkg.sha512", 74 | "/Users/perigrinobruce/.nuget/packages/serilog.sinks.debug/2.0.0/serilog.sinks.debug.2.0.0.nupkg.sha512", 75 | "/Users/perigrinobruce/.nuget/packages/serilog.sinks.file/6.0.0/serilog.sinks.file.6.0.0.nupkg.sha512", 76 | "/Users/perigrinobruce/.nuget/packages/sharpcompress/0.30.1/sharpcompress.0.30.1.nupkg.sha512", 77 | "/Users/perigrinobruce/.nuget/packages/snappier/1.0.0/snappier.1.0.0.nupkg.sha512", 78 | "/Users/perigrinobruce/.nuget/packages/swashbuckle.aspnetcore/6.5.0/swashbuckle.aspnetcore.6.5.0.nupkg.sha512", 79 | "/Users/perigrinobruce/.nuget/packages/swashbuckle.aspnetcore.swagger/6.5.0/swashbuckle.aspnetcore.swagger.6.5.0.nupkg.sha512", 80 | "/Users/perigrinobruce/.nuget/packages/swashbuckle.aspnetcore.swaggergen/6.5.0/swashbuckle.aspnetcore.swaggergen.6.5.0.nupkg.sha512", 81 | "/Users/perigrinobruce/.nuget/packages/swashbuckle.aspnetcore.swaggerui/6.5.0/swashbuckle.aspnetcore.swaggerui.6.5.0.nupkg.sha512", 82 | "/Users/perigrinobruce/.nuget/packages/system.buffers/4.5.1/system.buffers.4.5.1.nupkg.sha512", 83 | "/Users/perigrinobruce/.nuget/packages/system.codedom/4.4.0/system.codedom.4.4.0.nupkg.sha512", 84 | "/Users/perigrinobruce/.nuget/packages/system.collections.immutable/6.0.0/system.collections.immutable.6.0.0.nupkg.sha512", 85 | "/Users/perigrinobruce/.nuget/packages/system.composition/6.0.0/system.composition.6.0.0.nupkg.sha512", 86 | "/Users/perigrinobruce/.nuget/packages/system.composition.attributedmodel/6.0.0/system.composition.attributedmodel.6.0.0.nupkg.sha512", 87 | "/Users/perigrinobruce/.nuget/packages/system.composition.convention/6.0.0/system.composition.convention.6.0.0.nupkg.sha512", 88 | "/Users/perigrinobruce/.nuget/packages/system.composition.hosting/6.0.0/system.composition.hosting.6.0.0.nupkg.sha512", 89 | "/Users/perigrinobruce/.nuget/packages/system.composition.runtime/6.0.0/system.composition.runtime.6.0.0.nupkg.sha512", 90 | "/Users/perigrinobruce/.nuget/packages/system.composition.typedparts/6.0.0/system.composition.typedparts.6.0.0.nupkg.sha512", 91 | "/Users/perigrinobruce/.nuget/packages/system.identitymodel.tokens.jwt/7.1.2/system.identitymodel.tokens.jwt.7.1.2.nupkg.sha512", 92 | "/Users/perigrinobruce/.nuget/packages/system.io.pipelines/6.0.3/system.io.pipelines.6.0.3.nupkg.sha512", 93 | "/Users/perigrinobruce/.nuget/packages/system.memory/4.5.5/system.memory.4.5.5.nupkg.sha512", 94 | "/Users/perigrinobruce/.nuget/packages/system.reflection.metadata/6.0.1/system.reflection.metadata.6.0.1.nupkg.sha512", 95 | "/Users/perigrinobruce/.nuget/packages/system.runtime.compilerservices.unsafe/6.0.0/system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512", 96 | "/Users/perigrinobruce/.nuget/packages/system.security.accesscontrol/5.0.0/system.security.accesscontrol.5.0.0.nupkg.sha512", 97 | "/Users/perigrinobruce/.nuget/packages/system.security.principal.windows/5.0.0/system.security.principal.windows.5.0.0.nupkg.sha512", 98 | "/Users/perigrinobruce/.nuget/packages/system.text.encoding.codepages/6.0.0/system.text.encoding.codepages.6.0.0.nupkg.sha512", 99 | "/Users/perigrinobruce/.nuget/packages/system.text.encodings.web/8.0.0/system.text.encodings.web.8.0.0.nupkg.sha512", 100 | "/Users/perigrinobruce/.nuget/packages/system.text.json/8.0.4/system.text.json.8.0.4.nupkg.sha512", 101 | "/Users/perigrinobruce/.nuget/packages/system.threading.channels/6.0.0/system.threading.channels.6.0.0.nupkg.sha512", 102 | "/Users/perigrinobruce/.nuget/packages/zstdsharp.port/0.6.2/zstdsharp.port.0.6.2.nupkg.sha512" 103 | ], 104 | "logs": [] 105 | } --------------------------------------------------------------------------------