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

    Customer-tier CRUD over product_activation_rule. Always operates on the type='CUSTOMER' slice. Customer rules can only opt the customer OUT of routes (value: "DENY") — opting back in is reserved for admin tier (CUSTOMER_CANNOT_ACTIVATE on both create() and update()).

    Identity / version split: see ProductActivationRuleAdminService for the full description.

    Route rules only. A cross-route rule is ADMIN-only: a customer cannot write one (product_activation_rule_cross_route_admin refuses a CUSTOMER row with no route), and search / evaluate inner-join the route, so they never surface one.

    Internal admins must use ProductActivationRuleAdminService instead.

    Index
    db: B2bDatabase
    instance: (...args: []) => ProductActivationRuleService = ...

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

    • Parameters

      • input: {
            customerId: string;
            description?: string;
            effectiveFrom?: Instant;
            label?: string;
            matcher?: Matcher;
            priority: number;
            routeId: string;
            value: "DENY";
        }
        • customerId: string
        • Optionaldescription?: string
        • OptionaleffectiveFrom?: Instant

          When this version becomes effective. Defaults to now() at the DB layer when omitted. Pass a future Temporal.Instant to schedule a change.

        • Optionallabel?: string
        • Optionalmatcher?: Matcher
        • priority: number
        • routeId: string
        • value: "DENY"

      Returns Promise<
          | { ok: true; value: ProductActivationRule }
          | { error: ServiceError; ok: false },
      >

    • Returns activation rules visible to this customer:

      • admin-global (customerId IS NULL)
      • admin-for-this-customer (type='ADMIN', customerId=input.customerId)
      • customer-tier (type='CUSTOMER', customerId=input.customerId)

      Pass types: ["CUSTOMER"] from a controller to restrict to the customer's own writable slice. Write paths (create/update/delete) always operate on the CUSTOMER slice regardless of this filter.

      Parameters

      • input: {
            createdAt?: DbTimestampCriteria<Instant>;
            customerId: string;
            ids?: string[];
            orderBy?: RuleOrderByCriterion[];
            page?: number;
            pageSize?: number;
            routeIds?: string[];
            statuses?: ("ACTIVE" | "DISABLED")[];
            types?: ("CUSTOMER" | "ADMIN")[];
            updatedAt?: DbTimestampCriteria<Instant>;
        }

      Returns Promise<
          {
              ok: true;
              value: { hasNext: boolean; items: ProductActivationRule[]; total: number };
          },
      >

    • Parameters

      • input: {
            customerId: string;
            data: {
                description?: string | null;
                effectiveFrom?: Instant;
                label?: string | null;
                matcher?: Matcher;
                priority?: number;
                status?: "ACTIVE" | "DISABLED";
                value?: "DENY";
            };
            id: string;
        }

      Returns Promise<
          | { ok: true; value: ProductActivationRule }
          | { error: ServiceError; ok: false },
      >