// tslint:disable:no-console import * as mongoose from 'mongoose'; import { chevre } from '../../../../lib/index'; import { findPaymentCardPermit } from '../../../../lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit'; const project = { id: String(process.env.PROJECT_ID) }; async function main() { await mongoose.connect(process.env.MONGOLAB_URI, { autoIndex: false }); const ownershipInfoRepo = new chevre.repository.OwnershipInfo(mongoose.connection); const productRepo = new chevre.repository.Product(mongoose.connection); const result = await findPaymentCardPermit({ project: { id: project.id }, customer: { id: 'a7909268-a584-425e-8212-d7d10f344093' }, now: new Date(), accountType: 'Point' })({ product: productRepo, ownershipInfo: ownershipInfoRepo }); console.log(result); } main() .then(console.log) .catch(console.error);