Class: WorkOrderRepository

WorkOrderRepository

Repository implementation for Work Order data operations. Implements the Repository pattern to encapsulate data access logic. Follows SOLID principles: Single Responsibility, Dependency Inversion.

new WorkOrderRepository()

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 14

Methods

asynccreate(workOrder)

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 28

Creates a new work order.

Name Type Description
workOrder

The work order data to create

Returns:
Promise resolving to the API response

asyncfindByAppAndModel(appId, modelId, group, view)

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 49

Retrieves work orders for a specific application and model.

Name Type Description
appId

Application identifier

modelId

Model identifier

group

Group identifier

view

View identifier

Returns:
Promise resolving to work orders or error message

asyncfindWorkOrders(appId, modelId, group, view)

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 79

Retrieves work orders for a specific context.

Name Type Description
appId

Application identifier

modelId

Model identifier

group

Group identifier

view

View identifier

Returns:
Promise resolving to work orders or error message

getBaseUrl()

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 151

Gets the appropriate base URL based on configuration.

Returns:
Base URL string or undefined for production

asyncgetMetadata()

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 134

Retrieves work order metadata.

Returns:
Promise resolving to metadata or error message

asyncupdateCoordinates(params)

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 108

Updates coordinates for a work order.

Name Type Description
params

Parameters for coordinate update

Returns:
Promise resolving to the API response

validateCoordinateParams(params)

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 173

Validates coordinate update parameters.

Name Type Description
params

Coordinate update parameters

Throws:

Error if any required parameter is missing or invalid

validateRequiredParams(params)

Interactions/IFC/interact/GoIFCComponents/Components/WorkOrderComponent/src/repositories/WorkOrderRepository.ts, line 160

Validates required parameters to ensure they are not empty.

Name Type Description
params

Object containing parameters to validate

Throws:

Error if any required parameter is missing or empty