libraryPackage manifestv2.0.4

lib.billing-runtime

Pure backend-neutral BillingOS runtime helpers for deterministic quote-to-cash lifecycle projections.

@lssm-tech/lib.billing-runtime
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 2.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
servernode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.billing-runtimedomains

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

3 déclarationsSELECT TO INSPECT

@lssm-tech/lib.billing-runtime

Pure, backend-neutral BillingOS runtime helpers over @lssm-tech/lib.billing-spec.

France readiness metadata is not PA accreditation, production PA submission, legal advice, or tax advice.

Runtime helpers

@lssm-tech/lib.billing-runtime provides pure helper engines over @lssm-tech/lib.billing-spec:

  • quote/order/invoice/payment/reconciliation lifecycle projections;
  • deterministic pricing totals with an injected synchronous tax-calculation port;
  • local workflow event creation/appending;
  • payment-state reconciliation hints;
  • draft accounting export shaping;
  • deterministic quote-to-cash cockpit projections with lifecycle, approval-packet, surface, and finance-review handoff metadata; and
  • agent planning guards that produce approval packets instead of executing high-impact billing actions.

The package performs no network calls, filesystem access, provider SDK calls, credential handling, persistence writes, PA submission, or autonomous production billing execution.

BillingOS truth and FinanceOS handoff

The additive ./truth surface projects normalized billing facts into the append-only economic-evidence lifecycle, provides a tenant-isolated in-memory reference store with revision and idempotency guards, records superseding corrections without deleting history, and validates balanced, company-scoped posting handoffs. A posting handoff remains a proposal until an explicit ContractSpec Connect authorization reference is supplied.

Persistence ports (additive)

Backend-neutral port interfaces that a host implements against its store; the package defines the contracts, never the adapters:

  • InvoiceRepositoryPort — persist and read issued invoices.
  • EventLogAppendPort — append-only billing workflow event log.
  • InvoiceChainAppendPort — append entries to the per-period invoice hash-chain.
  • CreditNoteRepositoryPort — persist and read credit notes (avoir).

Observability (additive)

  • BillingObservabilityPort — structured, correlation-id-propagating observability hook for issuance and submission.
  • Field-level redaction of SIREN/SIRET/VAT identifiers, secrets, and amounts so no sensitive payload is logged; redaction is applied before any sink receives the record.

Service agreements (./service-agreement, additive)

Pure engines and host ports for @lssm-tech/lib.billing-spec/service-agreement:

  • recordServiceUsage / correctServiceUsage over ServiceUsageLedgerPort: atomic usage + outbox + work-completion transaction; identical replay returns the stored receipt, a changed payload conflicts, corrections supersede the current head without deleting history.
  • recordMeteredServiceUsage over ServicePriceTablePort and MeteredServiceUsageStorePort: meters one platform service call exactly once per tenant and usage ref, rated by selectServicePriceVersion / rateServiceUsage against the version effective at the occurrence. It never guesses a price: the call is unpriced until the owner sets one. An optional MeteredServiceBillingPort appends the call to the service usage ledger through recordServiceUsage when the tenant's agreement sells the meter; a replay returns the stored receipt and a changed payload conflicts. occurredAt is metadata: the first recorded occurrence wins, and a retry after a crash that left the call in the ledger only adopts that ledger event. The bound ledger must scope event ids (usage:<usageRef>) by tenant. toMeterServiceUsageOutput projects a result onto the billing.service.usage.meter output; the host emits its billing.service.usage.metered audit record. InMemoryServicePriceTable and InMemoryMeteredServiceUsageStore are the reference adapters.
  • computeServiceInvoiceDraft: deterministic, digest-bound drafts per cadence period with frozen price editions; late usage and post-issue corrections become adjustment or credit lines for the earlier period instead of rewriting issued invoices; BYOK never yields passthrough.
  • reserveServiceCapacity / settleServiceReservation / resumeServiceBudget over a compare-and-set ServiceBudgetStorePort: allowance, approved overage ceiling, bounded grace and pause, plus a separate internal provider budget.
  • buildOnPremUsageBatch / importOnPremUsageBatch: signed digest-only batches with replay, gap, fork, instance-change, key-rotation and clock checks.
  • submitServiceInvoiceOnce / issueServiceInvoice / applyServicePaymentEvent: approved, exactly-once submission (unique per tenant and merchant), approved issue, and idempotent, order-safe payment evidence.
  • openServiceCollection / issueStoredServiceInvoice / receiveServicePaymentEvent over ServiceCollectionStorePort: collection state per invoice under a row lock; a verified webhook is stored once per merchant and provider event id (redelivery is a duplicate, a changed payload conflicts), and events that arrive before issuance are held and applied at issuance.
  • requireServiceApproval: consequential actions verify an OperationApprovalReceipt through the host's OperationApprovalPort (subject, operation key/version, input digest, consumed nonce). A caller-supplied decision string is never authority; with no port bound the action fails closed.

In-memory reference adapters mirror the required host semantics for tests; they are not durable storage. Hosts bind the ports to their database.

Declared capabilities.

Lib Billing Runtime

Pure backend-neutral BillingOS runtime helpers for deterministic quote-to-cash lifecycle projections.

Use it to

  • Adopt pure backend-neutral billingos runtime helpers for deterministic quote-to-cash lifecycle projections

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.billing-runtime package constraints do not match the target runtime or platform.

@lssm-tech/lib.billing-runtime

@lssm-tech/lib.billing-runtime/fixtures

@lssm-tech/lib.billing-runtime/fixtures-rich

@lssm-tech/lib.billing-runtime/observability

@lssm-tech/lib.billing-runtime/observability/correlation

@lssm-tech/lib.billing-runtime/observability/instrumentation-port

@lssm-tech/lib.billing-runtime/observability/redaction

@lssm-tech/lib.billing-runtime/ports

@lssm-tech/lib.billing-runtime/ports/credit-note-repository-port

@lssm-tech/lib.billing-runtime/ports/event-log-append-port

@lssm-tech/lib.billing-runtime/ports/invoice-chain-append-port

@lssm-tech/lib.billing-runtime/ports/invoice-repository-port

Imports and export paths.

21 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

21 imports

Dependencies and related packages.

Runtime dependencies 3
Development dependencies 3
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
devcontractspec-bun-build dev
cleanrimraf dist .turbo
lintbun lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
testbun test
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
Votre vue

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Votre contexte

The different parts of you

Choose a starting point

Un mélange utile de contexte, de visuels et de guidage discret.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Confort de lecture

Choisir votre langue

La langue de l’interface change uniquement le texte. Les marchés, les prix et les parcours conservent leurs propres paramètres.

Couverture des traductions

Une partie du contenu est affichée en anglais.

Navigation151
Graphe616
Catégories378
Portfolio833
Exemples2 035
Aperçu de la source1 542

D’autres traductions seront ajoutées à mesure que le contenu sera relu.

Cette préférence est enregistrée dans ce navigateur.

Rechercher sur le site

Des points de départ utiles

Aucun résultat. Essayez une expression plus courte, un nom d’opération ou un autre périmètre de recherche.

UN PEU DE PLACE POUR EXPLORER

Trouvez quelque chose à explorer.

Ouvrez un aperçu détaillé sur cette page, essayez une autre perspective ou suivez le détail vers sa propre page.

Fonctionnement des aperçus et des commandes
01

Regarder avant de partir

Survolez un lien ou sélectionnez-le avec Tab pour voir un aperçu. Cliquer sur le lien d’origine ou appuyer sur Entrée ouvre toujours sa destination.

02

Rester dans le contexte

Entrez dans l’aperçu pour explorer ses sections. Depuis un lien sélectionné, utilisez Alt + ↓ pour y entrer au clavier. Échap le ferme.

03

Ouvrir les possibilités

Les lignes dépliables, les choix de perspective et les commandes mises en évidence révèlent davantage. Votre vue adapte le confort de lecture et le contexte exploré.

Un bouton séparé pour voir de plus près

Affichez de petits boutons d’aperçu à côté des liens quand l’espace le permet. Touchez l’œil pour examiner ou le lien pour y aller directement. Ce choix reste dans cet onglet.

Aucun historique de navigation n’est collecté. La réduction des animations suit votre appareil et Votre vue.