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

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

const project = { id: String(process.env.PROJECT_ID) };

async function main() {
    await mongoose.connect(<string>process.env.MONGOLAB_URI);

    const paymentServiceRepo = await chevre.repository.PaymentService.createInstance(mongoose.connection);

    const result = await paymentServiceRepo.findAvailableChannelMovieTicket({
        id: '5f9a52994f3709000abe6417',
        project: {
            id: project.id
        }
    });
    // tslint:disable-next-line:no-null-keyword
    console.dir(result, { depth: null });
}

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