import { UserApp } from './apps'; import { Brand } from './brand'; import { Entity } from './entity'; import { Merchant } from './merchant'; import { Country } from './appConfig'; import { TextAndLang } from './common'; export interface SegmentCountry { id: string; code: string; name: TextAndLang[]; entities: Entity[]; countryId: string; logo: string; idd_prefix: number; min_digits: number; max_digits: number; capital: string; iso2: string; } export interface UserName { lang: 'en' | 'ar'; first: string; last: string; } export interface SelectedBrand { id: string; } export interface SelectedEntity { id: string; } export interface SelectedCountry { id: string; entities?: SelectedEntity[]; } export interface SegmentType { id: string; code: string; type: TextAndLang[]; logo: string; } export interface Segment { id: string; code: string; organization_id: string; name: TextAndLang[]; logo: string; brands: Brand[]; countries: SegmentCountry[]; users: []; user_apps?: { user_id: string; installed: { count: number; apps: UserApp[]; }; uninstalled: { count: number; apps: UserApp[]; }; created_at: string; updated_at: string; id: string; }; developers: []; customers: []; segment: Omit; is_any_merchant_has_marketplace?: boolean; operator?: { api_credentials: { test: { public: string; }; live?: { public: string; }; }; }; is_business_segment?: boolean; is_segment_has_more_than_one_merchant?: boolean; marketplace_merchants_count?: number; } interface SegmentUserName { first: string; middle: string; last: string; } export interface Role { id: string; segment_id: string; name: { ar: string; en: string; }; } export interface SegmentDetails { id: string; type: string; name: Record; } interface SegmentEntity { id: string; } export interface Contact { email: string; phone: { country_code: string; number: string; }; } export interface SegmentUser { id: string; created: number; individual_id: string; name: Record; contact: Contact; birth: { date: number; }; role: Role[]; is_authorized: true; segments: SegmentDetails[]; entities: SegmentEntity[]; is_verified: boolean; data_state: string; } export interface IndividualSegmentDetails { individual: { name: UserName[]; contact: Contact; }; segment: Segment; } export interface OperatorSegment { id: string; name: TextAndLang[]; segmentType: { code: string; type: TextAndLang[]; }; } export interface OperatorKey { merchant: Merchant; segment: OperatorSegment; } export interface AppFunction { id: string; action: 'uninstall' | 'install'; } export interface InstallAndUninstallFuns extends AppFunction { serviceId: string; } export interface SegmentRole { segment_id: string; role_id: string; } export interface UserSection { id: string; title?: string; icon?: string; } export interface UserSections { sections: UserSection[]; } export interface UserListItem { id: string | number; label: string | number; } export interface UserFormValues { firstName: string; lastName: string; email: string; nationality: Country; country: Country; phoneNumber: string; identificationNumber?: string; identificationType?: UserListItem; expiryDay?: UserListItem; expiryMonth?: UserListItem; expiryYear?: UserListItem; issuedCountry?: Country; isAuthorized?: boolean; } export interface CreateUserFormValues extends UserFormValues { userRole: UserListItem; } export interface UserFormI { name: { first: string; last: string; }; email: string; user_role?: string; phone: string; nationality: string; country: { countryId: string; idd_prefix: number; }; expiry?: { day?: number; month?: number; year?: number; } | null; id_number?: string; issued_country?: string; id_type?: string; is_authorized?: boolean; } export type GeographyVariant = 'G' | 'L' | 'R'; export interface BrandReference { id: string; } export interface CountryReference { id: string; entities: EntityReference[]; } export interface EntityReference { id: string; } export interface UserReference { id: string; } export interface DeveloperReference { id: string; } export interface CustomerReference { id: string; } export interface SelectedSegment { id: string; brands: BrandReference[]; countries: CountryReference[]; users: UserReference[]; developers: DeveloperReference[]; customers: CustomerReference[]; } export interface UserNameLocale { lang: string; first: string; last: string; } export interface Individual { id: string; contact: Contact; name: UserNameLocale[]; } export interface User { individual: Individual; authentication_id: string; individual_id: string; is_active: boolean; bi: string; count: number; has_more: boolean; live_mode: boolean; force_logout: boolean; segments: Segment[]; active_segment_id: string; active_segments: SelectedSegment[]; created_at: string; updated_at: string; } export {};