From 531ff9ddab399112d7eee8f84e3334e119e03fc6 Mon Sep 17 00:00:00 2001 From: Alan Pinkert Date: Tue, 30 Apr 2024 19:24:51 -0400 Subject: [PATCH 1/2] use string enums for natural gas company --- rules-engine/src/rules_engine/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules-engine/src/rules_engine/parser.py b/rules-engine/src/rules_engine/parser.py index e90ac7fd..93e89ac8 100644 --- a/rules-engine/src/rules_engine/parser.py +++ b/rules-engine/src/rules_engine/parser.py @@ -10,9 +10,9 @@ from .pydantic_models import NaturalGasBillingInput, NaturalGasBillingRecordInput -class NaturalGasCompany(Enum): - EVERSOURCE = 1 - NATIONAL_GRID = 2 +class NaturalGasCompany(str, Enum): + EVERSOURCE = "eversource" + NATIONAL_GRID = "national_grid" class _GasBillRowEversource: From cfeaa7d28d5832b20c961d695cafafff6ee9680a Mon Sep 17 00:00:00 2001 From: Alan Pinkert Date: Tue, 30 Apr 2024 20:07:02 -0400 Subject: [PATCH 2/2] use StrEnum --- rules-engine/src/rules_engine/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules-engine/src/rules_engine/parser.py b/rules-engine/src/rules_engine/parser.py index 93e89ac8..54aff093 100644 --- a/rules-engine/src/rules_engine/parser.py +++ b/rules-engine/src/rules_engine/parser.py @@ -5,12 +5,12 @@ import csv import io from datetime import datetime, timedelta -from enum import Enum +from enum import StrEnum from .pydantic_models import NaturalGasBillingInput, NaturalGasBillingRecordInput -class NaturalGasCompany(str, Enum): +class NaturalGasCompany(StrEnum): EVERSOURCE = "eversource" NATIONAL_GRID = "national_grid"