// @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
// @generated from file orderAction.proto (package api, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import { CommandHeader, DateTime, EntityID, MetadataElement } from "./shared_pb.js";
import { OrderLine, OrderRequestedMilestones, ReferencedID, TradeTier } from "./tradeShared_pb.js";

/**
 *
 * Build Executionflow from Order
 *  This is the "OMS light". 1 Execution Flow for 1 Order if ShipFrom is defined
 *
 * @generated from message api.OrderBuildExecutionflowPayload
 */
export class OrderBuildExecutionflowPayload extends Message<OrderBuildExecutionflowPayload> {
  /**
   * @generated from field: api.DateTime CreationDateTime = 1;
   */
  CreationDateTime?: DateTime;

  /**
   * @generated from field: api.ReferencedID ParentOrder = 2;
   */
  ParentOrder?: ReferencedID;

  /**
   * @generated from field: string LanguageCodeISO6391 = 3;
   */
  LanguageCodeISO6391 = "";

  /**
   * Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)
   *
   * @generated from field: repeated api.MetadataElement MetaData = 4;
   */
  MetaData: MetadataElement[] = [];

  /**
   * @generated from field: api.TradeTier Buyer = 5;
   */
  Buyer?: TradeTier;

  /**
   * @generated from field: api.TradeTier Seller = 6;
   */
  Seller?: TradeTier;

  /**
   * Where to ship the order from
   *
   * @generated from field: api.TradeTier ShipFrom = 7;
   */
  ShipFrom?: TradeTier;

  /**
   * Where to ship the order to
   *
   * @generated from field: api.TradeTier ShipTo = 8;
   */
  ShipTo?: TradeTier;

  /**
   * Definition of the order carrier
   *
   * @generated from field: api.TradeTier Carrier = 9;
   */
  Carrier?: TradeTier;

  /**
   * Type of carrier service
   *
   * @generated from field: string CarrierService = 16;
   */
  CarrierService = "";

  /**
   * @generated from field: api.OrderRequestedMilestones RequestedMilestones = 10;
   */
  RequestedMilestones?: OrderRequestedMilestones;

  /**
   * Lines of the order
   *
   * @generated from field: repeated api.OrderLine Lines = 11;
   */
  Lines: OrderLine[] = [];

  constructor(data?: PartialMessage<OrderBuildExecutionflowPayload>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "api.OrderBuildExecutionflowPayload";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "CreationDateTime", kind: "message", T: DateTime },
    { no: 2, name: "ParentOrder", kind: "message", T: ReferencedID },
    { no: 3, name: "LanguageCodeISO6391", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 4, name: "MetaData", kind: "message", T: MetadataElement, repeated: true },
    { no: 5, name: "Buyer", kind: "message", T: TradeTier },
    { no: 6, name: "Seller", kind: "message", T: TradeTier },
    { no: 7, name: "ShipFrom", kind: "message", T: TradeTier },
    { no: 8, name: "ShipTo", kind: "message", T: TradeTier },
    { no: 9, name: "Carrier", kind: "message", T: TradeTier },
    { no: 16, name: "CarrierService", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 10, name: "RequestedMilestones", kind: "message", T: OrderRequestedMilestones },
    { no: 11, name: "Lines", kind: "message", T: OrderLine, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): OrderBuildExecutionflowPayload {
    return new OrderBuildExecutionflowPayload().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): OrderBuildExecutionflowPayload {
    return new OrderBuildExecutionflowPayload().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): OrderBuildExecutionflowPayload {
    return new OrderBuildExecutionflowPayload().fromJsonString(jsonString, options);
  }

  static equals(a: OrderBuildExecutionflowPayload | PlainMessage<OrderBuildExecutionflowPayload> | undefined, b: OrderBuildExecutionflowPayload | PlainMessage<OrderBuildExecutionflowPayload> | undefined): boolean {
    return proto3.util.equals(OrderBuildExecutionflowPayload, a, b);
  }
}

/**
 * @generated from message api.OrderBuildExecutionflow
 */
export class OrderBuildExecutionflow extends Message<OrderBuildExecutionflow> {
  /**
   * @generated from field: api.CommandHeader Header = 1;
   */
  Header?: CommandHeader;

  /**
   * @generated from field: api.EntityID ID = 2;
   */
  ID?: EntityID;

  /**
   * @generated from field: api.OrderBuildExecutionflowPayload Payload = 3;
   */
  Payload?: OrderBuildExecutionflowPayload;

  /**
   * @generated from field: api.OrderBuildExecutionflowPayload EventPayload = 4;
   */
  EventPayload?: OrderBuildExecutionflowPayload;

  /**
   * @generated from field: api.OrderBuildExecutionflowPayload PreviousPayload = 5;
   */
  PreviousPayload?: OrderBuildExecutionflowPayload;

  constructor(data?: PartialMessage<OrderBuildExecutionflow>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "api.OrderBuildExecutionflow";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "Header", kind: "message", T: CommandHeader },
    { no: 2, name: "ID", kind: "message", T: EntityID },
    { no: 3, name: "Payload", kind: "message", T: OrderBuildExecutionflowPayload },
    { no: 4, name: "EventPayload", kind: "message", T: OrderBuildExecutionflowPayload },
    { no: 5, name: "PreviousPayload", kind: "message", T: OrderBuildExecutionflowPayload },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): OrderBuildExecutionflow {
    return new OrderBuildExecutionflow().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): OrderBuildExecutionflow {
    return new OrderBuildExecutionflow().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): OrderBuildExecutionflow {
    return new OrderBuildExecutionflow().fromJsonString(jsonString, options);
  }

  static equals(a: OrderBuildExecutionflow | PlainMessage<OrderBuildExecutionflow> | undefined, b: OrderBuildExecutionflow | PlainMessage<OrderBuildExecutionflow> | undefined): boolean {
    return proto3.util.equals(OrderBuildExecutionflow, a, b);
  }
}

