distributed-it-for-telco / distributed-rating-poc

Proof of concept illustrating a sample implementation of wasmCloud-based distributed rating
1 stars 1 forks source link

Seeding data

prerequiests:

to deploy the app

prerequiests:

- wash installed v 20
- redis kv store installed 

steps

distributed-rating-poc

Proof of concept illustrating a sample implementation of wasmCloud-based distributed rating

Software arhitecture

Business use cases:

Rate using Post Paid bucket

- As A Customer  I selected a bundled service of 3 movies for 1  dollar THEN I can consume this service from a providers mobile app And I can see the correct rate reflected in my bill

Agents:

Metaverse Advertiser offering movies through meta room

Metaverse advertiser offer vod/ movie service though his meta room.

Agent

- orange_vod_metaverse

Sample Curl Request

Room usage

 curl --location --request POST 'http://localhost:8070/usage/rating' \
    --header 'cf-ipcountry: EG' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "customerId":"advertiser1",
      "usage": {
        "usageCharacteristicList": [
            {
                  "name":"room-entering-usage",
                  "value":"1",
                  "valueType":"integer"
            }
          ]
      },   
      "agentId": "orange_vod_metaverse"
  }'
Response
{
    "authorizationStatus": {
        "code": 200,
        "key": "This user is authorized to use this service"
    },
    "billingInformation": {
        "messages": [
            " 1 will be deducted from your balance",
            " Your Balance now is 992 EUR"
        ],
        "price": "1",
        "unit": "EUR"
    }
}

Movie usage

 curl --location --request POST 'http://localhost:8070/usage/rating' \
    --header 'cf-ipcountry: EG' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "customerId":"advertiser1",
      "usage": {
        "usageCharacteristicList": [
            {
                  "name":"movie-usage",
                  "value":"1",
                  "valueType":"integer"
            }
          ]
      },   
      "agentId": "orange_vod_metaverse"
  }'
Response
{
  "authorizationStatus": {
    "code": 200,
    "key": "This user is authorized to use this service"
},
  "billingInformation": {
    "messages": [
        " 2 will be deducted from your balance",
        " Your Balance now is 992 EUR"
    ],
    "price": "2",
    "unit": "EUR"
  }
}

Metaverse User topup their balance

Metaverse User topup their balance

Agent

- balancemanager

Sample Curl Request

 curl --location --request POST 'http://localhost:8070/usage/balance/topup' \
    --header 'cf-ipcountry: EG' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "customerId":"advertiser1",
      "amount": "10",
      "offer_id": "metaverse-vod"
  }'
Response
{
  "balanceCharacteristic": {
    "count": 1059.0,
    "unit": "EUR"
    },
  "party_id": ""
}