    import LineItem from 'pvbid-sdk/src/domain/LineItem.js'

public class | source

# LineItem

#### Extends:

eventemitter3~EventEmitter → AdvanceEventEmitter → BidEntity → LineItem

Represents line item data.

## Constructor Summary

Public Constructor
public | constructor(entityData: object, bid: Bid) Creates an instance of LineItem. |

## Member Summary

Public Members
public get | base: number Base Property |
public set | base: number |
public | bid: Bid Reference to the bid that the line item belongs to. |
public set | burden: number |
public get | burden: number Burden Property |
public get | config: object Config Property |
public set | cost: number |
public get | cost: number Cost Property |
public set | costWatt: number |
public get | costWatt: number Cost per watt |
public get | costWithTax: number Cost With Tax |
public get | definitionId: number this get was deprecated. Definition ids will become obsolete in planned data structure upgrade. Gets the line item's definition id. |
public set | escalator: number |
public get | escalator: number Escalator Property |
public set | isIncluded: boolean |
public get | isIncluded: boolean Is Included Property |
public get | isWeighted: boolean Is Weighted Property - determes whether or not the contribution weight should be applied to the cost |
public set | isWeighted: boolean |
public get | laborHours: number Labor Hours Property |
public set | laborHours: number |
public set | markup: number |
public get | markup: number Markup Property |
public set | markupPercent: number |
public get | markupPercent: number Markup Percent Property |
public | maxEvents: number |
public get | multiplier: number |
public set | multiplier: number |
public get | ohp: number OH&P Property (overhead and profit) |
public set | ohp: number |
public get | perQuantity: number Per Quantity Property |
public set | perQuantity: number |
public get | price: number Price Property |
public set | price: number |
public set | priceWatt: number |
public get | priceWatt: number Price per watt |
public get | quantity: number Quantity Property |
public set | quantity: number |
public get | scalar: number Scalar Property |
public get | subtotal: number: * Gets Subtotal aka Initial Results. |
public get | tags: Array<string|number|boolean> Gets the line items tags array |
public get | tax: number Tax Property |
public set | tax: number |
public get | taxPercent: number Tax Percent Property |
public set | taxPercent: number |
public get | useComputedValueWhenAvailable: boolean When using predictive pricing, should the computed value be used if it's available? |
public set | useComputedValueWhenAvailable: boolean Overrides the bid variable for the line item |
public set | wage: number |
public get | wage: number Wage Property |

## Method Summary

Public Methods
public | assess(dependency: BidEntity, forceUpdate: boolean) Assess line item for changes. |
public | bind() Binds the "updated" event for all dependant bid entities. |
public | components(): Component[] Gets an array of components that the line item is under. |
public | async delete(): Promise<void> Deletes line item. |
public | dependants(): BidEntity[] Gets dependant bid entities that rely on line item instance. |
public | dependencies(): BidEntity[] Gets a list of bid entities that the line item instance relys on. |
public | dirty() Flags the line item and corresponding bid as dirty and to be saved. |
public | exportData(): object Exports the line item's internal data structure. |
public | getPredictedCost(): number Evaluates the cost prediction models for the line item. |
public | getPredictedLaborHours(): number Evaluates the labor hours prediction models for the line item. |
public | hasNullDependency(field: string): boolean Determines if the field is dependent on null/undefined dependencies |
public | isDirty(): boolean Determines if the line item is has changed for it's original data. |
public | isLabor(): boolean Determines if the line item represents labor costs. |
public | isOverridden(property: string): boolean |
public | isPredicted(property: string): boolean Determines if a property is predicted by recursively checking the properties calculation dependencies prediction status. |
public | moveToComponent(component: Component) Moves line item to a new component and self removes from original component in the same ComponentGroup |
public | override(property: string, value: number | string | boolean) |
public | reset() Resets the line item, removing all user override inputs. |
public | resetMarkup() Resets the markup, removing user override inputs for markup and markup percent. |
public | resetProperty(property: string) Resets a specific line item member, remove override value. |

## Inherited Summary

From class AdvanceEventEmitter
public | maxEvents: number Maximum number of events fired for the requester before events stop. |
public | on(eventName: string, requesterId: string, callback: function) |
public | onDelay(eventName: string, ms: number, requesterId: string, callback: function) |
public | removeListenerByRequester(eventName: string, requesterId: string) Removes event listeners by event and requesterId. |

From class BidEntity
public get | id: number Gets the id of the bid entity. |
public get | title: string Gets the bid entity title. |
public set | title: string Sets the bid entity title. |
public get | type: string Gets the bid entity type. |
public abstract | assess(dependency: BidEntity) Assesses bid entity. |
public | dependants(): BidEntity[] Gets an array of depndants that rely on the bid entity. |
public | dependencies(): BidEntity[] Gets all the dependencies that the bid entity relies on. |
public | dirty() Flags the bid entity as dirty and to be saved. |
public | exportData(): object Exports the internal data for the bid entity. |
public | hasNullDependency(field: string): boolean Determines if bid entity relies on a null or undefined dependency value |
public | isDirty(): boolean Determines of bid entity is dirty. |
public | pristine() Marks the bid entity as clean. |

## Public Constructors

### public constructor(entityData: object, bid: Bid) source

Creates an instance of LineItem.

#### Override:

BidEntity#constructor

#### Params:

Name | Type | Attribute | Description
entityData | object |  |
bid | Bid |  |

## Public Members

### public get base: number source

Base Property

### public set base: number source

### public bid: Bid source

Reference to the bid that the line item belongs to.

### public set burden: number source

### public get burden: number source

Burden Property

### public get config: object source

Config Property

### public set cost: number source

### public get cost: number source

Cost Property

### public set costWatt: number source

### public get costWatt: number source

Cost per watt

### public get costWithTax: number source

Cost With Tax

### public get definitionId: number source

this get was deprecated. Definition ids will become obsolete in planned data structure upgrade.

Gets the line item's definition id.

### public set escalator: number source

### public get escalator: number source

Escalator Property

### public set isIncluded: boolean source

### public get isIncluded: boolean source

Is Included Property

### public get isWeighted: boolean source

Is Weighted Property - determes whether or not the contribution weight should be applied to the cost

### public set isWeighted: boolean source

### public get laborHours: number source

Labor Hours Property

### public set laborHours: number source

### public set markup: number source

### public get markup: number source

Markup Property

### public set markupPercent: number source

### public get markupPercent: number source

Markup Percent Property

### public maxEvents: number source

Maximum number of events fired for the requester before events stop.

#### Override:

AdvanceEventEmitter#maxEvents

### public get multiplier: number source

### public set multiplier: number source

### public get ohp: number source

OH&P Property (overhead and profit)

### public set ohp: number source

### public get perQuantity: number source

Per Quantity Property

### public set perQuantity: number source

### public get price: number source

Price Property

### public set price: number source

### public set priceWatt: number source

### public get priceWatt: number source

Price per watt

### public get quantity: number source

Quantity Property

### public set quantity: number source

### public get scalar: number source

Scalar Property

### public get subtotal: number: * source

Gets Subtotal aka Initial Results.

#### Return:

number

### public get tags: Array<string|number|boolean> source

Gets the line items tags array

### public get tax: number source

Tax Property

### public set tax: number source

### public get taxPercent: number source

Tax Percent Property

### public set taxPercent: number source

### public get useComputedValueWhenAvailable: boolean source

When using predictive pricing, should the computed value be used if it's available?

### public set useComputedValueWhenAvailable: boolean source

Overrides the bid variable for the line item

### public set wage: number source

### public get wage: number source

Wage Property

## Public Methods

### public assess(dependency: BidEntity, forceUpdate: boolean) source

Assess line item for changes.

#### Override:

BidEntity#assess

#### Params:

Name | Type | Attribute | Description

dependency

BidEntity

- nullable: true

The calling dependency

forceUpdate

boolean

- nullable: true

#### Emit:

assessing | fires event before assessement.
assessed
updated

### public bind() source

Binds the "updated" event for all dependant bid entities.

### public components(): Component[] source

Gets an array of components that the line item is under. A line item is either uncategorized or under one Component per ComponentGroup

#### Return:

Component[]

### public async delete(): Promise<void> source

Deletes line item.

#### Return:

Promise<void>

### public dependants(): BidEntity[] source

Gets dependant bid entities that rely on line item instance.

#### Override:

BidEntity#dependants

#### Return:

BidEntity[]

### public dependencies(): BidEntity[] source

Gets a list of bid entities that the line item instance relys on.

#### Override:

BidEntity#dependencies

#### Return:

BidEntity[]

### public dirty() source

Flags the line item and corresponding bid as dirty and to be saved.

#### Override:

BidEntity#dirty

### public exportData(): object source

Exports the line item's internal data structure.

#### Override:

BidEntity#exportData

#### Return:

object

### public getPredictedCost(): number source

Evaluates the cost prediction models for the line item.

#### Return:

number | The predicted cost value

### public getPredictedLaborHours(): number source

Evaluates the labor hours prediction models for the line item.

#### Return:

number | The predicted cost value

### public hasNullDependency(field: string): boolean source

Determines if the field is dependent on null/undefined dependencies

#### Override:

BidEntity#hasNullDependency

#### Params:

Name | Type | Attribute | Description
field | string |  | The field value in question

#### Return:

boolean

### public isDirty(): boolean source

Determines if the line item is has changed for it's original data.

#### Override:

BidEntity#isDirty

#### Return:

boolean

### public isLabor(): boolean source

Determines if the line item represents labor costs.

#### Return:

boolean

### public isOverridden(property: string): boolean source

#### Params:

Name | Type | Attribute | Description
property | string |  |

#### Return:

boolean

### public isPredicted(property: string): boolean source

Determines if a property is predicted by recursively checking the properties calculation dependencies prediction status.

#### Params:

Name | Type | Attribute | Description
property | string |  | snake case property name

#### Return:

boolean

### public moveToComponent(component: Component) source

Moves line item to a new component and self removes from original component in the same ComponentGroup

#### Params:

Name | Type | Attribute | Description
component | Component |  |

### public override(property: string, value: number | string | boolean) source

#### Params:

Name | Type | Attribute | Description
property | string |  |
value | number | string | boolean |  |

### public reset() source

Resets the line item, removing all user override inputs.

### public resetMarkup() source

Resets the markup, removing user override inputs for markup and markup percent.

### public resetProperty(property: string) source

Resets a specific line item member, remove override value.

#### Params:

Name | Type | Attribute | Description
property | string |  |