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

    Admin-tier CRUD over product_limit_rule. Accepts any rule type (admin-global, admin-for-customer, or customer).

    Identity / version split: see ProductLimitRuleAdminService (this file). Edits insert a new version row and re-point currentVersionId in one transaction.

    Duplicate-matcher detection is enforced by the partial unique index product_limit_rule_unique_tuple — see ProductActivationRuleAdminService for the rationale. matcherHash is denormalized onto the identity row; service code maintains identity.matcherHash = currentVersion.matcherHash on every version bump and translates the unique-violation back into DUPLICATE_MATCHER.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    Methods

    • Parameters

      • input: {
            customerId?: string;
            description?: string;
            effectiveFrom?: Instant;
            label?: string;
            matcher?: Matcher;
            priority: number;
            routeId: string;
            type?: "ADMIN" | "CUSTOMER";
        } & LimitFields
        • OptionalcustomerId?: 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 (e.g. Reg E 30-day notice).

        • Optionallabel?: string
        • Optionalmatcher?: Matcher
        • priority: number
        • routeId: string
        • Optionaltype?: "ADMIN" | "CUSTOMER"

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

    • Parameters

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

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

    • Parameters

      • input: {
            data: {
                description?: string | null;
                effectiveFrom?: Instant;
                label?: string | null;
                matcher?: Matcher;
                priority?: number;
                status?: "ACTIVE" | "DISABLED";
            } & {
                limit24hMaxCount?: BigNumber
                | null;
                limit24hMaxUsd?: BigNumber | null;
                limit30dMaxCount?: BigNumber | null;
                limit30dMaxUsd?: BigNumber | null;
                limit7dMaxCount?: BigNumber | null;
                limit7dMaxUsd?: BigNumber | null;
                limitCalendarMonthMaxCount?: BigNumber | null;
                limitCalendarMonthMaxUsd?: BigNumber | null;
                transactionMaxUsd?: BigNumber | null;
                transactionMinUsd?: BigNumber | null;
            };
            id: string;
        }

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