Project
Extends:
A Project contains multiple Bids and summations of the bid results. Projects also have statuses (ie. open/closed/win/loss), and can have assigned users
Constructor Summary
Public Constructor | ||
public |
constructor(entityData: object, projectService: ProjectService) Creates an instance of Project. |
Member Summary
Public Members | ||
public get |
|
|
public get |
|
|
public get |
|
|
public get |
Cost Property |
|
public get |
|
|
public |
|
|
public |
|
|
public get |
Labor Hours Property |
|
public get |
Margin Property |
|
public get |
Markup Property |
|
public get |
Markup Percent Property |
|
public get |
Price Property |
|
public get |
ProjectStatus Property |
|
public set |
projectStatus: {id: number, title: string, core_status: string, is_won: boolean} |
|
public get |
|
|
public get |
Tax Property |
|
public get |
Tax Percent Property |
|
public get |
title: * |
|
public set |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
Method Summary
Public Methods | ||
public |
assess() Assess project values by summing all active bids. |
|
public |
Attaches a Bid to the project and binds necessary events. |
|
public |
async attachUser(user: object): Promise<null> Adds user to project. |
|
public |
bind() Binds the "updated" event for all dependant bids. |
|
public |
Clones project and underlying bids. |
|
public |
Creates a new bid and attaches and attaches it to the project. |
|
public |
Removes a Bid from the project and removes all bid event listeners. |
|
public |
async detachUser(userId: number): Promise<null> Removes user from project |
|
public |
Disables auto saving when project or bid changes occur. |
|
public |
|
|
public |
enableAutoSave(delay: number) Enables auto saving after project or bid changes occur. |
|
public |
|
|
public |
exportData(): object Exports the project's data to an object. |
|
public |
Determines if user is assigned to project |
|
public |
Determines if project is closed. |
|
public |
Determines if project is reconciled |
|
public |
async logChanges(entityChangeData: *) |
|
public |
Saves project and underlying bids. |
Inherited Summary
From class AdvanceEventEmitter | ||
public |
Maximum number of events fired for the requester before events stop. |
|
public |
|
|
public |
|
|
public |
removeListenerByRequester(eventName: string, requesterId: string) Removes event listeners by event and requesterId. |
From class BidEntity | ||
public get |
Determine if the entity is in an assembly |
|
public get |
Gets the id of the bid entity. |
|
public get |
Gets the bid entity title. |
|
public set |
Sets the bid entity title. |
|
public get |
Gets the bid entity type. |
|
public abstract |
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 |
async initSaveChangeLog(originalValue: *, newValue: *, valueType: *, entityProperty: *, metaData: *): * |
|
public |
Determines of bid entity is dirty. |
|
public |
pristine() Marks the bid entity as clean. |
Public Constructors
public constructor(entityData: object, projectService: ProjectService) source
Creates an instance of Project.
Override:
BidEntity#constructorParams:
Name | Type | Attribute | Description |
entityData | object | ||
projectService | ProjectService |
Public Members
public get context: PVBidContext source
Public Methods
public assess() source
Assess project values by summing all active bids.
Override:
BidEntity#assessEmit:
assessing |
assessed |
updated |
public attachBid(bid: Bid) source
Attaches a Bid to the project and binds necessary events.
Params:
Name | Type | Attribute | Description |
bid | Bid |
public async attachUser(user: object): Promise<null> source
Adds user to project.
Params:
Name | Type | Attribute | Description |
user | object |
public async createBid(title: string): Promise<Bid> source
Creates a new bid and attaches and attaches it to the project. This is a wrapper function for ProjectService.createBid
Params:
Name | Type | Attribute | Description |
title | string |
public detachBid(bid: Bid) source
Removes a Bid from the project and removes all bid event listeners.
Params:
Name | Type | Attribute | Description |
bid | Bid |
public async detachUser(userId: number): Promise<null> source
Removes user from project
Params:
Name | Type | Attribute | Description |
userId | number |
public disableLoggingChanges() source
public enableAutoSave(delay: number) source
Enables auto saving after project or bid changes occur.
Params:
Name | Type | Attribute | Description |
delay | number |
|
The number of milliseconds to delay auto save. Minimum is 1000ms. |
Emit:
* |
saving |
* |
saved |
public enableLoggingChanges() source
public exportData(): object source
Exports the project's data to an object.
Override:
BidEntity#exportDataReturn:
object |
Return Properties:
Name | Type | Attribute | Description |
id | number | ||
title | string | ||
cost | number | ||
taxable_cost | number | ||
labor_cost | number | ||
labor_hours | number | ||
price | number | ||
margin_percent | number | ||
markup | number | ||
markup_percent | number | ||
tax | number | ||
tax_percent | number | ||
price | number | ||
actual_cost | number | ||
actual_hours | number | ||
watts | number | ||
created_at | string | ||
updated_at | string | ||
closed_at | string | ||
reconciled_at | string |
public hasUser(userId: number): boolean source
Determines if user is assigned to project
Params:
Name | Type | Attribute | Description |
userId | number |
public async logChanges(entityChangeData: *) source
Params:
Name | Type | Attribute | Description |
entityChangeData | * |