class DDDSampleApplicationContext {

    @Autowired
    CargoRepository cargoRepository;

    @Autowired
    LocationRepository locationRepository;

    @Autowired
    VoyageRepository voyageRepository;

    @Autowired
    GraphTraversalService graphTraversalService;

    @Autowired
    RoutingService routingService;

    @Autowired
    HandlingEventFactory handlingEventFactory;

    @Autowired
    HandlingEventRepository handlingEventRepository;

    @Autowired
    ApplicationEvents applicationEvents;

    @Bean
    public CargoFactory cargoFactory() {
        return new CargoFactory(locationRepository, cargoRepository);
    }

    @Bean
    public BookingService bookingService(CargoFactory cargoFactory) {
        return new BookingServiceImpl(cargoRepository, locationRepository, routingService, cargoFactory);
    }

    @Bean
    public CargoInspectionService cargoInspectionService() {
        return new CargoInspectionServiceImpl(applicationEvents, cargoRepository, handlingEventRepository);
    }

    @Bean
    public HandlingEventService handlingEventService() {
        return new HandlingEventServiceImpl(handlingEventRepository, applicationEvents, handlingEventFactory);
    }

    @Bean
    public HandlingEventFactory handlingEventFactory() {
        return new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository);
    }

    @Bean
    public RoutingService routingService() {
        return new ExternalRoutingService(graphTraversalService, locationRepository, voyageRepository);
    }

    @Bean
    public SampleDataGenerator sampleDataGenerator(CargoRepository cargoRepository, VoyageRepository voyageRepository,
                                                   LocationRepository locationRepository, HandlingEventRepository handlingEventRepository,
                                                   PlatformTransactionManager platformTransactionManager, EntityManager entityManager) {<FILL_FUNCTION_BODY>}
}

        SampleDataGenerator sampleDataGenerator = new SampleDataGenerator(cargoRepository, voyageRepository, locationRepository, handlingEventRepository, platformTransactionManager);
        try {
            sampleDataGenerator.generate(); // TODO investigate if this can be called with initMethod in the annotation
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
        return sampleDataGenerator;
    
<no_super_class>