You are here

function uc_fulfillment_rules_data_info in Ubercart 8.4

Implements hook_rules_data_info().

File

shipping/uc_fulfillment/uc_fulfillment.rules.inc, line 13
Rules hooks for uc_fulfillment.module.

Code

function uc_fulfillment_rules_data_info() {
  $address_info = uc_address_property_info();
  $entities['uc_shipment'] = [
    'label' => t('Ubercart shipment object'),
    'group' => t('Ubercart'),
    'wrap' => TRUE,
    'property info' => [
      'sid' => [
        'type' => 'integer',
        'label' => t('Shipment ID'),
      ],
      'order_id' => [
        'type' => 'integer',
        'label' => t('Order ID'),
      ],
      'origin' => [
        'type' => 'struct',
        'label' => t('Origin address'),
        'description' => t('The origin location for the shipment.'),
        'getter callback' => 'uc_fulfillment_address_property_get',
        'setter callback' => 'uc_fulfillment_address_property_set',
        'setter permission' => 'fulfill orders',
        'property info' => $address_info,
      ],
      'destination' => [
        'type' => 'struct',
        'label' => t('Destination address'),
        'description' => t('The destination location for the shipment.'),
        'getter callback' => 'uc_fulfillment_address_property_get',
        'setter callback' => 'uc_fulfillment_address_property_set',
        'setter permission' => 'fulfill orders',
        'property info' => $address_info,
      ],
      'shipping_method' => [
        'type' => 'text',
        'label' => t('Shipping method'),
        'description' => t('The transportation method used to ship.'),
      ],
      'accessorials' => [
        'type' => 'text',
        'label' => t('Accessorials'),
        'description' => t('Shipping options and special instructions.'),
      ],
      'carrier' => [
        'type' => 'text',
        'label' => t('Carrier'),
        'description' => t('The company making the delivery.'),
      ],
      'transaction_id' => [
        'type' => 'text',
        'label' => t('Transaction ID'),
        'description' => t("The carrier's shipment identifier."),
      ],
      'tracking_number' => [
        'type' => 'text',
        'label' => t('Tracking number'),
        'description' => t('The number used by the carrier to locate the shipment while it is in transit.'),
      ],
      'ship_date' => [
        'type' => 'date',
        'label' => t('Ship date'),
        'description' => t('The time the shipment was sent out.'),
      ],
      'expected_delivery' => [
        'type' => 'date',
        'label' => t('Expected delivery'),
        'description' => t('The time the shipment is expected to be delivered'),
      ],
      'cost' => [
        'type' => 'decimal',
        'label' => t('Cost'),
        'description' => t('The cost of the shipment.'),
      ],
      'packages' => [
        'type' => 'list<struct>',
        'label' => t('Packages'),
        'description' => t('The physical items being shipped.'),
        'property info' => [
          'package_id' => [
            'type' => 'integer',
            'label' => t('Package ID'),
          ],
          'shipping_type' => [
            'type' => 'text',
            'label' => t('Shipping type'),
            'description' => t('The basic type of shipment, e.g.: small package, freight, etc.'),
          ],
          'pkg_type' => [
            'type' => 'text',
            'label' => t('Package type'),
            'description' => t('The type of packaging.'),
          ],
          'length' => [
            'type' => 'decimal',
            'label' => t('Length'),
            'description' => t('The package length.'),
          ],
          'width' => [
            'type' => 'decimal',
            'label' => t('Width'),
            'description' => t('The package width.'),
          ],
          'height' => [
            'type' => 'decimal',
            'label' => t('Height'),
            'description' => t('The package height.'),
          ],
          'value' => [
            'type' => 'decimal',
            'label' => t('Value'),
            'description' => t('The monetary value of the package contents.'),
          ],
          'tracking_number' => [
            'type' => 'text',
            'label' => t('Tracking number'),
            'description' => t('The number used by the carrier to locate the shipment while it is in transit.'),
          ],
          'description' => [
            'type' => 'text',
            'label' => t('Description'),
            'description' => t('The package description'),
          ],
          'weight' => [
            'type' => 'decimal',
            'label' => t('Weight'),
            'description' => t('The physical weight of the package.'),
          ],
          'products' => [
            'type' => 'list<uc_order_product>',
            'label' => t('Products'),
            'description' => t('The package contents.'),
          ],
          'label_image' => [
            'type' => 'file',
            'label' => t('Label image'),
            'description' => t('An image of the shipping label.'),
          ],
        ],
      ],
    ],
  ];
  return $entities;
}