diff --git a/TradeOffStackAPI/Controllers/DepartmentController.cs b/TradeOffStackAPI/Controllers/DepartmentController.cs index 0b5d727..0ecd73f 100644 --- a/TradeOffStackAPI/Controllers/DepartmentController.cs +++ b/TradeOffStackAPI/Controllers/DepartmentController.cs @@ -50,7 +50,7 @@ public async Task Update(Guid id, [FromBody] Department departmen return BadRequest("Object ID does not match route ID."); var response = await _service.UpdateDepartmentAsync(id, department); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpDelete("{id}")] @@ -58,6 +58,6 @@ public async Task Update(Guid id, [FromBody] Department departmen public async Task Delete(Guid id) { var response = await _service.DeleteDepartmentAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } } \ No newline at end of file diff --git a/TradeOffStackAPI/Controllers/EquipmentController.cs b/TradeOffStackAPI/Controllers/EquipmentController.cs index d9b7c94..0fc89ad 100644 --- a/TradeOffStackAPI/Controllers/EquipmentController.cs +++ b/TradeOffStackAPI/Controllers/EquipmentController.cs @@ -64,7 +64,7 @@ public async Task Update(Guid id, [FromBody] Equipment equipment) return BadRequest("Object ID does not match route ID."); var response = await _service.UpdateEquipmentAsync(id, equipment); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpDelete("{id}")] @@ -72,7 +72,7 @@ public async Task Update(Guid id, [FromBody] Equipment equipment) public async Task Delete(Guid id) { var response = await _service.DeleteEquipmentAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpPost("{id}/licenses/{licenseId}")] @@ -88,6 +88,6 @@ public async Task AssignLicense(Guid id, Guid licenseId) public async Task RevokeLicense(Guid id, Guid licenseId) { var response = await _service.RevokeLicenseAsync(id, licenseId); - return response.Success ? NoContent() : BadRequest(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : BadRequest(new { message = response.Message }); } } \ No newline at end of file diff --git a/TradeOffStackAPI/Controllers/MaintenanceRequestController.cs b/TradeOffStackAPI/Controllers/MaintenanceRequestController.cs index 1365b67..72ec9bb 100644 --- a/TradeOffStackAPI/Controllers/MaintenanceRequestController.cs +++ b/TradeOffStackAPI/Controllers/MaintenanceRequestController.cs @@ -62,21 +62,21 @@ public async Task Update(Guid id, [FromBody] MaintenanceRequest r return BadRequest("Object ID does not match route ID."); var response = await _service.UpdateRequestAsync(id, request); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpPost("{id}/complete")] public async Task Complete(Guid id, [FromBody] CompleteMaintenanceDto? body) { var response = await _service.CompleteRequestAsync(id, body?.TechnicianNotes); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpPost("{id}/cancel")] public async Task Cancel(Guid id) { var response = await _service.CancelRequestAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpDelete("{id}")] @@ -84,7 +84,7 @@ public async Task Cancel(Guid id) public async Task Delete(Guid id) { var response = await _service.DeleteRequestAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } } diff --git a/TradeOffStackAPI/Controllers/ReservationController.cs b/TradeOffStackAPI/Controllers/ReservationController.cs index 18fe045..0516f05 100644 --- a/TradeOffStackAPI/Controllers/ReservationController.cs +++ b/TradeOffStackAPI/Controllers/ReservationController.cs @@ -88,21 +88,21 @@ public async Task Update(Guid id, [FromBody] Reservation reservat return BadRequest("Object ID does not match route ID."); var response = await _service.UpdateReservationAsync(id, reservation); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpPost("{id}/return")] public async Task Return(Guid id) { var response = await _service.ReturnEquipmentAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpPost("{id}/cancel")] public async Task Cancel(Guid id) { var response = await _service.CancelReservationAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpPost("{id}/approve")] @@ -111,7 +111,7 @@ public async Task Approve(Guid id) { if (_currentUser.UserId == null) return Unauthorized(); var response = await _service.ApproveReservationAsync(id, _currentUser.UserId.Value); - return response.Success ? NoContent() : BadRequest(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : BadRequest(new { message = response.Message }); } public class RejectionDto { public string Reason { get; set; } = string.Empty; } @@ -122,13 +122,13 @@ public async Task Reject(Guid id, [FromBody] RejectionDto dto) { if (_currentUser.UserId == null) return Unauthorized(); var response = await _service.RejectReservationAsync(id, _currentUser.UserId.Value, dto.Reason); - return response.Success ? NoContent() : BadRequest(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : BadRequest(new { message = response.Message }); } [HttpDelete("{id}")] public async Task Delete(Guid id) { var response = await _service.DeleteReservationAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } } \ No newline at end of file diff --git a/TradeOffStackAPI/Controllers/SaaSController.cs b/TradeOffStackAPI/Controllers/SaaSController.cs index 140a5f9..745bac7 100644 --- a/TradeOffStackAPI/Controllers/SaaSController.cs +++ b/TradeOffStackAPI/Controllers/SaaSController.cs @@ -49,7 +49,7 @@ public async Task DeleteProvider(Guid id) { var response = await _saasService.DeleteProviderAsync(id); if (!response.Success) return BadRequest(new { message = response.Message }); - return NoContent(); + return Ok(new { message = "Success" }); } [HttpGet("subscriptions")] @@ -86,7 +86,7 @@ public async Task DeleteSubscription(Guid id) { var response = await _saasService.DeleteSubscriptionAsync(id); if (!response.Success) return NotFound(new { message = response.Message }); - return NoContent(); + return Ok(new { message = "Success" }); } [HttpGet("assignments")] @@ -118,6 +118,6 @@ public async Task UnassignUser(Guid id) { var response = await _saasService.UnassignUserAsync(id); if (!response.Success) return NotFound(new { message = response.Message }); - return NoContent(); + return Ok(new { message = "Success" }); } } diff --git a/TradeOffStackAPI/Controllers/SoftwareLicenseController.cs b/TradeOffStackAPI/Controllers/SoftwareLicenseController.cs index 8e76941..7dd8508 100644 --- a/TradeOffStackAPI/Controllers/SoftwareLicenseController.cs +++ b/TradeOffStackAPI/Controllers/SoftwareLicenseController.cs @@ -57,7 +57,7 @@ public async Task Update(Guid id, [FromBody] SoftwareLicense lice return BadRequest("Object ID does not match route ID."); var response = await _service.UpdateAsync(id, license); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpDelete("{id}")] @@ -65,6 +65,6 @@ public async Task Update(Guid id, [FromBody] SoftwareLicense lice public async Task Delete(Guid id) { var response = await _service.DeleteAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } } diff --git a/TradeOffStackAPI/Controllers/UserController.cs b/TradeOffStackAPI/Controllers/UserController.cs index dbbe082..e0c9eb4 100644 --- a/TradeOffStackAPI/Controllers/UserController.cs +++ b/TradeOffStackAPI/Controllers/UserController.cs @@ -104,7 +104,7 @@ public async Task Update(Guid id, [FromBody] User user) } var response = await _service.UpdateUserAsync(id, user); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } [HttpPut("{id}/change-password")] @@ -145,7 +145,7 @@ public async Task ChangePassword(Guid id, [FromBody] ChangePasswo public async Task Delete(Guid id) { var response = await _service.DeleteUserAsync(id); - return response.Success ? NoContent() : NotFound(new { message = response.Message }); + return response.Success ? Ok(new { message = "Success" }) : NotFound(new { message = response.Message }); } } diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index c00e16a..117b3b3 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -24,7 +24,8 @@ services: db: condition: service_healthy environment: - ConnectionStrings__DefaultConnection: Host=db;Database=tradeoffstack;Username=${POSTGRES_USER:-tradeoff_admin};Password=${POSTGRES_PASSWORD:-Tr@de0ff_Secure!2026_Db#X9} + ConnectionStrings__CoreConnection: Host=db;Database=tradeoffstack_core;Username=${POSTGRES_USER:-tradeoff_admin};Password=${POSTGRES_PASSWORD:-Tr@de0ff_Secure!2026_Db#X9} + ConnectionStrings__AssetConnection: Host=db;Database=tradeoffstack_assetportal;Username=${POSTGRES_USER:-tradeoff_admin};Password=${POSTGRES_PASSWORD:-Tr@de0ff_Secure!2026_Db#X9} JWT_SECRET_KEY: ${JWT_SECRET_KEY:-Tr@de0ff_Super_Secret_Key_For_JWT_Auth_2026!} ASPNETCORE_ENVIRONMENT: Production restart: always