Skip to content

Commit

Permalink
Recurring payments (#1816)
Browse files Browse the repository at this point in the history
* Feature branch rp job

* Initial setup RP job (#1769)

* Initial setup RP job

https://eaflood.atlassian.net/browse/IWTF-3381

Setup recurring payment job

* initial setup

* Update docker/README.md

Co-authored-by: Iris Faraway <[email protected]>

* update readme

* update license

* add console log for when rp running

* setup docker so picks up commands run tomprove running

* LICENSE

---------

Co-authored-by: Iris Faraway <[email protected]>

* Retrieve recurring payments

https://eaflood.atlassian.net/browse/IWTF-3617

Recurring Payments Job to retrieve the recurring payments due on the current day

* grab rp

* working rpjob

* update error in tranaction.schema

* prettier readme

* remove console logs

* Updated following comments in PR, pushing to fix test

* Update dependencies, fix lint errors

* push changes for support

* update getRecurringPayments

* updated env files, remove logs, add date, refactor tests

* lint errors

* code smells

* remove console logs

* fix broken test

* fix code smell

* remove await

* code coverage

* update tests and package.json

* npm install on rp job folder

* remove package-lock and run npm install

* update package-lock and package references

* changes made following pr comments

* update package.json

* update entity tests, add comments where changes are needed

* Amend so that we expand contact and active permission in a single fetc
h, plus filter just on date when retrieving recurring payments

* Fixed process transaction queue tests

* Fix recurring payment service tests

* Update dependencies

* Fix more dependencies

* Dependencies. Yeah.

* new version of recurring-payments-job

* Update package lock for recurring payments job

* Remove automock and add manual mock to work around weird failure

* Fix RP query test

* Fix code smell

* Remove phone from content in text message option (#1826)

* Remove phone from content in text message option

https://eaflood.atlassian.net/browse/IWTF-3861

Remove the word phone from the content for a text message option

* added welsh

* chore(release): publish v1.37.0-rc.7

* rename tests, change date format and update tests

* remove mockRestore

---------

Co-authored-by: Iris Faraway <[email protected]>
Co-authored-by: Phil Benson <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
4 people authored Jan 3, 2024
1 parent 2b1ede0 commit 2d02548
Show file tree
Hide file tree
Showing 37 changed files with 2,253 additions and 789 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ packages/
> Handles processing of post-office counter sales
- [fulfilment-job](packages/fulfilment-job/README.md)
> Handles processing of licence fulfilment requirements
- [recurring-payments-job](packages/recurring-payments-job/README.md)
> Handles processing of recurring payments
docker/

Expand Down
2 changes: 2 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ cp pocl_job.env.example .pocl_job.env
cp sales_api.env.example .sales_api.env
cp sales_api.secrets.env.example .sales_api.secrets.env
cp sqs_receiver.env.example .sqs_receiver.env
cp recurring_payments_job.env.example .recurring_payments_job.env
cp recurring_payments_job.secrets.env.example .recurring_payments_job.secrets.env
```

### How to run
Expand Down
11 changes: 11 additions & 0 deletions docker/env/recurring_payments_job.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
####################################################################################
# Recurring Payments Job
####################################################################################
NODE_ENV=development

# Recurring Payments feature switch
RUN_RECURRING_PAYMENTS=true

# Sales API
SALES_API_URL=http://host.docker.internal:4000
SALES_API_TIMEOUT_MS=120000
15 changes: 15 additions & 0 deletions docker/env/recurring_payments_job.secrets.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
####################################################################################
# Recurring Payment Job Secret Environment Variables
####################################################################################

# Global OAuth Settings
OAUTH_AUTHORITY_HOST_URL=<insert here>
OAUTH_TENANT=<insert here>

# Dynamics instance-specific settings
OAUTH_CLIENT_ID=<insert here>
OAUTH_CLIENT_SECRET=<insert here>
OAUTH_SCOPE=<insert here>

DYNAMICS_API_PATH=<insert here>
DYNAMICS_API_VERSION=<insert here>
9 changes: 9 additions & 0 deletions docker/services.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,12 @@ services:
build:
<<: *common-build-options
dockerfile: packages/sqs-receiver-service/${PROJECT_DOCKERFILE:-Dockerfile}

##############################################################################################################
# rod-licensing recurring_payments_job
##############################################################################################################
recurring_payments_job:
image: rod_licensing/recurring_payments_job:${TAG:-latest}
build:
<<: *common-build-options
dockerfile: packages/recurring-payments-job/${PROJECT_DOCKERFILE:-Dockerfile}
16 changes: 16 additions & 0 deletions docker/services.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ services:
restart_policy:
condition: on-failure

##############################################################################################################
# rod_licensing recurring_payments_job
##############################################################################################################
recurring_payments_job:
image: rod_licensing/recurring_payments_job:${TAG:-latest}
volumes:
- ../:/app
env_file:
- ./env/.recurring_payments_job.env
- ./env/.recurring_payments_job.secrets.env
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure

#######################################################
# Network configuration
#######################################################
Expand Down
14 changes: 14 additions & 0 deletions docker/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,17 @@ services:
replicas: 1
restart_policy:
condition: on-failure

##############################################################################################################
# rod_licensing recurring_payments_job
##############################################################################################################
recurring_payments_job:
image: rod_licensing/recurring_payments_job:${TAG:-latest}
env_file:
- ./env/.recurring_payments_job.env
- ./env/.recurring_payments_job.secrets.env
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
Loading

0 comments on commit 2d02548

Please sign in to comment.