The WorkMetadata class is a TypeScript class that implements the IWorkMetadata interface and contains properties for description, external reference, estimated time, and estimated cost.

Hierarchy (View Summary)

Implements

Constructors

Properties

description: string = ''

The description property is used to store a string that provides a description or additional information about a particular entity. It is commonly used in metadata interfaces to provide a description of the entity being described. For example, in the IMetadata interface, the description property is used to describe the metadata of a node, such as a requirement, test, or structure.

estimateCost: string = ''

work_estCost

estimateTime: string = ''

work_estTime

external: ExternalDigitalPlatform = ...
path: string[] = []
ref_extern: string = ''

ref_extern property is used to store a reference to an external system, which can be an id or token.

status: string = ''

Accessors

Methods

  • The function assigns metadata to an object and returns the updated object.

    Parameters

    • metadata: Record<string, any>

      The metadata parameter is an object that contains key-value pairs. The keys are strings, and the values can be of any type.

    Returns any

    the object that the method is being called on (i.e., this).

  • The function takes in a metadata object, ensures its structure, flattens it, merges it with the existing metadata of the object, and returns the updated metadata object.

    Parameters

    • metadata: Record<string, any>

      The metadata parameter is an object that contains key-value pairs representing metadata information. The keys are strings, and the values can be of any type.

    Returns any

    the metadata object with any missing keys from the original object added.

  • The ensureMetadata function takes in a metadata object, flattens the current object and the metadata object, merges them together, and then returns the merged object in its original nested structure.

    Parameters

    • metadata: Record<string, any>

      The metadata parameter is a record object that contains key-value pairs. The keys represent the metadata properties, and the values represent the corresponding values for those properties.

    Returns {}

    The function ensureMetadata returns the metadata object with any missing values filled in with the corresponding values from the original object.

  • The function checks if all the keys in the object are present in the metadata object.

    Parameters

    • metadata: Record<string, any>

      The metadata parameter is a record object that contains key-value pairs. The keys are strings and the values can be of any type.

    Returns boolean

    a boolean value.