Skip to content

Create an EntityType class to encapsulate constants associated with Dioptra Resources #651

@keithmanville

Description

@keithmanville

Implement a new EntityType dataclass that encapsulates constants associated with Dioptra Resources.

The implementation may look something like this.

@dataclass
class EntityType:
    name: str
    key: str
    id: int

QUEUE_TYPE = EntityType("Queue", "queue", 1)
EXPERIMENT_TYPE = EntityType("Experiment", "experiment", 2)
PLUGIN_FILE_TYPE = EntityType("Plug-in File", "plugin_file", 3)

Definition of done

  • identify all constants that need to be defined for each resource
  • Implement the dataclass and instantiate instances of the new dataclass for each Dioptra resource
  • Remove and duplicative constants and replace with references to new dataclass
  • All existing tests pass
  • The feature is merged into dev

Metadata

Metadata

Labels

refactorChanges that neither fix a bug nor add a feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions