syntax = "proto3";

package dbag.energy.m7t.management.response.v7;

option java_multiple_files = true;
option java_package = "com.deutscheboerse.energy.m7.api.management.response.v7";

/**
 * ErrorResponse returned when a request fails business validation.
 */
message ErrorResponse {
  // Summary of the error.
  string message = 1;

  // Numeric code identifying the error.
  int32 code = 2;

  // Field-level error details.
  repeated ErrorDetails error_details = 3;
}

/**
 * Details a specific field error.
 */
message ErrorDetails {
  // Description of the error.
  string description = 1;

  // Attribute (e.g field_name)
  optional string attribute = 2;

  // Optional error context. For example, it is set when the error is linked to a specific order (via client_order_id).
  optional string context = 3;
}
