Skip to main content

Business Services Overview

The Business Services layer is the heart of the SureInk Platform. It orchestrates the complex relationships between customers, the products they buy, and the rules that govern their usage.

Summary

This section details the core domain models and workflows that drive the platform's revenue and entitlement engines. It covers the lifecycle from an initial Quote to a finalized Agreement, the provisioning of Subscriptions and Licenses, and the ongoing tracking of Usage and Invoices.

Business Services Model and Hierarchy

The platform's business logic is structured around several key hierarchies that define how entities interact.

Entity Relationships

Core Hierarchies

  1. Entitlement Hierarchy:

  2. Commerce Hierarchy:

  3. Identity Hierarchy:

    • Customers: The business entities.
    • Contacts: The individuals associated with customers.
    • Projects: Organizational units for agreements.
  4. Governance Hierarchy:

    • Agreements: Define the high-level terms.
    • Policies: Specific constraints derived from agreements.
    • Rules: Logic that enforces policies.
    • Resources: Assets protected by rules.
    • Usage: Consumption of resources.

Functional Overview (Cloud MSA)

  • Subscription Management: Handling creation, updates, and cancellations of Master Subscription Agreements.

  • License Lifecycle: Generating, signing (.p12 keys), and managing software licenses.

  • Order Processing: Calculating totals, handling carts, and processing payments via Stripe.

  • Business Rules: Applying logic for pricing, discounts, and feature accessibility.

  • Reporting: Generating metrics for revenue, license conversion, and subscriber growth.

Major Code Modules (com.sureink.cloudmsa)

  • controller: Exposes REST endpoints for Cart, License, Order, Product, Subscription, and Report.
  • service: Implements core business logic (e.g., SubscriptionService, ProjectService, MasterSubscriptionAgreementService).
  • repository: JPA repositories for persisting entities in the cloudmsa database schema.
  • event: Publishers and listeners for Kafka events (e.g., LicenseCreatedEvent, OrderProcessedEvent).
  • client: Feign clients for interacting with sureink-customer and sureink-usage-data.
  • util: Helper classes like OrderCalculator and ProductCodeGenerator.

Linkages and References

  • Central Role: This service serves as the primary backend for the SureMSA Angular UI.
  • Downstream Links:
    • Uses Connector for Salesforce/Stripe sync.
    • Uses Customer for tenant and contact details.
    • Uses Usage Data to validate license consumption.
  • Security: Secured via Keycloak with role-based access control (@RolesAllowed("user")).