Skip to content

[$25] Creating payment by query should get data form DB instead of ES #340

@maxceem

Description

@maxceem

At the moment when we call endpoint POST /work-period-payments/query to get the list of Work Periods to create payments for it uses method searchResourceBookings which get data from ES (and only fallback to DB in case of an error).

Instead of this when creating payments we have to get Work Periods from DB, because data from DB is much more reliable.

For this purpose we have to:

  • add options.returnFromDB to the method searchResourceBookings. Is this option is true then we have to get data from DB instead of ES. Otherwise, the current logic should work: get data from ES and in case of error fallback to DB. NOTE: options.returnFromDB would be only for internal usage, same like options.returnAll
  • pass this option when searching for WPs inside createQueryWorkPeriodPayments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions