# frozen_string_literal: true

# This file is generated. Do not edit.

require "peddler/types/vendor_shipments_v1/party_identification"
require "peddler/types/vendor_shipments_v1/collect_freight_pickup_details"
require "peddler/types/vendor_shipments_v1/containers"
require "peddler/types/vendor_shipments_v1/import_details"
require "peddler/types/vendor_shipments_v1/purchase_orders"
require "peddler/types/vendor_shipments_v1/transport_shipment_measurements"
require "peddler/types/vendor_shipments_v1/shipment_status_details"
require "peddler/types/vendor_shipments_v1/transportation_details"

module Peddler
  module Types
    module VendorShipmentsV1
      # A list of one or more shipments with respective details.
      Shipment = Structure.new do
        # @return [PartyIdentification] Name/Address and tax details of the selling party.
        attribute(:selling_party, PartyIdentification, from: "sellingParty")

        # @return [PartyIdentification] Name/Address and tax details of the ship from party.
        attribute(:ship_from_party, PartyIdentification, from: "shipFromParty")

        # @return [PartyIdentification] Name/Address of the destination warehouse where the shipment is being shipped
        # to.
        attribute(:ship_to_party, PartyIdentification, from: "shipToParty")

        # @return [String] Date on which the transportation request was submitted.
        attribute(:transaction_date, String, from: "transactionDate")

        # @return [String] Indicates the type of transportation request (for example, `New` or `Cancel`). Each
        # `transactionType` has a unique set of operations and there are corresponding details to be populated for each
        # operation.
        attribute(:transaction_type, String, from: "transactionType")

        # @return [String] Unique Transportation ID created by Vendor (Should not be used over the last 365 days).
        attribute(:vendor_shipment_identifier, String, from: "vendorShipmentIdentifier")

        # @return [String] The buyer Reference Number is a unique identifier generated by buyer for all Collect/WePay
        # shipments when you submit a transportation request. This field is mandatory for Collect/WePay shipments.
        attribute?(:buyer_reference_number, String, from: "buyerReferenceNumber")

        # @return [CollectFreightPickupDetails] Indicates the earliest pickup date for the transportation from vendor
        # warehouse. This information is mandatory to be filled for requesting transportation from Buyer
        # (WePay/Collect).
        attribute?(:collect_freight_pickup_details, CollectFreightPickupDetails, from: "collectFreightPickupDetails")

        # @return [Array<Containers>] A list of the items in this transportation and their associated inner container
        # details. If any of the item detail fields are common at a carton or a pallet level, provide them at the
        # corresponding carton or pallet level.
        attribute?(:containers, [Containers])

        # @return [String] Indicates the current shipment status.
        attribute?(:current_shipment_status, String, from: "currentShipmentStatus")

        # @return [String] Date and time when the last status was updated.
        attribute?(:currentshipment_status_date, String, from: "currentshipmentStatusDate")

        # @return [ImportDetails] Provide these fields only if this shipment is a direct import.
        attribute?(:import_details, ImportDetails, from: "importDetails")

        # @return [String] The date and time of the package label created for the shipment by buyer.
        attribute?(:package_label_create_date, String, from: "packageLabelCreateDate")

        # @return [Array<PurchaseOrders>] Indicates the purchase orders involved for the transportation request. This
        # group is an array create 1 for each PO and list their corresponding items. This information is used for
        # deciding the route,truck allocation and storage efficiently. This is a mandatory information for Buyer
        # performing transportation from vendor warehouse (WePay/Collect)
        attribute?(:purchase_orders, [PurchaseOrders], from: "purchaseOrders")

        # @return [String] The date and time of the departure of the shipment from the vendor's location. Vendors are
        # requested to send ASNs within 30 minutes of departure from their warehouse/distribution center or at least 6
        # hours prior to the appointment time at the Buyer destination warehouse, whichever is sooner. Shipped date
        # mentioned in the shipment confirmation should not be in the future.
        attribute?(:shipment_confirm_date, String, from: "shipmentConfirmDate")

        # @return [String] The date and time of the shipment request created by vendor.
        attribute?(:shipment_create_date, String, from: "shipmentCreateDate")

        # @return [String] Specifies if payment is Collect (WePay) or Prepaid (TheyPay). Required.
        attribute?(:shipment_freight_term, String, from: "shipmentFreightTerm")

        # @return [TransportShipmentMeasurements] Indicates the shipment measurement details on how many cartons and
        # pallets and the total transportation weight and volume as part of this request. This is a mandatory detail
        # which will help determining the transportation cost, truck allocations and route determination efficiently.
        attribute?(:shipment_measurements, TransportShipmentMeasurements, from: "shipmentMeasurements")

        # @return [Array<ShipmentStatusDetails>] Indicates the list of current shipment status details and when the last
        # update was received from carrier this is available on shipment Details response.
        attribute?(:shipment_status_details, [ShipmentStatusDetails], from: "shipmentStatusDetails")

        # @return [TransportationDetails] Transportation details this a mandatory information which states delivery
        # date, shipping date and carrier details.
        attribute?(:transportation_details, TransportationDetails, from: "transportationDetails")
      end
    end
  end
end
