singnet / snet-daemon

Service Daemon exposes an AI application as an API that is accessible through the SingularityNET Network. It handles all interaction with the blockchain for authorization and payment using AGI tokens and passes through API calls to the AI application.
MIT License
46 stars 49 forks source link

Update Daemon to handle latest license type structure supported #542

Open anandrgitnirman opened 3 years ago

anandrgitnirman commented 3 years ago
"licenses": {
    "tiers": [{
      "type": "Tier",
      "planName": "Tier AAA",
      "grpcServiceName": "ServiceA",
      "grpcMethodName": "MethodA",
      "range": [
        {
          "high": 100,
          "DiscountInPercentage": 3
        },
        {
          "high": 200,
          "DiscountInPercentage": 4
        },
        {
          "high": 300,
          "DiscountInPercentage": 6
        }
      ],
      "detailsUrl": "http://abc.org/licenses/Tier.html",
      "isActive": "true/false"
    },
     {
      "type": "Tier",
      "planName": "Tier BBB Applicable for All service.methods",
      "range": [
        {
          "high": 100,
          "DiscountInPercentage": 1
        },
        {
          "high": 200,
          "DiscountInPercentage": 1.75
        },
        {
          "high": 300,
          "DiscountInPercentage": 2.50
        }
      ],
      "detailsUrl": "http://abc.org/licenses/Tier.html",
      "isActive": "true/false"
    }],
    "subscriptions": {
      "type": "Subscription",
      "subscription": [
        {
          "periodInDays": 30,
          "DiscountInPercentage": 10,
          "planName": "Monthly For ServiceA/MethodA",
          "LicenseCost": 90,
          "grpcServiceName": "ServiceA",
          "grpcMethodName": "MethodA"
        },
        {
          "periodInDays": 30,
          "DiscountInPercentage": 12,
          "planName": "Monthly",
          "LicenseCost": 93
        },
        {
          "periodInDays": 120,
          "DiscountInPercentage": 16,
          "LicenseCost": 120,
          "planName": "Quarterly"
        },
        {
          "periodInDays": 365,
          "DiscountInPercentage": 23,
          "LicenseCost": 390,
          "planName": "Yearly"
        }
      ],
      "detailsUrl": "http://abc.org/licenses/Subscription.html",
      "isActive": "true/false"
    }
  }