@company-manager/docs

Subscriptions Domain

UML diagrams for subscription management, billing cycles, and renewals

Subscriptions Domain

The Subscriptions domain handles recurring billing, subscription lifecycle management, print/digital subscriptions, and integration with payment providers.

Domain Overview

graph TB
    subgraph "Subscription Management"
        SUB[Subscription]
        PRINT[Print Subscription]
        INVOICE[Subscription Invoice]
        PLAN[Subscription Plan]
    end

    subgraph "Billing"
        BILLING[Billing Cycle]
        PAYMENT[Payment Processing]
        DUNNING[Dunning/Relance]
    end

    subgraph "Customer"
        CONTACT[Contact]
        ADDRESS[Delivery Address]
        PREFS[Preferences]
    end

    subgraph "Integrations"
        STRIPE[Stripe]
        PLENIGO[Plenigo]
        ABOWEB[Aboweb]
    end

    SUB --> CONTACT
    SUB --> PLAN
    SUB --> INVOICE
    PRINT --> SUB
    PRINT --> ADDRESS

    BILLING --> SUB
    BILLING --> PAYMENT
    BILLING --> DUNNING

    PAYMENT --> STRIPE
    SUB --> PLENIGO
    PRINT --> ABOWEB

    style SUB fill:#e1f5fe
    style BILLING fill:#fff3e0

Entity Relationship Diagram

erDiagram
    TENANT ||--o{ SUBSCRIPTION : has
    CONTACT ||--o{ SUBSCRIPTION : subscribes
    SUBSCRIPTION ||--o{ SUBSCRIPTION_INVOICE : generates
    SUBSCRIPTION }o--|| SUBSCRIPTION_PLAN : uses
    SUBSCRIPTION ||--o| PRINT_SUBSCRIPTION : extends

    PRINT_SUBSCRIPTION }o--|| ADDRESS : delivered_to
    PRINT_SUBSCRIPTION ||--o{ PRINT_ISSUE_DELIVERY : tracks

    SUBSCRIPTION_INVOICE }o--|| PAYMENT_TRANSACTION : paid_by
    SUBSCRIPTION ||--o{ SUBSCRIPTION_PAUSE : may_have

    SUBSCRIPTION_REFERENCE_CODE ||--o{ SUBSCRIPTION : applied_to

    SUBSCRIPTION {
        string id PK
        string tenantId FK
        string contactId FK
        string planId FK
        enum status
        timestamp startDate
        timestamp endDate
        timestamp nextBillingDate
        decimal amount
        string currency
        enum billingInterval
        string stripeSubscriptionId
        string plenigoSubscriptionId
    }

    SUBSCRIPTION_PLAN {
        string id PK
        string tenantId FK
        string name
        decimal price
        string currency
        enum interval
        int intervalCount
        int trialDays
        json features
        boolean active
    }

    SUBSCRIPTION_INVOICE {
        string id PK
        string subscriptionId FK
        string invoiceNumber
        decimal amount
        enum status
        timestamp dueDate
        timestamp paidDate
        string stripeInvoiceId
    }

    PRINT_SUBSCRIPTION {
        string id PK
        string subscriptionId FK
        string deliveryAddressId FK
        int issuesRemaining
        timestamp lastIssueDate
        string routingCode
    }

    SUBSCRIPTION_PAUSE {
        string id PK
        string subscriptionId FK
        timestamp pauseStart
        timestamp pauseEnd
        string reason
    }

Key Business Processes

Subscription Lifecycle

Complete flow from signup to cancellation or expiry. View Lifecycle Details

Billing Cycles

Recurring billing, invoice generation, and payment processing. View Billing Details

Renewal & Cancellation

Subscription renewal flows and cancellation handling. View Renewal Details

Subscription Types

Digital Subscription

flowchart LR
    SIGNUP[Sign Up] --> PAYMENT[Payment]
    PAYMENT --> ACCESS[Grant Access]
    ACCESS --> RENEW[Auto-Renew]
    RENEW --> PAYMENT
flowchart LR
    SIGNUP[Sign Up] --> PAYMENT[Payment]
    PAYMENT --> SCHEDULE[Schedule Deliveries]
    SCHEDULE --> DELIVER[Deliver Issues]
    DELIVER --> TRACK[Track Delivery]
    TRACK --> RENEW[Renewal Notice]

Hybrid Subscription

flowchart LR
    SIGNUP[Sign Up] --> PAYMENT[Payment]
    PAYMENT --> DIGITAL[Digital Access]
    PAYMENT --> PRINT[Print Delivery]
    DIGITAL --> SYNC[Sync Content]
    PRINT --> DELIVER[Mail Delivery]

Integration Architecture

flowchart TB
    subgraph "Company Manager"
        SUB_SVC[Subscription Service]
        BILLING_SVC[Billing Service]
        CONTACT_SVC[Contact Service]
    end

    subgraph "Payment"
        STRIPE[Stripe]
        STRIPE_SUB[Stripe Subscriptions]
        STRIPE_INV[Stripe Invoicing]
    end

    subgraph "Publishing"
        PLENIGO[Plenigo]
        ABOWEB[Aboweb]
    end

    SUB_SVC <--> STRIPE_SUB
    BILLING_SVC <--> STRIPE_INV
    SUB_SVC <--> PLENIGO
    SUB_SVC <--> ABOWEB

    style STRIPE fill:#635bff,color:#fff
    style PLENIGO fill:#1a73e8,color:#fff

Subscription Metrics

MetricDescription
MRRMonthly Recurring Revenue
ARRAnnual Recurring Revenue
Churn RatePercentage of cancellations
LTVCustomer Lifetime Value
CACCustomer Acquisition Cost
Retention RatePercentage retained