import { SmrtObject } from '@happyvertical/smrt-core'; import { EarnerSourceAttributionOptions, EarnerSourceAttributionStatus } from '../types.js'; export declare class EarnerSourceAttribution extends SmrtObject { /** Tenant ID for multi-tenant isolation (nullable → global mappings). */ tenantId: string | null; /** The {@link Earner} credited for this external key. Required. */ earnerId: string; /** * Consumer-defined attribution kind (`ad_network_property`, * `marketplace_storefront`, …). Required. */ sourceKind: string; /** * External identifier within {@link sourceKind}. Required. Indexed so * batched ingestion lookups stay bounded by the requested ids even * without a tenant predicate (the natural-key index is led by * `tenant_id`, which tenant-context lookups use). */ sourceId: string; /** * Mapping lifecycle: only `active` rows resolve through the lookups. * `inactive` retains the row for audit. */ status: EarnerSourceAttributionStatus; /** Additional metadata as a JSON string. */ metadata: string; constructor(options?: EarnerSourceAttributionOptions); isActive(): boolean; /** Parse {@link metadata}; returns `{}` on empty/invalid JSON. */ getMetadata(): Record; /** Serialize and store {@link metadata}. */ setMetadata(data: Record): void; /** * Save with two guards: * * 1. **Completeness** — a mapping without an earner or a full external * key can never resolve, so it must never persist. * 2. **Tenant coherence** — the mapping's tenant must equal its earner's * tenant (both normalized; `''` and `NULL` mean "no tenant"). A tenant * A mapping crediting a tenant B earner would be unresolvable in * tenant scope yet credit across tenants in operator scope — fail * closed at the model boundary, for the generated create/update * surface as much as the service. The earner row is read RAW (no * tenant interception) because the guard must see the earner's true * tenant even when saving from another tenant's context. */ save(): Promise; private assertEarnerTenantCoherence; } export default EarnerSourceAttribution; //# sourceMappingURL=EarnerSourceAttribution.d.ts.map