---
tags: [vompay, repository]
module: VomPay
---

# [Repo]Repositories

## Connections
[[_VomPay]] · [[[Model]Models]] · [[[Service]SupplierServices]] · [[[Service]InvoiceServices]] · [[[Service]DashboardSettingsServices]]

## Source
`Modules/VomPay/Repositories/`

---

## VomPaySupplierRepository

**Model:** `VomPaySupplier` (from `Modules\Tenant\Models`)  
⚠️ Wraps a Tenant-module model — operates on the central DB, not tenant DB.

| Method | Purpose |
|---|---|
| getCompanyIdBySubdomain() | Hostname → website → company chain lookup |
| getVomPackageIdByCompanyId($companyId) | Latest active subscription package ID |
| getSupplierBySubdomain() | Full supplier record via Hostname relationships (null-safe) |
| updateSupplierStatus($id, $status, $notes) | Updates by `my_fatoorah_id` |
| getSupplierBy($subdomain) | Supplier via Hostname |
| getSWebsiteBySupplierCode($code) | Latest website for a supplier by MyFatoorah code |
| getCompanyBySubdomain() | Company record via Hostname |

---

## VomPayInvoiceRepository

**Model:** `VomPayInvoice` (tenant DB)

| Method | Purpose |
|---|---|
| updateInvoiceStatus($id, $status, $notes) | Update by `my_fatoorah_invoice_id` |
| findByMyFatoorahId($id) | Find invoice by MyFatoorah invoice ID |
| getBy($paiableType, $paiableId) | Latest invoice for a specific payable (with relations) |
| updateInvoiceByWebHookData($data, $notes) | Sets status + payment_method + payment_id from webhook payload |
| paginateDataBy($params) | Filters via FilterTrait scopes, transforms via `VomPayInvoiceResource` |

---

## VomPaySettingRepository

**Model:** `VomPaySetting` (tenant DB)

| Method | Purpose |
|---|---|
| getLatest() | Returns single most-recent setting row (ordered by id DESC) |

All write operations handled directly by `VomPaySettingService` via `BaseRepository::create()`.
