import { ID } from '../common'; type CustomerIDPlus0SubCustomer = [thisCustomerId: string]; type CustomerIDPlus1SubCustomer = [ thisCustomerId: string, parentCustomerId: string ]; type CustomerIDPlus2SubCustomer = [ thisCustomerId: string, parentCustomerId: string, greatParentCustomerId: string ]; type CustomerIDPlus3SubCustomer = [ thisCustomerId: string, parentCustomerId: string, greatParentCustomerId: string, greatGreatParentCustomerId: string ]; type CustomerIDPlus4SubCustomer = [ thisCustomerId: string, parentCustomerId: string, greatParentCustomerId: string, greatGreatParentCustomerId: string, greatGreatGreatParentCustomerId: string ]; /** * Example usage: * Root level customer ID = ["thisCustomerId"] * ID of a customer with one parent customer, 1 level nesting = ["parentCustomerId", "thisCustomerId"]; * ID of a customer which has a parent and a grand parent, 2 level nesting = ["grandParentCustomerId", "parentCustomerId", "thisCustomerId"] * and so on.. */ export type NestedCustomerID = CustomerIDPlus0SubCustomer | CustomerIDPlus1SubCustomer | CustomerIDPlus2SubCustomer | CustomerIDPlus3SubCustomer | CustomerIDPlus4SubCustomer; export interface NestedCustomerHierarchy { children: NestedCustomerHierarchy[]; customerId: NestedCustomerID; customerName: string; hasSiblings: boolean; qboId: ID | undefined; } export {};