@cfxlabsinc/b2b-services
    Preparing search index...

    Manage customer-wide term acceptances and term documents

    Hierarchy (View Summary)

    Index
    • Parameters

      • __namedParameters: {
            attioClient: AttioClient;
            customerDocumentQueryService:
                | CustomerDocumentQueryService
                | CustomerDocumentService;
            db: B2bDatabase;
            eventPublisher: CustomerEventPublisher;
            s3Client: S3Client;
            valkeyClient: ValkeyClient
            | null;
        }
        • attioClient: AttioClient

          Sales reads terms-of-service acceptance off the Attio CRM record, so the mutation happens here rather than in an event consumer. Required, not optional: there are three construction sites, and a root that forgot it would silently stop the sync rather than fail to compile.

        • customerDocumentQueryService: CustomerDocumentQueryService | CustomerDocumentService
        • db: B2bDatabase
        • eventPublisher: CustomerEventPublisher
        • s3Client: S3Client
        • valkeyClient: ValkeyClient | null

      Returns CustomerTermsService

    customerDocumentQueryService: CustomerDocumentQueryService
    s3Client: S3Client
    instance: (...args: []) => CustomerTermsService = ...

    The process default: built from each dependency's own instance().

    • Parameters

      • __namedParameters: {
            customerId: string;
            termType:
                | "MOVEUSD_TERMS_OF_USE"
                | "COOKIES_POLICY"
                | "ESIGN_POLICY"
                | "PRIVACY_POLICY";
        }

      Returns Promise<{ ok: true; value: CustomerTermDocument | null }>

    • All term-acceptance records for the customer (defaults filled in for any not yet acted on).

      Parameters

      • __namedParameters: { customerId: string }

      Returns Promise<{ ok: true; value: DescribedTermAcceptance[] }>

    • Create or update a customer term acceptance

      The term acceptance in the db is replaced completely if present, i.e. if accepted terms are supplied, it overrides the persisted values.

      Parameters

      Returns Promise<{ ok: true; value: DescribedTermAcceptance[] }>