class TripTableActionAlterations extends StubTableActionAlterations<Trip> {

    @NonNull
    @Override
    public Single<Trip> postInsert(@NonNull final Trip postInsertTrip)  {
            if (postInsertTrip == null) {
                return Single.error(new Exception("Post insert failed due to a null trip"));
            }

            return makeTripDirectory(postInsertTrip)
                    .doOnError(throwable -> {
                        mTripsTable.delete(postInsertTrip, new DatabaseOperationMetadata(OperationFamilyType.Rollback))
                                .subscribe();
                    })
                    .andThen(Single.just(postInsertTrip))
                    .doOnSuccess(trip -> backUpDatabase());
    }

    public  TripTableActionAlterations(@NonNull PersistenceManager persistenceManager);
    public  TripTableActionAlterations(@NonNull DatabaseHelper databaseHelper, @NonNull StorageManager storageManager);
    public  TripTableActionAlterations(@NonNull Table<Trip> tripsTable, @NonNull ReceiptsTable receiptsTable, @NonNull DistanceTable distanceTable,
                                      @NonNull DatabaseHelper databaseHelper, @NonNull StorageManager storageManager);

}