UNPKG

@foxy.io/sdk

Version:

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

26 lines (25 loc) 1.11 kB
import type { CustomerPortalSettings } from './Graph/customer_portal_settings'; import type { Resource } from '../core/Resource/Resource'; import type { Subscription } from './Graph/subscription'; declare type Rules = Resource<CustomerPortalSettings>['subscriptions']['allow_next_date_modification']; declare type Data = Omit<Resource<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: Data, rules: Rules): Constraints | boolean; export {};