feat: rename voucher to license.

This commit is contained in:
Ahmed Bouhuolia
2020-09-05 22:58:36 +02:00
parent 750377ba86
commit df0cf287ff
24 changed files with 347 additions and 361 deletions

View File

@@ -0,0 +1,22 @@
import { Container } from 'typedi';
import LicenseService from '@/services/Payment/License';
export default class SendLicenseViaEmailJob {
public async handler(job, done: Function): Promise<void> {
const Logger = Container.get('logger');
const licenseService = Container.get(LicenseService);
const { email, licenseCode } = job.attrs.data;
Logger.debug(`Send license via email - started: ${job.attrs.data}`);
try {
await licenseService.mailMessages.sendMailLicense(licenseCode, email);
Logger.debug(`Send license via email - completed: ${job.attrs.data}`);
done();
} catch(e) {
console.log(e);
Logger.error(`Send license via email: ${job.attrs.data}, error: ${e}`);
done(e);
}
}
}