@@ -6,20 +6,14 @@ import { buildConfig } from 'payload'
66import { fileURLToPath } from 'node:url'
77import sharp from 'sharp'
88
9- import { Users } from './collections/Users'
10- import { Media } from './collections/Media'
11- import { Documents } from './collections/Documents'
12- import { Settings } from './globals/Settings'
13- import { FetchAirtableDocuments } from './tasks/fetchAirtableDocuments'
14- import { airtableWorkflow } from './workflows/airtableWorkflow'
15- import { DownloadDocuments } from './tasks/downloadDocuments'
16- import { ExtractDocuments } from './tasks/extractDocuments'
17- import { AISummarizer } from './tasks/aiSummarizer'
18- import { UploadToMeedan } from './tasks/uploadToMeedan'
9+ import { Users } from '@/collections/Users'
10+ import { collections } from '@/collections'
11+ import { globals } from '@/globals'
12+ import { tasks } from '@/tasks'
13+ import { workflows } from '@/workflows'
1914
2015const filename = fileURLToPath ( import . meta. url )
2116const dirname = path . dirname ( filename )
22- // check if is prod env
2317const isProd = process . env . NODE_ENV === 'production'
2418
2519export default buildConfig ( {
@@ -29,8 +23,8 @@ export default buildConfig({
2923 baseDir : path . resolve ( dirname ) ,
3024 } ,
3125 } ,
32- collections : [ Users , Media , Documents ] ,
33- globals : [ Settings ] ,
26+ collections,
27+ globals,
3428 editor : lexicalEditor ( ) ,
3529 secret : process . env . PAYLOAD_SECRET || '' ,
3630 typescript : {
@@ -52,15 +46,10 @@ export default buildConfig({
5246 return defaultJobsCollection
5347 } ,
5448 addParentToTaskLog : true ,
55- tasks : [
56- FetchAirtableDocuments ,
57- DownloadDocuments ,
58- ExtractDocuments ,
59- AISummarizer ,
60- UploadToMeedan ,
61- ] ,
62- workflows : [ airtableWorkflow ] ,
49+ tasks,
50+ workflows,
6351 autoRun : [
52+ // TODO:(@kelvinkipruto): Use correct schedule.This is for testing only
6453 {
6554 cron : '* * * * *' ,
6655 queue : 'everyMinute' ,
0 commit comments