Skip to content

Change record usage UI to take into consideration aviate based usage plans #647

Description

@reshmabidikar

Recently, we added a feature to record usage via Kaui. Kaui simply invokes the Record Usage API to record the usages. However, if the subscription is created corresponding to an aviate based usage plan (that has a billing meter), this would not work.  For such plans, usages need to be recorded via the Submit Usage Events API.

Changes on the Kaui side:

  1. Invoke the https://apidocs.killbill.io/aviate-catalog#get-catalog-info to determine if the catalog is XML based or Aviate based
  2. If the catalog is XML based, keep the same behavior as current - show the current form and invoke the Record Usage API to record the usages on submit
  3. If the catalog is Aviate based, show a form that allows submitting the following data and invoke the Submit Usage Events API:
    • billingMeterCode
    • subscriptionId (may not require a separate field)
    • trackingId
    • timestamp
    • value

Some notes:

  1. All the fields between the Record Usage Form and Submit Usage Events form are the same, except for the unit field, so the Record Usage API requires the unit field while the Submit Usage Events API requires the billingMeterCode field. So maybe we should show the same form but only change the label of the field to either unit or billingMeterCode depending on the type of the catalog
  2. Maybe we should show some tooltip or help information, so users are not confused about why they sometimes see the unit field and why they sometimes see the billingMeterCode field.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions