Options
All
  • Public
  • Public/Protected
  • All
Menu

This mixin provides the duration converting functionality - the convertDuration method. It requires (inherit from) ChronoModelMixin.

Hierarchy

Index

Properties

daysPerMonth

daysPerMonth: number

The number of days per month.

Please note: the value does not define the amount of working time per month for that purpose one should use calendars.

The value is used when converting the duration from one unit to another. So when user enters a duration of, for example, 1 month the system understands that it actually means 30 days (which is then converted to hours) and schedules accordingly.

daysPerWeek

daysPerWeek: number

The number of days per week.

Please note: the value does not define the amount of working time per week for that purpose one should use calendars.

The value is used when converting the duration from one unit to another. So when user enters a duration of, for example, 2 weeks the system understands that it actually means 14 days (which is then converted to hours) and schedules accordingly.

graph

graph: Replica

A reference to the graph, this entity belongs to. Initially empty, and is populated when the entity instance is added to the replica (Replica.addEntity)

hoursPerDay

hoursPerDay: number

The number of hours per day.

Please note: the value does not define the amount of working time per day for that purpose one should use calendars.

The value is used when converting the duration from one unit to another. So when user enters a duration of, for example, 5 days the system understands that it actually means 120 hours and schedules accordingly.

Accessors

$

  • get $(): {}
  • An object, which properties corresponds to the ChronoGraph Identifiers, created for every field.

    For example:

    class Author extends Entity.mix(Base) {
        @field()
        firstName       : string
        @field()
        lastName        : string
    }
    
    const author = Author.new()
    
    // identifier for the field `firstName`
    author.$.firstName
    
    const firstName = replica.read(author.$.firstName)

    Returns {}

$$

  • A graph identifier, that represents the whole entity.

    Returns EntityIdentifier

$entity

  • An EntityMeta instance, representing the "meta" information about the entity class. It is shared among all instances of the class.

    Returns EntityMeta

Static $entity

  • An EntityMeta instance, representing the "meta" information about the entity class. It is shared among all instances of the class.

    Returns EntityMeta

Methods

commit

  • This is a convenience method, that just delegates to the ChronoGraph.commit method of this entity's graph.

    If there's no graph (entity has not been added to any replica) a CommitZero constant will be returned.

    Parameters

    Returns CommitResult

commitAsync

  • This is a convenience method, that just delegates to the ChronoGraph.commitAsync method of this entity's graph.

    If there's no graph (entity has not been added to any replica) a resolved promise with CommitZero constant will be returned.

    Parameters

    Returns Promise<CommitResult>

convertDuration

enterGraph

  • enterGraph(replica: Replica): void
  • This method is called when entity is added to some replica.

    Parameters

    Returns void

leaveGraph

  • This method is called when entity is removed from the replica it's been added to.

    Parameters

    Returns void

userProvidedValue

Generated using TypeDoc