@happyvertical/smrt-sales 0.57.22 → 0.57.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -0
- package/README.md +34 -0
- package/agents/agreements.md +32 -0
- package/agents/commissions.md +2 -1
- package/agents/crm.md +150 -0
- package/agents/svelte.md +7 -0
- package/dist/agreements/collections/AgreementCollection.d.ts +3 -2
- package/dist/agreements/collections/AgreementCollection.d.ts.map +1 -1
- package/dist/agreements/models/Agreement.d.ts.map +1 -1
- package/dist/agreements/services/AgreementExecutionService.d.ts +9 -0
- package/dist/agreements/services/AgreementExecutionService.d.ts.map +1 -1
- package/dist/agreements/types.d.ts +2 -0
- package/dist/agreements/types.d.ts.map +1 -1
- package/dist/agreements.js +2 -2
- package/dist/chunks/__smrt-register__-Yzz7_2xD.js +6 -0
- package/dist/chunks/__smrt-register__-Yzz7_2xD.js.map +1 -0
- package/dist/chunks/{agreements-jBiVmttD.js → agreements-RsyRLeDn.js} +35 -16
- package/dist/chunks/agreements-RsyRLeDn.js.map +1 -0
- package/dist/chunks/{commissions-D5x24d4o.js → commissions-nMBMa0DT.js} +410 -344
- package/dist/chunks/commissions-nMBMa0DT.js.map +1 -0
- package/dist/chunks/{crm-BRICSwf2.js → crm-BENK-hHd.js} +793 -123
- package/dist/chunks/crm-BENK-hHd.js.map +1 -0
- package/dist/chunks/{referrals-BRdTkEFt.js → referrals-BPEaXqCz.js} +2 -2
- package/dist/chunks/{referrals-BRdTkEFt.js.map → referrals-BPEaXqCz.js.map} +1 -1
- package/dist/commissions/collections/CommissionPayoutCollection.d.ts +3 -1
- package/dist/commissions/collections/CommissionPayoutCollection.d.ts.map +1 -1
- package/dist/commissions/models/CommissionPayout.d.ts +15 -1
- package/dist/commissions/models/CommissionPayout.d.ts.map +1 -1
- package/dist/commissions/services/CommissionPayoutService.d.ts.map +1 -1
- package/dist/commissions/types.d.ts +2 -0
- package/dist/commissions/types.d.ts.map +1 -1
- package/dist/commissions.js +2 -2
- package/dist/crm/collections/SalesGovernanceEventCollection.d.ts +7 -0
- package/dist/crm/collections/SalesGovernanceEventCollection.d.ts.map +1 -0
- package/dist/crm/collections/SalesGovernanceStateCollection.d.ts +13 -0
- package/dist/crm/collections/SalesGovernanceStateCollection.d.ts.map +1 -0
- package/dist/crm/index.d.ts +6 -0
- package/dist/crm/index.d.ts.map +1 -1
- package/dist/crm/models/SalesGovernanceEvent.d.ts +19 -0
- package/dist/crm/models/SalesGovernanceEvent.d.ts.map +1 -0
- package/dist/crm/models/SalesGovernanceState.d.ts +17 -0
- package/dist/crm/models/SalesGovernanceState.d.ts.map +1 -0
- package/dist/crm/services/SalesGovernanceService.d.ts +68 -0
- package/dist/crm/services/SalesGovernanceService.d.ts.map +1 -0
- package/dist/crm/services/governance-write.d.ts +4 -0
- package/dist/crm/services/governance-write.d.ts.map +1 -0
- package/dist/crm/services/sales-governance-types.d.ts +108 -0
- package/dist/crm/services/sales-governance-types.d.ts.map +1 -0
- package/dist/crm.js +3 -3
- package/dist/index.js +6 -6
- package/dist/manifest.json +592 -5
- package/dist/referrals.js +2 -2
- package/dist/smrt-knowledge.json +320 -14
- package/dist/svelte/components/SellerGovernancePanel.svelte +65 -0
- package/dist/svelte/components/SellerGovernancePanel.svelte.d.ts +13 -0
- package/dist/svelte/components/SellerGovernancePanel.svelte.d.ts.map +1 -0
- package/dist/svelte/index.d.ts +2 -1
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +1 -0
- package/dist/svelte/types.d.ts +22 -1
- package/dist/svelte/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/chunks/__smrt-register__-bn1C2AUF.js +0 -6
- package/dist/chunks/__smrt-register__-bn1C2AUF.js.map +0 -1
- package/dist/chunks/agreements-jBiVmttD.js.map +0 -1
- package/dist/chunks/commissions-D5x24d4o.js.map +0 -1
- package/dist/chunks/crm-BRICSwf2.js.map +0 -1
package/AGENTS.md
CHANGED
|
@@ -73,3 +73,11 @@ Business/domain models are generally `@TenantScoped({ mode: 'optional' })` with
|
|
|
73
73
|
- **recordClick inside your transaction participates, never nests**: a nested adapter `transaction()` takes an independent pooled connection (happyvertical/sdk#1108) — it deadlocks undetectably on locks the caller's transaction holds (PostgreSQL sees a promise-wait, not a lock-wait) and refuses caller-created uncommitted links as `unknown_code`. Pass the caller's transaction database as `RecordClickInput.transaction` or bind the collection to it (`{ db: tx, _reuseInitializedDb: true, _deferRuntimeInitialization: true }` — detected and honored automatically); a pool-level database passed as `transaction` is refused with typed reason `invalid_transaction`. Participating results are bound to the caller's transaction — carry ids across the commit boundary; the pool-bound default still self-transacts and rehydrates after commit.
|
|
74
74
|
- **Click retries reuse one key**: pass the exact same non-empty, well-formed-Unicode `recordClick.idempotencyKey` (maximum 256 UTF-8 bytes) on transport/database retry. Omitting it remains source-compatible but creates and returns a one-shot UUID; it cannot deduplicate a later independent invocation. `maxEvidenceBytes` guards creation; changing it cannot turn an already-committed exact replay into failure. Replay validation is against the immutable operation/touch snapshot, not mutable current link fields: later link edits preserve exact replay, the result link is current, and the touch evidence is the original snapshot. The private optional-tenant `ReferralClickOperation` table is the serialization fence and must be included in schema migration. Never pre-bound caller evidence: Sales owns the authoritative final-envelope byte check.
|
|
75
75
|
- **`ObjectRegistry.getConfig(X)` needs the class module imported** (decorator side effects) — manifest-only registration doesn't carry api/mcp/conflictColumns; tests asserting surface configs need a side-effect import of the module barrel.
|
|
76
|
+
|
|
77
|
+
- **Governed sales use the owned service factory**: `SalesGovernanceService`
|
|
78
|
+
accepts allowlisted PostgreSQL connection configuration only, owns its
|
|
79
|
+
adapter and transaction executors, and guards private state/model writes.
|
|
80
|
+
DuckDB support remains blocked on SDK #1452; SQLite is also rejected until
|
|
81
|
+
same-process BUSY recovery is proven. Quote issue/sign always recheck
|
|
82
|
+
current seller, host policy/inventory and exact finance approval; see
|
|
83
|
+
[agents/crm.md](agents/crm.md#governed-sellers-quotes-and-canonical-advertiser-registration).
|
package/README.md
CHANGED
|
@@ -163,6 +163,23 @@ connected account id or the public receiving address, and an active earner
|
|
|
163
163
|
using either method must have one. The package records where money should
|
|
164
164
|
go and never calls a payment provider.
|
|
165
165
|
|
|
166
|
+
`CommissionPayoutService.createPayoutBatch()` captures the typed destination on
|
|
167
|
+
`CommissionPayout.payoutDestination`. Executors and approval screens must read
|
|
168
|
+
`payout.getPayoutDestination()` from the batch, never the current Earner.
|
|
169
|
+
The batch's method and destination are immutable from its first save, including
|
|
170
|
+
pending batches and failed batches reset for retry. Earner preference changes,
|
|
171
|
+
idempotent replay and interrupted membership repair never refresh routing.
|
|
172
|
+
Reject the batch through `transitionPayoutForSource` and create a new batch with
|
|
173
|
+
a new idempotency key to use another destination. This also preserves the route
|
|
174
|
+
that was reviewed before approval; no payment provider is called here.
|
|
175
|
+
|
|
176
|
+
Run the normal manifest migration before adopting the new field. Existing
|
|
177
|
+
Stripe Connect/crypto batches without a recorded descriptor remain readable,
|
|
178
|
+
but cannot be approved or advanced toward payment. Reject and recreate them;
|
|
179
|
+
never backfill a historical route from today's Earner. Manual methods continue
|
|
180
|
+
to use an empty descriptor. Unknown/malformed descriptors and extra fields
|
|
181
|
+
(including credentials) are rejected.
|
|
182
|
+
|
|
166
183
|
## Core model
|
|
167
184
|
|
|
168
185
|
- **Roles are separate from money.** `SalesRepresentative` and `Referrer` are
|
|
@@ -296,3 +313,20 @@ lane: PostgreSQL locks the oldest persisted version and re-reads the latest;
|
|
|
296
313
|
embedded engines use core's transaction/write queue. Each successful call keeps
|
|
297
314
|
its own terms and version. Direct `supersede()` requires a finite `effectiveTo`
|
|
298
315
|
set before the transition; saving an open-ended superseded row is rejected.
|
|
316
|
+
|
|
317
|
+
Governed sales are available from `/crm`: `SalesGovernanceService` authorizes
|
|
318
|
+
sellers, exclusively leases canonical advertisers, freezes quote revisions and
|
|
319
|
+
requires exact maker/checker discount approval. Hosts supply current membership,
|
|
320
|
+
suspension, inventory and seller/finance policies. See
|
|
321
|
+
[the governed sales integration contract](agents/crm.md#governed-sellers-quotes-and-canonical-advertiser-registration)
|
|
322
|
+
for transactional executor ownership, migration and provider signing boundaries.
|
|
323
|
+
The Svelte export includes `SellerGovernancePanel` and its view/action contracts.
|
|
324
|
+
|
|
325
|
+
Governance currently accepts owned PostgreSQL connection configurations
|
|
326
|
+
only. Other adapters fail before connection creation. Full issue #4264 remains
|
|
327
|
+
blocked on [SDK DuckDB connection visibility #1452](https://github.com/happyvertical/sdk/issues/1452).
|
|
328
|
+
|
|
329
|
+
SQLite governance is also refused before opening because same-process recovery
|
|
330
|
+
from BUSY invalidation has not been proven for this workflow. Previous SQLite
|
|
331
|
+
behavioral tests are investigation evidence, not a supported runtime claim.
|
|
332
|
+
Follow-up validation is tracked in [s-m-r-t #4269](https://github.com/happyvertical/smrt/issues/4269).
|
package/agents/agreements.md
CHANGED
|
@@ -9,3 +9,35 @@ money), and the Gotchas that apply before editing anything live in
|
|
|
9
9
|
- **AgreementExecutionEvent**: private append-only evidence for verified webhooks and operator/provider operations. Provider events are deduped by tenant/provider replay key; explicit occurrence/first-receipt timestamps and the exact payload/hash are retained, while signature headers are never stored. A later receipt time for the same verified provider event is an idempotent replay. Stale, regressive, or conflicting terminal events are audited without regressing lifecycle state or creating executed evidence.
|
|
10
10
|
- **ExecutedAgreement**: immutable read-only source version plus signed-document and audit-trail Asset ids/hashes/sizes/filenames/media types, completed signer evidence, acceptance/effective dates, and supersession reference. Amendments create new records.
|
|
11
11
|
- **AgreementExecutionService**: accepts an SDK `SignatureProvider` and shared `AssetRuntimeLike`; enforces ambient tenant equality, expiring remote-attempt fencing, create idempotency, verified webhook ingestion/replay, tenant-fenced lifecycle compare-and-set with monotonic provider-event ordering, partial audit/failure updates that cannot overwrite lifecycle state, cancellation/expiry/reconciliation, exact artifact hashing, and immutable finalization. An expired create lease may be reclaimed only when the provider advertises atomic idempotency; otherwise a create with no confirmed request id must be reconciled/adopted before retry.
|
|
12
|
+
|
|
13
|
+
## Effective-dated agreement withdrawal
|
|
14
|
+
|
|
15
|
+
`AgreementCollection.withdrawAmendment(id)` cancels any active version whose
|
|
16
|
+
`effectiveFrom` is strictly later than the current time, including a scheduled
|
|
17
|
+
initial version and an amendment starting after an ended predecessor. Cancelled
|
|
18
|
+
versions remain stored but never govern `activeFor` record-date lookups. Terms
|
|
19
|
+
and execution evidence are retained unchanged.
|
|
20
|
+
|
|
21
|
+
If activation closed a predecessor, withdrawal restores only the exact persisted
|
|
22
|
+
predecessor boundary and status. If activation closed nothing, withdrawal
|
|
23
|
+
restores nothing: an expired or terminated earlier version stays ended, and a
|
|
24
|
+
gap remains a gap. Imported overlapping governing history is refused; disjoint
|
|
25
|
+
later versions remain unchanged. Tenant scope, revision checks, cancellation,
|
|
26
|
+
and optional predecessor restoration share one transaction. Missing, draft,
|
|
27
|
+
terminal, already-effective, repeated, and conflicting withdrawals fail closed.
|
|
28
|
+
|
|
29
|
+
## Governed sales signing
|
|
30
|
+
|
|
31
|
+
`sourceKind: 'sales-quote'` requires `signingActorProfileId` and an injected
|
|
32
|
+
`authorizeSigning(CreateAgreementExecutionInput)` guard. Bind the exact tenant,
|
|
33
|
+
sourceId (quoteId), sourceVersion (revision) and actor to
|
|
34
|
+
`SalesGovernanceService.assertCanSign`, and validate the source document against
|
|
35
|
+
the frozen quote terms. The guard runs before source storage/existing-execution
|
|
36
|
+
replay and immediately before provider request creation. Actor identity is part
|
|
37
|
+
of immutable retry intent. Other agreement kinds may use the same optional guard.
|
|
38
|
+
|
|
39
|
+
Local authority commits before external provider I/O; provider work cannot join
|
|
40
|
+
a SQL transaction. Seller or finance revocation denies fresh/retried signing but
|
|
41
|
+
does not cancel already-dispatched provider requests. Hosts must explicitly cancel
|
|
42
|
+
outstanding requests when their policy requires it. See the governed sales
|
|
43
|
+
integration and supported PostgreSQL-only boundary in [crm.md](crm.md).
|
package/agents/commissions.md
CHANGED
|
@@ -13,6 +13,7 @@ money), and the Gotchas that apply before editing anything live in
|
|
|
13
13
|
- **Commission**: one earning record per earner per plan component per event occurrence. Integer-cents amounts (`baseAmountCents`, `amountCents`), decimal `rate`, `basis`, snapshot references (`planKey`/`planVersion`, generic `termsSnapshotKind`/`termsSnapshotId`), a JSON `calculationTrace` sufficient to reproduce the amount, split support (`splitGroupId`, `shareFraction`), and a `dedupeKey` for idempotent creation. Lifecycle `pending → earned → approved → payable → paid`, enforced by a save-time transition guard with an authoritative prior-status re-read (commerce pattern).
|
|
14
14
|
- **CommissionAdjustment**: append-only corrections (`refund|credit|chargeback|dispute|correction`), signed `amountCents`, required `reason`, immutable once created. `CommissionAdjustmentService.createAdjustment()` is the tenant-required idempotent creation door: callers provide a stable operation UUID; the database creates exactly one row, exact retries return it, and changed tenant/commission/earner/kind/cents/currency/reason/operator/metadata fail with a typed replay conflict. Parent Commission plus denormalized tenant/Earner/currency and operator UUID are validated before insert. The financial row deliberately exposes no operation field. A private, required-tenant `CommissionAdjustmentOperation` table uses the globally unique operation UUID as its primary id, maps it to the adjustment UUID, and is inserted in the same transaction as the adjustment. Claims tolerate either primary-key or tenant/slug/context uniqueness arbitration without aborting the transaction; only the tenant-scoped operation UUID lookup and immutable intent comparison authorize a replay. Existing adjustment schemas and legacy direct creates remain unchanged. Earned/paid Commissions are never rewritten — adjustments append to them.
|
|
15
15
|
- **Payable balance**: computed, not stored — `CommissionBalanceService` sums payable Commissions plus unsettled Adjustments per Earner/currency.
|
|
16
|
-
- **CommissionPayout**: settlement batch per Earner. `pending → approved → processing → completed | failed` (`resetFromFailed()` is the only exit from failed), plus the terminal operator decline `rejected` reachable from pending/approved (#1987 — reject through `transitionPayoutForSource`, which also RELEASES the batch's membership so the rows settle through a future batch; `reject()` on the model mutates status only). Settles rows via the collections' **conditional `claimForPayout`** (model-layer get/save/re-read — tenancy- and dialect-safe; a row owned by another batch is never re-claimed) and stores totals recomputed from the VERIFIED claimed membership; idempotent via `idempotencyKey` natural key (default `${earnerId}:${currency}:${YYYY-MM-DD}`) — a clean replay touches nothing, while a pending payout whose totals disagree with its stamped rows (interrupted claim pass) is repaired on replay (the claim pass re-checks the payout is still pending first). Each batch/repair pass also derives the payout's **single-source stamp** (`sourceKind`/`sourceId`, indexed): set when every claimed commission — and every claimed adjustment through its parent commission — shares exactly one non-empty source; empty for mixed/unknown/empty membership. `completePayout` flips member commissions to `paid` BEFORE the terminal transition, so a mid-loop failure stays retryable. Enforces `totalAmountCents = commissionTotalCents + adjustmentTotalCents` at save; retains `paymentReference`/`providerRef`; optional `invoiceId` cross-package string ref to a commerce Invoice. Generated surface is read-only on ALL doors (api/mcp/cli `list`/`get`) — writes go through `CommissionPayoutService`. `createPayoutBatch` settles the whole earner+currency by default, or a **scoped** subset: pass `sourceKind`+`sourceId` to settle just one earning source (e.g. one ad network), or `commissionIds` for an explicit set (each validated payable+unsettled+earner+currency; requires its own `idempotencyKey`) — adjustments are narrowed to the same scope, and the default idempotency key folds the source in. Scoping is how concurrent per-source batches settle safely: batches scoped to different sources (or disjoint `commissionIds`) gather **disjoint** row sets and never contend. The collection layer has no cross-row transaction, so OVERLAPPING concurrent scopes (a source batch + the earner-wide batch, intersecting id sets, or a batch replay racing a lifecycle transition of the same payout) must be serialized by the caller — `claimForPayout` still won't double-own a row, but a shared commission and its adjustment could split across the two batches.
|
|
16
|
+
- **CommissionPayout**: settlement batch per Earner. `pending → approved → processing → completed | failed` (`resetFromFailed()` is the only exit from failed), plus the terminal operator decline `rejected` reachable from pending/approved (#1987 — reject through `transitionPayoutForSource`, which also RELEASES the batch's membership so the rows settle through a future batch; `reject()` on the model mutates status only). Settles rows via the collections' **conditional `claimForPayout`** (model-layer get/save/re-read — tenancy- and dialect-safe; a row owned by another batch is never re-claimed) and stores totals recomputed from the VERIFIED claimed membership; idempotent via `idempotencyKey` natural key (default `${earnerId}:${currency}:${YYYY-MM-DD}`) — initial creation uses a strict insert so concurrent same-key creators cannot overwrite the first routing snapshot; the loser receives a unique-constraint error and can retry the same key. A clean replay touches nothing, while a pending payout whose totals disagree with its stamped rows (interrupted claim pass) is repaired on replay (the claim pass re-checks the payout is still pending first). Each batch/repair pass also derives the payout's **single-source stamp** (`sourceKind`/`sourceId`, indexed): set when every claimed commission — and every claimed adjustment through its parent commission — shares exactly one non-empty source; empty for mixed/unknown/empty membership. `completePayout` flips member commissions to `paid` BEFORE the terminal transition, so a mid-loop failure stays retryable. Enforces `totalAmountCents = commissionTotalCents + adjustmentTotalCents` at save; retains `paymentReference`/`providerRef`; optional `invoiceId` cross-package string ref to a commerce Invoice. Generated surface is read-only on ALL doors (api/mcp/cli `list`/`get`) — writes go through `CommissionPayoutService`. `createPayoutBatch` settles the whole earner+currency by default, or a **scoped** subset: pass `sourceKind`+`sourceId` to settle just one earning source (e.g. one ad network), or `commissionIds` for an explicit set (each validated payable+unsettled+earner+currency; requires its own `idempotencyKey`) — adjustments are narrowed to the same scope, and the default idempotency key folds the source in. Scoping is how concurrent per-source batches settle safely: batches scoped to different sources (or disjoint `commissionIds`) gather **disjoint** row sets and never contend. The collection layer has no cross-row transaction, so OVERLAPPING concurrent scopes (a source batch + the earner-wide batch, intersecting id sets, or a batch replay racing a lifecycle transition of the same payout) must be serialized by the caller — `claimForPayout` still won't double-own a row, but a shared commission and its adjustment could split across the two batches.
|
|
17
|
+
- **Payout destination snapshot** (#4148): `CommissionPayout.payoutDestination` stores the typed Earner descriptor captured at batch creation. Use `getPayoutDestination()` on the batch for execution/review, never live Earner routing. Method and destination are immutable from first persistence (pending included); idempotency replay/repair and failed-reset preserve them. Reject through the source transition service and create a new key to change routing. Existing Connect/crypto batches with an empty migrated snapshot cannot approve/process/complete; reject/recreate rather than infer historical routing. Manual methods retain `{}`. Generated list/get surfaces expose the snapshot; no provider transfer is implemented.
|
|
17
18
|
- **Source-scoped payout history** (#1985): `CommissionPayoutService.getSourcePayoutHistory({ sourceKind, sourceId, limit?, offset? })` — one page of the payouts belonging to ONE earning source, newest first (`created_at DESC, id DESC`), offset contract (`nextOffset` advances by the scanned count; `null` when exhausted). Candidates come from the indexed stamp, so work is bounded by page size (a sparse source never scans the global history); each page is re-verified against actual membership in three batched queries (no per-payout N+1) — every member commission and every adjustment's parent must carry exactly the requested source and agree on earner/currency/tenant; unprovable rows (mixed-source, missing parents, memberless artifacts, released/rejected batches) are excluded fail-closed and reported in `excluded` with reasons. Adjustment-only payouts prove ownership through parent commissions and list normally. Payouts minted before the stamp existed are invisible until backfilled with `restampPayoutSource(payoutId)` (idempotent, any status).
|
|
18
19
|
- **Source-authorized lifecycle transitions** (#1987): `CommissionPayoutService.transitionPayoutForSource({ payoutId, sourceKind, sourceId, action, expectedStatus?, paymentReference?, reason? })` — atomic alternative to load-verify-transition. Actions `approve | mark_processing | complete | fail | reject`. Everything runs on one transaction database: the payout row is locked (PostgreSQL `SELECT … FOR UPDATE`, replica-safe; single-connection engines serialize transitions per database in-process), membership is re-verified under the lock (every commission and every adjustment through its parent must carry exactly the requested source and matching earner/currency/tenant — else typed fail-closed refusals with no payout/member data), and only authorized calls receive status-derived `already_applied` or `status_conflict` outcomes. Totals are then recomputed under the lock (drift refuses the money-forward actions with `totals_drift`; repair = `createPayoutBatch` replay while pending; `fail`/`reject` proceed despite drift — reject IS the remedy), and the transition plus member writes commit or roll back together (`complete` flips members to paid in the same transaction; `reject` releases membership then declines). Outcomes: `transitioned`, `already_applied` (idempotent echo — terminal completion NEVER rewrites `paymentReference`/`providerRef`/`paidAt`), or `refused` with `{ reason, detail }`. Concurrent duplicate calls for actions that retain membership resolve as one `transitioned` + `already_applied` echoes; `reject` releases its membership evidence, so serialized replays fail `membership_empty` rather than expose rejected state. `expectedStatus` adds optimistic-concurrency strictness after authorization. Memberless batch artifacts cannot pass the source-authorized door (`membership_empty`) — they stay operator-level.
|
package/agents/crm.md
CHANGED
|
@@ -83,3 +83,153 @@ normalized/validated, and at least email or existing phone is required. Exact
|
|
|
83
83
|
retries are no-ops. Effective changes append one `contact_update` activity with
|
|
84
84
|
before/after values and actor; audit failure rolls back the correction. Profile
|
|
85
85
|
identity, acquisition context/source, CRM status and downstream records stay intact.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## Governed sellers, quotes and canonical advertiser registration
|
|
89
|
+
|
|
90
|
+
`SalesGovernanceService` is the required mutation boundary for governed sales.
|
|
91
|
+
Referral identity never grants seller authority. Every fresh seller mutation
|
|
92
|
+
requires a tenant context matching the canonical UUID `tenantId`, an actor Profile matching
|
|
93
|
+
an active tenant-owned `SalesRepresentative`, host membership and suspension
|
|
94
|
+
checks, and `canSell`. There is no seller count limit. Hosts own newsroom or
|
|
95
|
+
editorial classification through `canSell`; SMRT imports no application policy.
|
|
96
|
+
|
|
97
|
+
Create with `{ database: { type: 'postgres', url, ... }, host, now? }`.
|
|
98
|
+
The service owns connection creation; arbitrary adapter injection is not accepted.
|
|
99
|
+
`service.database` is a read-only getter for migrations and host reads. The owned
|
|
100
|
+
backend declaration and adapter reference cannot be replaced through public API.
|
|
101
|
+
The factory validates an explicit connection-options allowlist before SQL sees
|
|
102
|
+
it: no adapter-shaped objects or runtime schema definitions.
|
|
103
|
+
Connections always use `cache: false`; requesting `cache: true` is refused before
|
|
104
|
+
SQL. Each service owns a distinct adapter, so closing it cannot invalidate a peer.
|
|
105
|
+
SQLite is rejected before opening: the required same-process recovery after
|
|
106
|
+
BUSY invalidation could not be established on the published SQL adapter, even
|
|
107
|
+
with uncached owned connections, callback transactions, close and recreate.
|
|
108
|
+
Earlier SQLite behavioral and separate-process race evidence does not establish
|
|
109
|
+
that recovery contract. This backend remains unavailable until a passing complete
|
|
110
|
+
Sales recovery proof supports enabling it. This is an unverified validation
|
|
111
|
+
contract, not an established raw SQL defect. Follow the acceptance in
|
|
112
|
+
[SMRT #4269](https://github.com/happyvertical/smrt/issues/4269) before enabling SQLite.
|
|
113
|
+
Every service
|
|
114
|
+
transaction and mutation rechecks its supported backend boundary. All host methods are mandatory and authorize
|
|
115
|
+
only on literal `true`. `host.policy` returns `{ version, maxDiscountBps,
|
|
116
|
+
leaseDurationMs, approvalDurationMs }`: basis points and durations are safe
|
|
117
|
+
integers, durations positive, basis points between 0 and 10000. Unsupported or
|
|
118
|
+
malformed values, missing resources and thrown provider/inventory failures deny
|
|
119
|
+
without partial writes. Host predicates receive the exact transaction executor;
|
|
120
|
+
lock current authoritative membership, suspension, policy and inventory rows
|
|
121
|
+
through that executor. A cached predicate or remote network check cannot promise
|
|
122
|
+
transactionally stable authority. `validateQuote` must validate the exact rate
|
|
123
|
+
card version, inventory version, advertiser resource validity and cents totals.
|
|
124
|
+
Sales itself enforces exclusive advertiser lease ownership on the same executor;
|
|
125
|
+
host quote validation cannot replace or disable that lease guard.
|
|
126
|
+
|
|
127
|
+
`acquireLease` accepts a canonical tenant-local `advertiserId`, never free-text
|
|
128
|
+
organization/email dedupe. `advertiserExists` validates this identity and tenant
|
|
129
|
+
ownership. Registration is exclusive while `released === false` and
|
|
130
|
+
`expiresAtMs > now`; equality is expired. The shared deterministic resource UUID
|
|
131
|
+
and database row lock/CAS arbitrate independent processes/connections. Database
|
|
132
|
+
busy/transaction-conflict failures are safe to retry with the original operation
|
|
133
|
+
UUID. `renewLease` requires a live owner and matching `leaseId`, and starts a
|
|
134
|
+
new configured duration from current time. `releaseLease` requires the same
|
|
135
|
+
owner token and does not transfer ownership; release at expiry is allowed.
|
|
136
|
+
A newly acquired replacement has a new token. `getLease` returns the current
|
|
137
|
+
registration after host member/suspension and advertiser checks.
|
|
138
|
+
|
|
139
|
+
All tenant, actor/Profile, seller, advertiser, quote, lease, approval-request and
|
|
140
|
+
operation identities must be valid UUIDs. The service lowercases them before
|
|
141
|
+
resource-key hashing, host predicates, comparisons, persistence and replay intent
|
|
142
|
+
binding. UUID spelling is not a distinct identity: uppercase advertiser forms
|
|
143
|
+
cannot acquire another lease, and uppercase maker forms cannot self-approve.
|
|
144
|
+
The ambient tenant context is normalized within the service while preserving its
|
|
145
|
+
other metadata. Loaded owner/maker/checker identities are normalized before
|
|
146
|
+
comparisons; altered approval terms still invalidate their exact binding.
|
|
147
|
+
|
|
148
|
+
Every mutation accepts a globally unique UUID `operationId` (either case). An exact
|
|
149
|
+
retry returns its immutable original outcome, including its original expiry,
|
|
150
|
+
without extending a lease or repeating a transition. Case-only UUID changes
|
|
151
|
+
are the same replay intent; changed identities or terms conflict.
|
|
152
|
+
An outcome replay is historical evidence, **never fresh authority to sign**.
|
|
153
|
+
To combine host writes and Sales writes, use:
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
await sales.withTransaction(async (tx) => {
|
|
157
|
+
const quote = await sales.signQuote(input, tx);
|
|
158
|
+
await hostPersistSignIntent(quote, tx);
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Only active executors issued by `withTransaction` are accepted; arbitrary pools
|
|
163
|
+
and external callback executors are refused. This avoids guessing transaction
|
|
164
|
+
identity or nesting transactions on independent pooled sessions. Any throw rolls
|
|
165
|
+
back Sales state, audit and host writes together. Do not retain the executor
|
|
166
|
+
beyond the callback. Result projections are plain detached values.
|
|
167
|
+
|
|
168
|
+
`createQuote` freezes one commercial revision: seller, canonical advertiser,
|
|
169
|
+
rate-card version, inventory version, subtotal/total integer cents, uppercase
|
|
170
|
+
currency, maker Profile, tenant and exact policy. New revisions must increase;
|
|
171
|
+
older revisions cannot issue, approve or sign after a new revision is created.
|
|
172
|
+
The comparison `(subtotalCents - totalCents) * 10000 <= subtotalCents *
|
|
173
|
+
maxDiscountBps` uses BigInt, so the discount boundary has no floating rounding.
|
|
174
|
+
`issueQuote` moves draft to issued; `signQuote` moves issued to signed. Both
|
|
175
|
+
revalidate current seller, host resources and exact policy version/values.
|
|
176
|
+
`createQuote`, every fresh quote issue/sign transition, approval request/decision,
|
|
177
|
+
and `assertCanSign` require the canonical advertiser's live, unreleased lease to
|
|
178
|
+
belong to the quote seller. The service locks that lease state in the **same
|
|
179
|
+
transaction** as the guarded action. Missing ownership, another seller, release,
|
|
180
|
+
or expiry at `expiresAtMs <= now` refuses the action even when every host
|
|
181
|
+
predicate returns true. Existing issued/signed records do not preserve ownership
|
|
182
|
+
once the lease expires, is released or is acquired by another seller. There is
|
|
183
|
+
no policy flag that makes this guard optional. Historical operation outcomes
|
|
184
|
+
remain audit evidence; provider preflight always rechecks current ownership.
|
|
185
|
+
|
|
186
|
+
Above-limit terms require `requestApproval` then `decideApproval`. Requests bind
|
|
187
|
+
the entire frozen revision and policy hash. A distinct current tenant member
|
|
188
|
+
with `canApprove` must decide: no self-approval or single-operator fallback.
|
|
189
|
+
Only pending, unexpired requests can approve/reject. Approved decisions can be
|
|
190
|
+
revoked, including after issue/sign. Sign/issue recheck current checker
|
|
191
|
+
membership, suspension and finance authorization. Pending, rejected, revoked,
|
|
192
|
+
expired or altered bindings fail closed. A new request after expiry/rejection
|
|
193
|
+
uses a new quote revision. Decisions and reasons remain immutable audit events.
|
|
194
|
+
|
|
195
|
+
For provider execution use `sourceKind: 'sales-quote'`, `sourceId: quoteId`,
|
|
196
|
+
`sourceVersion: revision`, and `signingActorProfileId`. Agreement execution
|
|
197
|
+
requires an injected `authorizeSigning(input)` guard for these sources; wire it
|
|
198
|
+
to `sales.assertCanSign({ tenantId, actorProfileId: signingActorProfileId,
|
|
199
|
+
quoteId: sourceId, revision: sourceVersion })` and
|
|
200
|
+
validate that the source document describes those exact frozen terms. The guard
|
|
201
|
+
runs before source storage/replay and immediately before provider create I/O.
|
|
202
|
+
An optional guard can cover other source kinds too. A host must not relabel a
|
|
203
|
+
sales quote as an ungoverned source. Already-existing execution retries still
|
|
204
|
+
recheck the guard; seller revocation cannot reuse earlier signing authority.
|
|
205
|
+
SQL commits local sign authority; external provider work cannot join or roll
|
|
206
|
+
back with SQL. Revoking authority does not cancel already-dispatched provider
|
|
207
|
+
requests: hosts must explicitly cancel outstanding requests when their policy
|
|
208
|
+
requires it, and handle the provider result/reconciliation lifecycle.
|
|
209
|
+
|
|
210
|
+
Migrate **both** manifest models `SalesGovernanceState` (resource/operation
|
|
211
|
+
fences) and `SalesGovernanceEvent` (immutable intent/result history) before
|
|
212
|
+
calling the service. Runtime never creates application schema. Both models and
|
|
213
|
+
collections are root/CRM exports for generated registration but have no generated
|
|
214
|
+
API/MCP/CLI writes. Direct generic collection/model create, update and delete are
|
|
215
|
+
also refused: the service owns an internal executor-bound write capability.
|
|
216
|
+
Do not edit private state rows or delete audit rows. A privileged SQL owner can
|
|
217
|
+
bypass domain models; never expose raw database access to application callers.
|
|
218
|
+
`SellerGovernancePanel` and its exported `SellerGovernanceView` /
|
|
219
|
+
`SellerGovernanceAction` are callback-only UI contracts; displayed eligibility
|
|
220
|
+
never substitutes for server authority checks. Hosts map canonical advertiser
|
|
221
|
+
selection and current conflict/expiry state onto those props.
|
|
222
|
+
|
|
223
|
+
This delivery supports **PostgreSQL only**. SQLite, DuckDB, JSON, PGlite,
|
|
224
|
+
missing and unknown backend configurations are refused before any connection,
|
|
225
|
+
SQL, policy callback or state mutation. PostgreSQL independent pooled-connection tests exercise the database fence.
|
|
226
|
+
Native PostgreSQL acceptance cases run under `test:postgres`.
|
|
227
|
+
|
|
228
|
+
The complete #4264 request remains open and blocked on
|
|
229
|
+
[happyvertical/sdk#1452](https://github.com/happyvertical/sdk/issues/1452): the
|
|
230
|
+
published SQL DuckDB adapter opens independent native instances for the same
|
|
231
|
+
file and a second handle can read stale state after another handle commits.
|
|
232
|
+
Independent writer authority cannot safely rely on that adapter. This explicit
|
|
233
|
+
backend boundary is a reduced supported contract, not a DuckDB SQL workaround.
|
|
234
|
+
DuckDB support requires the upstream shared-instance visibility fix and a repeat
|
|
235
|
+
of the full cross-connection lease/approval matrix before enabling it.
|
package/agents/svelte.md
CHANGED
|
@@ -8,3 +8,10 @@ money), and the Gotchas that apply before editing anything live in
|
|
|
8
8
|
Props-driven presentational components (no data fetching, no model-class imports, Provider-free smrt-ui primitives, `--smrt-*` tokens only): CRM — `SalesDashboard`, `LeadCreateForm`, `LeadList`, `LeadDetail`, `OpportunityBoard`, `OpportunityDetail`; referrer portal — `ReferralLinkManager`, `ReferralStatusList`, `ReferrerEarningsSummary`, `CommissionBreakdown` (trace-explained amounts), `PayoutHistoryList`, `ExecutedAgreementsList`; operator — `AttributionConflictQueue` (award editor + required resolution reason), `PayoutBatchReview`, `CommissionExpenseSummary` (explicitly distinct from client invoices). Monetary props stay integer cents; `format.ts` converts at render. View-model prop types are exported interfaces (never inline intersected generics in `$props()`). Pure helpers are unit-tested and Lead intake/inbox/detail components have mounted runtime tests through `vitest.ui.config.ts`.
|
|
9
9
|
|
|
10
10
|
`LeadCreateForm` validates the required name and email-or-phone contact rule, normalizes email, and emits a host-mapped `LeadCreateDraft`; source choices, duplicate results, errors, and owner choices come from the host. `LeadList` accepts controlled filter/count, sort, page, selection/link, and row-action props; the host owns inbox fetching and callback mutations. `LeadDetail` renders a complete host-supplied timeline, an optional linked-opportunity summary snippet, and callback-only assignment, start/reopen, disqualification, human-activity, next-action, completion, and qualification controls. Its `busy` prop disables every mutation affordance; the host owns tenancy, authorization, service invocation, refresh, and any policy around due dates or reminders.
|
|
11
|
+
|
|
12
|
+
`SellerGovernancePanel` renders host-supplied seller eligibility, canonical
|
|
13
|
+
advertiser registration/expiry, quote revision/status and discount review. Its
|
|
14
|
+
`SellerGovernanceAction` callback carries the exact quote revision, request and
|
|
15
|
+
lease tokens plus review reason. Hosts invoke `SalesGovernanceService`; UI
|
|
16
|
+
flags never grant seller or finance authority. No model or database imports run
|
|
17
|
+
in the component. See the governed sales section in [crm.md](crm.md).
|
|
@@ -37,8 +37,9 @@ export declare class AgreementCollection extends SmrtCollection<Agreement> {
|
|
|
37
37
|
* advance; record-date lookup still selects its predecessor until `from`.
|
|
38
38
|
*/
|
|
39
39
|
activateAmendment(id: string): Promise<Agreement>;
|
|
40
|
-
/** Withdraw a scheduled
|
|
41
|
-
* Restores
|
|
40
|
+
/** Withdraw a scheduled active version before it has ever governed.
|
|
41
|
+
* Restores its persisted predecessor boundary when activation closed one.
|
|
42
|
+
* Initial versions and amendments following a gap restore nothing.
|
|
42
43
|
* Repeated/concurrent withdrawal refuses rather than applying recovery twice.
|
|
43
44
|
*/
|
|
44
45
|
withdrawAmendment(id: string): Promise<Agreement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgreementCollection.d.ts","sourceRoot":"","sources":["../../../src/agreements/collections/AgreementCollection.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,OAAO,EAKL,cAAc,EAEf,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,SAAS,EAA2B,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAMD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,SAAS,CAAC;IAChE,MAAM,CAAC,QAAQ,CAAC,UAAU,mBAAa;IAEjC,YAAY,CAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,SAAS,EAAE,CAAC;IASvB;;;;;;;;;OASG;IACG,SAAS,CACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,EAAE,GAAE,IAAiB,EACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IA2C5B,8EAA8E;IACxE,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,SAAS,CAAC;IA2DrB;;;;;OAKG;IACG,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IA6FvD
|
|
1
|
+
{"version":3,"file":"AgreementCollection.d.ts","sourceRoot":"","sources":["../../../src/agreements/collections/AgreementCollection.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,OAAO,EAKL,cAAc,EAEf,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,SAAS,EAA2B,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAMD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,SAAS,CAAC;IAChE,MAAM,CAAC,QAAQ,CAAC,UAAU,mBAAa;IAEjC,YAAY,CAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,SAAS,EAAE,CAAC;IASvB;;;;;;;;;OASG;IACG,SAAS,CACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,EAAE,GAAE,IAAiB,EACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IA2C5B,8EAA8E;IACxE,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,EACt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AAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAInC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAO9C,QAAQ,IAAI,IAAI;IAUhB,SAAS,IAAI,IAAI;IAcjB,SAAS,CAAC,EAAE,GAAE,IAAiB,GAAG,IAAI;IAevB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BpC,+EAA+E;IACzE,+BAA+B,IAAI,OAAO,CAAC,IAAI,CAAC;YAWxC,mCAAmC;IAkBjD,OAAO,CAAC,gCAAgC;IAoBxC,OAAO,CAAC,gBAAgB;YA0BV,wBAAwB;YAoCxB,kBAAkB;IAYhC,OAAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,0BAA0B;IASlC,OAAO,CAAC,oBAAoB;CAc7B;AAaD,eAAe,SAAS,CAAC"}
|
|
@@ -13,6 +13,14 @@ export interface AgreementExecutionServiceDeps {
|
|
|
13
13
|
executedAgreements: ExecutedAgreementCollection;
|
|
14
14
|
now?: () => Date;
|
|
15
15
|
createLeaseDurationMs?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Mandatory for sales-quote sources, optional policy for other sources.
|
|
18
|
+
* Rechecked before every create/replay and immediately before provider I/O.
|
|
19
|
+
* Bind sourceId/sourceVersion to SalesGovernanceService.assertCanSign().
|
|
20
|
+
* Local authority commits before external I/O; remote execution cannot be
|
|
21
|
+
* rolled back by SQL. Hosts revoke outstanding provider requests explicitly.
|
|
22
|
+
*/
|
|
23
|
+
authorizeSigning?: (input: CreateAgreementExecutionInput) => Promise<void>;
|
|
16
24
|
}
|
|
17
25
|
export interface AdoptAgreementProviderRequestInput {
|
|
18
26
|
tenantId: string;
|
|
@@ -79,6 +87,7 @@ export declare class AgreementExecutionService {
|
|
|
79
87
|
private recordOperationAudit;
|
|
80
88
|
private assertNonTerminalOperation;
|
|
81
89
|
private result;
|
|
90
|
+
private authorizeSigning;
|
|
82
91
|
private assertTenant;
|
|
83
92
|
private assertTenantValue;
|
|
84
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgreementExecutionService.d.ts","sourceRoot":"","sources":["../../../src/agreements/services/AgreementExecutionService.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAGjF,OAAO,KAAK,EAGV,iBAAiB,EAGlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAS,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AACnG,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qDAAqD,CAAC;AAC7G,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAGjG,OAAO,KAAK,EACV,wBAAwB,EACxB,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAOrB,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,EAAE,4BAA4B,CAAC;IACzC,MAAM,EAAE,iCAAiC,CAAC;IAC1C,kBAAkB,EAAE,2BAA2B,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AgreementExecutionService.d.ts","sourceRoot":"","sources":["../../../src/agreements/services/AgreementExecutionService.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAGjF,OAAO,KAAK,EAGV,iBAAiB,EAGlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAS,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AACnG,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qDAAqD,CAAC;AAC7G,OAAO,KAAK,E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ExecutedAgreementOptions extends SmrtObjectOptions {
|
|
|
129
129
|
metadata?: string;
|
|
130
130
|
}
|
|
131
131
|
export interface CreateAgreementExecutionInput {
|
|
132
|
+
/** Required for governed sourceKind sales-quote; bound into retry intent. */
|
|
133
|
+
signingActorProfileId?: string;
|
|
132
134
|
tenantId: string;
|
|
133
135
|
idempotencyKey: string;
|
|
134
136
|
sourceKind: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agreements/types.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,OAAO,KAAK,EACV,6BAA6B,EAC7B,iBAAiB,EAEjB,eAAe,EACf,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,uEAMrB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,yEAAyE;AACzE,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IA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,CACpC,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,eAAe,EAAE,CAgBnB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAQ/D"}
|
package/dist/agreements.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./chunks/__smrt-register__-
|
|
2
|
-
import { a as AgreementExecutionEvent, c as AgreementCollection, d as serializeAgreementParty, f as AGREEMENT_EXECUTION_STATUSES, g as sanitizeSignerIntent, h as sanitizeSignerEvidence, i as AgreementExecutionEventCollection, l as Agreement, m as coerceAgreementDate, n as ExecutedAgreementCollection, o as AgreementExecutionCollection, p as AGREEMENT_STATUSES, r as ExecutedAgreement, s as AgreementExecution, t as AgreementExecutionService, u as parseAgreementParty } from "./chunks/agreements-
|
|
1
|
+
import "./chunks/__smrt-register__-Yzz7_2xD.js";
|
|
2
|
+
import { a as AgreementExecutionEvent, c as AgreementCollection, d as serializeAgreementParty, f as AGREEMENT_EXECUTION_STATUSES, g as sanitizeSignerIntent, h as sanitizeSignerEvidence, i as AgreementExecutionEventCollection, l as Agreement, m as coerceAgreementDate, n as ExecutedAgreementCollection, o as AgreementExecutionCollection, p as AGREEMENT_STATUSES, r as ExecutedAgreement, s as AgreementExecution, t as AgreementExecutionService, u as parseAgreementParty } from "./chunks/agreements-RsyRLeDn.js";
|
|
3
3
|
export { AGREEMENT_EXECUTION_STATUSES, AGREEMENT_STATUSES, Agreement, AgreementCollection, AgreementExecution, AgreementExecutionCollection, AgreementExecutionEvent, AgreementExecutionEventCollection, AgreementExecutionService, ExecutedAgreement, ExecutedAgreementCollection, coerceAgreementDate, parseAgreementParty, sanitizeSignerEvidence, sanitizeSignerIntent, serializeAgreementParty };
|