gcal/index.js

51 lines
787 B
JavaScript

// index.js
const express = require('express');
const app = express();
require('dotenv').config()
const cron = require('node-cron')
app.get('/send-target-reports', (req, res) => {
console.log('Sending target reports to sales executives');
res.send('Target reports sent successfully');
});
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
console.log('hhhh', process.env.FOO);
cron.schedule('* * * * *', () => {
fetchCalendar()
})
/**
* calendars
* - from
* - to
* - fetch
* - last_fetch
*/
const fetchCalendar = () => {
console.log('fetchCalendar');
/**
* upsert records
* soft delete
* analyze calendar
*/
}
const analyzeCalendar = () => {
/**
* tag
* start
* end
*/
}