MokoSuite CRM integration — license purchase, DLID delivery, customer portal #630

Closed
opened 2026-06-12 08:01:24 +00:00 by jmiller · 3 comments
Owner

Phase 5.1 — MokoSuite as Licensing Storefront

Parent: #616 | Depends on: #618, #619, #623

MokoSuite base + CRM IS the storefront for license sales. Not MokoSuiteShop — that's for selling products TO customers. MokoSuite sells itself.

CRM License Purchase Flow

  1. Product catalog: CRM products table has license-type products with product_tier field (pos, restaurant, suite, etc.)
  2. Order creation: Customer places order for a license product via CRM order system or public website
  3. DLID generation: On order completion, CRM calls Gitea API:
    POST /api/v1/licensing/licenses
    {
      "user_email": "customer@example.com",
      "tier": "pos",
      "max_domains": 5,
      "expires_months": 12
    }
    
  4. DLID delivery: CRM sends transactional email with DLID + setup instructions
  5. Invoice: CRM generates invoice linked to the license

CRM Customer Portal

Customer logs into CRM portal and sees:

  • Active licenses with DLID (masked, click to copy)
  • Tier and entitlement list
  • Activated domains with deactivate option
  • Expiry date with renewal button
  • Download links for entitled extensions
  • Order/invoice history for license purchases

CRM Admin License Management

Admin sees in CRM dashboard:

  • License sales metrics (new, renewed, churned)
  • Revenue by tier
  • Expiring licenses (30-day lookahead)
  • Customer license detail from contact record

Renewal Flow

  • CRM task scheduler sends renewal reminder emails (30 days, 7 days, expired)
  • Customer clicks renewal link -> CRM creates renewal order
  • On payment, CRM calls PATCH /api/v1/licensing/licenses/{id} to extend expiry
  • Same DLID, new expiry

Files to modify (MokoSuiteCRM)

  • Helper/LicenseHelper.php — already exists in Shop, move to CRM or create CRM version
  • api/src/Controller/CrmLicenseController.php — new API for license purchase flow
  • site/src/View/License/HtmlView.php — customer portal license view
  • admin/src/View/CrmLicenses/HtmlView.php — admin license sales dashboard

Acceptance criteria

  • License products purchasable through CRM order flow
  • DLID auto-generated via Gitea API on order completion
  • Customer portal shows license status, domains, entitlements
  • Renewal extends existing DLID without new key
  • Admin dashboard shows license sales metrics
  • Transactional email with DLID + Joomla setup instructions
## Phase 5.1 — MokoSuite as Licensing Storefront Parent: #616 | Depends on: #618, #619, #623 **MokoSuite base + CRM IS the storefront** for license sales. Not MokoSuiteShop — that's for selling products TO customers. MokoSuite sells itself. ### CRM License Purchase Flow 1. **Product catalog:** CRM products table has license-type products with `product_tier` field (pos, restaurant, suite, etc.) 2. **Order creation:** Customer places order for a license product via CRM order system or public website 3. **DLID generation:** On order completion, CRM calls Gitea API: ``` POST /api/v1/licensing/licenses { "user_email": "customer@example.com", "tier": "pos", "max_domains": 5, "expires_months": 12 } ``` 4. **DLID delivery:** CRM sends transactional email with DLID + setup instructions 5. **Invoice:** CRM generates invoice linked to the license ### CRM Customer Portal Customer logs into CRM portal and sees: - Active licenses with DLID (masked, click to copy) - Tier and entitlement list - Activated domains with deactivate option - Expiry date with renewal button - Download links for entitled extensions - Order/invoice history for license purchases ### CRM Admin License Management Admin sees in CRM dashboard: - License sales metrics (new, renewed, churned) - Revenue by tier - Expiring licenses (30-day lookahead) - Customer license detail from contact record ### Renewal Flow - CRM task scheduler sends renewal reminder emails (30 days, 7 days, expired) - Customer clicks renewal link -> CRM creates renewal order - On payment, CRM calls `PATCH /api/v1/licensing/licenses/{id}` to extend expiry - Same DLID, new expiry ### Files to modify (MokoSuiteCRM) - `Helper/LicenseHelper.php` — already exists in Shop, move to CRM or create CRM version - `api/src/Controller/CrmLicenseController.php` — new API for license purchase flow - `site/src/View/License/HtmlView.php` — customer portal license view - `admin/src/View/CrmLicenses/HtmlView.php` — admin license sales dashboard ### Acceptance criteria - [ ] License products purchasable through CRM order flow - [ ] DLID auto-generated via Gitea API on order completion - [ ] Customer portal shows license status, domains, entitlements - [ ] Renewal extends existing DLID without new key - [ ] Admin dashboard shows license sales metrics - [ ] Transactional email with DLID + Joomla setup instructions
Author
Owner

Branch created: feature/630-shop-integration-auto-generate-dlid-on-l

git fetch origin
git checkout feature/630-shop-integration-auto-generate-dlid-on-l
Branch created: [`feature/630-shop-integration-auto-generate-dlid-on-l`](https://code.mokoconsulting.tech/MokoConsulting/MokoGitea-APP/src/branch/feature/630-shop-integration-auto-generate-dlid-on-l) ```bash git fetch origin git checkout feature/630-shop-integration-auto-generate-dlid-on-l ```
jmiller changed title from Shop integration — auto-generate DLID on license product purchase to MokoSuite CRM integration — license purchase, DLID delivery, customer portal 2026-06-12 08:10:10 +00:00
Author
Owner

MokoSuite-Side Implementation — Issues Created

The MokoSuite side of this integration is now tracked across multiple repos, with CRM as the controlling system:

Issues Created

  • MokoSuiteClient (Base): LicenseValidator — core DRM, DLID validation, module gating (code built + pushed)
  • MokoSuiteCRM #57: License key management (CRUD, customer portal)
  • MokoSuiteCRM #58: Master license orchestration hub
  • MokoSuiteShop #28: License purchase + DLID delivery
  • MokoSuitePOS #28: License counter sales
  • MokoSuiteERP #50: Revenue recognition + update server proxy
  • MokoSuiteHRM #17: Developer seat licensing

Architecture

MokoGitea-Fork (#615-#631) ← Go server
    ↕ REST API
MokoSuiteClient (Base) → LicenseValidator ← built ✓
    ↕
MokoSuiteCRM #57/#58 → License CRUD (controlling)
    ↕           ↕           ↕          ↕
Shop #28    POS #28    ERP #50    HRM #17

LicenseValidator (already built)

  • Validates DLID against git.mokoconsulting.tech/api/v1/licenses/validate
  • 24h response caching (SHA-256 hashed DLID)
  • isEntitled() maps all 12 module extensions to Gitea repos
  • Daily task scheduler for revalidation + heartbeat
  • Grace period support (7 days default)
## MokoSuite-Side Implementation — Issues Created The MokoSuite side of this integration is now tracked across multiple repos, with **CRM as the controlling system**: ### Issues Created - **MokoSuiteClient (Base)**: LicenseValidator — core DRM, DLID validation, module gating (**code built + pushed**) - **MokoSuiteCRM #57**: License key management (CRUD, customer portal) - **MokoSuiteCRM #58**: Master license orchestration hub - **MokoSuiteShop #28**: License purchase + DLID delivery - **MokoSuitePOS #28**: License counter sales - **MokoSuiteERP #50**: Revenue recognition + update server proxy - **MokoSuiteHRM #17**: Developer seat licensing ### Architecture ``` MokoGitea-Fork (#615-#631) ← Go server ↕ REST API MokoSuiteClient (Base) → LicenseValidator ← built ✓ ↕ MokoSuiteCRM #57/#58 → License CRUD (controlling) ↕ ↕ ↕ ↕ Shop #28 POS #28 ERP #50 HRM #17 ``` ### LicenseValidator (already built) - Validates DLID against `git.mokoconsulting.tech/api/v1/licenses/validate` - 24h response caching (SHA-256 hashed DLID) - `isEntitled()` maps all 12 module extensions to Gitea repos - Daily task scheduler for revalidation + heartbeat - Grace period support (7 days default)
Author
Owner

Gitea Side Complete — CRM Integration Tracked Separately

All Gitea licensing API endpoints are implemented (#617-#624, #627). The CRM-side implementation is tracked in:

  • MokoSuiteCRM #57 — License key management in CRM
  • MokoSuiteCRM #58 — Bridge orchestration hub

Full API reference posted as comment on MokoSuiteCRM #57.

## Gitea Side Complete — CRM Integration Tracked Separately All Gitea licensing API endpoints are implemented (#617-#624, #627). The CRM-side implementation is tracked in: - MokoSuiteCRM #57 — License key management in CRM - MokoSuiteCRM #58 — Bridge orchestration hub Full API reference posted as comment on MokoSuiteCRM #57.
Sign in to join this conversation.