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

Open
opened 2026-06-12 08:01:24 +00:00 by jmiller · 1 comment
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
Sign in to join this conversation.