Cleanup: remove internal references and scaffolding

This commit is contained in:
Sulkta 2026-05-27 11:15:03 -07:00
parent b4a81e0ab8
commit 812393d030
10 changed files with 72 additions and 141 deletions

View file

@ -6,13 +6,6 @@ The scheduler drives two jobs against a consumer-supplied
- :func:`cardano_checkout.monitor.check_pending_invoices` every 15 seconds
- :func:`cardano_checkout.monitor.reprice_expired_invoices` every 60 seconds
That's the *full* SDK job surface. The subscription-level + grace-period
jobs that the original the host app scheduler shipped are the host app-specific
(they touch ``Company``, ``Subscription``, ``SubscriptionPayment`` models
that are merchant-specific) those live in
:mod:`cardano_checkout.hostapp_compat` so the host app can still import the
exact wrappers it has always used, without polluting the generic SDK.
Usage::
from cardano_checkout.scheduler import InvoiceScheduler
@ -54,7 +47,7 @@ class InvoiceScheduler:
store: Persistence backend. Required.
koios_url: Chain-query endpoint. Override for testnet / custom gateways.
check_interval_seconds: How often to poll Koios for pending invoices.
Defaults to 15 identical to the host app's production cadence.
Defaults to 15.
reprice_interval_seconds: How often to sweep for expired invoices.
Defaults to 60.
payment_window_minutes: Re-expiry window when repricing.
@ -87,9 +80,8 @@ class InvoiceScheduler:
async def _job_reprice_expired(self) -> None:
if self.price_fn is None:
# No oracle wired — skip repricing silently. Consumers that
# don't care about the USD-lock workflow (e.g. fixed-ADA
# invoices) will never configure a price_fn; that's fine.
# No oracle wired — skip repricing. Fixed-ADA invoices don't
# need one.
return
try:
await reprice_expired_invoices(
@ -149,12 +141,9 @@ class InvoiceScheduler:
# ---------------------------------------------------------------------------
# Backwards-compatible free-function API
# Free-function API around a module-level default instance.
# Prefer the InvoiceScheduler class for anything nontrivial.
# ---------------------------------------------------------------------------
#
# Early adopters may have imported ``start_cardano_scheduler`` / ``stop_cardano_scheduler``
# directly. Provide those as thin wrappers around a module-level default instance.
# Using the InvoiceScheduler class is preferred for anything nontrivial.
_default: Optional[InvoiceScheduler] = None