class ReceiptTableActionAlterations extends StubTableActionAlterations<Receipt> {

    @NonNull
    @Override
    public Single<Receipt> preInsert(@NonNull final Receipt receipt) {
        return receiptsTable.get(receipt.getTrip())
                .map(existingReceipts -> {
                    final ReceiptBuilderFactory factory = receiptBuilderFactoryFactory.build(receipt).setIndex(getNextReceiptIndex(receipt));
                    final long customOrderId = ReceiptsOrderer.getCustomOrderId(receipt, existingReceipts);
                    return updateReceiptFileNameBlocking(factory.setCustomOrderId(customOrderId).build());
                });

    }

    public  ReceiptTableActionAlterations(@NonNull Context context,
                                         @NonNull ReceiptsTable receiptsTable,
                                         @NonNull StorageManager storageManager,
                                         @NonNull Lazy<Picasso> picasso);
      ReceiptTableActionAlterations(@NonNull Context context,
                                  @NonNull ReceiptsTable receiptsTable,
                                  @NonNull StorageManager storageManager,
                                  @NonNull BuilderFactory1<Receipt, ReceiptBuilderFactory> receiptBuilderFactoryFactory,
                                  @NonNull Lazy<Picasso> picasso);

}