// tslint:disable:no-console
import * as mongoose from 'mongoose';

import { chevre } from '../../../lib/index';

async function main() {
    await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });

    const orderInTransactionRepo = await chevre.repository.OrderInTransaction.createInstance(mongoose.connection);

    const customer = await orderInTransactionRepo.findCustomerByOrderNumber({
        orderNumber: { $eq: 'SSK3-0708814-6653130' }
    });
    console.log(customer);
}

main()
    .then(console.log)
    .catch(console.error);
