Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Customer

Index

References

Re-exports getTimeFromFrequency

Functions

  • getNextTransactionDateConstraints(data: Pick<Core.Resource<Customer.Rels.Subscription, undefined>, "start_date" | "next_transaction_date" | "end_date" | "frequency" | "error_message" | "past_due_amount" | "first_failed_transaction_date" | "is_active" | "third_party_id" | "date_created" | "date_modified">, rules: boolean | { allowed_days?: { days: number[]; type: "day" } | { days: number[]; type: "month" }; disallowed_dates?: string[]; jsonata_query: string; max?: string; min?: string }[]): Constraints | boolean
  • Finds which next transaction date modification rules are applicable to the given subscription and merges them together.

    Parameters

    • data: Pick<Core.Resource<Customer.Rels.Subscription, undefined>, "start_date" | "next_transaction_date" | "end_date" | "frequency" | "error_message" | "past_due_amount" | "first_failed_transaction_date" | "is_active" | "third_party_id" | "date_created" | "date_modified">

      Subscription to generate constraints for.

    • rules: boolean | { allowed_days?: { days: number[]; type: "day" } | { days: number[]; type: "month" }; disallowed_dates?: string[]; jsonata_query: string; max?: string; min?: string }[]

      Next date modification config from the customer portal settings.

    Returns Constraints | boolean

    Returns true if all modifications are allowed, false if next date can't be changed by the customer, object with constraints in any other case.

  • isNextTransactionDate(opts: Options): boolean
  • Checks if given date (YYYY-MM-DD) can be used as the next transaction date for given subscription.

    Parameters

    • opts: Options

      Subscription, customer portal settings and value.

    Returns boolean

    True if given date can be used as next transaction date.

Generated using TypeDoc