first commit

This commit is contained in:
2024-05-16 16:05:41 +02:00
commit adf8283ae0
197 changed files with 26666 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
const Agenda = require("agenda");
const agenda = new Agenda({ db: { address: "mongodb://db:27017/agendaDb" } });
const {Agent} = require('./agent');
const agent = new Agent();
// Define a job
agenda.define('followSale', async (job, done) => {
const { saleId } = job.attrs.data;
agent.followSale(saleId)
.then(data => {;
done();
})
});
agenda.define('prepareSale', async (job, done) => {
const { saleId } = job.attrs.data;
agent.prepareSale(saleId)
.then(data => {;
done();
})
});
module.exports = agenda;