BidService
Constructor Summary
| Public Constructor | ||
| public | constructor(context: PVBidContext) Creates an instance of BidService. | |
Member Summary
| Public Members | ||
| public | context: * | |
| public | repositories: * | |
Method Summary
| Public Methods | ||
| public | async addAssemblies(bid: Bid, assemblyMapIds: number[]): Promise<Object[]> Adds assemblies to bid. | |
| public | async addDynamicGroup(bid: Bid, title: string): Promise<DynamicGroup> Adds a new Dynamic Group to the Bid. | |
| public | Adds a new field to the bid. | |
| public | async addLineItem(bid: Bid, title: string): Promise<LineItem> Adds a new line item to the bid. | |
| public | Adds a new metric to the bid. | |
| public | Clones bid returning an initialized Bid | |
| public | Creates a snapshot of the current bid. | |
| public | Deletes bid. | |
| public | async moveBidToProject(originalBid: *, project: *): Promise<*> Moves a bid to a project by first detaching the bid from its original project, then moves the bid to a given project by attaching the project id to the bid. | |
| public | async recoverBid(bid: Bid, snapshotId: number): Promise<null> Recovers a bid from a snapshot. | |
| public | Reload a bid with all of its entities while maintaining the same instance. | |
| public | async removeAssembly(bid: Bid, assemblyId: number): Promise<null> Removes assembly from a bid. | |
| public | Validates bid structure and references. | |
Public Constructors
public constructor(context: PVBidContext) source
Creates an instance of BidService.
Params:
| Name | Type | Attribute | Description | 
| context | PVBidContext | 
Public Methods
public async addAssemblies(bid: Bid, assemblyMapIds: number[]): Promise<Object[]> source
Adds assemblies to bid.
public async addDynamicGroup(bid: Bid, title: string): Promise<DynamicGroup> source
Adds a new Dynamic Group to the Bid.
public async addField(bid: Bid, title: string, type: string): Promise<Field> source
Adds a new field to the bid.
public async addLineItem(bid: Bid, title: string): Promise<LineItem> source
Adds a new line item to the bid. The added line item is uncategorized in all component groups.
public async addMetric(bid: Bid, title: string): Promise<Metric> source
Adds a new metric to the bid.
public async clone(bid: Bid): Promise<Bid> source
Clones bid returning an initialized Bid
Params:
| Name | Type | Attribute | Description | 
| bid | Bid | 
public async createSnapshot(bid: Bid, title: string, description: string): Promise<object> source
Creates a snapshot of the current bid.
public async deleteBid(bid: Bid): Promise<null> source
Deletes bid.
Params:
| Name | Type | Attribute | Description | 
| bid | Bid | 
public async moveBidToProject(originalBid: *, project: *): Promise<*> source
Moves a bid to a project by first detaching the bid from its original project, then moves the bid to a given project by attaching the project id to the bid.
Reassessing the projects after moving.
Params:
| Name | Type | Attribute | Description | 
| originalBid | * | ||
| project | * | 
public async recoverBid(bid: Bid, snapshotId: number): Promise<null> source
Recovers a bid from a snapshot. An auto snapshot of the current state will be created.
public async reload(bid: Bid): Bid source
Reload a bid with all of its entities while maintaining the same instance.
Params:
| Name | Type | Attribute | Description | 
| bid | Bid | 
