Service Registry

PSR-4 services in src/RPM/ — accessed via rpm_*_service() factory functions

Usage Guidance

Prefer factory functions over duplicating SQL in pages, API controllers, and cron scripts.

Loading order: Site factories → includes/site-bootstrap.php. Booking → includes/booking-bootstrap.php. Finance/admin/housekeeping → includes/functions.php. Encryption → includes/rpm-encryption-bootstrap.php.

Site Services

Bootstrap: includes/site-bootstrap.php

FactoryClassKey MethodsAPI Usage
rpm_site_settings_service() RPM\Site\SiteSettingsService settings(), siteContent(), pages(), reviews(), sliders(), navigation(), faqs(), events(), attractions() All site* REST controllers
rpm_site_lead_service() RPM\Site\SiteLeadService submitContactMessage(), subscribe() siteContact controller
rpm_site_blog_service() RPM\Site\BlogService getPost(), listPosts(), getCategory(), listCategories() networkBlog controller

Property Catalog

Bootstrap: includes/site-bootstrap.php

FactoryClassKey MethodsAPI Usage
rpm_property_catalog_service() RPM\Property\CatalogService getPropertyById(), listProperties(), getImages(), getFeaturedImageUrl(), pathId() vrProperties, ltrProperties via ApiPropertyHelper

Booking Services

Bootstrap: includes/booking-bootstrap.php

FactoryClassKey MethodsAPI Usage
rpm_booking_quote_calculator() RPM\Booking\Quote\QuoteCalculator buildQuote() publicBooking/quote, book
rpm_booking_reservation_service() RPM\Booking\Reservation\ReservationService createReservation(), buildApiQuote() publicBooking/book
rpm_booking_post_reservation_service() RPM\Booking\Reservation\PostReservationService finalizeBooking() publicBooking/book (invoice creation)
rpm_booking_availability_checker() RPM\Booking\Availability\AvailabilityChecker Availability validation Quote flow
rpm_booking_date_list_builder() RPM\Booking\Availability\DateListBuilder getReservationRanges(), getBlockedRanges() publicBooking/calendar
rpm_booking_day_price_calculator() RPM\Booking\Pricing\DayPriceCalculator getDayPrice(), getDayPricesForRange() publicBooking/calendar
rpm_booking_coupon_validator() RPM\Booking\Quote\CouponValidator checkCoupon(), checkCouponCode() publicBooking/validateCoupon
rpm_booking_property_service() RPM\Booking\Service\PropertyService VR property/service lookups Booking engine
rpm_booking_mail_service() RPM\Booking\Notification\MailService Booking notification email Post-reservation

Finance Services

Bootstrap: includes/functions.php

FactoryClassKey Methods
rpm_finance_invoice_service() RPM\Finance\InvoiceService getSubtotal(), getTax(), getTotal(), getTotalPaid(), refreshTotals(), syncPaymentState(), createInvoice(), addInvoiceItem()
rpm_finance_expense_service() RPM\Finance\ExpenseService adminListExpenses(), adminGetExpenseDetail(), adminCreateExpense(), adminUpdateExpense(), adminCancelExpense()
rpm_finance_report_service() RPM\Finance\ReportService incomeSummary(), occupancySummary() — admin REST read-only reports
rpm_finance_payment_service() RPM\Finance\PaymentService deleteTransaction(), addInvoicePayment(), addExpensePayment()
rpm_finance_lookup_service() RPM\Finance\LookupService getTaxRates(), getPaymentGateways(), getBankAccounts(), getGlCodes()

Admin Services

FactoryClassKey Methods
rpm_admin_tracking_service() RPM\Admin\TrackingService trackPage(), updateAdminLastSeen(), updateTenantLastSeen(), isClockedIn(), clockIn(), clockOut(), hoursWorked()
rpm_admin_activity_log_service() RPM\Admin\ActivityLogService log()
rpm_admin_tenant_service() RPM\Admin\TenantService listTenants(), getTenant() — admin REST API
Admin REST controllers delegate to catalog, invoice, tenant, reservation, expense, housekeeping, and report services. Authorization: RPM\Api\AdminAuthGuard + RPM\Api\LandlordScope for landlord read scoping.

Housekeeping

FactoryClassKey Methods
rpm_housekeeping_service() RPM\Housekeeping\Service createRequest(), createOwnerRequest(), adminListRequests(), adminCreateRequest(), adminCancelRequest()

Security

Bootstrap: includes/rpm-encryption-bootstrap.php

FactoryClassKey Methods
rpm_encryption_service() RPM\Security\EncryptionService encrypt(), decrypt(), decryptLegacyV1(), detectVersion(), needsReEncryption()

Database & Utilities

ClassMethodsNotes
RPM\Database\Connection getMysqli(), ping(), query(), prepare() Wrapper around mysqli; used by all services
RPM\Util\ClientHelper Static client utilities
RPM\Util\StringHelper Static string utilities
RPM\Util\MoneyHelper Currency formatting Use rpm_money_cmp() for comparisons

Payment & channel services

Integration helpers used alongside the REST gateway

FileClassPurpose
includes/stripe-payment.phpStripePaymentServicePaymentIntent, webhook handling
includes/stripe-connect.phpLandlord Connect onboarding
includes/bookingpal/services/*BookingPal*ServiceChannel manager sync
includes/quickbooks/services/*QuickBooks*ServiceAccounting sync
includes/APIFunctions.phpOutbound calls to external RPM network API

Integration conventions

How clients and extensions should treat the API surface

TopicGuidance
ContractUse this documentation, the OpenAPI YAML, and Postman collection as the client contract
ControllersControllers validate input and delegate to domain services — clients should not depend on internal SQL details
Money & financeTreat money fields as documented; compare and display using the types returned by the API
Browser sessionsPortal and admin browser sessions use cookies; keep SameSite and HTTPS best practices in production
Server integrationsPrefer server-to-server calls with secrets stored outside the browser
Tenant dataTenant-scoped endpoints only return data for the authenticated tenant/session
Payments & channelsStripe, QuickBooks, and BookingPal follow their own auth and webhook models — see the API reference integrations section
Specs available: OpenAPI YAML and Postman packages are listed on the Downloads page. Human reference pages and agent Markdown stay in sync with the published API surface for this version.