django-flexible-subscriptions icon indicating copy to clipboard operation
django-flexible-subscriptions copied to clipboard

Link a subscription to an entity other than the user

Open ronflima opened this issue 4 years ago • 11 comments

For common scenarios, a subscription is normally linked to a subscriber, and the subscriber is commonly a user. However, there are scenarios where the subscriber is not a user, but another entity. This is a very common scenario when the user is the payment responsible in a large account structure: an entity dependent on the user is the subscriber, but the user is the one who pays for all subscriptions under his structure.

Since the large account structure is not previously known, billing it should be subject of a custom account traversal, which can be accomplished by a custom callback as part of its customization.

ronflima avatar May 19 '20 18:05 ronflima

Sounds very reasonable in theory. I will be honest that I probably won't be able to get to this in the near future given other commitments. I would be happy to review/discuss some thoughts on implementation +/- review any PRs. Otherwise we can keep this issue open and when I finally get some time to do some dedicated maintenance to this library I can take a stab at it.

studybuffalo avatar May 20 '20 12:05 studybuffalo

In fact, this is how telecom billing software works. I was the maintainer of BSCS, a German billing solution for mobile platforms (today owned by Ericsson). I´ll try to analyze your solution and structure a way to give it support to large accounting structure and hierarchical billing, which is a neat feature of BSCS.

For instance, only to illustrate with a practical scenario: in Telecom´s it is common to have a company to buy corporate plans to lend corporate cell phones to its employees. The company is responsible to pay all call usage. But each employee is billed separately, loading all costs to the company itself.

In fact the software I´m current developing aimed for digital marketing agencies uses a similar approach. After analyzing several projects in Github I found yours which is pretty complete but lacks large account structures.

Please, leave this issue opened. As soon as possible I´ll provide a PR or even more comments to help you out with this.

ronflima avatar May 21 '20 12:05 ronflima

Hello @studybuffalo @ronflima

First of all, thank you so much for this nice project and appreciate your efforts . We need to use this project for the subscribers to get them subscribe/purchase services from telecom operators these services are called MUCs(Marketing use cases) such CUG(closed user group) ,FnF(friend and family) ,,etc and for the payment need to use the API provided by the OCS(ONLINE CHARGING SYSTEM) which the subscribers's account/balance exists there on OCS for the direct debit the subscription fees or the periodic fees,,etc..

Kindly help with the below: Can we use Subscribers instead of users, and use the API provided by the OCS for the payment/direct/online charge?

Thank you a lot in advance Waled

WaledEzzi avatar Dec 01 '23 01:12 WaledEzzi

Hello @studybuffalo @ronflima

First of all, thank you so much for this nice project and appreciate your efforts . We need to use this project for the subscribers to get them subscribe/purchase services from telecom operators these services are called MUCs(Marketing use cases) such CUG(closed user group) ,FnF(friend and family) ,,etc and for the payment need to use the API provided by the OCS(ONLINE CHARGING SYSTEM) which the subscribers's account/balance exists there on OCS for the direct debit the subscription fees or the periodic fees,,etc..

Kindly help with the below: Can we use Subscribers instead of users, and use the API provided by the OCS for the payment/direct/online charge?

Thank you a lot in advance Waled

Hi, Waled!

I'm away from this project for a long time and now I have the time to go through it. I'm about to fork this repo and start analyzing it. When the time comes, I'll contact you to gather more details on your use case and try to generalize it in a way we can implement it as a general customizable solution.

Cheers,

Ronaldo

ronflima avatar Dec 01 '23 10:12 ronflima

Thank you Ronaldo for your response .. Could please tell me by when we can work together on this ?

REgards, Waled

WaledEzzi avatar Dec 02 '23 22:12 WaledEzzi

Thank you Ronaldo for your response .. Could please tell me by when we can work together on this ?

REgards, Waled

I'm already on it. But I can't say when it will be available. Need to think well about how to deal with backward compatibility.

ronflima avatar Dec 03 '23 11:12 ronflima

Just for the record: I have created this issue in order to upgrade the support to the latest python version.

ronflima avatar Dec 03 '23 13:12 ronflima

Hello Ronaldo.

Kindly have you got time to work on this case,and in case you need more info about the flow of the desired solution I am here!

Thank you in advance Waled

WaledEzzi avatar Mar 29 '24 21:03 WaledEzzi

Hi, Waled. No, I haven't. I'm about to start a new project using django, and I'll be tackling this starting this week. Last year was a mess. I got laid off and my end of year was a little messy. But things are quite right now.

Cheers,

Ronaldo

ronflima avatar Mar 31 '24 01:03 ronflima

Thank you Ronaldo for your feedback,, PLease let me know so I might here here with any information,

WaledEzzi avatar Apr 12 '24 19:04 WaledEzzi

Thank you Ronaldo for your feedback,, PLease let me know so I might here here with any information,

I'm slow for this, my friend. These days I'm very busy at work. But I'm working it during the weekends, when possible. I'm on it right now.

I'm studying this possibility:

  • Rename UserSubscription to PlanSubscription, so it will make the model more general with better semantics.
  • Rename the foreign key user to subscriber, because we are generalizing the subscriber to something else than a user.
  • Add a new key to settings, which points to a model that should replace the User model. It will defaults to User model through get_user_model function. If set, it will use whatever is the model that is configured.

It is just a possibility right now because I still need to go deeper in the code to be sure.

ronflima avatar Apr 13 '24 13:04 ronflima