TM Forum Community

 View Only
  • 1.  TMF654: Accumulated Balance

    TM Forum Member
    Posted Sep 19, 2023 00:57

    Hi

    The id that we pass in the parameter of TMF654(Prepay balance management) - Accumulated balance API denotes what? Is that an id that we should create for each partyAccount while creating the first bucket and hold all the buckets specific to that account? Please elaborate on how does accumulated balance work. Thank you


    #General

    ------------------------------
    Suganthan Chandrasekaran
    Blueoceandigital India Pvt Ltd
    ------------------------------


  • 2.  RE: TMF654: Accumulated Balance

    TM Forum Member
    Posted Sep 29, 2023 08:15

    Hi, 

    Looking at the API and the details around it it I see there is no use case describing its use and that is a pity. Each individual balance/bucket will have their own identity given upon creation. A customer/user/entity can have 0 or more buckets. When looking at the resource, operation and samples provided I see that the accumulated balance has an ID itself in the below sample 6956 and it is related to one bucket with ID 11. 

    {
        "bucket": [
            {
                "id": "11",
                "href": "https://mycsp.com:8080/tmf-api/prepayBalanceManagement/v4/bucket/11"
            }
        ],
        "description": "an accumulation of balances",
        "href": "https://mycsp.com:8080/tmf-api/prepayBalanceManagment/v4/accumulatedBalance/6956",
        "id": "6956",
        "logicalResource": [
            {
                "id": "22",
                "href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v4/logicalResource/22",
                "@type": "MSISDN",
                "@baseType": "logicalResource",
                "value": "07645233482"
            }
        ],
        "name": "accumulatedBalance",
        "partyAccount": {
            "id": "acc1",
            "href": "https://mycsp.com:8080/tmf-api/accountManagement/v4/account/acc1"
        },
        "product": [
            {
                "id": "prd1",
                "href": "https://mycsp.com:8080/tmf-api/productInventory/v4/product/prd1"
            }
        ],
        "relatedParty": [
            {
                "id": "5",
                "href": "https://mycsp.com:8080/tmf-api/customerManagement/customer/22",
                "name": "jerry lewis",
                "role": "customer",
                "@referredType": "Customer"
            }
        ],
        "totalBalance": {
            "amount": 900,
            "units": "MB"
        }
    }

    In the operation for List the accumulated balance has an ID of 55 as a unique Identifier and it has buckets 11 and 12 included in it. 


    Request

    GET /tmf-api/prepayBalanceManagement/v4/accumulatedBalance?product.id=prd1
    Accept: application/json



    Response

    200

    {
        "id": "55",
        "href": "https://mycsp.com:8080/tmf-api/prepayBalanceManagement/v4/bucket?product.id=12345&bucketBalance[usageType==\"data\"]",
        "description": "The query used to fetch the accumulated balance",
        "@type": "AccumulatedBalance",
        "@baseType": "Entity",
        "bucket": [
            {
                "id": "11",
                "href": "https://mycsp.com:8080/tmf-api/prepayBalanceManagement/v4/bucket/11"
            },
            {
                "id": "12",
                "href": "https://mycsp.com:8080/tmf-api/prepayBalanceManagement/v4/bucket/12"
            }
        ],
        "partyAccount": {
            "id": "acc1",
            "href": "https://mycsp.com:8080/tmf-api/accountManagement/v4/account/acc1"
        },
        "product": [
            {
                "id": "prd1",
                "href": "https://mycsp.com:8080/tmf-api/productInventory/v4/product/prd1"
            }
        ],
        "relatedParty": [
            {
                "id": "cust1",
                "href": "https://mycsp.com:8080/tmf-api/customerManagement/customer/cust1",
                "name": "jerry watts",
                "role": "customer",
                "@referredType": "Customer"
            }
        ],
        "totalBalance": {
            "amount": 200,
            "units": "MB"
        }
    }

    As there is no create accumulated, I would assume that the ID is generated as part of the list request to then be able to re-query it, but that is guessing without having more guideline in the user guide. 

    My recommendation is to look at your use case and see how you would use the accumulate balance part. You do have TMF677 that in a way is similar to retrieve balances. 



    ------------------------------
    Elisabeth Andersson
    MATRIXX Software
    ------------------------------



  • 3.  RE: TMF654: Accumulated Balance

    TM Forum Member
    Posted Oct 02, 2023 01:27

    An addressable resource in TM Forum Open APIs contains the id and href attributes. Logically the resource path /prepayBalanceManagement/accumulatedBalance is a collection of items representing accumulated balances. When producing this API you should ensure that each time you create an AccumulatedBalance item it is assigned a unique id. I'm not looking at the CTK but I assume it doesn't require you to support a GET operation on /accumulatedBalance/{id} so 404 (Not Found) would be fine, however if you return 200 (OK) the body MUST be the same as when it was created. In other words these are unique and (possibly) ephemeral resources. If you're thinking the resources shouldn't be addressable, think about it in event notifications and logging.



    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------