mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 08:30:05 +00:00
fix(trips): keep a visit's own stay when a trip is copied
insertAssignmentCopy took stay_minutes but never wrote it, so a copied trip fell back to the place's duration for every visit.
This commit is contained in:
@@ -1059,6 +1059,8 @@ describe('Copy trip with data', () => {
|
||||
place: place.id,
|
||||
order_index: 0,
|
||||
notes: 'Visit in morning',
|
||||
// #3092: the visit's own stay, apart from the place's duration
|
||||
stay_minutes: 90,
|
||||
});
|
||||
|
||||
// Accommodation spanning days 0→1
|
||||
@@ -1103,6 +1105,7 @@ describe('Copy trip with data', () => {
|
||||
// Assignment copied
|
||||
const newAssignments = await findRows(orm, DayAssignments, { day: { trip: newId } });
|
||||
expect(newAssignments).toHaveLength(1);
|
||||
expect(newAssignments[0].stay_minutes).toBe(90);
|
||||
|
||||
// Accommodation copied
|
||||
const newAccom = await findRows(orm, DayAccommodations, { trip: newId });
|
||||
|
||||
Reference in New Issue
Block a user