Closed
Description
At the moment we process a payment for any WorkPeriod no matter if it's already past or no. We should NOT allow processing/creating payments for the future WorkPeriods.
This should be don't for all 3 ways of creating payments:
- Single payment
POST /work-period-payments
- one object in body request - Batch payment
POST /work-period-payments
- array of objects in body request - Query payment
POST /work-period-payments/query
- process payment by query
In case we try to process payment for the future WorkPeriod, return an error "Cannot process payments for the future WorkPeriods." the similar way as if we try to process payment for a ResourceBookings without memberRate
.
We should treat WorkPeriod as future if WorkPeriod.startDate
belongs to the future week. As WorkPeriod.startDate
doesn't have a timezone we should use UTC+12 timezone, to make sure that a user in any timezone could process payment.