Genability / genability-js

Node.js and Browser Javascript SDK for Genability APIs.
MIT License
0 stars 2 forks source link

propertyTypes in TariffProperty defined as an array #137

Closed aqbalahmad closed 3 years ago

aqbalahmad commented 3 years ago
export interface TariffProperty extends GenPropertyKey {
    period?: Period;
    propertyTypes: TariffPropertyType[];
    operator: string;
    propertyValue?: string;
    minValue?: string;
    maxValue?: string;
    isDefault: boolean;
}
jasonriley commented 3 years ago

Correct. Despite the name being plural, it should be signular. Here's the java code on the server.

    public TariffPropertyType getPropertyTypes() {
        return propertyTypes;
    }

    public void setPropertyTypes(TariffPropertyType propertyTypes) {
        this.propertyTypes = propertyTypes;
    }
aqbalahmad commented 3 years ago

Correct. Despite the name being plural, it should be signular. Here's the java code on the server.

  public TariffPropertyType getPropertyTypes() {
      return propertyTypes;
  }

  public void setPropertyTypes(TariffPropertyType propertyTypes) {
      this.propertyTypes = propertyTypes;
  }

Hi @jasonriley

We are still getting propertyTypes in the response from tariff API. It should be propertyType based on changes in this PR. Please look into this ASAP.

It is blocker for this issue.

jasonriley commented 3 years ago

Here's an example from a real tariff. What is the issue here?

  "properties": [
    {
      "keyName": "isNEM2",
      "quantityKey": null,
      "displayName": "Is NEM2 Tariff",
      "family": "billing",
      "keyspace": "electricity",
      "description": "Is this a California NEM 2.0 tariff.  True is a NEM 2.0 tariff, false is NOT a NEM 2.0 tariff.",
      "dataType": "BOOLEAN",
      "propertyTypes": "APPLICABILITY",
      "operator": "=",
      "propertyValue": "false",
      "isDefault": true
    },

I believe the SDK code should be ...

propertyTypes: TariffPropertyType;

We are not changing the server side. Its been that way for 8 years and all our customers use it.

aqbalahmad commented 3 years ago

Ok, I'll change the SDK code for this and merge.