Skip to content

Systems

A System represents an external system that Conflux can integrate with — an e-commerce platform such as WooCommerce or PrestaShop, or an internal Positive Group product such as rapidmail. Each system record declares which driver implements its integration and which capabilities that driver exposes.

Model attributes

Attribute Type Notes
id UUID Primary key via HasUuids
name string Human-readable display name (e.g. "WooCommerce")
slug string URL-safe identifier (e.g. "woocommerce")
driver SystemDriver Backed enum; identifies the integration implementation
auth_fields array JSON; describes the credential fields required to connect to this system
capabilities Collection<SystemCapability> Cast via AsEnumCollection; the operations this system supports
direction_matrix array, nullable JSON map of SystemCapability value → list of SyncDirection values, e.g. {"orders": ["pull_in","push_out"]}; null means no direction data has been set yet
is_active boolean Only active systems are returned by the API and available for new system connections
deleted_at timestamp Soft deletes enabled

Scopes

scopeActive

System::active()->get();

Filters to rows where is_active = true. Used by the API endpoint to return only systems available for use.

SystemDriver enum

App\Enums\SystemDriver — backed string enum. Identifies which integration class handles a system's API calls. Never store the FQCN; always use the enum value.

Case Value
WooCommerce "woocommerce"
PrestaShop "prestashop"
RapidMail "rapidmail"
UserPlatform "user-platform"

SystemCapability enum

App\Enums\SystemCapability — backed string enum. Declares which data domains a system integration supports. A system may expose any subset of these.

Case Value Description
Products "products" Read/write product catalogue
Orders "orders" Read/write orders
Customers "customers" Read/write customer records

SyncDirection enum

App\Enums\SyncDirection — backed string enum implementing HasLabel. Declares which of four data-flow directions a system supports, per data domain. See ADR-0004 for why this is a separate field from capabilities.

Case Value Meaning
PULL_IN "pull_in" Conflux actively queries the system (e.g. bulk export from WooCommerce)
PUSH_IN "push_in" The system reports to Conflux (e.g. a webhook)
PUSH_OUT "push_out" Conflux actively writes to the system
PULL_OUT "pull_out" The system reads from Conflux

Direction matrix

direction_matrix records which of the directions above a system supports, per SystemCapability domain — e.g. {"orders": ["pull_in","push_in","push_out"], "customers": ["pull_in","pull_out"]}. It is deliberately its own field rather than folded into capabilities: capabilities says which data domains a system deals in at all, direction_matrix says which direction of flow is supported for each of those domains.

supportsDirection()

$system->supportsDirection(SystemCapability::Orders, SyncDirection::PushOut); // bool

Returns whether the given domain is present in direction_matrix with the given direction listed. Returns false — not an error — when direction_matrix is null or the domain key is absent, so callers never need a null check before calling it.

SyncRule::isDirectionFlowValid() calls this twice (once per connection) to validate a rule's source/target pair per ADR-0005 — see Sync Rules.

API endpoint

See the auto-generated API docs for the full endpoint specification, request parameters, and response shape.

Source files

File Purpose
app/Models/System.php Eloquent model, casts, scopeActive, supportsDirection()
app/Enums/SystemDriver.php Driver backed enum
app/Enums/SystemCapability.php Capability backed enum
app/Enums/SyncDirection.php Direction backed enum
app/Http/Controllers/Api/SystemsController.php GET /api/systems invokable controller
app/Http/Resources/SystemResource.php API resource transformer
routes/api.php Route definition (api.systems)

See also

  • API Authentication — the connection guard, bearer token setup, EnsureSystemConnectionIsActive middleware, test helpers
  • Sync Rules — validates a source/target pair's direction_matrix before allowing data to flow between them