UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

25 lines (18 loc) 741 B
// tslint:disable:no-console import * as mongoose from 'mongoose'; import { chevre } from '../../../lib/index'; // const project = { id: String(process.env.PROJECT_ID) }; const SELLER_ID = '59d20831e53ebc2b4e774466'; const PAYMENT_METHOD_TYPE = 'Cash'; async function main() { await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false }); const paymentAcceptedRepo = await chevre.repository.SellerPaymentAccepted.createInstance(mongoose.connection); const paymentAccepted = await paymentAcceptedRepo.isAcceptedBySeller({ seller: { id: SELLER_ID }, codeValue: PAYMENT_METHOD_TYPE }); console.log('paymentAccepted:', paymentAccepted); } main() .then() .catch(console.error);