syntax = "proto3";

package wix.infra.asyncjobs.v1;
option java_package = "com.wixpress.infra.asyncinfra.asyncjobservice.v1";

import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";

import "wix/api/validations.proto";
import "wix/api/errors.proto";
import "wix/api/entity.proto";


message AsyncJobItem {
  option (wix.api.entity) = {
    fqdn: "wix.infra.asyncjobs.v1.async_job_item",
    segment: USERS
  };
  // Job item ID.
  string id = 1 [(wix.api.format) = GUID, (wix.api.readOnly) = true];

  // Job item data, as passed by the originating service.
  google.protobuf.Struct data = 2;

  // ID of the entity being processed, as passed by the originating service.
  google.protobuf.StringValue entity_id = 3 [(wix.api.minLength) = 1, (wix.api.maxLength) = 32, (wix.api.immutable) = true];

  // Whether the job item was processed successfully.
  bool success = 4 [(wix.api.readOnly) = true];

  // Error that prevented the item from being processed, if relevant.
  wix.api.ApplicationError error = 5 [(wix.api.immutable) = true];
}
