Crosswake. Commerce behaviour
(crosswake v0.1.0)
View Source
Thin behaviour/orchestration seam for Phoenix-owned commerce intent and snapshot hooks.
Summary
Callbacks
Fetch the current entitlement snapshot for a given group.
Ingest evidence from device callbacks or webhooks.
Submit a purchase intent initiated by the Phoenix user.
Submit a restore intent initiated by the Phoenix user.
Callbacks
@callback fetch_entitlement_snapshot(String.t()) :: {:ok, Crosswake.Commerce.Contracts.EntitlementSnapshot.t()} | {:error, term()}
Fetch the current entitlement snapshot for a given group.
@callback ingest_reconciliation_evidence( Crosswake.Commerce.Contracts.ReconciliationEvidence.t() ) :: {:ok, Crosswake.Commerce.Reconciliation.EvidenceResult.t()} | {:error, term()}
Ingest evidence from device callbacks or webhooks.
@callback submit_purchase_intent(Crosswake.Commerce.Contracts.PurchaseIntent.t()) :: :ok | {:error, term()}
Submit a purchase intent initiated by the Phoenix user.
@callback submit_restore_intent(Crosswake.Commerce.Contracts.RestoreIntent.t()) :: :ok | {:error, term()}
Submit a restore intent initiated by the Phoenix user.