For product-manager, there still have some missing things need to be finished. Those features and reworks mostly based on two utility which recently introduced.

Schedules based on airflow

  1. nextResetAt reached.

  2. autodebitAt reached.

Posting library

As we are using posting library to process transactions with TM, the process for pay subscription fee and waive subscription fee need to be updated to using the posting library too.

  1. Refactor pay subscription fee to use posting library

  1. Refactor waive subscription fee to use posting library

Other reworks

Currently we have a big issue with pay and waive subscription fee. Let me describe the reason first.

Process with transaction now is send a kafka message to TM, and the process result will be returned by Kafka too. That means the process is async, we need to update transaction status after receiving the result message from TM.

But the implementation now is sync, this means after sent message to TM, the status will be updated immediately, and whatever TM returns, we just recorded a transaction and no more update of customer subscriptions.

Deeper into pay subscription fee, currently after sent message to TM, codes will update customer subscription’s autodebitAt to next month, this means the subscription already been renewal, even if TM returns with failure, it won’t reupdate the status to freeze.

And for waive subscription fee, there is much worse. When committed a waive subscription fee transaction, we will send a post to TM and will never update the status of customer subscription. When the result is return from TM, we will record an entity of waived fee transaction. And this record will be used to check if original fee transactions have been waived.

This will cause two bigger issues: First, if TM has processed successfully which means money have return to customers, and the record of waive fee transaction haven’t saved successfully, customers can commit waive again, and customers will receive another waived fee which should not happened.

The second is after waived subscription, we were not update the status of subscription. If it has rest free use of operations, user still can use this operation.

Todo lists

  • Continue on refactor pay subscription fee. SM-6857 - Update subscription fee charging In Progress
  • Implement the process of nextResetAt reached.
  • Refactor pay subscription fee to use posting library.
  • Refactor waive subscription fee to use posting library.
  • refactor pay subscription fee, status update of customer subscription should be processed after receive the result of TM. We also lost to set customer subscription to frozen if transaction failed.
  • refactor waive subscription fee, status of customer subscription should be set to forzen if fee already waived.
  • upgradeCustomerSubscription should require to be charged if no free subscription existed.