forked from MDCPS/DamageAssessment_Backend
		
	updated latest changes from dev
This commit is contained in:
		| @ -16,7 +16,7 @@ namespace DamageAssesment.Api.Locations.Controllers | ||||
|         /// Get all locations. | ||||
|         /// </summary> | ||||
|  | ||||
|         [HttpGet("Locations")] | ||||
|         [HttpGet("locations")] | ||||
|         public async Task<ActionResult> GetLocationsAsync() | ||||
|         { | ||||
|  | ||||
| @ -32,7 +32,7 @@ namespace DamageAssesment.Api.Locations.Controllers | ||||
|         /// Get all locations based on locationdId. | ||||
|         /// </summary> | ||||
|  | ||||
|         [HttpGet("Locations/{id}")] | ||||
|         [HttpGet("locations/{id}")] | ||||
|         public async Task<ActionResult> GetLocationByIdAsync(int id) | ||||
|         { | ||||
|  | ||||
| @ -48,7 +48,7 @@ namespace DamageAssesment.Api.Locations.Controllers | ||||
|         /// Update a Location. | ||||
|         /// </summary> | ||||
|  | ||||
|         [HttpPut("Locations/{id}")] | ||||
|         [HttpPut("locations/{id}")] | ||||
|         public async Task<IActionResult> UpdateLocation(int id, Models.Location Location) | ||||
|         { | ||||
|             if (Location != null) | ||||
| @ -66,7 +66,7 @@ namespace DamageAssesment.Api.Locations.Controllers | ||||
|         /// Save a new location. | ||||
|         /// </summary> | ||||
|  | ||||
|         [HttpPost("Locations")] | ||||
|         [HttpPost("locations")] | ||||
|         public async Task<IActionResult> CreateLocation(Models.Location Location) | ||||
|         { | ||||
|             if (Location != null) | ||||
| @ -84,7 +84,7 @@ namespace DamageAssesment.Api.Locations.Controllers | ||||
|         /// Delete an existing location. | ||||
|         /// </summary> | ||||
|  | ||||
|         [HttpDelete("Locations/{id}")] | ||||
|         [HttpDelete("locations/{id}")] | ||||
|         public async Task<IActionResult> DeleteLocation(int id) | ||||
|         { | ||||
|             var result = await this.LocationProvider.DeleteLocationAsync(id); | ||||
|  | ||||
| @ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; | ||||
|  | ||||
| namespace DamageAssesment.Api.Locations.Db | ||||
| { | ||||
|     [Table("Locations")] | ||||
|     public class Location | ||||
|     { | ||||
|         [Key] | ||||
|  | ||||
| @ -1,7 +1,9 @@ | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.ComponentModel.DataAnnotations.Schema; | ||||
|  | ||||
| namespace DamageAssesment.Api.Locations.Db | ||||
| { | ||||
|     [Table("Regions")] | ||||
|     public class Region | ||||
|     { | ||||
|         [Key] | ||||
|  | ||||
| @ -17,7 +17,7 @@ namespace DamageAssesment.Api.Locations.Providers | ||||
|             this.locationDbContext = locationDbContext; | ||||
|             this.logger = logger; | ||||
|             this.mapper = mapper; | ||||
|             //SeedData(); | ||||
|           //  SeedData(); | ||||
|         } | ||||
|  | ||||
|         public async Task<(bool IsSuccess, IEnumerable<Models.Location> Locations, string ErrorMessage)> GetLocationsAsync() | ||||
| @ -139,12 +139,13 @@ namespace DamageAssesment.Api.Locations.Providers | ||||
|         { | ||||
|             if (!locationDbContext.Locations.Any()) | ||||
|             { | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "Loc1", RegionId = 1, Name = "BOB GRAHAM EDUCATION CENTER 1", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "Loc2", RegionId = 2, Name = "BOB GRAHAM EDUCATION CENTER 2", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "Loc3", RegionId = 3, Name = "BOB GRAHAM EDUCATION CENTER 3", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "Loc4", RegionId = 1, Name = "BOB GRAHAM EDUCATION CENTER 4", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "Loc5", RegionId = 2, Name = "BOB GRAHAM EDUCATION CENTER 5", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "Loc6", RegionId = 3, Name = "BOB GRAHAM EDUCATION CENTER 6", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "0091", RegionId = 5, Name = "BOB GRAHAM EDUCATION CENTER", MaintenanceCenter = "1", SchoolType = "K8" }); | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "0092", RegionId = 1, Name = "NORMAN S. EDELCUP/SUNNY ISLES BEACH K-8", MaintenanceCenter = "1", SchoolType = "K8" }); | ||||
|                 locationDbContext.Locations.Add(new Db.Location() { LocationCode = "7511", RegionId = 4, Name = "MIAMI SPRINGS SHS", MaintenanceCenter = "2", SchoolType = "S" }); | ||||
|                 //locationDbContext.Locations.Add(new Db.Location() { Id = 3, LocationCode = "Loc3", RegionId = 3, Name = "BOB GRAHAM EDUCATION CENTER 3", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 //locationDbContext.Locations.Add(new Db.Location() { Id = 4, LocationCode = "Loc4", RegionId = 1, Name = "BOB GRAHAM EDUCATION CENTER 4", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 //locationDbContext.Locations.Add(new Db.Location() { Id = 5, LocationCode = "Loc5", RegionId = 2, Name = "BOB GRAHAM EDUCATION CENTER 5", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 //locationDbContext.Locations.Add(new Db.Location() { Id = 6, LocationCode = "Loc6", RegionId = 3, Name = "BOB GRAHAM EDUCATION CENTER 6", MaintenanceCenter = "1", SchoolType = "US" }); | ||||
|                 locationDbContext.SaveChanges(); | ||||
|             } | ||||
|  | ||||
|  | ||||
| @ -16,7 +16,7 @@ namespace DamageAssesment.Api.Locations.Providers | ||||
|             this.locationDbContext = regionDbContext; | ||||
|             this.logger = logger; | ||||
|             this.mapper = mapper; | ||||
|             //SeedData(); | ||||
|           //  SeedData(); | ||||
|         } | ||||
|  | ||||
|         public async Task<(bool IsSuccess, Models.Region Region, string ErrorMessage)> GetRegionByIdAsync(int Id) | ||||
| @ -166,8 +166,10 @@ namespace DamageAssesment.Api.Locations.Providers | ||||
|             if (!locationDbContext.Regions.Any()) | ||||
|             { | ||||
|                 locationDbContext.Regions.Add(new Db.Region() { Name = "North", Abbreviation = "N" }); | ||||
|                 locationDbContext.Regions.Add(new Db.Region() { Name = "South", Abbreviation = "S" }); | ||||
|                 locationDbContext.Regions.Add(new Db.Region() { Name = "Central", Abbreviation = "C" }); | ||||
|                 locationDbContext.Regions.Add(new Db.Region() { Name = "South", Abbreviation = "S" }); | ||||
|                 locationDbContext.Regions.Add(new Db.Region() { Name = "Charter Schools", Abbreviation = "CS" }); | ||||
|                 locationDbContext.Regions.Add(new Db.Region() { Name = "Alternate and Special Centers", Abbreviation = "AC" }); | ||||
|                 locationDbContext.SaveChanges(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
| @ -1,8 +0,0 @@ | ||||
| { | ||||
|   "Logging": { | ||||
|     "LogLevel": { | ||||
|       "Default": "Information", | ||||
|       "Microsoft.AspNetCore": "Warning" | ||||
|     } | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user