# Changelog

All notable changes to the Travelio web backend (Laravel) are listed here.

## 1.7.0

International payments, exchange rates and two-factor sign-in.

### Added
- Stripe (cards, Apple Pay, Google Pay) and PayPal under Settings → Payment
  Gateways, each with its own charge currency. When that differs from the
  agency currency the amount is converted at the rate below; bookings,
  invoices and the ledger stay in the agency currency, and the payment keeps
  the amount, currency and rate it was charged at. Stripe and PayPal charge
  their own fees.
- Settings → Currencies: an exchange rate per currency against the agency
  currency, typed in or refreshed daily from a free public rates feed
  (open.er-api.com, off by default). New currencies can be added there. The
  mobile API lists the currencies with rates so the app can show prices in
  the customer's currency.
- Two-factor sign-in with an authenticator app (Profile → Two-factor sign-in)
  for staff, agents and every other user account, with eight recovery codes.
  Applies to the web sign-in, Google/Facebook sign-in and the mobile app
  (`POST /api/v1/auth/two-factor`). Turning it on or off asks for the password.
- PayPal as a receipt and payment method.
- Partner agencies (Agent Finance):
  - Agent groups: tiers with a commission rate per service (tours, hotels,
    transport, flights) and a default credit limit. An agent's own rate
    still wins; with neither, the agency default applies.
  - Partner terms per agent: company, group, own rate and credit limit. The
    limit caps the agent's unpaid open bookings; past it, new bookings are
    refused (portal and app) until clients pay.
  - Team: an agency's main account adds staff logins in its portal or the
    app. Staff book for the agency and see its bookings, commission and
    invoices; they cannot add staff or request withdrawals.
  - Agent applications: the Become an Agent form (website and app) can
    create a partner account with an optional trade licence, which signs in
    once approved under Agent Finance → Agent Applications. Without a
    password it is a CRM lead, as before.
- Twilio SMS (Settings → SMS) for international numbers, used ahead of MiM
  SMS while active; numbers without + get the default country code.
- Settings → Webhooks: POST signed JSON events (booking.created, .updated,
  .paid, .cancelled, payment.succeeded) to the agency's own systems — an ERP
  such as Odoo, a CRM, Zapier/Make. HMAC-SHA256 signature, delivery id for
  de-duplication, retries for about 15 hours, delivery log with test and
  retry. Local and private network addresses are refused. Sent by the
  every-minute scheduler, or at once with a queue worker.
- Extra live-hotel suppliers (config/suppliers.php, `HotelProvider`) are
  searched next to Amadeus and merged cheapest first; one failing supplier
  does not stop the others. Their offers are booked through the desk.
- Hotel rate calendar (Hotels → Rooms → Rates & availability): a rate per
  night, allotment, minimum stay and stop sell, set for a date range and
  chosen weekdays. Website, app and agent bookings price night by night from
  it; nights without an entry use the room's base rate, as before.
- Activities (excursions and experiences): options with adult, child and
  group prices; dated time slots with capacity, created in bulk; guide
  languages and pickup points; instant or on-request confirmation; free
  cancellation window. Website pages at /activities, booking from the
  website and the app, a printable voucher with QR code emailed on
  confirmation, and Activities → Bookings to confirm, cancel (places are
  released) or mark paid. Part of the Additional services module; new
  `activity_*` permissions are given to the admin roles on update.

### Changed
- An online payment in a currency the agency has no rate for is refused
  before the checkout opens, with a message naming the missing rate, instead
  of charging the agency-currency amount in the gateway's currency.
- Scheduled jobs are listed in one place (`App\Support\ScheduledJobs`).

## 1.6.0

Website templates, live chat, Messenger, fonts and text size for the website
and the admin panel, smarter website search, an installer for hosts without a
terminal, and a security review.

### Added
- Website templates (Settings → Appearance): Skyline (the original), Classic
  Agency, Haramain (for Hajj & Umrah agencies), Luxe and Night (always dark).
  Each keeps the same pages and content and brings its own styling and a
  recommended look — colours, fonts and corners — that you can apply in one
  tick and still change afterwards. Preview any template in a new tab before
  switching; an admin previewing the website gets an "Apply to site" bar.
- Hero layouts (Home Sections → Hero → Layout): Classic, Centered, Photo and
  Split, or Auto to follow the template.
- Live chat: a chat button on every website page and on the Support page,
  and a Live Chat screen in the mobile app (with a push notice when staff
  reply). Staff answer from Support → Live Chat: one inbox for website and
  app chats, assign a conversation, mark it open or closed, see who is online;
  a chat icon in the admin header shows the unread count.
  When nobody is online the visitor sees your away message, and a guest who
  left an email gets the reply by email. It runs on ordinary HTTP, so it works
  on shared hosting with no chat server to set up. Settings → Live Chat: on/off,
  title, welcome and away messages. On by default for a new install; a site
  upgraded from 1.5.0 starts with it off — switch it on there. Staff need the
  existing Support permissions.
- Facebook Messenger: add your page under Settings → General and a Messenger
  button appears next to WhatsApp, in the footer, on the Support page and on
  the app's Contact screen.
- Settings → Appearance: 20 bundled fonts (Poppins, Roboto, Open Sans,
  Montserrat, Lato, Nunito, DM Sans, Plus Jakarta Sans, Outfit, Manrope, Rubik,
  Raleway, Playfair Display, Hind Siliguri for Bangla, Cairo for Arabic, Heebo
  for Hebrew and more), a separate heading font and a base text size
  (14–18 px) for the website. A new Admin Panel Appearance section sets the
  font, heading font, text size and an optional brand colour of the admin
  panel and every portal. All fonts are self-hosted — no Google Fonts request.
- Website search: live hotel rates (cheapest first) when Amadeus is set up;
  the Flights tab searches live once a flight API is on and shows the request
  form otherwise; filters for tour packages (budget, trip length), Hajj &
  Umrah (budget, length, open seats) and transport (text, type); visa cards
  list the documents required; hotel dates carry into the enquiry.
- Settings → Flight API groups the providers into GDS and NDC/aggregators
  with a live/missing/off badge for each.
- Install on cPanel without a terminal: prepare `vendor/` on your computer,
  upload, and run the browser installer. When the document root cannot be
  changed, move `public/` into `public_html/` and add `travelio-path.php` —
  `index.php` is never edited, and System Update follows it.
- System Update checks the server first: PHP version and extensions, file
  uploads and the temporary folder, upload size, execution and input time,
  memory, writable folders and free disk space. A failing item blocks the
  automatic update and names the setting to change; the same checks run
  again before any file is replaced. An oversized or interrupted upload is
  explained ("nothing was changed") instead of failing silently.
- Sign out of every device (`POST /api/v1/auth/logout-all`).

### Changed
- The installer creates your administrator from the details you enter,
  installs only into an empty database, stays locked after installation
  (even if `.env` changes) and sets `APP_ENV=production`, `APP_DEBUG=false`.
  A real install never gets demo accounts or sample data.
- PHP 8.3 or newer is required (Laravel 13); the installer checks for it.
- Text sizes are in `rem`, so the font-size setting scales the whole page;
  at the default 16 px nothing moves.
- Every corner on the website — cards, panels, the search widget, promotion
  and destination cards, bands, badges, the live chat window and Bootstrap's
  own components — follows the Appearance radius settings, so a card radius
  of 0 makes the whole site square.
- Default session driver is `file`, so a fresh upload works before the
  database exists.

### Security
- Uploaded files take their extension from their content, not their name
  (a renamed PHP script is refused), and deleting an old file can never reach
  outside `public/uploads`.
- A deactivated customer or user cannot sign in, and their app tokens are
  revoked at once; a password reset signs out every device.
- The mobile app sign-in asks an unverified customer for the email code
  instead of issuing a token. Existing customers are marked verified on
  upgrade.
- Activity log values are always shown escaped.

### Fixed
- In dark mode the search widget's dropdowns showed dark text on a dark
  background.
- Brand-coloured link buttons on promotion cards now follow the primary
  colour.
- A hand-edited search link (`?q[]=x`) no longer causes a server error.
- Admin toggle switches render as switches instead of stretched checkboxes.
- The website's heading font now follows Settings → Appearance (it stayed
  Inter before).

## 1.5.0

Switch whole modules off, six flight APIs, Featured packages and Promotions.

### Added
- Settings → Modules: switch Tour packages, Hajj & Umrah, Visa, Flights,
  Hotels, Transport, Additional services, Agents, Marketing, CRM, Accounting,
  HR, Tasks, Support or Reports off; the website, portals, admin menu and
  mobile app all follow, and nothing is deleted.
- Agent registration switch: close "Become an agent" while existing agents
  keep working; vendor sign-up follows the marketplace switch.
- Six flight APIs (Amadeus, Sabre, Travelport, Duffel, TBO Air, Kiwi.com),
  searched together with the provider shown on every offer.
- Featured packages for tours and Hajj/Umrah, and Promotions (scheduled promo
  banners for the website and the app). New home sections: Promotions and a
  Hajj & Umrah package rail.
- Mobile app 1.5.0 follows the module switches and adds a Special Offers
  carousel, the Hajj & Umrah rail, Featured badges and live fares.

### Fixed
- Saving a settings page with a secret field left blank no longer erases the
  saved secret.

## 1.4.0

Manual bank payments with admin verification, two new Pakistani gateways,
separate payment and supplier status on bookings, an optional multi-vendor
marketplace, a full-width Hero slider for the home page, and a direct upgrade
path from 1.0.0 / 1.1.0.

### Added

**Payments**
- Bank transfer with verification: a customer paying by Bank submits the
  reference, payment date and a receipt (JPG, PNG or PDF) from the portal or
  the app; the booking shows *Pending verification*. The new *Payment
  Verification* queue lets the desk review the proof, record the bank account,
  reference, amount and date, then approve or reject. Approval settles the
  invoice, issues the receipt and (for agent sales) creates the commission;
  rejection tells the customer why and allows resubmitting. An amount below
  what is due cannot be approved. Receipts are on private storage, served to
  staff only. Works for package, hotel and transport bookings and over the API.
- Company Bank Accounts screen; active accounts are shown to customers who
  choose Bank, in the portal and via `GET /api/v1/payments/bank-accounts`.
- `payment_status` (unpaid, pending_verification, paid, rejected) and
  `supplier_status` (not_required, pending, confirmed, failed) on bookings,
  with a supplier and supplier reference, separate from the booking status.
  `status = paid` still works and mirrors `payment_status = paid`; existing
  bookings are backfilled. An online gateway payment now sets
  `payment_status` and leaves the booking's own status alone.
- JazzCash (hosted checkout, signed response verified) and Easypaisa (Easypay,
  verified via the Inquire Transaction API), configured in Settings → Payment
  Gateways. Test them with your own merchant sandbox before going live.
- Visa applications gain billing fields (payment status and method).

**Multi-vendor marketplace (optional; on for a fresh install, off after an upgrade until switched on; Settings → General → Marketplace)**
- Public vendor registration (`/become-a-vendor`), vendor directory and vendor
  profile pages. All of them return 404 while the marketplace is switched off.
- Vendor portal: dashboard, profile, bookings (confirm or decline), reviews
  with replies, earnings and payout requests.
- Vendors list their own tour packages, hotels, transport services, Hajj &
  Umrah packages and visa services; every new or edited listing waits for
  admin approval.
- Back-office Marketplace: vendor approval and per-vendor commission rate,
  listing approval, earnings ledger (reversed and partially refunded when a
  booking is cancelled or refunded) and payout approval.
- New `vendor_*` permissions, granted to existing roles by migration.
- Settlement controls (all optional, Settings → General → Marketplace):
  per-service and per-vendor commission, a flat fee per sale and a minimum
  commission; a holding period before a vendor's share can be withdrawn;
  VAT on the agency's commission (vendors can be marked exempt); tax withheld
  from payouts; a minimum payout; automatic weekly/monthly payout requests
  that can also approve — or book themselves as paid — for agencies whose
  bank pays on a schedule. The system books payments; it does not move money.
- Manual balance adjustments (penalty, bonus, correction); a negative balance
  is carried against the vendor's next sales. Payout approval re-checks the
  balance. Bank-file CSV of approved payouts with "mark all paid".
- Vendor settlement report (admin, CSV) and a printable vendor statement
  (web, CSV and API). Every earning, payout, tax and VAT amount is posted to
  the accounts (new Vendor Payable, Vendor Cost of Sales and Vendor TDS
  Payable accounts) and `accounting:rebuild` re-posts them.
- Vendor notifications (in-app and push), optional "Sold by" on listings, and
  the vendor mobile API under `/api/v1/vendor/*` with `POST /become-a-vendor`.
- "How it works" help panels on every marketplace page (admin and vendor
  portal) and a Bangla/Arabic `vendor` language module; the app downloads the
  vendor phrases with its other texts (`vendor_phrases`).
- Marketplace links: "Become a Vendor" / "Our Vendors" in the site menus (migration for existing sites) and on the sign-in page, hidden automatically while the marketplace is off; a Vendor one-click login on the demo sign-in; vendors sign in through the normal `/login`.
- Vendor portal and admin vendor lists use the standard list layout (Add button top-right, search/filter/paging, status tabs with counts); a vendor's logo is their header avatar.
- Admin can add a vendor by hand (Marketplace → Vendors → + Add vendor): status,
  commission and a generated one-time password. Vendors upload private
  documents (trade licence, tax certificate) from Business profile; vendor and
  desk notices are also emailed when Settings → Mail is set up.
- Demo `VendorSeeder` (vendor@bugbuild.com, trails@bugbuild.com,
  newvendor@bugbuild.com, password 12345678). Running it also switches the marketplace on.

**Website and admin tools**
- Hero slider: a new Home Page Sections type that turns every active Slider
  into a full-width fading slide, with the search widget optionally on top.
  "Hero + search widget" is unchanged; use one or the other.
- Search widget manager (Settings): edit the home search tabs and the
  traveller options.
- Home and CMS page sections (`page_sections`) for reordering and editing the
  sections that make up public pages.

### Changed
- System Update accepts the full `WebSourceCode` project (zip of the contents
  or of the folder) and can finalize a manual cPanel copy; one source tree
  serves both fresh installs and updates. See `UPDATE_PACKAGE.md`.
- Settings values are stored as text so long encrypted credentials fit.
- Language text directions are normalised (RTL for Arabic and Hebrew).
- Mobile app (Flutter 1.4.0): bank transfer sheet, JazzCash and Easypaisa,
  payment and supplier pills on bookings, social sign-in, trip planner,
  points and referrals, reviews, and promo code and points in the booking
  sheet.

### Fixed
- The Coupons form escaped its own quotes (`class=\"text-danger\"`), emitting
  broken markup for every required-field marker and number input.
- A cancelled, refunded trip no longer pays out loyalty rewards.

### Security
- Bank-transfer receipts are stored privately and are only downloadable by
  staff.
- Gateway responses (JazzCash signature, Easypaisa inquiry) are verified
  server-side before a payment is recorded.
- Marketplace vendors can only see and act on their own listings, bookings,
  earnings and payouts; the whole surface is gated by the on/off setting.

### Upgrading from 1.0.0 / 1.1.0
Use Settings → System Update. Upgrading directly from any earlier version
(1.0.0 or 1.1.0) to 1.4.0 is supported; there is no need to install
intermediate releases. Take a backup first; the updater also makes one.

**Steps** (tested against a real v1.0.0 install with demo data):
1. Back up the files and the database.
2. v1.0.0 and v1.1.0 have no System Update screen, so the first jump is a file copy: copy the *contents* of `WebSourceCode` into the project root with *Replace all*, but not `.env`, `vendor`, `storage`, `public/uploads` or `public/storage`.
3. Sign in as super-admin, open Settings → System Update and press **Finalize manual update** (or run `php artisan travelio:upgrade`). Do this straight away; until then the site points at database columns that do not exist yet.
4. Finalize applies every pending migration, adds new permissions to existing roles and users, adds new settings and the French language and home sections without overwriting your values, moves old visa documents to private storage and records v1.3.0. `composer install --no-dev` is optional.
From 1.3.0 onwards you can update by uploading the ZIP on the same screen.

## 1.3.0

Also covers the 1.2.0 additions, which shipped before this entry
was written.

### Added

**Growth and engagement**
- AI trip planner (customer portal and mobile app) that builds a day-by-day
  itinerary from destination, dates, budget and interests; plans are saved.
- Loyalty points and referrals: points earned on paid bookings, tiers, a
  personal referral code per customer, and a loyalty page in the portal.
- WhatsApp messaging integration, configured under Settings → Integrations.
- Google and Facebook sign-in for the web and the mobile API; a user can link
  more than one social provider.
- Social Links manager (Settings → Social Links) for the public site footer
  and contact blocks.
- Wishlist: customers can save tour packages from the public site and manage
  them in the portal.

**Discounts and reviews**
- Promo codes now work end to end. A code can be entered when booking from the
  mobile app, the customer portal, the public website and the back-office
  form; all paths price through one service (`BookingPricing`).
  `min_spend`, `usage_limit` and `expires_at` are enforced and `used_count`
  is claimed atomically; cancelling a booking hands the use back. A code that
  cannot be used never fails the booking.
- Loyalty points can be spent as a discount on a tour booking, bounded by new
  settings (Settings → Loyalty): point value, minimum spend per redemption and
  maximum share of a booking. Points are earned on what the customer actually
  paid, and a booking that stops being paid has its reward reversed.
- Verified booking reviews (Marketing → Reviews): only a customer who paid for
  and travelled on a tour can review it; one review per trip; moderated by
  default; staff approve, reject and reply. Ratings appear on the public
  package page, the portal and the app. New endpoints:
  `GET /api/v1/packages/{id}/reviews`, `GET /api/v1/reviews`,
  `POST /api/v1/bookings/{id}/review`, `POST /api/v1/bookings/quote`.

**Live flights and hotels (Amadeus)**
- Flight and hotel search and hotel booking through the Amadeus API
  (credentials in Settings; works with the Amadeus test or production host).
  Hotel bookings store the provider offer, booking and confirmation ids;
  flight bookings support a return leg (return route and date).

**Website and admin**
- Admin-configurable default light/dark theme for the public site and the admin
  panel (Settings → Appearance → Default Mode).
- Round-trip fare split per leg on flight bookings; a customer cancellation
  shows the refund amount, penalty and status note in the app and API.
- A customer can amend a still-tentative hotel booking; once the desk confirms
  it, amendments go through the desk.
- The manual-update (cPanel) panel also shows a ready-to-copy `rsync` command.

## 1.1.0
Changes made in response to the CodeCanyon review of the 1.0.0 submission.

**Security**
- Removed `POST /api/v1/wallet/topup` — it credited a customer's wallet with
  no payment taken. A wallet can now only be funded by a real payment or a
  staff-recorded manual adjustment.
- Wallet and agent-withdrawal balance checks now run inside a database
  transaction with a row lock, closing a race that let two concurrent
  requests both pass a balance check and overdraw.
- Visa applicant documents (passport scans, etc.) moved from the public disk
  to a private one. Downloading now always goes through an authenticated,
  permission- and ownership-checked route for staff, customers and agents.
  Existing installs: run `php artisan travelio:move-private-documents` once
  after upgrading to move any previously-uploaded documents off the public
  disk (safe to re-run).
- SVG uploads for the site logo and favicon are no longer accepted (stored
  XSS risk from inline SVG rendering).
- The image-upload pipeline no longer builds a function name from the
  uploaded file's extension and calls it; it now checks the extension
  against an explicit whitelist before processing.
- Android release builds now fail immediately with a clear message if
  `android/key.properties` is missing or incomplete, instead of silently
  falling back to a debug-signed build that the Play Store would reject.

**Fixed**
- Uploading a logo, favicon or any other file through an admin form behind the
  `XSS` middleware failed with "something went wrong": the middleware ran
  `strip_tags()` over every input including the uploaded files, coercing each
  one to a temp-path string. It now only touches string inputs, and the
  General Settings route it was meant to skip is spelled correctly.

**Fixed**
- The installer rejected the administrator email on servers without outbound
  DNS (the rule was `email:rfc,dns`); it now validates the address format only.

**Changed**
- Settings → API Security is seeded with a fixed default `X-App-Key`
  (`EnsureAppKey::DEFAULT_KEY`), matching the value compiled into the mobile
  app, so the app and a fresh backend pair up with no setup. Generate a new
  key in the panel to rotate; blank switches the check off.

**Logic**
- Booking cancellation now respects an admin-configurable window and
  penalty (*Settings → General Settings → Booking Policy*) instead of
  allowing a full refund at any time, including after the travel date.

**Performance**
- Wallet balance is read from the latest ledger row instead of loading a
  customer's full transaction history; new entries update the running
  balance in place instead of rewriting every prior row; the total held
  across all wallets is now one SQL aggregate instead of one query per
  customer.

**Dependencies**
- Removed the unused Inertia/Vue layer (46 Vue components, the Inertia
  middleware, `app.blade.php`) — nothing in the app rendered through it.
- Removed `laravel/breeze` (unused scaffolding) and `minimum-stability: dev`
  from composer.json.
- Upgraded `intervention/image` from the end-of-life 2.7 to 3.x.
- Standardised on one jQuery build (3.7.1) and one Select2 build (4.1)
  across the admin panel; Bootstrap intentionally kept at two builds
  (4 for the existing admin panel/auth pages, 5 for the public frontend) —
  a full markup port was judged too risky to do as part of this fix.

**Packaging**
- Compressed documentation screenshots (217 MB → 49 MB) and resynced the
  shipped offline documentation folder, which had gone stale.
- Replaced `online-documentation.html`'s blind redirect with a page that
  opens the included offline documentation first.
- Removed committed build output (`resources/scss/backend/*.css[.map]`,
  stray `.css.map` files), `.bak` files, `tinker_test.php`, the internal
  `issues.txt`, and Flutter/Gradle build caches from the working tree.
- Enabled R8 (`isMinifyEnabled`, `isShrinkResources`) for Android release
  builds and documented `--obfuscate --split-debug-info` in the app's
  README.
- Release packager now also strips runtime data under `storage/app`
  (uploaded documents, backups), generated `bootstrap/cache/*.php`, editor
  LSP cache files, source maps, internal planning docs and every empty
  directory, and asserts none of them survived. Untracked the stray
  `storage/framework/lsp-*.php` and `*.css.map` files from git.
- Replaced the stock Laravel README with one that covers install, modes,
  tests and the 1.0.x → 1.1.0 upgrade path; `.env.example` defaults now
  name the product instead of the starter template.

## 1.0.0 — Initial Release
- Tour packages, categories, schedules, guides and package bookings
- Visa management with appointments, documents, status tracking and expiry management
- Hajj & Umrah with pilgrims, hotel/flight allocation, groups, payments and document verification
- Hotel, flight and transport booking modules with vouchers, ticketing, reissue, cancellation and refunds
- Additional services — travel insurance, student consultancy, medical tourism, corporate travel and events
- CRM with leads, activities, follow-up calendar, notes and communication history
- Double-entry accounting with full statements, invoices, receipts, refunds and tax reports
- Suppliers, contracts, supplier ledger and agent commission with agent invoices
- Task management, support center, knowledge base and nine exportable reports
- CMS website builder, SEO settings, HR module and role-based access control
- Customer, Agent and Staff self-service portals
- Firebase push notifications (FCM HTTP v1), switched on from the admin panel
- Gmail API mail driver for hosts that block outbound SMTP ports, alongside SMTP and Sendmail
- Optional shared app key (X-App-Key) for the mobile API, generated and rotated from the admin panel
- Guided web installer with a system check, database test and one-click install
- Unified email verification codes across web and mobile, with expiry and rate limiting
- Four languages out of the box — English, Bangla, Arabic and Hebrew — with RTL/LTR support
