You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Creates a new incident based on the provided details.
62
+
*
63
+
* This endpoint accepts a {@link NewIncidentDTO} object, validates the data,
64
+
* and attempts to create a new incident. The process includes:
65
+
* - Verifying that the alert list is not empty.
66
+
* - Checking if any of the provided alerts are already associated with another incident.
67
+
* - Creating the incident if all validations pass.
57
68
*
58
-
* @param newIncidentDTO the utmIncident to create
59
-
* @return the ResponseEntity with status 201 (Created) and with body the new utmIncident, or with status 400 (Bad Request) if the utmIncident has already an ID
69
+
* @param newIncidentDTO the DTO containing the details of the incident to create, including associated alerts.
70
+
* @return a {@link ResponseEntity} containing:
71
+
* - HTTP 201 (Created) if the incident is successfully created.
72
+
* - HTTP 400 (Bad Request) if the alert list is empty.
73
+
* - HTTP 409 (Conflict) if one or more alerts are already associated with another incident.
74
+
* - HTTP 500 (Internal Server Error) if an unexpected error occurs during processing.
75
+
* @throws IllegalArgumentException if the input data is invalid.
@@ -78,10 +110,17 @@ public ResponseEntity<UtmIncident> createUtmIncident(@Valid @RequestBody NewInci
78
110
}
79
111
80
112
/**
81
-
* POST /utm-incidents : Create a new utmIncident.
113
+
* POST /utm-incidents/add-alerts : Add alerts to an existing utmIncident.
82
114
*
83
-
* @param addToIncidentDTO the utmIncident to add alerts to
84
-
* @return the ResponseEntity with status 201 (Created) and with body the new utmIncident, or with status 400 (Bad Request) if the utmIncident has already an ID
115
+
* This endpoint allows users to associate a list of alerts with an existing utmIncident.
116
+
* If any of the provided alerts are already linked to another incident, a conflict response is returned.
117
+
*
118
+
* @param addToIncidentDTO the DTO containing the details of the utmIncident and the list of alerts to add
119
+
* @return the ResponseEntity with:
120
+
* - status 201 (Created) and the updated utmIncident if successful,
121
+
* - status 400 (Bad Request) if the alert list is empty,
122
+
* - status 409 (Conflict) if some alerts are already associated with another incident,
123
+
* - status 500 (Internal Server Error) if an unexpected error occurs.
85
124
* @throws URISyntaxException if the Location URI syntax is incorrect
86
125
*/
87
126
@PostMapping("/utm-incidents/add-alerts")
@@ -92,6 +131,19 @@ public ResponseEntity<UtmIncident> addAlertsToUtmIncident(@Valid @RequestBody Ad
92
131
if (CollectionUtils.isEmpty(addToIncidentDTO.getAlertList())) {
93
132
thrownewBadRequestAlertException("Add utmIncident cannot already have an empty related alerts", ENTITY_NAME, "alertList");
Copy file name to clipboardexpand all lines: frontend/src/app/data-management/alert-management/shared/components/alert-view-detail/alert-view-detail.component.html
0 commit comments