Skip to content
Closed
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c60de58
feat(travel): remove self-reported 'leaving post adhyayan' question
vendz Jul 7, 2026
ed99fad
Remove leftover "Leaving post adhyayan?" travel question from addon f…
vendz Jul 7, 2026
a9dc524
feat(travel): round-trip toggle + editable return leg (self & mumukshu)
vendz Jul 7, 2026
393defc
feat(travel): guest travel booking flow in app (one-way + round trip)
vendz Jul 7, 2026
9fabc6c
feat(travel): tag round-trip legs in member bookings list
vendz Jul 7, 2026
7b0e49f
feat(travel): room-booking-style date-range round trip for main + add…
vendz Jul 7, 2026
eba3826
fix(travel): add-ons use compact date fields (not inline calendar); s…
vendz Jul 7, 2026
fc724fd
fix(travel): minimal round-trip card — on-brand readable tag, drop re…
vendz Jul 8, 2026
10174d5
fix(travel): drop round-trip chip; use double-sided arrow between dates
vendz Jul 8, 2026
3303d5f
fix(travel): replace text arrow with Ionicons swap-horizontal between…
vendz Jul 8, 2026
97ffec1
feat(travel): add-on inherits primary date range (round trip for mult…
vendz Jul 8, 2026
49523a8
style(food): add Meal Dates label + helper above calendar to match tr…
vendz Jul 8, 2026
d7ad8f8
style(food): replace amber info callout with Meal Dates label + helpe…
vendz Jul 8, 2026
3dcc91a
style(food): rename date heading to 'Booking Dates' (clearer than 'Me…
vendz Jul 8, 2026
ea90c20
fix(travel): propagate round-trip return_date as add-on end date when…
vendz Jul 8, 2026
e20a826
fix(travel): add-ons inherit round-trip return_date as end date; add …
vendz Jul 8, 2026
031c8f8
fix(travel): review fixes — clear return-leg per-person arrival_time;…
vendz Jul 8, 2026
b5b58fd
refactor(travel): simplify — extract TravelDateDisplay + TravelReturn…
vendz Jul 8, 2026
3f0bac5
fix(travel): address PR review comments — restart range on out-of-ord…
vendz Jul 8, 2026
99a16e9
feat(travel): flight-style itinerary on cards + cancellation list; ca…
vendz Jul 8, 2026
44e3899
style(travel): concise calendar callout, match food's warning style
vendz Jul 8, 2026
995d664
style(travel): remove em-dashes from user-facing text & comments
vendz Jul 8, 2026
579d517
style(travel): realign cancellation card to shared pattern; drop roun…
vendz Jul 8, 2026
1ad5029
style(travel): show pickup → drop route with arrow in cancellation ca…
vendz Jul 8, 2026
44d53ba
feat(travel): shared editable return-leg component (TravelReturnDetails)
vendz Jul 8, 2026
632a3fc
feat(travel): add showDatePicker prop to TravelReturnDetails
vendz Jul 8, 2026
3c58a05
feat(travel): editable return leg on the travel booking form
vendz Jul 8, 2026
1fac278
feat(travel): editable return leg in travel add-ons
vendz Jul 8, 2026
0483470
feat(travel): guest travel add-on across all guest flows
vendz Jul 8, 2026
d48119a
feat(travel): TravelReturnGroups multi-group return editor
vendz Jul 8, 2026
5cede0c
refactor(travel): TravelReturnDetails hosts multi-group return editor
vendz Jul 8, 2026
0deab8e
feat(travel): standalone form uses multi-group return editor
vendz Jul 8, 2026
28132a1
feat(travel): addon request cases consume returnGroups arrays
vendz Jul 8, 2026
c31ceb8
feat(travel): detail cards show both legs in full
vendz Jul 8, 2026
de343f8
feat(travel): add-ons and screens use multi-group return editor
vendz Jul 8, 2026
02fc8eb
fix(travel): return leg is a prefilled copy of the onward form
vendz Jul 9, 2026
5959c43
fix(travel): sync period calendar with props; require return flight/t…
vendz Jul 9, 2026
6a2ed3d
fix(travel): enforce flight/train time in add-on flows (onward and re…
vendz Jul 9, 2026
ecebb6f
feat(travel): surface what is blocking submission
vendz Jul 9, 2026
b065668
refactor(travel): compact boarding-pass style booking detail cards
vendz Jul 9, 2026
8b3251f
fix(travel): return block placement + autofill in add-ons; prefill ne…
vendz Jul 9, 2026
3cfc097
fix(travel): address code-review findings on round-trip
vendz Jul 9, 2026
afb8163
refactor(travel): dedup return-group reversal, drop dead import
vendz Jul 9, 2026
8f5f5b4
feat(travel): add Vendor to guest type options
vendz Jul 10, 2026
79e01eb
chore: bump version to 1.1.52
vendz Jul 10, 2026
fa49e72
feat(travel): order booking chips Self, Guest, Mumukshus
vendz Jul 10, 2026
b98805d
fix(travel): don't inherit return_date from companion booking dates
vendz Jul 24, 2026
c25bd14
fix(travel): require return group with return_date in addon payload path
vendz Jul 24, 2026
e71b688
Merge origin/main into feat/travel-guest-adhyayan-roundtrip (keep mai…
vendz Oct 3, 2026
ec76d2f
Travel: keep the Adhyayan question, per-chip return state, guest fixes
vendz Oct 3, 2026
855b13c
Ask "Leaving post Adhyayan?" on the leg that leaves the centre; check…
vendz Oct 3, 2026
ba318a0
Self round trip asks the Adhyayan question on the return; no stale Yes
vendz Oct 3, 2026
77e883f
Self return: answering the Adhyayan question keeps the return in sync
vendz Oct 3, 2026
9bb983e
Merge main into feat/travel-guest-adhyayan-roundtrip
vendz Oct 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 59 additions & 3 deletions src/app/booking/[booking].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SafeAreaView } from 'react-native-safe-area-context';
import { dropdowns, types } from '@/src/constants';
import { useQuery } from '@tanstack/react-query';
import { prepareMumukshuRequestBody } from '@/src/utils/preparingRequestBody';
import { requiresArrivalTime } from '@/src/utils/travel';
import { useLocalSearchParams, useRouter, useFocusEffect } from 'expo-router';
import { KeyboardAwareScrollView } from 'react-native-keyboard-controller';
import { ShadowBox } from '@/src/components/ShadowBox';
Expand Down Expand Up @@ -60,16 +61,17 @@ const transformToMumukshuFormat = (user: any, simpleForm: any, formType: string)
],
};

case 'travel':
return {
case 'travel': {
const travelDetails: any = {
date: simpleForm.date,
return_date: simpleForm.return_date || '',
mumukshuGroup: [
{
pickup: simpleForm.pickup,
drop: simpleForm.drop,
luggage: simpleForm.luggage,
type: simpleForm.type,
adhyayan: simpleForm.adhyayan,
type: simpleForm.type,
arrival_time: simpleForm.arrival_time,
total_people: simpleForm.total_people,
special_request: simpleForm.special_request,
Expand All @@ -78,6 +80,40 @@ const transformToMumukshuFormat = (user: any, simpleForm: any, formType: string)
},
],
};
// A return date makes it a round trip. The return is a full set of groups (same shape as
// the onward). The default (unedited) is the reversed onward for the same traveler, so an
// untouched round trip books exactly as before; edited groups come from the return editor.
if (simpleForm.return_date) {
const sourceGroups =
simpleForm.returnEdited && simpleForm.returnGroups?.length
? simpleForm.returnGroups
: [
{
pickup: simpleForm.drop,
drop: simpleForm.pickup,
type: simpleForm.type,
luggage: simpleForm.luggage,
arrival_time: '',
comments: simpleForm.special_request,
total_people: simpleForm.total_people,
travelerIndices: ['0'],
},
];
travelDetails.returnMumukshuGroup = sourceGroups.map((rg: any) => ({
pickup: rg.pickup,
drop: rg.drop,
type: rg.type,
luggage: rg.luggage || [],
arrival_time: rg.arrival_time || '',
special_request: rg.comments || '',
total_people: rg.total_people ?? null,
mumukshus: rg.travelerIndices
.map((i: string) => (i === '0' ? selfMumukshu : null))
.filter(Boolean),
}));
}
return travelDetails;
}

case 'adhyayan':
return {
Expand Down Expand Up @@ -120,6 +156,7 @@ const BookingDetails = () => {

const endDate =
mumukshuData.room?.endDay ||
mumukshuData.travel?.return_date ||
(mumukshuData.adhyayan && mumukshuData.adhyayan.adhyayan?.end_date) ||
mumukshuData.flat?.endDay ||
mumukshuData.utsav?.utsav?.utsav_end ||
Expand All @@ -145,6 +182,12 @@ const BookingDetails = () => {
},
travel: {
date: initialDates.startDate,
// Inherit the primary booking's date range: a multi-day primary (e.g. a room stay)
// defaults travel to a round trip (arrive on start, depart on end); single-day stays one-way.
return_date:
initialDates.endDate && initialDates.endDate !== initialDates.startDate
? initialDates.endDate
: '',
pickup: '',
drop: '',
adhyayan: dropdowns.TRAVEL_ADHYAYAN_ASK_LIST[1]?.value || '',
Expand All @@ -153,6 +196,8 @@ const BookingDetails = () => {
total_people: null,
luggage: [],
special_request: '',
returnGroups: [],
returnEdited: false,
},
adhyayan: [],
}));
Expand Down Expand Up @@ -309,6 +354,17 @@ const BookingDetails = () => {
if (pickup === 'Research Centre' && drop === 'Research Centre') return false;
if (pickup !== 'Research Centre' && drop !== 'Research Centre') return false;
if (type === dropdowns.BOOKING_TYPE_LIST[1]?.value && !total_people) return false;
// Onward flight/train time is required when the route touches an airport/railway.
if (requiresArrivalTime(pickup, drop) && !forms.travel.arrival_time) return false;
// Same rule for the return leg: edited groups, else the reversed-onward default.
if (forms.travel.return_date) {
const returnGroups =
forms.travel.returnEdited && forms.travel.returnGroups?.length
? forms.travel.returnGroups
: [{ pickup: drop, drop: pickup, arrival_time: '' }];
if (returnGroups.some((g: any) => requiresArrivalTime(g.pickup, g.drop) && !g.arrival_time))
return false;
}

return true;
}, [forms.travel]);
Expand Down
Loading
Loading