import { SmrtObject } from '@happyvertical/smrt-core'; import { SalesRepresentativeOptions, SalesRepresentativeStatus } from '../types.js'; /** * SalesRepresentative is a ROLE model: it links an identity (smrt-profiles * Profile) to sales ownership (Leads/Opportunities reference `ownerRepId`). * * Roles and money stay separate (see `packages/sales/AGENTS.md` "Roles vs. * money"): a rep connects to payouts only through the optional `earnerId` * pointing at the commissions module's neutral `Earner`. No referral or * commission semantics live on this model. * * @example * ```typescript * const reps = await SalesRepresentativeCollection.create({ db }); * const rep = await reps.create({ * profileId: 'profile-uuid', * title: 'Account Executive', * }); * const active = await reps.findActive(); * ``` */ export declare class SalesRepresentative extends SmrtObject { /** * Tenant ID for multi-tenant isolation. * Nullable to support both tenant-scoped and global (operator-level) reps. */ tenantId: string | null; /** * Identity of the person acting as a rep — cross-package string reference * to a smrt-profiles Profile. */ profileId: string; /** * Optional link to the commissions module's `Earner` (the neutral payout * identity). String-form same-package FK: the Earner class lives in * `src/commissions` and is intentionally NOT imported here — the string * form registers the relationship without a module dependency, keeping the * `crm → commissions` boundary reference-only. Empty when the rep is not * commission-compensated. */ earnerId: string; /** Role status — only `active` reps should receive new assignments. */ status: SalesRepresentativeStatus; /** Job title shown on CRM surfaces (e.g. `'Account Executive'`). */ title: string; /** * Free-form JSON object stored as a string. Use * {@link getMetadata}/{@link setMetadata} instead of parsing manually. */ metadata: string; constructor(options?: SalesRepresentativeOptions); /** Whether the rep may receive new lead/opportunity assignments. */ isActive(): boolean; /** Parse the metadata JSON string; returns `{}` on malformed content. */ getMetadata(): Record; /** Serialize and store the metadata object. */ setMetadata(metadata: Record): void; } export default SalesRepresentative; //# sourceMappingURL=SalesRepresentative.d.ts.map