Skip to content

5-Minute Quickstart

This quickstart runs the Aegean Voyages (aegeanvoyages.example) charter workflow from site/modules/Charter/examples/real-world/.

  1. Search Available Yachts With FleetSearchService:

    <?php declare(strict_types=1);
    namespace ProcessWire;
    $charter = Charter::requireInstance($wire);
    $results = $charter->fleet()->search([
    'check_in' => '2026-07-11',
    'check_out' => '2026-07-18',
    'guests' => 8,
    'cabins_min' => 4,
    'currency' => 'EUR',
    'limit' => 12,
    ]);
  2. Compute an Itemized Multi-Currency Quote With PricingEngine:

    $quote = $charter->pricing()->calculate([
    'yacht_ref' => 'entry:' . $yacht->id,
    'check_in' => '2026-07-11',
    'check_out' => '2026-07-18',
    'guests' => 8,
    'currency' => 'USD',
    ]);
    echo "{$quote->nights} nights | Net: {$quote->netCharterFee} {$quote->currencyCode} | Grand Total: {$quote->grandTotal}";
  3. Capture an Inquiry & Convert to an Option Booking:

    $workflow = $charter->workflow();
    $inquiry = $workflow->createInquiryFromSubmission([
    'client_name' => 'Elena Rossi',
    'client_email' => '[email protected]',
    'yacht_ref' => 'entry:' . $yacht->id,
    'check_in' => '2026-07-11',
    'check_out' => '2026-07-18',
    'guests' => 8,
    ]);
    // Acquires CharterWriteLock and verifies half-open [check_in, check_out) availability
    $booking = $workflow->convertInquiryToBooking($inquiry);
  4. Generate a Branded or Unbranded HMAC Proposal Link:

    $brandedUrl = $charter->proposals()->shareUrl('booking', (string) $booking->id, branded: true, ttlSeconds: 604800);
    $unbrandedUrl = $charter->proposals()->shareUrl('booking', (string) $booking->id, branded: false, ttlSeconds: 604800);

Next steps