syntax = "proto3";

package wix.payment.api.pay.v2;

import public "wix/payment/api/pay/v2/resources/order-additional-charges.proto";
import public "wix/payment/api/pay/v2/resources/order-buyer-info.proto";
import public "wix/payment/api/pay/v2/resources/order-description.proto";
import public "wix/payment/api/pay/v2/resources/order-item.proto";
import public "wix/payment/api/pay/v2/resources/order-return-urls.proto";
import public "wix/payment/api/pay/v2/resources/order-status.proto";
import public "wix/payment/api/pay/v2/resources/order-urls.proto";

import "wix/api/entity.proto";

option java_package = "com.wix.payment.api.pay.v2";

// entity representing an order
message Order {

  option (wix.api.entity) = {
    fqdn: "wix.cashier.pay.v2.order"
    segment: PUBLIC // no domain events produced
  };

  // unique identifier of each order
  string id                     = 1;
  // order description
  OrderDescription description  = 2;
  // return urls
  OrderReturnUrls return_urls   = 3;

  // Unique identifier of an account for which the order was created.
  string account_id             = 5;

  // current and historical statuses of this order, ordered descending by `ts`
  repeated OrderStatus statuses = 100;
}
