all repos — caroster @ 67460a673309451acd35ffe5044d80095ef3da89

[Octree] Group carpool to your event https://caroster.io

feat: ✨ Standardize phone inputs and formats
Simon Mulquin simon@octree.ch
Fri, 12 Jul 2024 08:29:44 +0000
commit

67460a673309451acd35ffe5044d80095ef3da89

parent

392f026c797ca85247bf71cdef9b86c274532e60

M backend/src/api/passenger/content-types/passenger/schema.jsonbackend/src/api/passenger/content-types/passenger/schema.json

@@ -43,6 +43,9 @@ "inversedBy": "passengers"

}, "phone": { "type": "string" + }, + "phoneCountry": { + "type": "string" } } }
M backend/src/api/travel/content-types/travel/schema.jsonbackend/src/api/travel/content-types/travel/schema.json

@@ -58,6 +58,9 @@ },

"departureTime": { "type": "string", "regex": "(\\d\\d:\\d\\d)?" + }, + "phoneCountry": { + "type": "string" } } }
M backend/src/api/vehicle/content-types/vehicle/schema.jsonbackend/src/api/vehicle/content-types/vehicle/schema.json

@@ -9,8 +9,6 @@ "pluralName": "vehicles",

"displayName": "Vehicle" }, "options": { - "increments": true, - "timestamps": true, "draftAndPublish": false }, "attributes": {

@@ -31,6 +29,9 @@ "type": "relation",

"relation": "manyToOne", "target": "plugin::users-permissions.user", "inversedBy": "vehicles" + }, + "phoneCountry": { + "type": "string" } } }
M backend/types/generated/contentTypes.d.tsbackend/types/generated/contentTypes.d.ts

@@ -1064,6 +1064,7 @@ 'manyToOne',

'api::event.event' >; phone: Attribute.String; + phoneCountry: Attribute.String; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; createdBy: Attribute.Relation<

@@ -1216,6 +1217,7 @@ 'plugin::users-permissions.user'

>; departureDate: Attribute.Date; departureTime: Attribute.String; + phoneCountry: Attribute.String; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; createdBy: Attribute.Relation<

@@ -1290,8 +1292,6 @@ pluralName: 'vehicles';

displayName: 'Vehicle'; }; options: { - increments: true; - timestamps: true; draftAndPublish: false; }; attributes: {

@@ -1307,6 +1307,7 @@ 'api::vehicle.vehicle',

'manyToOne', 'plugin::users-permissions.user' >; + phoneCountry: Attribute.String; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; createdBy: Attribute.Relation<
M frontend/components/PhoneInput/index.tsxfrontend/components/PhoneInput/index.tsx

@@ -4,9 +4,11 @@ InputAdornment,

MenuItem, Select, TextField, + TextFieldProps, Typography, } from '@mui/material'; import { + CountryIso2, defaultCountries, FlagImage, getActiveFormattingMask,

@@ -18,11 +20,23 @@ import 'react-international-phone/style.css';

interface Props { value: string; - onChange: (phoneNumber: string) => void; + onChange: ({ + phone, + country, + }: { + phone: string; + country: CountryIso2 | ''; + error: boolean + }) => void; label: string; } -const PhoneInput = ({value, onChange, label}: Props) => { +const PhoneInput = ({ + value, + onChange, + label, + ...textFieldProps +}: Omit<TextFieldProps, 'onChange'> & Props) => { const [phone, setPhone] = useState(value); const browserLocales = navigator.language.split('-');

@@ -34,19 +48,19 @@ usePhoneInput({

defaultCountry: defaultCountry || defaultCountries[0][1], value: phone, countries: defaultCountries, - onChange: data => { - setPhone(data.phone); + onChange: ({phone, country}) => { + setPhone(phone); const mask = getActiveFormattingMask({ - phone: data.phone, - country: data.country, + phone: phone, + country: country, }); const digitnumbers = mask.split('').filter(c => c === '.').length; const isValid = - data.phone.length === 1 + data.country.dialCode.length + digitnumbers; + phone.length === 1 + country.dialCode.length + digitnumbers; if (isValid) { - onChange(data.phone); + onChange({phone, country: country.iso2, error: false}); } else { - onChange(''); + onChange({phone: '', country: '', error: true}); } }, });

@@ -54,7 +68,8 @@

return ( <TextField fullWidth - color={value === phone ? 'primary' : 'error'} + error={!phone || value !== phone} + {...textFieldProps} label={label} value={inputValue} onChange={handlePhoneValueChange}
M frontend/containers/DrawerPassenger/index.tsxfrontend/containers/DrawerPassenger/index.tsx

@@ -1,6 +1,10 @@

import {Drawer, Typography, useMediaQuery, Link, Box} from '@mui/material'; import {useTranslation} from 'react-i18next'; +import { + CountryIso2, +} from 'react-international-phone'; import DrawerPassengerHeader from './DrawerPassengerHeader'; +import { getFormatedPhoneNumber } from '../../lib/phoneNumbers'; interface Props { isOpen: boolean;

@@ -9,7 +13,10 @@ firstName: string;

lastName: string; email: string; phone?: string; + phoneCountry?: '' | CountryIso2; } + + const DrawerPassenger = ({ isOpen,

@@ -18,6 +25,7 @@ lastName,

firstName, email, phone, + phoneCountry, }: Props) => { const {t} = useTranslation(); const isMobile = useMediaQuery('(max-width:400px)');

@@ -80,7 +88,7 @@ <Link

sx={{display: 'flex', flexDirection: 'row', gap: 1}} href={`tel:${phone}`} > - {phone} + {getFormatedPhoneNumber({phone, phoneCountry})} </Link> ) : ( <Typography variant="body1">
M frontend/containers/NewTravelDialog/index.tsxfrontend/containers/NewTravelDialog/index.tsx

@@ -14,11 +14,12 @@ import {useTheme} from '@mui/material/styles';

import {DatePicker} from '@mui/x-date-pickers/DatePicker'; import {TimePicker} from '@mui/x-date-pickers/TimePicker'; import {useTranslation} from 'react-i18next'; +import PhoneInput from '../../components/PhoneInput'; +import PlaceInput from '../PlaceInput'; import useEventStore from '../../stores/useEventStore'; import useActions from './useActions'; import FAQLink from './FAQLink'; import {VehicleEntity} from '../../generated/graphql'; -import PlaceInput from '../PlaceInput'; interface Props { selectedVehicle: VehicleEntity;

@@ -48,12 +49,16 @@ const [time, setTime] = useState(dateMoment);

const [phone, setPhone] = useState( selectedVehicle?.attributes.phone_number || '' ); + const [phoneCountry, setPhoneCountry] = useState( + selectedVehicle?.attributes.phoneCountry || '' + ); + const [phoneError, setPhoneError] = useState(false); const [details, setDetails] = useState(''); const [dateError, setDateError] = useState(false); const [titleError, setTitleError] = useState(false); const [isTitleEmpty, setIsTitleEmpty] = useState(true); - const canCreate = !!name && !!seats; + const canCreate = !!name && !!seats && !phoneError; const clearState = () => { setName('');

@@ -63,6 +68,7 @@ setMeetingLatitude(null);

setMeetingLongitude(null); setDate(moment()); setPhone(''); + setPhoneCountry(''); setDetails(''); };

@@ -91,6 +97,7 @@ details,

seats, vehicleName: name, phone_number: phone, + phoneCountry: phoneCountry, departureDate: date ? moment(date).format('YYYY-MM-DD') : '', departureTime: time ? moment(time).format('HH:mm') : '', event: event.id,

@@ -160,16 +167,18 @@ }

FormHelperTextProps={{sx: {color: 'warning.main'}}} /> - <TextField + <PhoneInput + value={phone} + onChange={({phone, country, error}) => { + setPhone(phone); + setPhoneCountry(country); + setPhoneError(error); + }} + label={t('travel.creation.phone')} + name="phone" variant="outlined" size="small" sx={{...addSpacing(theme, 1), paddingBottom: theme.spacing(1)}} - label={t('travel.creation.phone')} - fullWidth - inputProps={{type: 'tel'}} - value={phone} - onChange={e => setPhone(e.target.value)} - name="phone" helperText={ <Typography variant="caption"> <FAQLink
M frontend/containers/Travel/Header.tsxfrontend/containers/Travel/Header.tsx

@@ -15,6 +15,7 @@ import usePermissions from '../../hooks/usePermissions';

import useProfile from '../../hooks/useProfile'; import DetailsLink from '../DetailsLink'; import {TravelEntity} from '../../generated/graphql'; +import { getFormatedPhoneNumber } from '../../lib/phoneNumbers'; interface Props { travel: TravelEntity;

@@ -94,7 +95,7 @@ <Typography variant="overline" sx={{color: 'GrayText'}}>

{t('travel.fields.phone')} </Typography> <Typography variant="body1" id="TravelPhone"> - {travel.attributes.phone_number} + {getFormatedPhoneNumber({phone: travel.attributes.phone_number, phoneCountry: travel.attributes.phoneCountry})} </Typography> </Box> )}
M frontend/containers/Travel/HeaderEditing.tsxfrontend/containers/Travel/HeaderEditing.tsx

@@ -8,10 +8,12 @@ import moment from 'moment';

import {useTheme} from '@mui/material/styles'; import {DatePicker} from '@mui/x-date-pickers/DatePicker'; import {TimePicker} from '@mui/x-date-pickers/TimePicker'; +import {CountryIso2} from 'react-international-phone'; import {useTranslation} from 'react-i18next'; import RemoveDialog from '../RemoveDialog'; import useActions from './useActions'; import PlaceInput from '../PlaceInput'; +import PhoneInput from '../../components/PhoneInput'; import useEventStore from '../../stores/useEventStore'; import {TravelEntity} from '../../generated/graphql';

@@ -50,6 +52,10 @@ ? moment(travel.attributes.departureTime, 'HH:mm')

: null ); const [phone, setPhone] = useState(travel?.attributes.phone_number ?? ''); + const [phoneCountry, setPhoneCountry] = useState<CountryIso2>( + travel?.attributes.phoneCountry ?? '' + ); + const [phoneError, setPhoneError] = useState(false); const [details, setDetails] = useState(travel?.attributes.details ?? ''); // Click on ESQ closes the form

@@ -76,6 +82,7 @@ meeting_longitude,

details, seats, phone_number: phone, + phoneCountry, vehicleName: name, departureDate: date ? moment(date).format('YYYY-MM-DD') : '', departureTime: time ? moment(time).format('HH:mm') : '',

@@ -128,12 +135,15 @@ onChange={e => setName(e.target.value)}

name="name" id="EditTravelName" /> - <TextField + <PhoneInput + value={phone} + onChange={({phone, country, error}) => { + setPhone(phone); + setPhoneCountry(country); + setPhoneError(error); + }} label={t('travel.creation.phone')} - fullWidth sx={{pb: 2}} - value={phone} - onChange={e => setPhone(e.target.value)} name="phone" id="EditTravelPhone" />

@@ -197,6 +207,7 @@ variant="contained"

color="primary" onClick={onSave} id="TravelSave" + disabled={phoneError} > {t('generic.save')} </Button>
M frontend/containers/Travel/RequestTripModal.tsxfrontend/containers/Travel/RequestTripModal.tsx

@@ -24,13 +24,12 @@ const {t} = useTranslation();

const {profile, userId} = useProfile(); const [createPassenger] = useCreatePassengerMutation(); const [email, setEmail] = useState(''); - useEffect( - () => { - setEmail(profile?.email); - }, - [profile?.email] - ); + useEffect(() => { + setEmail(profile?.email); + }, [profile?.email]); const [phone, setPhone] = useState(''); + const [phoneCountry, setPhoneCountry] = useState(''); + const [phoneError, setPhoneError] = useState(false); const {event} = useEventStore(); const {addToEvent} = useAddToEvents(); const addToast = useToastStore(s => s.addToast);

@@ -47,6 +46,7 @@ passenger: {

user: userId, email, phone, + phoneCountry, name: hasName ? userName : profile.username, travel: travel.id, event: event.id,

@@ -69,18 +69,23 @@ cancel={toggle}

onSubmit={onSubmit} title={t('travel.requestTrip.title')} action={t('travel.requestTrip.send')} + disabled={emailError || phoneError} > <Typography>{t('travel.requestTrip.description')}</Typography> <Box py={2}> <PhoneInput value={phone} - onChange={v => setPhone(v)} + onChange={({phone, country, error}) => { + setPhone(phone); + setPhoneCountry(country); + setPhoneError(error); + }} label={t('travel.requestTrip.phone')} /> </Box> <TextField fullWidth - error={emailError} + error={emailError || phoneError} label={t('travel.requestTrip.email')} value={email} onChange={e => setEmail(e.target.value)}
M frontend/containers/Travel/index.tsxfrontend/containers/Travel/index.tsx

@@ -113,6 +113,7 @@ focusPassenger?.attributes.user?.data?.attributes.lastName

} email={focusPassenger?.attributes.email} phone={focusPassenger?.attributes.phone} + phoneCountry={focusPassenger?.attributes.phoneCountry} /> )} </>
M frontend/containers/TravelMarker/TravelPopup.tsxfrontend/containers/TravelMarker/TravelPopup.tsx

@@ -7,6 +7,7 @@ import {TravelEntity} from '../../generated/graphql';

import {Popup} from 'react-leaflet'; import {useTranslation} from 'react-i18next'; import getMapsLink from '../../lib/getMapsLink'; +import { getFormatedPhoneNumber } from '../../lib/phoneNumbers'; interface Props { travel: TravelEntity;

@@ -32,7 +33,7 @@ <Typography variant="overline" color="GrayText">

{t('travel.fields.phone')} </Typography> <Typography variant="body1"> - {travel.attributes.phone_number} + {getFormatedPhoneNumber({phone: travel.attributes.phone_number, phoneCountry: travel.attributes.phoneCountry})} </Typography> </Box> )}
M frontend/generated/graphql.tsxfrontend/generated/graphql.tsx

@@ -282,12 +282,6 @@ __typename?: 'EventEntityResponse';

data?: Maybe<EventEntity>; }; -export type EventEntityResponseCollection = { - __typename?: 'EventEntityResponseCollection'; - data: Array<EventEntity>; - meta: ResponseCollectionMeta; -}; - export type EventFiltersInput = { address?: InputMaybe<StringFilterInput>; administrators?: InputMaybe<StringFilterInput>;

@@ -1067,6 +1061,7 @@ event?: Maybe<EventEntityResponse>;

location?: Maybe<Scalars['String']['output']>; name: Scalars['String']['output']; phone?: Maybe<Scalars['String']['output']>; + phoneCountry?: Maybe<Scalars['String']['output']>; travel?: Maybe<TravelEntityResponse>; updatedAt?: Maybe<Scalars['DateTime']['output']>; user?: Maybe<UsersPermissionsUserEntityResponse>;

@@ -1100,6 +1095,7 @@ name?: InputMaybe<StringFilterInput>;

not?: InputMaybe<PassengerFiltersInput>; or?: InputMaybe<Array<InputMaybe<PassengerFiltersInput>>>; phone?: InputMaybe<StringFilterInput>; + phoneCountry?: InputMaybe<StringFilterInput>; travel?: InputMaybe<TravelFiltersInput>; updatedAt?: InputMaybe<DateTimeFilterInput>; user?: InputMaybe<UsersPermissionsUserFiltersInput>;

@@ -1111,6 +1107,7 @@ event?: InputMaybe<Scalars['ID']['input']>;

location?: InputMaybe<Scalars['String']['input']>; name?: InputMaybe<Scalars['String']['input']>; phone?: InputMaybe<Scalars['String']['input']>; + phoneCountry?: InputMaybe<Scalars['String']['input']>; travel?: InputMaybe<Scalars['ID']['input']>; user?: InputMaybe<Scalars['ID']['input']>; };

@@ -1130,7 +1127,6 @@ event?: Maybe<EventEntityResponse>;

/** Retrieve an event using its UUID */ eventByUUID?: Maybe<EventEntityResponse>; eventTripAlert?: Maybe<TripAlertEntityResponse>; - events?: Maybe<EventEntityResponseCollection>; i18NLocale?: Maybe<I18NLocaleEntityResponse>; i18NLocales?: Maybe<I18NLocaleEntityResponseCollection>; me?: Maybe<UsersPermissionsMe>;

@@ -1153,7 +1149,6 @@ uploadFolders?: Maybe<UploadFolderEntityResponseCollection>;

usersPermissionsRole?: Maybe<UsersPermissionsRoleEntityResponse>; usersPermissionsRoles?: Maybe<UsersPermissionsRoleEntityResponseCollection>; usersPermissionsUser?: Maybe<UsersPermissionsUserEntityResponse>; - usersPermissionsUsers?: Maybe<UsersPermissionsUserEntityResponseCollection>; vehicle?: Maybe<VehicleEntityResponse>; vehicles?: Maybe<VehicleEntityResponseCollection>; };

@@ -1198,13 +1193,6 @@ event: Scalars['ID']['input'];

}; -export type QueryEventsArgs = { - filters?: InputMaybe<EventFiltersInput>; - pagination?: InputMaybe<PaginationArg>; - sort?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>; -}; - - export type QueryI18NLocaleArgs = { id?: InputMaybe<Scalars['ID']['input']>; };

@@ -1328,13 +1316,6 @@ id?: InputMaybe<Scalars['ID']['input']>;

}; -export type QueryUsersPermissionsUsersArgs = { - filters?: InputMaybe<UsersPermissionsUserFiltersInput>; - pagination?: InputMaybe<PaginationArg>; - sort?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>; -}; - - export type QueryVehicleArgs = { id?: InputMaybe<Scalars['ID']['input']>; };

@@ -1432,6 +1413,7 @@ meeting?: Maybe<Scalars['String']['output']>;

meeting_latitude?: Maybe<Scalars['Float']['output']>; meeting_longitude?: Maybe<Scalars['Float']['output']>; passengers?: Maybe<PassengerRelationResponseCollection>; + phoneCountry?: Maybe<Scalars['String']['output']>; phone_number?: Maybe<Scalars['String']['output']>; seats?: Maybe<Scalars['Int']['output']>; updatedAt?: Maybe<Scalars['DateTime']['output']>;

@@ -1477,6 +1459,7 @@ meeting_longitude?: InputMaybe<FloatFilterInput>;

not?: InputMaybe<TravelFiltersInput>; or?: InputMaybe<Array<InputMaybe<TravelFiltersInput>>>; passengers?: InputMaybe<PassengerFiltersInput>; + phoneCountry?: InputMaybe<StringFilterInput>; phone_number?: InputMaybe<StringFilterInput>; seats?: InputMaybe<IntFilterInput>; updatedAt?: InputMaybe<DateTimeFilterInput>;

@@ -1493,6 +1476,7 @@ meeting?: InputMaybe<Scalars['String']['input']>;

meeting_latitude?: InputMaybe<Scalars['Float']['input']>; meeting_longitude?: InputMaybe<Scalars['Float']['input']>; passengers?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>; + phoneCountry?: InputMaybe<Scalars['String']['input']>; phone_number?: InputMaybe<Scalars['String']['input']>; seats?: InputMaybe<Scalars['Int']['input']>; user?: InputMaybe<Scalars['ID']['input']>;

@@ -1927,12 +1911,6 @@

export type UsersPermissionsUserEntityResponse = { __typename?: 'UsersPermissionsUserEntityResponse'; data?: Maybe<UsersPermissionsUserEntity>; -}; - -export type UsersPermissionsUserEntityResponseCollection = { - __typename?: 'UsersPermissionsUserEntityResponseCollection'; - data: Array<UsersPermissionsUserEntity>; - meta: ResponseCollectionMeta; }; export type UsersPermissionsUserFiltersInput = {

@@ -1999,6 +1977,7 @@ export type Vehicle = {

__typename?: 'Vehicle'; createdAt?: Maybe<Scalars['DateTime']['output']>; name: Scalars['String']['output']; + phoneCountry?: Maybe<Scalars['String']['output']>; phone_number?: Maybe<Scalars['String']['output']>; seats?: Maybe<Scalars['Int']['output']>; updatedAt?: Maybe<Scalars['DateTime']['output']>;

@@ -2029,6 +2008,7 @@ id?: InputMaybe<IdFilterInput>;

name?: InputMaybe<StringFilterInput>; not?: InputMaybe<VehicleFiltersInput>; or?: InputMaybe<Array<InputMaybe<VehicleFiltersInput>>>; + phoneCountry?: InputMaybe<StringFilterInput>; phone_number?: InputMaybe<StringFilterInput>; seats?: InputMaybe<IntFilterInput>; updatedAt?: InputMaybe<DateTimeFilterInput>;

@@ -2037,6 +2017,7 @@ };

export type VehicleInput = { name?: InputMaybe<Scalars['String']['input']>; + phoneCountry?: InputMaybe<Scalars['String']['input']>; phone_number?: InputMaybe<Scalars['String']['input']>; seats?: InputMaybe<Scalars['Int']['input']>; user?: InputMaybe<Scalars['ID']['input']>;

@@ -2091,14 +2072,14 @@

export type ResetPasswordMutation = { __typename?: 'Mutation', resetPassword?: { __typename?: 'UsersPermissionsLoginPayload', jwt?: string | null, user: { __typename?: 'UsersPermissionsMe', id: string, username: string, email?: string | null, confirmed?: boolean | null } } | null }; -export type EventFieldsFragment = { __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, description?: string | null, enabled_modules?: any | null, email: string, lang?: Enum_Event_Lang | null, administrators?: Array<string | null> | null, date?: any | null, address?: string | null, latitude?: number | null, longitude?: number | null, position?: any | null, waitingPassengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, email?: string | null, location?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null, travels?: { __typename?: 'TravelRelationResponseCollection', data: Array<{ __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, seats?: number | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null } | null } | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, email?: string | null, phone?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null } | null }> } | null } | null }; +export type EventFieldsFragment = { __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, description?: string | null, enabled_modules?: any | null, email: string, lang?: Enum_Event_Lang | null, administrators?: Array<string | null> | null, date?: any | null, address?: string | null, latitude?: number | null, longitude?: number | null, position?: any | null, waitingPassengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, email?: string | null, location?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null, travels?: { __typename?: 'TravelRelationResponseCollection', data: Array<{ __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, phoneCountry?: string | null, seats?: number | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null } | null } | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, email?: string | null, phone?: string | null, phoneCountry?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null } | null }> } | null } | null }; export type CreateEventMutationVariables = Exact<{ eventData: EventInput; }>; -export type CreateEventMutation = { __typename?: 'Mutation', createEvent?: { __typename?: 'EventEntityResponse', data?: { __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, description?: string | null, enabled_modules?: any | null, email: string, lang?: Enum_Event_Lang | null, administrators?: Array<string | null> | null, date?: any | null, address?: string | null, latitude?: number | null, longitude?: number | null, position?: any | null, waitingPassengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, email?: string | null, location?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null, travels?: { __typename?: 'TravelRelationResponseCollection', data: Array<{ __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, seats?: number | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null } | null } | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, email?: string | null, phone?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null } | null }> } | null } | null } | null } | null }; +export type CreateEventMutation = { __typename?: 'Mutation', createEvent?: { __typename?: 'EventEntityResponse', data?: { __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, description?: string | null, enabled_modules?: any | null, email: string, lang?: Enum_Event_Lang | null, administrators?: Array<string | null> | null, date?: any | null, address?: string | null, latitude?: number | null, longitude?: number | null, position?: any | null, waitingPassengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, email?: string | null, location?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null, travels?: { __typename?: 'TravelRelationResponseCollection', data: Array<{ __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, phoneCountry?: string | null, seats?: number | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null } | null } | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, email?: string | null, phone?: string | null, phoneCountry?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null } | null }> } | null } | null } | null } | null }; export type UpdateEventMutationVariables = Exact<{ uuid: Scalars['String']['input'];

@@ -2106,7 +2087,7 @@ eventUpdate: EventInput;

}>; -export type UpdateEventMutation = { __typename?: 'Mutation', updateEventByUUID?: { __typename?: 'EventEntityResponse', data?: { __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, description?: string | null, enabled_modules?: any | null, email: string, lang?: Enum_Event_Lang | null, administrators?: Array<string | null> | null, date?: any | null, address?: string | null, latitude?: number | null, longitude?: number | null, position?: any | null, waitingPassengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, email?: string | null, location?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null, travels?: { __typename?: 'TravelRelationResponseCollection', data: Array<{ __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, seats?: number | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null } | null } | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, email?: string | null, phone?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null } | null }> } | null } | null } | null } | null }; +export type UpdateEventMutation = { __typename?: 'Mutation', updateEventByUUID?: { __typename?: 'EventEntityResponse', data?: { __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, description?: string | null, enabled_modules?: any | null, email: string, lang?: Enum_Event_Lang | null, administrators?: Array<string | null> | null, date?: any | null, address?: string | null, latitude?: number | null, longitude?: number | null, position?: any | null, waitingPassengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, email?: string | null, location?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null, travels?: { __typename?: 'TravelRelationResponseCollection', data: Array<{ __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, phoneCountry?: string | null, seats?: number | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null } | null } | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, email?: string | null, phone?: string | null, phoneCountry?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null } | null }> } | null } | null } | null } | null }; export type AddEventAdminMutationVariables = Exact<{ eventId: Scalars['ID']['input'];

@@ -2129,7 +2110,7 @@ uuid: Scalars['String']['input'];

}>; -export type EventByUuidQuery = { __typename?: 'Query', eventByUUID?: { __typename?: 'EventEntityResponse', data?: { __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, description?: string | null, enabled_modules?: any | null, email: string, lang?: Enum_Event_Lang | null, administrators?: Array<string | null> | null, date?: any | null, address?: string | null, latitude?: number | null, longitude?: number | null, position?: any | null, waitingPassengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, email?: string | null, location?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null, travels?: { __typename?: 'TravelRelationResponseCollection', data: Array<{ __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, seats?: number | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null } | null } | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, email?: string | null, phone?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null } | null }> } | null } | null } | null } | null }; +export type EventByUuidQuery = { __typename?: 'Query', eventByUUID?: { __typename?: 'EventEntityResponse', data?: { __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, description?: string | null, enabled_modules?: any | null, email: string, lang?: Enum_Event_Lang | null, administrators?: Array<string | null> | null, date?: any | null, address?: string | null, latitude?: number | null, longitude?: number | null, position?: any | null, waitingPassengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, email?: string | null, location?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null, travels?: { __typename?: 'TravelRelationResponseCollection', data: Array<{ __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, phoneCountry?: string | null, seats?: number | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null } | null } | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, email?: string | null, phone?: string | null, phoneCountry?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null } | null } | null } | null } | null }> } | null } | null }> } | null } | null } | null } | null }; export type ModuleQueryVariables = Exact<{ locale: Scalars['I18NLocaleCode']['input'];

@@ -2152,14 +2133,14 @@

export type ReadNotificationsMutation = { __typename?: 'Mutation', readNotifications?: { __typename?: 'NotificationEntityResponseCollection', data: Array<{ __typename?: 'NotificationEntity', id?: string | null, attributes?: { __typename?: 'Notification', type: Enum_Notification_Type, read?: boolean | null } | null }> } | null }; -export type PassengerFieldsFragment = { __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, email?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null }; +export type PassengerFieldsFragment = { __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, phoneCountry?: string | null, email?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null }; export type CreatePassengerMutationVariables = Exact<{ passenger: PassengerInput; }>; -export type CreatePassengerMutation = { __typename?: 'Mutation', createPassenger?: { __typename?: 'PassengerEntityResponse', data?: { __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, email?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null } | null } | null }; +export type CreatePassengerMutation = { __typename?: 'Mutation', createPassenger?: { __typename?: 'PassengerEntityResponse', data?: { __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, phoneCountry?: string | null, email?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null } | null } | null }; export type UpdatePassengerMutationVariables = Exact<{ id: Scalars['ID']['input'];

@@ -2167,7 +2148,7 @@ passengerUpdate: PassengerInput;

}>; -export type UpdatePassengerMutation = { __typename?: 'Mutation', updatePassenger?: { __typename?: 'PassengerEntityResponse', data?: { __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, email?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null } | null } | null }; +export type UpdatePassengerMutation = { __typename?: 'Mutation', updatePassenger?: { __typename?: 'PassengerEntityResponse', data?: { __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, phoneCountry?: string | null, email?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null } | null } | null }; export type DeletePassengerMutationVariables = Exact<{ id: Scalars['ID']['input'];

@@ -2183,7 +2164,7 @@

export type SettingQuery = { __typename?: 'Query', setting?: { __typename?: 'SettingEntityResponse', data?: { __typename?: 'SettingEntity', id?: string | null, attributes?: { __typename?: 'Setting', gtm_id?: string | null, about_link?: string | null, announcement?: string | null, matomo_script_url?: string | null, opencollective_link?: string | null, code_link?: string | null, stripe_dashboard_link?: string | null, tos_link?: string | null, data_policy_link?: string | null } | null } | null } | null }; -export type TravelFieldsFragment = { __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, seats?: number | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null }> } | null } | null }; +export type TravelFieldsFragment = { __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, phoneCountry?: string | null, seats?: number | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, phoneCountry?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null }> } | null } | null }; export type CreateTravelMutationVariables = Exact<{ travel: TravelInput;

@@ -2191,7 +2172,7 @@ createVehicle?: InputMaybe<Scalars['Boolean']['input']>;

}>; -export type CreateTravelMutation = { __typename?: 'Mutation', createTravel?: { __typename?: 'TravelEntityResponse', data?: { __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, seats?: number | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null }> } | null } | null } | null } | null }; +export type CreateTravelMutation = { __typename?: 'Mutation', createTravel?: { __typename?: 'TravelEntityResponse', data?: { __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, phoneCountry?: string | null, seats?: number | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, phoneCountry?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null }> } | null } | null } | null } | null }; export type UpdateTravelMutationVariables = Exact<{ id: Scalars['ID']['input'];

@@ -2199,7 +2180,7 @@ travelUpdate: TravelInput;

}>; -export type UpdateTravelMutation = { __typename?: 'Mutation', updateTravel?: { __typename?: 'TravelEntityResponse', data?: { __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, seats?: number | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null }> } | null } | null } | null } | null }; +export type UpdateTravelMutation = { __typename?: 'Mutation', updateTravel?: { __typename?: 'TravelEntityResponse', data?: { __typename?: 'TravelEntity', id?: string | null, attributes?: { __typename?: 'Travel', meeting?: string | null, meeting_latitude?: number | null, meeting_longitude?: number | null, departureDate?: any | null, departureTime?: string | null, details?: string | null, vehicleName?: string | null, phone_number?: string | null, phoneCountry?: string | null, seats?: number | null, passengers?: { __typename?: 'PassengerRelationResponseCollection', data: Array<{ __typename?: 'PassengerEntity', id?: string | null, attributes?: { __typename?: 'Passenger', name: string, location?: string | null, phone?: string | null, phoneCountry?: string | null, user?: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', firstName?: string | null, lastName?: string | null, email: string } | null } | null } | null } | null }> } | null } | null } | null } | null }; export type DeleteTravelMutationVariables = Exact<{ id: Scalars['ID']['input'];

@@ -2222,12 +2203,12 @@

export type UpdateMeMutation = { __typename?: 'Mutation', updateMe: { __typename?: 'UsersPermissionsUserEntityResponse', data?: { __typename?: 'UsersPermissionsUserEntity', id?: string | null, attributes?: { __typename?: 'UsersPermissionsUser', username: string, email: string, confirmed?: boolean | null, lastName?: string | null, firstName?: string | null, lang?: Enum_Userspermissionsuser_Lang | null, onboardingUser?: boolean | null, onboardingCreator?: boolean | null, newsletterConsent?: boolean | null, notificationEnabled?: boolean | null, provider?: string | null, events?: { __typename?: 'EventRelationResponseCollection', data: Array<{ __typename?: 'EventEntity', id?: string | null, attributes?: { __typename?: 'Event', uuid?: string | null, name: string, date?: any | null, address?: string | null, enabled_modules?: any | null } | null }> } | null } | null } | null } }; -export type VehicleFieldsFragment = { __typename?: 'VehicleEntity', id?: string | null, attributes?: { __typename?: 'Vehicle', name: string, seats?: number | null, phone_number?: string | null } | null }; +export type VehicleFieldsFragment = { __typename?: 'VehicleEntity', id?: string | null, attributes?: { __typename?: 'Vehicle', name: string, seats?: number | null, phone_number?: string | null, phoneCountry?: string | null } | null }; export type FindUserVehiclesQueryVariables = Exact<{ [key: string]: never; }>; -export type FindUserVehiclesQuery = { __typename?: 'Query', me?: { __typename?: 'UsersPermissionsMe', id: string, username: string, profile?: { __typename?: 'UsersPermissionsUser', vehicles?: { __typename?: 'VehicleRelationResponseCollection', data: Array<{ __typename?: 'VehicleEntity', id?: string | null, attributes?: { __typename?: 'Vehicle', name: string, seats?: number | null, phone_number?: string | null } | null }> } | null } | null } | null }; +export type FindUserVehiclesQuery = { __typename?: 'Query', me?: { __typename?: 'UsersPermissionsMe', id: string, username: string, profile?: { __typename?: 'UsersPermissionsUser', vehicles?: { __typename?: 'VehicleRelationResponseCollection', data: Array<{ __typename?: 'VehicleEntity', id?: string | null, attributes?: { __typename?: 'Vehicle', name: string, seats?: number | null, phone_number?: string | null, phoneCountry?: string | null } | null }> } | null } | null } | null }; export type DeleteVehicleMutationVariables = Exact<{ id: Scalars['ID']['input'];

@@ -2291,6 +2272,7 @@ departureTime

details vehicleName phone_number + phoneCountry seats user { data {

@@ -2305,6 +2287,7 @@ name

location email phone + phoneCountry user { data { id

@@ -2330,6 +2313,7 @@ attributes {

name location phone + phoneCountry email user { data {

@@ -2356,6 +2340,7 @@ departureTime

details vehicleName phone_number + phoneCountry seats passengers { data {

@@ -2364,6 +2349,7 @@ attributes {

name location phone + phoneCountry user { data { id

@@ -2414,6 +2400,7 @@ attributes {

name seats phone_number + phoneCountry } } `;
M frontend/graphql/event.gqlfrontend/graphql/event.gql

@@ -44,6 +44,7 @@ departureTime

details vehicleName phone_number + phoneCountry seats user { data {

@@ -58,6 +59,7 @@ name

location email phone + phoneCountry user { data { id
M frontend/graphql/passenger.gqlfrontend/graphql/passenger.gql

@@ -4,6 +4,7 @@ attributes {

name location phone + phoneCountry email user { data {
M frontend/graphql/travel.gqlfrontend/graphql/travel.gql

@@ -9,6 +9,7 @@ departureTime

details vehicleName phone_number + phoneCountry seats passengers { data {

@@ -17,6 +18,7 @@ attributes {

name location phone + phoneCountry user { data { id
M frontend/graphql/vehicle.gqlfrontend/graphql/vehicle.gql

@@ -4,6 +4,7 @@ attributes {

name seats phone_number + phoneCountry } }
A frontend/lib/phoneNumbers.tsx

@@ -0,0 +1,33 @@

+import { + CountryIso2, + defaultCountries, + getActiveFormattingMask, + parseCountry, + } from 'react-international-phone'; + +export const getFormatedPhoneNumber = ({ + phone, + phoneCountry, + }: { + phone: string; + phoneCountry: CountryIso2; + }): string => { + if (!phoneCountry || phoneCountry === '') return phone; + const parsedCountry = parseCountry( + defaultCountries.find(country => country[1] === phoneCountry) + ); + const activeMask = getActiveFormattingMask({phone, country: parsedCountry}); + let splittedPhone = phone.split(parsedCountry.dialCode)[1].split(''); + + const maskWithValues = activeMask + .split('') + .map(char => { + if (char === '.') { + return splittedPhone.shift(); + } + return char; + }) + .join(''); + + return `+${parsedCountry.dialCode} ${maskWithValues}`; + };