Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discount expiry notifier - handle multiple executions for given day #2670

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

david-pepper
Copy link
Contributor

@david-pepper david-pepper commented Feb 3, 2025

Description

  • update the filepath (key) so that multiple executions result in one file per execution (and do not overwrite previous files)
Screenshot 2025-02-03 at 17 31 18

Changes

  • add logic to save file in folder named as discountExpiryDate in format YYYY-MM-DD, and as file named as executionTime in format YYYY-MM-DDTHH:mm:ss.SSSZ e.g. 2024-02-03/2025-02-03T16:55:39.457Z. This ensure unique filenames regardless of how many executions are run for the same discountExpiryDate.
  • some tidyup on variable names and addition of helper methods in getSubsWithExpiringDiscounts.ts
  • shifting of discountExpiryDate determination from query to ts logic
  • adding '32' as an environment variable to represent time window between execution time and discount expiry date

Testing

Execute the state machine and verify the object in the jsonpath get saved at filepath following the convention outlined above. Execute again and ensure the second file does not overwrite the first.

Screenshot 2025-02-03 at 17 41 34

@david-pepper david-pepper marked this pull request as ready for review February 3, 2025 17:40
@david-pepper david-pepper requested a review from a team February 3, 2025 17:42
@david-pepper david-pepper changed the title Discount expiry notifier handle multiple executions for given day Discount expiry notifier - handle multiple executions for given day Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant