generate regular stupid car trips by default to trigger regular trip alternatives
This commit is contained in:
@@ -32,21 +32,25 @@ public class DevTripSeeder implements CommandLineRunner {
|
||||
userRepository.findAll().forEach(user -> {
|
||||
for (int week = 0; week < 5; week++) {
|
||||
for (int day = 0; day < 7; day++) {
|
||||
NewTripDTO carTrip = TripFactory.newCarTripDTO(
|
||||
java.time.Instant.now()
|
||||
.minus(java.time.Duration.ofDays(week * 7 + day))
|
||||
// NewTripDTO carTrip = TripFactory.newCarTripDTO(
|
||||
// Instant.now()
|
||||
// .minus(Duration.ofDays(week * 7 + day)).atZone(ZoneId.systemDefault()).toInstant()
|
||||
// );
|
||||
// This should definitly trigger regularTripDetection
|
||||
NewTripDTO triggerCarTrip = TripFactory.newTriggeringCarMock(
|
||||
java.time.Instant.now().minus(java.time.Duration.ofDays(week * 7 + day))
|
||||
);
|
||||
tripService.addTrip(user, carTrip);
|
||||
tripService.addTrip(user, triggerCarTrip);
|
||||
}
|
||||
|
||||
// Create 5 trips per week
|
||||
for (int i = 0; i < 5; i++) {
|
||||
// Create trips within each week's time range
|
||||
long daysAgo = week * 7 + (long) (Math.random() * 7);
|
||||
NewTripDTO newTrip = TripFactory.randomNewTripDTO(
|
||||
java.time.Instant.now().minus(java.time.Duration.ofDays((long) (Math.random() * 30))));
|
||||
tripService.addTrip(user, newTrip);
|
||||
}
|
||||
// for (int i = 0; i < 5; i++) {
|
||||
// // Create trips within each week's time range
|
||||
// long daysAgo = week * 7 + (long) (Math.random() * 7);
|
||||
// NewTripDTO newTrip = TripFactory.randomNewTripDTO(
|
||||
// java.time.Instant.now().minus(java.time.Duration.ofDays((long) (Math.random() * 30))));
|
||||
// tripService.addTrip(user, newTrip);
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user