@enable-tech/shared-types
Version:
This package represents the single source of truth of the Types being used in the codebase (front-end and back-end) of enable.tech, It is an organization-scoped package. So, all the development teams belonging to it can participate to enhance it.
122 lines • 4.46 kB
TypeScript
import { I_Brand } from 'src/modules/brand/backend/responses/schemas';
import { I_BackendInterfaceInvoicesConfig, I_InterfaceInvoicesConfig } from '../../backend';
import { E_CompanyInterfaceConfigChildren, E_CompanyInterfaceConfigSubChildren, E_InterfacePrePaidPaymentOptions, E_InterfacesOrdersPOS, E_InterfacesOrdersPOSMenuUIType, E_OrderItemsConfig, E_SelectedLogo, E_TemplateFilterEntity } from '../enums';
import { E_LogicalOperator, E_Operator } from 'src/modules/notification/backend/enums';
import { E_OrderCancellationReason } from 'src/modules/order/backend/enums';
export interface I_OrderItemsConfig {
[E_OrderItemsConfig.IS_SHOWN]: boolean;
[E_OrderItemsConfig.HAS_PRODUCT_SKU]: boolean;
}
export interface I_CompanyInterfaceCallCenterConfig {
posConfig?: I_InterfacePosConfigKeys;
invoicesConfig?: I_BackendInterfaceInvoicesConfig | I_InterfaceInvoicesConfig;
}
export interface I_CompanyInterfaceOrderConfig {
posConfig?: I_InterfacePosConfigKeys;
invoicesConfig?: I_BackendInterfaceInvoicesConfig | I_InterfaceInvoicesConfig;
paymentMethodsConfig?: I_InterfacePrePaidPaymentConfigKeys;
[E_CompanyInterfaceConfigChildren.acknowledgementScreenConfig]?: {
[E_CompanyInterfaceConfigSubChildren.orderItemsConfig]: I_OrderItemsConfig;
};
[E_CompanyInterfaceConfigChildren.trackingPageConfig]: {
clientConfig: {
enableOverlay: boolean | null;
brandingColor: string | null;
selectedLogo: E_SelectedLogo | null;
};
};
/**
* Configuration for the order cancellation screen
* Contains settings related to order cancellation UI and options
*/
[E_CompanyInterfaceConfigChildren.cancelScreenConfig]?: I_OrderCancelScreenConfig;
}
interface I_OrderCancelScreenConfig {
/**
* List of cancellation reasons to display on the cancel screen
* These will be shown as options when cancelling an order
*/
reasons?: T_CancellationReason[];
}
export type T_CancellationReason = E_OrderCancellationReason | string;
export interface I_CompanyInterfaceConfig {
callCenterConfig?: I_CompanyInterfaceCallCenterConfig;
orderConfig?: I_CompanyInterfaceOrderConfig;
}
export interface I_CompanyInterfaceCallCenterPosConfig {
menuUIType?: E_InterfacesOrdersPOS;
}
export interface I_ChildInterface {
moduleLabel: string;
moduleOptions: E_InterfacesOrdersPOS[] | any[];
}
export interface I_ParentInterface {
label: string;
children: I_ChildInterface[];
}
export type T_InterfaceParent = I_ParentInterface;
export interface I_CompanyInterfaceConfig {
callCenterConfig?: I_CompanyInterfaceCallCenterConfig;
orderConfig?: I_CompanyInterfaceOrderConfig;
}
export type T_clientModuleConfig = {
[k: string]: any;
};
export interface I_InterfacePosConfigKeys {
menuUIType?: E_InterfacesOrdersPOSMenuUIType;
}
export interface I_InterfacePrePaidPaymentConfigKeys {
prepaidOptions?: E_InterfacePrePaidPaymentOptions[];
}
export interface I_InvoiceTemplateSetupProps {
setProcessLoading: VoidFunction;
setProcessSuccess: VoidFunction;
setProcessError: VoidFunction;
}
export type T_TriggerValue = string | boolean | number | Date | undefined;
export interface I_Reference {
label: T_TriggerValue;
value: T_TriggerValue;
}
export interface I_TemplateFilter {
entity?: E_TemplateFilterEntity | string;
variable?: string;
operator?: keyof typeof E_Operator | string;
reference?: I_Reference;
id?: string | number;
}
export interface I_TemplateFilterGroup {
filtersOperator?: T_LogicalOperatorValue;
filters?: I_TemplateFilter[];
id?: string | number;
edit?: boolean;
}
export type T_LogicalOperatorValue = E_LogicalOperator[keyof E_LogicalOperator];
export interface I_TemplateConditionGroup {
groupsOperator: T_LogicalOperatorValue;
groups: I_TemplateFilterGroup[];
id: string | number;
}
export type T_TemplateFilterObjectKeys = {
[key in E_TemplateFilterEntity]?: {
attributes?: {
name?: string;
values?: string[];
};
};
};
export interface I_CreateOrUpdateTemplateCondition {
templateId?: string;
condition?: any;
}
export interface I_APIKey {
name: string;
expire_date: string;
roles: [string];
brand: I_Brand;
company: string;
status: 'active' | 'not_active';
branches?: [string];
}
export {};
//# sourceMappingURL=index.d.ts.map