apiVersion: batch/v1
kind: CronJob
metadata:
  name: inf-cronjob
spec:
  schedule: "*/20 8-19 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-inf
            image: localhost:32000/crawler:latest
            env:
             - name: GENERAL
               value: https://www.infodolar.com.do/
             - name: DBURI
               value: dolardb/crawler.db
             - name: NATSURI
               value: "nats://nats-svc:4222"
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: bcd-cronjob
spec:
  schedule: "3,33 8-22 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-bcd
            image: localhost:32000/crawler:latest
            env:
             - name: BCD
               value: https://www.bancentral.gov.do/SectorExterno/HistoricoTasas
             - name: DBURI
               value: dolardb/crawler.db
             - name: NATSURI
               value: "nats://nats-svc:4222"
             - name: WHO
               value: bcd
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: bpd-cronjob
spec:
  schedule: "5,35 8-22 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-bpd
            image: localhost:32000/crawler:latest
            env:
             - name: BPD
               value: https://popularenlinea.com/empresarial/Paginas/Home.aspx
             - name: DBURI
               value: dolardb/crawler.db
             - name: NATSURI
               value: "nats://nats-svc:4222"
             - name: WHO
               value: bpd
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: bhd-cronjob
spec:
  schedule: "8,38 8-22 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-bhd
            image: localhost:32000/crawler:latest
            env:
             - name: BHD
               value: https://bhd.com.do/calculators?calculator=DIVISAS
             - name: DBURI
               value: dolardb/crawler.db
             - name: NATSURI
               value: "nats://nats-svc:4222"
             - name: WHO
               value: bhd
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: brd-cronjob
spec:
  schedule: "22,52 8-22 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-brd
            image: localhost:32000/crawler:latest
            env:
             - name: BDR
               value: https://www.banreservas.com/calculadoras
             - name: DBURI
               value: dolardb/crawler.db
             - name: NATSURI
               value: "nats://nats-svc:4222"
             - name: WHO
               value: brd
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: apap-cronjob
spec:
  schedule: "25,55 8-22 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-apap
            image: localhost:32000/crawler:latest
            env:
              - name: APA
                value: https://apap.com.do/
              - name: DBURI
                value: dolardb/crawler.db
              - name: NATSURI
                value: "nats://nats-svc:4222"
              - name: WHO
                value: apa
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: bnc-cronjob
spec:
  schedule: "11,41 8-22 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-bnc
            image: localhost:32000/crawler:latest
            env:
              - name: BNC
                value: https://www.banesco.com.do/
              - name: DBURI
                value: dolardb/crawler.db
              - name: NATSURI
                value: "nats://nats-svc:4222"
              - name: WHO
                value: bnc
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: vimenca-cronjob
spec:
  schedule: "14,44 8-22 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-vimenca
            image: localhost:32000/crawler:latest
            env:
              - name: VIMENCA
                value: https://www.bancovimenca.com/
              - name: DBURI
                value: dolardb/crawler.db
              - name: NATSURI
                value: "nats://nats-svc:4222"
              - name: WHO
                value: vimenca
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: scotia-cronjob
spec:
  schedule: "17,47 8-22 * * 1-6"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: crawler-scotia
            image: localhost:32000/crawler:latest
            env:
              - name: SCOTIA
                value: https://do.scotiabank.com/banca-personal/tarifas/tasas-de-cambio.html
              - name: DBURI
                value: dolardb/crawler.db
              - name: NATSURI
                value: "nats://nats-svc:4222"
              - name: WHO
                value: scotia
            volumeMounts:
              - name: database
                mountPath: /app/dolardb
          volumes:
            - name: database
              persistentVolumeClaim:
                claimName: bank-crawler-pvc
          restartPolicy: OnFailure
