Database Models

Subscribers and providers are both instances of Organization. This is done such that one can be a subscriber to a Plan for a service hosted on the broker website as well as itself a provider to other subscribers. (ex: An organization can provide a CRM tool to subscribers while paying another app, also hosted on the broker platform, to display usage analytics of its own product). It is possible to implement a symmetric double-entry bookkeeping ledger by having a single model Organization.

Typically if you are self-hosting a pure Software-as-a-Service, as opposed to building a marketplace, you will define a single provider which incidently is also the the broker (See examples).

A billing profile (credit card and deposit bank account) is represented by an Organization. An Organization subscriber subscribes to services provided by another Organization provider through a Subscription to a Plan. An Organization represents a billing profile. The processor_card_key and processor_deposit_key fields are respectively used when an organization acts as a subscriber or provider in the subscription relationship.

There are no mechanism provided to authenticate as an Organization. Instead User authenticate with the application (through a login page or an API token). They are then able to access URLs related to an Organization based on their relation with that Organization as implemented by a RoleDescription. For historical reasons, two roles are often implemented: managers and contributors (for details see Security).

_images/saas-models.svg

Organization can be semantically separated in four categories, processor, broker, providers and subscribers.

  • subscribers: organizations that subscribe to one or multiple Plan.

  • providers: organizations that provides plans others can subscribe to.

  • broker: The provider that controls the website.

  • processor: The organization / backend actually processing the charges.

In a pure Software-as-a-Service setup, there is only one provider which is by definition the broker.

In a marketplace setup, there might be multiple providers even though there is only one broker, always. The broker controls the domain name on which the site is hosted.