Uploaded image for project: 'mod-invoice'
  1. mod-invoice
  2. MODINVOICE-134

Implement scheduled batch voucher exports

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      ACQ Sprint 131
    • Development Team:
      Thunderjet
    • Release:
      Lotus R1 2022

      Description

      Overview

      This story adds the ability to schedule batch voucher exports on a recurring basis (daily/weekly/etc.)

      The first part of this is implementing the "scheduled" endpoint which can be described via the following pseudocode:

      batchGroups.forEach(group -> {
        exportConfig = getExportConfig(group);
        if(exportConfig.enableScheduledExport) {
          if(exportConfig.sunday && today.dayOfWeek=="Sunday") {
             mostRecentExport = getMostRecentExport(group);
            if(now.TimeOfDay >= startTime && mostRecentExport.start > 24hrs ago) {
              POST /batch-voucher/batch-voucher-exports?startTime=mostRecentExport.end&endTime=today@exportConfig.startTime&batchGroup=group
            } ... elided ...
          }
        }
      });
      

      NOTE: down the road we might choose to calculate and store the "next" trigger time as well as start/end params so that we're not constantly doing all this work. That would allow us to just query the db each time this API is invoked and get back the list of batch groups (and related params) we need to trigger exports for. That said, for now let's keep it simple.

      The second part is adding an entry to the module descriptor for the _timer interface which calls the "scheduled" endpoint every 5 minutes

      Writing tests for this work may present some challenges. Keep that in mind during estimation.

      Acceptance Criteria

      • the _timer interface is implemented as described above
      • the "scheduled" API is implemented as described above
      • unit tests are implemented
      • api tests are implemented

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                cmcnally Craig McNally
                Tester Assignee:
                Craig McNally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    TestRail: Runs

                      TestRail: Cases