UNPKG

@foxy.io/sdk

Version:

Universal SDK for a full server-side and a limited in-browser access to Foxy hAPI.

25 lines (24 loc) 1.02 kB
import type * as Core from '../core'; import type * as Rels from './Rels'; declare type Rules = Core.Resource<Rels.CustomerPortalSettings>['subscriptions']['allowNextDateModification']; declare type Subscription = Omit<Core.Resource<Rels.Subscription>, '_links' | '_embedded'>; export declare type Constraints = { min?: string; max?: string; disallowedDates?: string[]; allowedDaysOfWeek?: number[]; allowedDaysOfMonth?: number[]; }; /** * Finds which next transaction date modification rules are applicable to * the given subscription and merges them together. * * @param data Subscription to generate constraints for. * @param rules Next date modification config from the customer portal settings. * * @returns * 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. */ export declare function getNextTransactionDateConstraints(data: Subscription, rules: Rules): Constraints | boolean; export {};