diff --git a/.changeset/long-seahorses-accept.md b/.changeset/long-seahorses-accept.md new file mode 100644 index 00000000..db17ddcc --- /dev/null +++ b/.changeset/long-seahorses-accept.md @@ -0,0 +1,5 @@ +--- +"@equinor/mad-maintenance-api-ts-wrapper": major +--- + +Update API wrapper to support api version 1.37.0 diff --git a/packages/api/maintenance-api/src/lib/generated/core/OpenAPI.ts b/packages/api/maintenance-api/src/lib/generated/core/OpenAPI.ts index 1c74e043..020ebd1f 100644 --- a/packages/api/maintenance-api/src/lib/generated/core/OpenAPI.ts +++ b/packages/api/maintenance-api/src/lib/generated/core/OpenAPI.ts @@ -21,7 +21,7 @@ export type OpenAPIConfig = { export const OpenAPI: OpenAPIConfig = { BASE: 'https://api-test.gateway.equinor.com/maintenance-api', - VERSION: '1.35.0', + VERSION: '1.37.0', WITH_CREDENTIALS: false, CREDENTIALS: 'include', TOKEN: undefined, diff --git a/packages/api/maintenance-api/src/lib/generated/index.ts b/packages/api/maintenance-api/src/lib/generated/index.ts index 361e19f9..6fa28ec5 100644 --- a/packages/api/maintenance-api/src/lib/generated/index.ts +++ b/packages/api/maintenance-api/src/lib/generated/index.ts @@ -192,6 +192,7 @@ export type { MaintenanceStrategy } from './models/MaintenanceStrategy'; export type { MaterialMinimal } from './models/MaterialMinimal'; export type { Measurement } from './models/Measurement'; export type { MeasurementCreate } from './models/MeasurementCreate'; +export type { MeasurementFromMeasuringPointLookup } from './models/MeasurementFromMeasuringPointLookup'; export type { MeasurementUpdate } from './models/MeasurementUpdate'; export type { MeasuringPoint } from './models/MeasuringPoint'; export type { MeasuringPointAddClass } from './models/MeasuringPointAddClass'; @@ -221,6 +222,10 @@ export type { ModificationWorkOrderWithOperationSelf } from './models/Modificati export type { NotFoundDetails } from './models/NotFoundDetails'; export type { ObjectLinkageCreate } from './models/ObjectLinkageCreate'; export type { operationIdPath } from './models/operationIdPath'; +export type { OverheadMaintenanceWorkOrder } from './models/OverheadMaintenanceWorkOrder'; +export type { OverheadMaintenanceWorkOrderBasic } from './models/OverheadMaintenanceWorkOrderBasic'; +export type { OverheadMaintenanceWorkOrderSimple } from './models/OverheadMaintenanceWorkOrderSimple'; +export type { OverheadMaintenanceWorkOrderWithOperationSelf } from './models/OverheadMaintenanceWorkOrderWithOperationSelf'; export type { page } from './models/page'; export type { perPage } from './models/perPage'; export type { PlannerGroup } from './models/PlannerGroup'; @@ -246,6 +251,7 @@ export type { ProjectWorkOrderCreate } from './models/ProjectWorkOrderCreate'; export type { ProjectWorkOrderSimple } from './models/ProjectWorkOrderSimple'; export type { ProjectWorkOrderSimpleWithRelationship } from './models/ProjectWorkOrderSimpleWithRelationship'; export type { ProjectWorkOrderWithOperationSelf } from './models/ProjectWorkOrderWithOperationSelf'; +export type { PSVCertificationReportCreate } from './models/PSVCertificationReportCreate'; export type { QualitativeCode } from './models/QualitativeCode'; export type { RawEquipmentChange } from './models/RawEquipmentChange'; export type { RawEquipmentChangeReturn } from './models/RawEquipmentChangeReturn'; @@ -275,6 +281,7 @@ export type { ServiceOperation } from './models/ServiceOperation'; export type { SimpleMaintenanceRecordsList } from './models/SimpleMaintenanceRecordsList'; export type { StandardTextTemplate } from './models/StandardTextTemplate'; export type { Status } from './models/Status'; +export type { StatusMinimal } from './models/StatusMinimal'; export type { StatusUpdate } from './models/StatusUpdate'; export type { StatusUpdateJsonPatch } from './models/StatusUpdateJsonPatch'; export type { subHierarchyLimit } from './models/subHierarchyLimit'; @@ -282,7 +289,7 @@ export type { SubseaServiceOperation } from './models/SubseaServiceOperation'; export type { SubseaWorkOrder } from './models/SubseaWorkOrder'; export type { SubseaWorkOrderBasic } from './models/SubseaWorkOrderBasic'; export type { SubseaWorkOrderMaterial } from './models/SubseaWorkOrderMaterial'; -export type { SubseaWorkOrderMaterialForAddMaterialRespone } from './models/SubseaWorkOrderMaterialForAddMaterialRespone'; +export type { SubseaWorkOrderMaterialForAddMaterialResponse } from './models/SubseaWorkOrderMaterialForAddMaterialResponse'; export type { SubseaWorkOrderOperation } from './models/SubseaWorkOrderOperation'; export type { SubseaWorkOrderSimple } from './models/SubseaWorkOrderSimple'; export type { SubseaWorkOrderSimpleWithRelationship } from './models/SubseaWorkOrderSimpleWithRelationship'; @@ -347,11 +354,12 @@ export type { WorkOrderCreateAbstract } from './models/WorkOrderCreateAbstract'; export type { WorkOrderInPlan } from './models/WorkOrderInPlan'; export type { WorkOrderMaterial } from './models/WorkOrderMaterial'; export type { WorkOrderMaterialAdd } from './models/WorkOrderMaterialAdd'; -export type { WorkOrderMaterialForAddMaterialRespone } from './models/WorkOrderMaterialForAddMaterialRespone'; +export type { WorkOrderMaterialForAddMaterialResponse } from './models/WorkOrderMaterialForAddMaterialResponse'; export type { WorkOrderMaterialJsonPatch } from './models/WorkOrderMaterialJsonPatch'; export type { WorkOrderObjectMaintenanceRecordMinimal } from './models/WorkOrderObjectMaintenanceRecordMinimal'; export type { WorkOrderOperation } from './models/WorkOrderOperation'; export type { WorkOrderOperationCreate } from './models/WorkOrderOperationCreate'; +export type { WorkOrderOperationForSearchFull } from './models/WorkOrderOperationForSearchFull'; export type { WorkOrderOperationInPlan } from './models/WorkOrderOperationInPlan'; export type { WorkOrderOperationJsonPatch } from './models/WorkOrderOperationJsonPatch'; export type { WorkOrderOperationJsonPatchDeprecated } from './models/WorkOrderOperationJsonPatchDeprecated'; @@ -387,6 +395,7 @@ export { ModificationProposalsService } from './services/ModificationProposalsSe export { ModificationWorkOrdersService } from './services/ModificationWorkOrdersService'; export { ModifiedEndpointsService } from './services/ModifiedEndpointsService'; export { NewEndpointsService } from './services/NewEndpointsService'; +export { OverheadMaintenanceWorkOrdersService } from './services/OverheadMaintenanceWorkOrdersService'; export { PreventiveWorkOrdersService } from './services/PreventiveWorkOrdersService'; export { ProjectWorkOrdersService } from './services/ProjectWorkOrdersService'; export { ReportsService } from './services/ReportsService'; @@ -396,6 +405,7 @@ export { TagService } from './services/TagService'; export { TechnicalClarificationsService } from './services/TechnicalClarificationsService'; export { TechnicalInformationUpdateRequestsService } from './services/TechnicalInformationUpdateRequestsService'; export { UpcomingModifiedEndpointsService } from './services/UpcomingModifiedEndpointsService'; +export { UpcomingNewEndpointsService } from './services/UpcomingNewEndpointsService'; export { WorkOrderOperationsService } from './services/WorkOrderOperationsService'; export { WorkOrderRelationshipsService } from './services/WorkOrderRelationshipsService'; export { WorkOrdersService } from './services/WorkOrdersService'; diff --git a/packages/api/maintenance-api/src/lib/generated/models/CorrectiveWorkOrderSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/CorrectiveWorkOrderSimple.ts index c5b55e6e..865fdc64 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/CorrectiveWorkOrderSimple.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/CorrectiveWorkOrderSimple.ts @@ -57,16 +57,6 @@ export type CorrectiveWorkOrderSimple = { priorityId: 'L' | 'M' | 'H' | 'U' | 'D'; costs: number; costsCurrency: string; - /** - * Criteria used by Equinor in CMR (Critical Maintenance Report): - * Corrective work orders where at least one item in the list or primary tag: - * - * - has the error classification "Dead" or "Seriously ill" or - * - has a "High" consequence classification for HSE or Production (one table for each) or - * - has received a "Hidden failure" code. - * - */ - cmrIndicator: boolean; /** * Indicates whether the Work Order is open or not. */ @@ -75,5 +65,9 @@ export type CorrectiveWorkOrderSimple = { costWBS: string; additionalCostWBSId: string; additionalCostWBS: string; + /** + * Indicates whether the Work Order has communication + */ + hasCommunication?: boolean; }; diff --git a/packages/api/maintenance-api/src/lib/generated/models/GenericWorkOrderSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/GenericWorkOrderSimple.ts index df1cdb61..40dd563b 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/GenericWorkOrderSimple.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/GenericWorkOrderSimple.ts @@ -51,6 +51,9 @@ export type GenericWorkOrderSimple = { * - has a "High" consequence classification for HSE or Production (one table for each) or * - has received a "Hidden failure" code. * + * Deprecated as of 21.01.2025. For more information, please see STRY0261073 in ServiceNow. + * + * @deprecated */ cmrIndicator?: boolean; /** diff --git a/packages/api/maintenance-api/src/lib/generated/models/MaintenanceRecordMinimal.ts b/packages/api/maintenance-api/src/lib/generated/models/MaintenanceRecordMinimal.ts index 49469db7..3022ede7 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/MaintenanceRecordMinimal.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/MaintenanceRecordMinimal.ts @@ -5,10 +5,15 @@ export type MaintenanceRecordMinimal = { recordId: string; - recordResource: 'maintenance-records/modification-proposals' | 'maintenance-records/failure-reports' | 'maintenance-records/activity-reports' | 'maintenance-records/technical-information-update-requests' | 'maintenance-records/technical-clarifications' | 'maintenance-records/certification-reports' | 'maintenance-records/unsupported-resource'; + recordResource: 'maintenance-records/modification-proposals' | 'maintenance-records/failure-reports' | 'maintenance-records/activity-reports' | 'maintenance-records/technical-information-update-requests' | 'maintenance-records/technical-clarifications' | 'maintenance-records/certifications' | 'maintenance-records/unsupported-resource'; tagId: string | null; tagPlantId: string; tag: string; + /** + * Structured location within the plant where the tag is located + */ + locationId?: string; + location?: string; equipmentId?: string; equipment?: string; title: string; diff --git a/packages/api/maintenance-api/src/lib/generated/models/Measurement.ts b/packages/api/maintenance-api/src/lib/generated/models/Measurement.ts index 0cc09710..e7a1758a 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/Measurement.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/Measurement.ts @@ -11,6 +11,9 @@ export type Measurement = { maintenanceRecordId: string | null; measuringPointId: string; measurementDateTime: string; + /** + * Title of the measurement + */ measurementTitle: string; quantitativeReading: number; quantitativeReadingUnitId: string; diff --git a/packages/api/maintenance-api/src/lib/generated/models/MeasurementCreate.ts b/packages/api/maintenance-api/src/lib/generated/models/MeasurementCreate.ts index 13a05be7..acadde36 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/MeasurementCreate.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/MeasurementCreate.ts @@ -27,5 +27,9 @@ export type MeasurementCreate = { * The workOrderId of the related work order */ workOrderId?: string; + /** + * Long text for the measurement document + */ + text?: string; }; diff --git a/packages/api/maintenance-api/src/lib/generated/models/MeasurementFromMeasuringPointLookup.ts b/packages/api/maintenance-api/src/lib/generated/models/MeasurementFromMeasuringPointLookup.ts new file mode 100644 index 00000000..a6cb619b --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/models/MeasurementFromMeasuringPointLookup.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Measurement } from './Measurement'; + +export type MeasurementFromMeasuringPointLookup = (Measurement & { + /** + * Long text for the measurement document + */ + text?: string | null; +}); + diff --git a/packages/api/maintenance-api/src/lib/generated/models/MeasurementUpdate.ts b/packages/api/maintenance-api/src/lib/generated/models/MeasurementUpdate.ts index 22ba5c6b..c8773f63 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/MeasurementUpdate.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/MeasurementUpdate.ts @@ -6,15 +6,28 @@ export type MeasurementUpdate = { /** * JSON Patch operation according to RFC6902 + * + * Operation `replace` is suitable for the following properties: + * - `/measurementTitle` + * - `/processingStatusId` + * - `/text` + * + * Operation `append` is suitable for the following properties: + * - `/text` + * + * Operation `prepend` is suitable for the following properties: + * - `/text` + * */ - op: 'replace'; + op: 'replace' | 'append' | 'prepend'; /** * Path indicating the property to be impacted by the operation */ - path: '/measurementTitle' | '/processingStatusId'; + path: '/measurementTitle' | '/processingStatusId' | '/text'; /** * Value to be assigned to a resource property based on the operation and path. * + * "replace" supports following fields: * Path specific information: * - /measurementTitle - max-length 40 characters * - /processingStatusId diff --git a/packages/api/maintenance-api/src/lib/generated/models/MeasuringPoint.ts b/packages/api/maintenance-api/src/lib/generated/models/MeasuringPoint.ts index c64bdd3c..29f72d5b 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/MeasuringPoint.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/MeasuringPoint.ts @@ -3,14 +3,19 @@ /* tslint:disable */ /* eslint-disable */ -import type { Measurement } from './Measurement'; +import type { MeasurementFromMeasuringPointLookup } from './MeasurementFromMeasuringPointLookup'; import type { MeasuringPointBasic } from './MeasuringPointBasic'; import type { MeasuringPointCharacteristic } from './MeasuringPointCharacteristic'; import type { QualitativeCode } from './QualitativeCode'; export type MeasuringPoint = (MeasuringPointBasic & { - lastMeasurement?: Measurement | null; - measurements?: Array | null; + lastMeasurement?: (MeasurementFromMeasuringPointLookup & { + /** + * Long text for the measurement document + */ + text?: string | null; + }) | null; + measurements?: Array | null; qualitativeCodes?: Array | null; characteristics?: Array | null; }); diff --git a/packages/api/maintenance-api/src/lib/generated/models/ModificationWorkOrderSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/ModificationWorkOrderSimple.ts index f25a3d8a..042d9e41 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/ModificationWorkOrderSimple.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/ModificationWorkOrderSimple.ts @@ -53,16 +53,6 @@ export type ModificationWorkOrderSimple = { * Field used to assist in grouping/sorting Work orders. Unstructured field used non-consistently between plants */ sortField: string; - /** - * Criteria used by Equinor in CMR (Critical Maintenance Report): - * Corrective work orders where at least one item in the list or primary tag: - * - * - has the error classification "Dead" or "Seriously ill" or - * - has a "High" consequence classification for HSE or Production (one table for each) or - * - has received a "Hidden failure" code. - * - */ - cmrIndicator: boolean; /** * Indicates whether the Work Order is open or not. */ diff --git a/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrder.ts b/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrder.ts new file mode 100644 index 00000000..21642b47 --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrder.ts @@ -0,0 +1,42 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { OverheadMaintenanceWorkOrderBasic } from './OverheadMaintenanceWorkOrderBasic'; +import type { ServiceOperation } from './ServiceOperation'; +import type { Status } from './Status'; +import type { TagRelatedToWorkOrder } from './TagRelatedToWorkOrder'; +import type { WorkOrderAttachment } from './WorkOrderAttachment'; +import type { WorkOrderOperation } from './WorkOrderOperation'; + +export type OverheadMaintenanceWorkOrder = (OverheadMaintenanceWorkOrderBasic & { + operations?: Array; + serviceOperations?: Array; + /** + * All statuses possible with information about activation + */ + statuses?: Array; + /** + * Attachments for this Overhead Maintenance Work order + */ + attachments?: Array; + /** + * Related equipment + */ + tagsRelated?: Array; + additionalCostWBSId: string; + additionalCostWBS: string; + costWBS: string; + isProductionCritical: string; + isHSECritical: string; + /** + * Value only returned if include-person-responsible=true. The internal id of the person responsible for the processing of the overhead maintenance work order. The id represents the employee id of the person. + */ + personResponsibleId: string | null; + /** + * Value only returned if include-person-responsible=true. The email of the person responsible for the processing of the overhead maintenance work order. This is the preferred way of identifying the person as it's consistent across systems. + */ + personResponsibleEmail: string | null; +}); + diff --git a/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderBasic.ts b/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderBasic.ts new file mode 100644 index 00000000..6e5e656f --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderBasic.ts @@ -0,0 +1,25 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { OverheadMaintenanceWorkOrderSimple } from './OverheadMaintenanceWorkOrderSimple'; + +export type OverheadMaintenanceWorkOrderBasic = (OverheadMaintenanceWorkOrderSimple & { + text: string; + /** + * The type of work order it is an instance of + */ + workOrderTypeId: 'overheadMaintenanceWorkOrder'; + plannerGroup: string; + workCenter: string; + /** + * If there is a person responsible assigned + */ + hasPersonResponsible: boolean; + costWBSId: string; + projectId: string; + costNetworkId: string; + costNetworkOperationId: string; +}); + diff --git a/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderSimple.ts new file mode 100644 index 00000000..291fab69 --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderSimple.ts @@ -0,0 +1,63 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type OverheadMaintenanceWorkOrderSimple = { + workOrderId: string; + tagId: string | null; + tagPlantId: string; + tag: string; + title: string; + workCenterId: string; + workCenterPlantId: string; + /** + * Structured location within the plant where the tag is located + */ + locationId: string; + failureReportId: string; + plantId: string; + planningPlantId: string; + plannerGroupId: string; + /** + * Active statuses for the overhead maintenance order with space as separating character + */ + activeStatusIds: string; + maintenanceTypeId: string; + maintenanceType: string; + requiredEndDate: string | null; + /** + * An identifier to the revision (shutdown or campaign work) this work order is related to + */ + revisionId: string; + /** + * Name of the revision (shutdown or campaign work) this work order is related to + */ + revision: string; + basicStartDateTime: string | null; + basicEndDateTime: string | null; + createdDateTime: string | null; + /** + * Date and time of when the Work order was changed + */ + changedDateTime: string | null; + /** + * Field used to assist in grouping/sorting Work orders. Unstructured field used non-consistently between plants + */ + sortField: string; + /** + * Priority of Work order + * * `L` - Low priority + * * `M` - Medi. priority + * * `H` - High priority + * * `U` - Unprioritized + * * null - No priority assigned + * + */ + priorityId: 'L' | 'M' | 'H' | 'U' | null; + /** + * Indicates whether the Work Order is open or not. + */ + isOpen: boolean; +}; + diff --git a/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderWithOperationSelf.ts b/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderWithOperationSelf.ts new file mode 100644 index 00000000..75d65fe9 --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/models/OverheadMaintenanceWorkOrderWithOperationSelf.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { OverheadMaintenanceWorkOrderSimple } from './OverheadMaintenanceWorkOrderSimple'; +import type { WorkOrderOperationSimpleForSearch } from './WorkOrderOperationSimpleForSearch'; + +export type OverheadMaintenanceWorkOrderWithOperationSelf = (OverheadMaintenanceWorkOrderSimple & { + text?: string | null; + requiredEndDate: string | null; + _links: { + self?: string; + }; + operations?: Array | null; +}); + diff --git a/packages/api/maintenance-api/src/lib/generated/models/PSVCertificationReportCreate.ts b/packages/api/maintenance-api/src/lib/generated/models/PSVCertificationReportCreate.ts new file mode 100644 index 00000000..dd99441f --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/models/PSVCertificationReportCreate.ts @@ -0,0 +1,144 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type PSVCertificationReportCreate = { + /** + * Cold design set point in Bar. From measuring point. + */ + coldDesignSetPoint: number; + detectionMethodGroupId: string; + detectionMethodId?: string; + failureMechanismGroupId: string; + failureMechanismId?: string; + /** + * Calibration date. + */ + calibrationDate?: string; + /** + * Calibration time. + */ + calibrationTime?: string; + /** + * Corrosion detected. + */ + corrosion: boolean; + /** + * Corrosion description, only required if `corrosion` is set to True. + */ + corrosionDescription?: string; + /** + * Mechanical damage detected. + */ + mechanicalDamage: boolean; + /** + * Mechanical damage description, only required if `mechanicalDamage` is set to True. + */ + mechanicalDamageDescription?: string; + /** + * Pollution detected. + */ + pollution: boolean; + /** + * Pollution description, only required if `pollution` is set to True. + */ + pollutionDescription?: string; + /** + * Manufacturer serial number for pretest. + */ + manufacturerSerialNumber?: string; + /** + * Pretest opening pressure in Bar. + */ + pretestOpeningPressure?: number; + /** + * Pretest closing pressure in Bar. + */ + pretestClosingPressure?: number; + /** + * Pretest pressure test method. + */ + pretestPressureTestMethod?: 'Pop' | 'Simmer'; + /** + * Pretest leakage rate in Bubbles per minute. + */ + pretestLeakageRate: number; + /** + * Pretest valve changed. If set to `True` Valve changed has been set to ‘Yes’. Note that pre-test values are recorded against the existing equipment and final test values will be recorded against the new equipment. + */ + pretestValveChanged: boolean; + /** + * New valve equipment number. Only required if `pretestValveChanged` equals `True` + */ + newValveEquipmentNumber?: string; + /** + * New valve serial number. Only required if `pretestValveChanged` equals `True` + */ + newValveSerialNumber?: string; + /** + * New valve part number. Only required if `pretestValveChanged` equals `True` + */ + newValvePartNumber?: string; + /** + * Pretest 2nd opening pressure in Bar. Only required if `pretestValveChanged` equals `False` + */ + pretest2ndOpeningPressure?: number; + /** + * Pretest 2nd closing pressure in Bar. Only required if `pretestValveChanged` equals `False` + */ + pretest2ndClosingPressure?: number; + /** + * Pretest 2nd pressure test method. Only required if `pretestValveChanged` equals `False` + */ + pretest2ndPressureTestMethod?: 'Pop' | 'Simmer'; + /** + * Additional information for pretest. + */ + pretestAdditionalInformation?: string; + /** + * Overhaul work scope. Only required if `pretestValveChanged` equals `False` + */ + overhaulWorkScope?: 'Functional Test' | 'Full overhaul'; + /** + * Overhaul parts condition. Only required if `pretestValveChanged` equals `False` & `overhaulWorkScope` equals `Full overhaul` + */ + overhaulPartsCondition?: 'Ok' | 'Not ok'; + /** + * Overhaul parts condition description. Only required if `pretestValveChanged` equals `False` & `overhaulWorkScope` equals `Full overhaul` & `overhaulPartsCondition` equals `Not ok` + */ + overhaulPartsConditionDescription?: string; + /** + * Overhaul internal pollution. Only required if `pretestValveChanged` equals `False` & `overhaulWorkScope` equals `Full overhaul` + */ + overhaulInternalPollution?: 'Ok' | 'Not ok'; + /** + * Overhaul internal pollution description. Only required if `pretestValveChanged` equals `False` & `overhaulWorkScope` equals `Full overhaul` & `overhaulInternalPollution` equals `Not ok` + */ + overhaulInternalPollutionDescription?: string; + /** + * Final test opening pressure in Bar. + */ + finalTestOpeningPressure?: number; + /** + * Final test closing pressure in Bar. + */ + finalTestClosingPressure?: number; + /** + * Final test pressure test method. + */ + finalTestPressureTestMethod?: 'Pop' | 'Simmer'; + /** + * Final test blowdown adjust in Teeths. + */ + finalTestBlowdownAdjust?: number; + /** + * Final test leakage rate in Bubbles per minute. + */ + finalTestLeakageRate: number; + /** + * Final test backpressure in Bar. + */ + finalTestBackpressure?: number; +}; + diff --git a/packages/api/maintenance-api/src/lib/generated/models/PreventiveWorkOrderSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/PreventiveWorkOrderSimple.ts index 92390164..a3ef0bb1 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/PreventiveWorkOrderSimple.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/PreventiveWorkOrderSimple.ts @@ -54,16 +54,12 @@ export type PreventiveWorkOrderSimple = { * Value only returned if include-person-responsible=true. The email of the person responsible for the processing of the technical clarification. This is the preferred way of identifying the person as it's consistent across systems. */ personResponsibleEmail?: string | null; + costs: number | null; + costsCurrency: string | null; /** - * Criteria used by Equinor in CMR (Critical Maintenance Report): - * Corrective work orders where at least one item in the list or primary tag: - * - * - has the error classification "Dead" or "Seriously ill" or - * - has a "High" consequence classification for HSE or Production (one table for each) or - * - has received a "Hidden failure" code. - * + * Indicates whether the Work Order has communication */ - cmrIndicator: boolean; + hasCommunication?: boolean; /** * Indicates whether the Work Order is open or not. */ diff --git a/packages/api/maintenance-api/src/lib/generated/models/ProjectWorkOrderSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/ProjectWorkOrderSimple.ts index 1c7bd9db..12323486 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/ProjectWorkOrderSimple.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/ProjectWorkOrderSimple.ts @@ -52,16 +52,6 @@ export type ProjectWorkOrderSimple = { * Field used to assist in grouping/sorting Work orders. Unstructured field used non-consistently between plants */ sortField: string; - /** - * Criteria used by Equinor in CMR (Critical Maintenance Report): - * Corrective work orders where at least one item in the list or primary tag: - * - * - has the error classification "Dead" or "Seriously ill" or - * - has a "High" consequence classification for HSE or Production (one table for each) or - * - has received a "Hidden failure" code. - * - */ - cmrIndicator: boolean; /** * Indicates whether the Work Order is open or not. */ diff --git a/packages/api/maintenance-api/src/lib/generated/models/RevisionWorkOrderOperation.ts b/packages/api/maintenance-api/src/lib/generated/models/RevisionWorkOrderOperation.ts index 098790df..1c2ca855 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/RevisionWorkOrderOperation.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/RevisionWorkOrderOperation.ts @@ -7,7 +7,7 @@ import type { WorkOrderMaterial } from './WorkOrderMaterial'; export type RevisionWorkOrderOperation = { /** - * Internal id of operation + * Internal id of operation. Combination of 'RoutingNumberId'-'RoutingCounterId'. */ operationId: string; /** @@ -16,6 +16,10 @@ export type RevisionWorkOrderOperation = { operation: string; workOrderId?: string; title: string; + /** + * Superior routing counter. If filled out, this operation is a sub-operation of the RoutingCounterId specified here. + */ + superiorRoutingCounterId?: string; workCenterId: string; workCenterPlantId: string; standardTextTemplate: string; diff --git a/packages/api/maintenance-api/src/lib/generated/models/SASChangeWorkOrderSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/SASChangeWorkOrderSimple.ts index 9d1807ef..4df23f25 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/SASChangeWorkOrderSimple.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/SASChangeWorkOrderSimple.ts @@ -48,16 +48,6 @@ export type SASChangeWorkOrderSimple = { * Field used to assist in grouping/sorting Work orders. Unstructured field used non-consistently between plants */ sortField: string; - /** - * Criteria used by Equinor in CMR (Critical Maintenance Report): - * Corrective work orders where at least one item in the list or primary tag: - * - * - has the error classification "Dead" or "Seriously ill" or - * - has a "High" consequence classification for HSE or Production (one table for each) or - * - has received a "Hidden failure" code. - * - */ - cmrIndicator: boolean; /** * Indicates whether the Work Order is open or not. */ diff --git a/packages/api/maintenance-api/src/lib/generated/models/ServiceOperation.ts b/packages/api/maintenance-api/src/lib/generated/models/ServiceOperation.ts index 47d6dc54..70b32128 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/ServiceOperation.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/ServiceOperation.ts @@ -3,6 +3,7 @@ /* tslint:disable */ /* eslint-disable */ +import type { SafetyMeasure } from './SafetyMeasure'; import type { Service } from './Service'; import type { WorkOrderMaterial } from './WorkOrderMaterial'; @@ -36,6 +37,29 @@ export type ServiceOperation = { agreement?: string; agreementItem?: string; requisitionerId?: string; + /** + * Duration as defined in ISO8601 + */ + plannedWorkHours?: string | null; + actualWorkHours?: string | null; + /** + * Planned duration for operation is based on plannedManHours and capacityCount. Property format is as defined in ISO8601 + */ + plannedDuration?: string | null; + earliestStartDateTime?: string | null; + earliestFinishDateTime?: string | null; + /** + * Number of capacity from work center required for the operation + */ + capacityCount?: number; + /** + * Safety measures for the work order operation + */ + safetyMeasures?: Array; + /** + * Calculation key defines which of the fields plannedWorkHours,capacityCount and plannedDuration are derived based on the values of the two others. If calculation key is `CALC_KEY_MANUAL`, all fields are filled in manually. + */ + calculationKey?: 'CALC_KEY_MANUAL' | 'CALC_KEY_DURATION' | 'CALC_KEY_PLANNED_HOURS' | 'CALC_KEY_CAPACITY' | null; services?: Array; materials?: Array | null; }; diff --git a/packages/api/maintenance-api/src/lib/generated/models/Status.ts b/packages/api/maintenance-api/src/lib/generated/models/Status.ts index 0c0cecfb..ac063ad6 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/Status.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/Status.ts @@ -3,14 +3,14 @@ /* tslint:disable */ /* eslint-disable */ -export type Status = { - statusId: string; - status: string; +import type { StatusMinimal } from './StatusMinimal'; + +export type Status = (StatusMinimal & { /** * Some status may be ordered in a sequence and this indicates the position */ statusOrder: number | null; isActive: boolean; activatedDateTime: string | null; -}; +}); diff --git a/packages/api/maintenance-api/src/lib/generated/models/StatusMinimal.ts b/packages/api/maintenance-api/src/lib/generated/models/StatusMinimal.ts new file mode 100644 index 00000000..8c02ff3f --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/models/StatusMinimal.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type StatusMinimal = { + statusId: string; + status: string; +}; + diff --git a/packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderMaterialForAddMaterialRespone.ts b/packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderMaterialForAddMaterialResponse.ts similarity index 50% rename from packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderMaterialForAddMaterialRespone.ts rename to packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderMaterialForAddMaterialResponse.ts index d268973e..acbe136b 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderMaterialForAddMaterialRespone.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderMaterialForAddMaterialResponse.ts @@ -3,9 +3,9 @@ /* tslint:disable */ /* eslint-disable */ -import type { WorkOrderMaterialForAddMaterialRespone } from './WorkOrderMaterialForAddMaterialRespone'; +import type { WorkOrderMaterialForAddMaterialResponse } from './WorkOrderMaterialForAddMaterialResponse'; -export type SubseaWorkOrderMaterialForAddMaterialRespone = (WorkOrderMaterialForAddMaterialRespone & { +export type SubseaWorkOrderMaterialForAddMaterialResponse = (WorkOrderMaterialForAddMaterialResponse & { equipmentId: string; equipment: string; supplyingPlantId: string; diff --git a/packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderSimple.ts index 404a71bb..e6e25989 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderSimple.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/SubseaWorkOrderSimple.ts @@ -59,16 +59,6 @@ export type SubseaWorkOrderSimple = { * */ priorityId: 'L' | 'M' | 'H' | 'U' | null; - /** - * Criteria used by Equinor in CMR (Critical Maintenance Report): - * Corrective work orders where at least one item in the list or primary tag: - * - * - has the error classification "Dead" or "Seriously ill" or - * - has a "High" consequence classification for HSE or Production (one table for each) or - * - has received a "Hidden failure" code. - * - */ - cmrIndicator: boolean; /** * Indicates whether the Work Order is open or not. */ diff --git a/packages/api/maintenance-api/src/lib/generated/models/SupportedStatusesWorkOrdersOptimizedForQuery.ts b/packages/api/maintenance-api/src/lib/generated/models/SupportedStatusesWorkOrdersOptimizedForQuery.ts index f937127d..550fe610 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/SupportedStatusesWorkOrdersOptimizedForQuery.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/SupportedStatusesWorkOrdersOptimizedForQuery.ts @@ -3,4 +3,4 @@ /* tslint:disable */ /* eslint-disable */ -export type SupportedStatusesWorkOrdersOptimizedForQuery = Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL'>; +export type SupportedStatusesWorkOrdersOptimizedForQuery = Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL' | 'SWNG'>; diff --git a/packages/api/maintenance-api/src/lib/generated/models/TagRelatedToWorkOrder.ts b/packages/api/maintenance-api/src/lib/generated/models/TagRelatedToWorkOrder.ts index 61e19a1e..027b2e31 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/TagRelatedToWorkOrder.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/TagRelatedToWorkOrder.ts @@ -8,6 +8,11 @@ import type { TagMinimal } from './TagMinimal'; export type TagRelatedToWorkOrder = (TagMinimal & { equipmentId: string; equipment: string; + /** + * Structured location within the plant where the tag is located + */ + locationId?: string; + location?: string; /** * Defines the type of relationship to the work order */ diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderChangeLogs.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderChangeLogs.ts index 8ef5087d..7b14e33e 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderChangeLogs.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderChangeLogs.ts @@ -12,5 +12,6 @@ export type WorkOrderChangeLogs = { sasChangeWorkOrdersChanged?: Array; projectWorkOrdersChanged?: Array; subseaWorkOrdersChanged?: Array; + overheadMaintenanceWorkOrdersChanged?: Array; }; diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderInPlan.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderInPlan.ts index bf7866ad..1c85a51f 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderInPlan.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderInPlan.ts @@ -19,16 +19,6 @@ export type WorkOrderInPlan = { maintenanceRecordId: string | null; productionCritical: string; hseCritical: string; - /** - * Criteria used by Equinor in CMR (Critical Maintenance Report): - * Corrective work orders where at least one item in the list or primary tag: - * - * - has the error classification "Dead" or "Seriously ill" or - * - has a "High" consequence classification for HSE or Production (one table for each) or - * - has received a "Hidden failure" code. - * - */ - cmrIndicator: boolean; /** * Work center id from the operation */ diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterial.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterial.ts index 6393feb6..8e20145f 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterial.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterial.ts @@ -3,17 +3,13 @@ /* tslint:disable */ /* eslint-disable */ -import type { WorkOrderMaterialForAddMaterialRespone } from './WorkOrderMaterialForAddMaterialRespone'; +import type { WorkOrderMaterialForAddMaterialResponse } from './WorkOrderMaterialForAddMaterialResponse'; -export type WorkOrderMaterial = (WorkOrderMaterialForAddMaterialRespone & { +export type WorkOrderMaterial = (WorkOrderMaterialForAddMaterialResponse & { /** * Specifies the recipient for whom the material is destined */ goodsRecipientId?: string; - /** - * Specifies the point at which the material is to be unloaded - */ - unloadingPoint?: string; price?: number; priceCurrency?: string; /** diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterialForAddMaterialRespone.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterialForAddMaterialResponse.ts similarity index 88% rename from packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterialForAddMaterialRespone.ts rename to packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterialForAddMaterialResponse.ts index ece2a924..83614e6d 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterialForAddMaterialRespone.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderMaterialForAddMaterialResponse.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ -export type WorkOrderMaterialForAddMaterialRespone = { +export type WorkOrderMaterialForAddMaterialResponse = { reservationId: string; materialId: string; material: string; @@ -53,5 +53,9 @@ export type WorkOrderMaterialForAddMaterialRespone = { * Indicates for whom the material is to be ordered */ requisitionerId?: string; + /** + * Specifies the point at which the material is to be unloaded + */ + unloadingPoint?: string; }; diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperation.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperation.ts index 318148ab..223bd3ca 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperation.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperation.ts @@ -31,5 +31,9 @@ export type WorkOrderOperation = (WorkOrderOperationSimple & { * The email of the person assigned as responsible for the Work Order Operation. This is the preferred way of identifying the person as it's consistent across systems. */ personResponsibleEmail?: string | null; + /** + * Text-based information from the planner + */ + planNotes: string; }); diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperationForSearchFull.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperationForSearchFull.ts new file mode 100644 index 00000000..5e29036c --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperationForSearchFull.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { WorkOrderOperation } from './WorkOrderOperation'; + +export type WorkOrderOperationForSearchFull = (WorkOrderOperation & { + tagId?: string | null; + tagPlantId?: string; + isServiceOperation?: boolean; +}); + diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperationSimple.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperationSimple.ts index c4644ce7..d90d2f61 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperationSimple.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOperationSimple.ts @@ -65,8 +65,5 @@ export type WorkOrderOperationSimple = { * Calculation key defines which of the fields plannedWorkHours,capacityCount and plannedDuration are derived based on the values of the two others. If calculation key is `CALC_KEY_MANUAL`, all fields are filled in manually. */ calculationKey: 'CALC_KEY_MANUAL' | 'CALC_KEY_DURATION' | 'CALC_KEY_PLANNED_HOURS' | 'CALC_KEY_CAPACITY' | null; - tagId?: string | null; - tagPlantId?: string; - isServiceOperation?: boolean; }; diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOptimizedForQuery.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOptimizedForQuery.ts index 21e1363d..28a7e34c 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOptimizedForQuery.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderOptimizedForQuery.ts @@ -7,6 +7,7 @@ import type { ActivityReportSimpleSelf } from './ActivityReportSimpleSelf'; import type { CertificationReportSimpleSelf } from './CertificationReportSimpleSelf'; import type { FailureReportSimpleSelf } from './FailureReportSimpleSelf'; import type { ModificationProposalSimpleSelf } from './ModificationProposalSimpleSelf'; +import type { StatusMinimal } from './StatusMinimal'; import type { TechnicalClarificationSimpleSelf } from './TechnicalClarificationSimpleSelf'; import type { TechnicalInformationUpdateRequestSimpleSelf } from './TechnicalInformationUpdateRequestSimpleSelf'; import type { WorkOrderTypeId } from './WorkOrderTypeId'; @@ -16,6 +17,7 @@ export type WorkOrderOptimizedForQuery = { workOrderTypeId: WorkOrderTypeId; tagId: string | null; tagPlantId: string; + tag?: string; title: string; /** * Multi-line description of work order. Only included if include-text=true @@ -55,6 +57,9 @@ export type WorkOrderOptimizedForQuery = { * @deprecated */ revisionCodeId: string; + requiredEndDate?: string | null; + hseCritical?: string; + productionCritical?: string; /** * Work order is open */ @@ -91,10 +96,18 @@ export type WorkOrderOptimizedForQuery = { * Has status Released */ hasStatusREL?: boolean; + /** + * Has status SWING + */ + hasStatusSWNG?: boolean; /** * Main maintenance record */ maintenanceRecord: (FailureReportSimpleSelf | ActivityReportSimpleSelf | CertificationReportSimpleSelf | ModificationProposalSimpleSelf | TechnicalInformationUpdateRequestSimpleSelf | TechnicalClarificationSimpleSelf) | null; + /** + * All active statuses on the WorkOrder + */ + statuses?: Array; _links: { related?: string; }; diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderServiceOperationJsonPatch.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderServiceOperationJsonPatch.ts index ab1aaa38..e38dc792 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderServiceOperationJsonPatch.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderServiceOperationJsonPatch.ts @@ -13,15 +13,17 @@ export type WorkOrderServiceOperationJsonPatch = { /** * Path indicating the property to be impacted by the operation */ - path: '/isServiceOperation' | '/isCompleted' | '/schedulingStartConstraintId' | '/schedulingStartConstraintDateTime' | '/schedulingFinishConstraintId' | '/schedulingFinishConstraintDateTime' | '/systemCondition' | '/operationId' | '/title' | '/text' | '/workCenterId' | '/workCenterPlantId' | '/standardTextTemplate' | '/scopeOfWork' | '/quantity' | '/unit' | '/materialGroup' | '/purchasingGroup' | '/purchasingOrganization' | '/purchaseOrderId' | '/purchaseOrderItemId' | '/service'; + path: '/isServiceOperation' | '/isCompleted' | '/isExcludedFromWorkOrderPlan' | '/schedulingStartConstraintId' | '/schedulingStartConstraintDateTime' | '/schedulingFinishConstraintId' | '/schedulingFinishConstraintDateTime' | '/systemCondition' | '/operationId' | '/title' | '/text' | '/workCenterId' | '/workCenterPlantId' | '/standardTextTemplate' | '/scopeOfWork' | '/quantity' | '/unit' | '/materialGroup' | '/purchasingGroup' | '/purchasingOrganization' | '/purchaseOrderId' | '/purchaseOrderItemId' | '/service' | '/plannedWorkHours' | '/plannedWorkDuration' | '/capacityCount' | '/calculationKey'; /** * Value to be assigned to a resource property based on the operation and path. * + * **To update either `schedulingStartConstraintId` or `schedulingStartConstraintDateTime`, both fields must be updated in the same request.** * /schedulingStartConstraintId allowed values: * - `MSO` - Must start on * - `SNET` - Start no earlier than * - `SNLT` - Start no later than * + * **To update either `schedulingFinishConstraintId` or `schedulingFinishConstraintDateTime`, both fields must be updated in the same request.** * /schedulingFinishConstraintId allowed values: * - `MFO ` - Must finish on * - `FNET` - Finish no earlier than diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderTypeId.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderTypeId.ts index 896b142e..96ed2bf8 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderTypeId.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderTypeId.ts @@ -3,4 +3,4 @@ /* tslint:disable */ /* eslint-disable */ -export type WorkOrderTypeId = 'correctiveWorkOrder' | 'preventiveWorkOrder' | 'modificationWorkOrder' | 'sasChangeWorkOrder' | 'projectWorkOrder' | 'subseaWorkOrder' | 'unsupportedOrderType'; +export type WorkOrderTypeId = 'correctiveWorkOrder' | 'preventiveWorkOrder' | 'modificationWorkOrder' | 'sasChangeWorkOrder' | 'projectWorkOrder' | 'subseaWorkOrder' | 'overheadMaintenanceWorkOrder' | 'unsupportedOrderType'; diff --git a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderWithOperationList.ts b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderWithOperationList.ts index 69309a07..70515e10 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/WorkOrderWithOperationList.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/WorkOrderWithOperationList.ts @@ -5,6 +5,7 @@ import type { CorrectiveWorkOrderWithOperationSelf } from './CorrectiveWorkOrderWithOperationSelf'; import type { ModificationWorkOrderWithOperationSelf } from './ModificationWorkOrderWithOperationSelf'; +import type { OverheadMaintenanceWorkOrderWithOperationSelf } from './OverheadMaintenanceWorkOrderWithOperationSelf'; import type { PreventiveWorkOrderWithOperationSelf } from './PreventiveWorkOrderWithOperationSelf'; import type { ProjectWorkOrderWithOperationSelf } from './ProjectWorkOrderWithOperationSelf'; import type { SASChangeWorkOrderWithOperationSelf } from './SASChangeWorkOrderWithOperationSelf'; @@ -17,5 +18,6 @@ export type WorkOrderWithOperationList = { sasChangeWorkOrders?: Array; projectWorkOrders?: Array; subseaWorkOrders?: Array; + overheadMaintenanceWorkOrders?: Array; }; diff --git a/packages/api/maintenance-api/src/lib/generated/models/includeWorkOrderTypes.ts b/packages/api/maintenance-api/src/lib/generated/models/includeWorkOrderTypes.ts index f092283f..66b3de51 100644 --- a/packages/api/maintenance-api/src/lib/generated/models/includeWorkOrderTypes.ts +++ b/packages/api/maintenance-api/src/lib/generated/models/includeWorkOrderTypes.ts @@ -6,4 +6,4 @@ /** * Include which types of work orders. Use comma-separated list of entries. */ -export type includeWorkOrderTypes = Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>; +export type includeWorkOrderTypes = Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>; diff --git a/packages/api/maintenance-api/src/lib/generated/services/CharacteristicsService.ts b/packages/api/maintenance-api/src/lib/generated/services/CharacteristicsService.ts index 3cc8b918..9fa1e67e 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/CharacteristicsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/CharacteristicsService.ts @@ -22,7 +22,7 @@ export class CharacteristicsService { * | 002 | Equipment | * | 003 | Tags | * | 015 | Notification Item | - * | 017 | Equipment | + * | 017 | Document | * | 037 | Measuring Point | * * @returns CharacteristicForSearch Success diff --git a/packages/api/maintenance-api/src/lib/generated/services/CorrectiveWorkOrdersService.ts b/packages/api/maintenance-api/src/lib/generated/services/CorrectiveWorkOrdersService.ts index cbd72afd..f6480e0c 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/CorrectiveWorkOrdersService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/CorrectiveWorkOrdersService.ts @@ -139,14 +139,13 @@ export class CorrectiveWorkOrdersService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services` * + * ### Update release 1.32.0 + * Added `include-cost-data-for-materials` query parameter. + * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * * ### Update release 1.33.0 * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials` * - * ### Update release 1.33.1 - * Added `include-cost-data-for-materials` query parameter. - * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. - * * ### Update release 1.34.0 * Added new property `relatedOperations` to `maintenanceRecords` and `tagsRelated`. * Also added query parameter `include-related-operations` to include the property `relatedOperations`. @@ -160,6 +159,21 @@ export class CorrectiveWorkOrdersService { * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * ### Upcoming future release + * Added new property `hasCommunication` + * * @returns CorrectiveWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -217,7 +231,7 @@ export class CorrectiveWorkOrdersService { */ includeStatusDetails?: boolean, /** - * Include detailed for the main tag of the Work order + * Include detailed information for the main tag of the Work order */ includeTagDetails?: boolean, /** @@ -769,6 +783,12 @@ export class CorrectiveWorkOrdersService { * ### Update release 1.27.0 * Work orders now include the property 'isOpen' * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns CorrectiveWorkOrderSimple Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -894,6 +914,12 @@ export class CorrectiveWorkOrdersService { * * To see which operationIds are already reserved, use `/maintenance-api/maintenance-records/failure-reports/{record-id}&include-task-list=true` * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from the response. See STRY0261073 in ServiceNow for more details. + * * @returns ProblemDetails Response for other HTTP status codes * @returns CorrectiveWorkOrderBasic Created * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/DocumentsService.ts b/packages/api/maintenance-api/src/lib/generated/services/DocumentsService.ts index 4de7af3a..0ed073dc 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/DocumentsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/DocumentsService.ts @@ -832,6 +832,48 @@ export class DocumentsService { }); } + /** + * Document - Attachment upload + * Upload attachment to a B30 document. + * + * Limitations of Attachment upload endpoints: + * - No support for parallel calls (uploading multiple attachments at once). + * - Maximum file size is 60 MB. Files between 60.0MB - 99.9MB will give a 400 error. Files larger than 100MB will result in a `413 Request Entity Too Large' Error in HTML. This is due to constraints in the underlying system and is outside of our control. + * + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static uploadDocumentAttachment({ + documentId, + formData, + }: { + /** + * Can be found by sending a GET request to: `/document-relationships/{relationship-type}/{source-id}` + * + */ + documentId: string, + formData?: { + files?: Array; + }, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/documents/{document-id}/attachments', + path: { + 'document-id': documentId, + }, + formData: formData, + mediaType: 'multipart/form-data', + errors: { + 403: `User does not have sufficient rights to upload attachment`, + 404: `The specified resource was not found`, + 413: `Request Entity Too Large. + This error occurs when the size of an attachment exceeds 100MB. + `, + }, + }); + } + /** * Document - Attachment download * ### Overview @@ -872,7 +914,10 @@ export class DocumentsService { * * This endpoint returns no response data. Perform a lookup on the linked maintenance record to get updated information. * - * Currently, this endpoint only supports removing attachments from documents of type 'B30'. + * Currently, this endpoint only supports removing attachments from documents of type 'B30' & 'C05'. + * + * ### Update release 1.36.0 + * Added support for removing attachments from documents of type 'C05'. * * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/EquipmentService.ts b/packages/api/maintenance-api/src/lib/generated/services/EquipmentService.ts index ac8ff07d..1dc67fc6 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/EquipmentService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/EquipmentService.ts @@ -114,6 +114,15 @@ export class EquipmentService { * ### Update release 1.35.0 * Added new fields `maintenancePlantId`, `createdOnDate` and `changedOnDate`. * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * Added new work order type `overHeadMaintenanceWorkOrders` to response. + * * @returns Equipment Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -161,7 +170,7 @@ export class EquipmentService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Limit include-work-orders to only open work order */ @@ -703,6 +712,15 @@ export class EquipmentService { * * Added new filters based on the new fields - `maintenancePlantId`, `equipmentCategoryId`, `maintenanceConceptId`, `createdOnDate` and `changedOnDate`. * + * ### Update release 1.36.0 + * Added new properies `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * Added new work order type `overHeadMaintenanceWorkOrders` to response. + * * @returns EquipmentSearchItem Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -846,7 +864,7 @@ export class EquipmentService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Limit include-work-orders to only open work order */ diff --git a/packages/api/maintenance-api/src/lib/generated/services/FailureReportsService.ts b/packages/api/maintenance-api/src/lib/generated/services/FailureReportsService.ts index c48dbd59..f3b14360 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/FailureReportsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/FailureReportsService.ts @@ -111,6 +111,9 @@ export class FailureReportsService { * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. * + * ### Update release 1.37.0 + * Added support for new work order type `overheadMaintenanceWorkOrders` to `workOrderTypeId` enum of allowed types. + * * @returns FailureReport Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -261,6 +264,9 @@ export class FailureReportsService { * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. * + * ### Update release 1.37.0 + * Added support for new work order type `overheadMaintenanceWorkOrders` to `workOrderTypeId` enum of allowed types. + * * @returns FailureReportBasic Success, the failure report has been updated * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -498,6 +504,9 @@ export class FailureReportsService { * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. * + * ### Update release 1.37.0 + * Added support for new work order type `overheadMaintenanceWorkOrders` to `workOrderTypeId` enum of allowed types. + * * @returns FailureReportSimpleForSearch Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -609,6 +618,9 @@ export class FailureReportsService { * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. * + * ### Update release 1.37.0 + * Added support for `overheadMaintenanceWorkOrders`. + * * @returns ProblemDetails Response for other HTTP status codes * @returns FailureReportBasic Created * @throws ApiError @@ -800,16 +812,18 @@ export class FailureReportsService { * When a task is created, it will have status `TSOS - Outstanding task` and `CRTE - Created`. * The status `TSRL - Task Released` can be set afterwards. * - * Now it is possible to set following statuses: + * Now it is possible to activate following statuses: * - TSRL Task Released * - TSCO Task Completed * - TSSC Task successful + * + * It is possible to activate and deactivate following statuses: * - TCMP WF when task completed - * - RIND Returned - Wait for info + * - RTND Returned - Wait for info * - CANC Cancelled * - * ### Upcoming changes - * Enabled activation of user statuses like `TCMP - WF when task completed`, `RIND - Returned - Wait for info` and `CANC - Cancelled` + * ### Update release 1.36.0 + * Enabled activation and deactivation of user statuses like `TCMP - WF when task completed`, `RTND - Returned - Wait for info` and `CANC - Cancelled` * * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/MasterDataForPlantsService.ts b/packages/api/maintenance-api/src/lib/generated/services/MasterDataForPlantsService.ts index c15bb46a..04db058a 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/MasterDataForPlantsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/MasterDataForPlantsService.ts @@ -289,16 +289,19 @@ export class MasterDataForPlantsService { * ### Update release 1.31.0 * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. - * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * + * ### Update release 1.33.0 + * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. + * * ### Update release 1.35.0 * Added new properties `requisitionerId` and `deliveryComplete` to `materials` in `operations`. * + * ### Update release 1.36.0 + * Added `superiorRoutingCounterId` to `operations`. + * * @returns PlanningPlantRevision Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -385,16 +388,19 @@ export class MasterDataForPlantsService { * * Split parts of `location` on `materials` into `finalLocation` and `temporaryLocation` in the response. * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. - * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * + * ### Update release 1.33.0 + * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. + * * ### Update release 1.35.0 * Added new properties `requisitionerId` and `deliveryComplete` to `materials` in `operations`. * + * ### Update release 1.36.0 + * Added `superiorRoutingCounterId` to response. + * * @returns RevisionWorkOrderOperation Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/MeasuringPointsService.ts b/packages/api/maintenance-api/src/lib/generated/services/MeasuringPointsService.ts index 3419bb32..b6253ae1 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/MeasuringPointsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/MeasuringPointsService.ts @@ -48,6 +48,9 @@ export class MeasuringPointsService { * ### Update release 1.21.0 * Measuring points for equipment now include the `tagId` and `tagPlantId` of the tag the equipment is installed on. * + * ### Update release 1.37.0 + * Added `include-measurement-text` query parameter to include measurement text in the response. + * * @returns MeasuringPoint Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -59,6 +62,7 @@ export class MeasuringPointsService { includeQualitativeCodeGroup = false, includeCharacteristics = false, includeCharacteristicsWithoutValue = false, + includeMeasurementText = false, }: { /** * Measuring point id @@ -84,6 +88,10 @@ export class MeasuringPointsService { * Include all characteristics available for the measuring point regardless if they have a defined value or not. Use `include-characteristics` to only include characteristics with defined value for the measuring point. */ includeCharacteristicsWithoutValue?: boolean, + /** + * Include measurement text in the response + */ + includeMeasurementText?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', @@ -97,6 +105,7 @@ export class MeasuringPointsService { 'include-qualitative-code-group': includeQualitativeCodeGroup, 'include-characteristics': includeCharacteristics, 'include-characteristics-without-value': includeCharacteristicsWithoutValue, + 'include-measurement-text': includeMeasurementText, }, errors: { 404: `The specified resource was not found`, @@ -197,6 +206,9 @@ export class MeasuringPointsService { * Added `characteristic-value-any-of`, `class-id` and `characteristic-id` query parameters. * Can be used to search for measuring points based on values of a characteristic. * + * ### Update future release + * Added `include-measurement-text` query parameter to include measurement text in the response. + * * @returns MeasuringPoint Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -219,6 +231,7 @@ export class MeasuringPointsService { characteristicId, classId, characteristicValueAnyOf, + includeMeasurementText = false, }: { /** * Filter to limit the measuring points by @@ -288,6 +301,10 @@ export class MeasuringPointsService { * Search based on characteristic values. Must be used in combination with `class-id` and `characteristic-id`. Wildcards are not supported. Make sure to encode the parameters if they contain special characters. */ characteristicValueAnyOf?: string, + /** + * Include measurement text in the response + */ + includeMeasurementText?: boolean, }): CancelablePromise | ProblemDetails> { return __request(OpenAPI, { method: 'GET', @@ -310,6 +327,7 @@ export class MeasuringPointsService { 'characteristic-id': characteristicId, 'class-id': classId, 'characteristic-value-any-of': characteristicValueAnyOf, + 'include-measurement-text': includeMeasurementText, }, errors: { 404: `The specified resource was not found`, @@ -370,6 +388,9 @@ export class MeasuringPointsService { * ### Update release 1.15.0 * Added `workOrderId` to request and response. * + * ### Update release 1.37.0 + * Add support for `text` in the request body and response. + * * @returns ProblemDetails Response for other HTTP status codes * @returns Measurement Created * @throws ApiError @@ -405,7 +426,10 @@ export class MeasuringPointsService { /** * Measurement - Update * Update a measurement for measuring point. - * The supported fields are: `measurementTitle` and `processingStatus`. + * The supported fields are: `measurementTitle` and `processingStatusId`. + * + * ### Update release 1.37.0 + * Add support for `text` in the request body. * * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/ModificationWorkOrdersService.ts b/packages/api/maintenance-api/src/lib/generated/services/ModificationWorkOrdersService.ts index 19c85eda..e51fe6be 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/ModificationWorkOrdersService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/ModificationWorkOrdersService.ts @@ -38,6 +38,9 @@ export class ModificationWorkOrdersService { * ### Update release 1.31.0 * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from the response. See STRY0261073 in ServiceNow for more details. + * * @returns ProblemDetails Response for other HTTP status codes * @returns ModificationWorkOrderBasic Created * @throws ApiError @@ -164,7 +167,7 @@ export class ModificationWorkOrdersService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * @@ -181,6 +184,18 @@ export class ModificationWorkOrdersService { * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns ModificationWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -229,7 +244,7 @@ export class ModificationWorkOrdersService { */ includeStatusDetails?: boolean, /** - * Include detailed for the main tag of the Work order + * Include detailed information for the main tag of the Work order */ includeTagDetails?: boolean, /** diff --git a/packages/api/maintenance-api/src/lib/generated/services/ModifiedEndpointsService.ts b/packages/api/maintenance-api/src/lib/generated/services/ModifiedEndpointsService.ts index 9aaf9d5c..674c938f 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/ModifiedEndpointsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/ModifiedEndpointsService.ts @@ -3,31 +3,44 @@ /* tslint:disable */ /* eslint-disable */ import type { CorrectiveWorkOrder } from '../models/CorrectiveWorkOrder'; -import type { Document } from '../models/Document'; +import type { CorrectiveWorkOrderBasic } from '../models/CorrectiveWorkOrderBasic'; +import type { CorrectiveWorkOrderCreate } from '../models/CorrectiveWorkOrderCreate'; +import type { CorrectiveWorkOrderSimple } from '../models/CorrectiveWorkOrderSimple'; import type { Equipment } from '../models/Equipment'; -import type { EquipmentBasicV2 } from '../models/EquipmentBasicV2'; -import type { EquipmentCreate } from '../models/EquipmentCreate'; import type { EquipmentSearchItem } from '../models/EquipmentSearchItem'; -import type { FailureReport } from '../models/FailureReport'; import type { FailureReportBasic } from '../models/FailureReportBasic'; import type { FailureReportCreate } from '../models/FailureReportCreate'; -import type { FailureReportJsonPatch } from '../models/FailureReportJsonPatch'; import type { FailureReportSimpleForSearch } from '../models/FailureReportSimpleForSearch'; -import type { MaintenanceRecordList } from '../models/MaintenanceRecordList'; +import type { Measurement } from '../models/Measurement'; +import type { MeasurementCreate } from '../models/MeasurementCreate'; +import type { MeasurementUpdate } from '../models/MeasurementUpdate'; +import type { MeasuringPoint } from '../models/MeasuringPoint'; import type { ModificationWorkOrder } from '../models/ModificationWorkOrder'; -import type { PlanningPlantRevision } from '../models/PlanningPlantRevision'; +import type { ModificationWorkOrderBasic } from '../models/ModificationWorkOrderBasic'; +import type { ModificationWorkOrderCreate } from '../models/ModificationWorkOrderCreate'; import type { PreventiveWorkOrder } from '../models/PreventiveWorkOrder'; +import type { PreventiveWorkOrderBasic } from '../models/PreventiveWorkOrderBasic'; +import type { PreventiveWorkOrderCreate } from '../models/PreventiveWorkOrderCreate'; +import type { PreventiveWorkOrderSimple } from '../models/PreventiveWorkOrderSimple'; import type { ProblemDetails } from '../models/ProblemDetails'; import type { ProjectWorkOrder } from '../models/ProjectWorkOrder'; -import type { RevisionWorkOrderOperation } from '../models/RevisionWorkOrderOperation'; +import type { ProjectWorkOrderBasic } from '../models/ProjectWorkOrderBasic'; +import type { ProjectWorkOrderCreate } from '../models/ProjectWorkOrderCreate'; +import type { ProjectWorkOrderSimple } from '../models/ProjectWorkOrderSimple'; import type { SASChangeWorkOrder } from '../models/SASChangeWorkOrder'; +import type { SASChangeWorkOrderBasic } from '../models/SASChangeWorkOrderBasic'; +import type { SASChangeWorkOrderCreate } from '../models/SASChangeWorkOrderCreate'; +import type { SASChangeWorkOrderSimple } from '../models/SASChangeWorkOrderSimple'; import type { SubseaWorkOrder } from '../models/SubseaWorkOrder'; -import type { SubseaWorkOrderMaterialForAddMaterialRespone } from '../models/SubseaWorkOrderMaterialForAddMaterialRespone'; +import type { SubseaWorkOrderMaterialForAddMaterialResponse } from '../models/SubseaWorkOrderMaterialForAddMaterialResponse'; import type { Tag } from '../models/Tag'; import type { TagSearch } from '../models/TagSearch'; +import type { WorkOrderChangeLogs } from '../models/WorkOrderChangeLogs'; +import type { WorkOrderInPlan } from '../models/WorkOrderInPlan'; import type { WorkOrderMaterialAdd } from '../models/WorkOrderMaterialAdd'; -import type { WorkOrderMaterialForAddMaterialRespone } from '../models/WorkOrderMaterialForAddMaterialRespone'; -import type { WorkOrderOptimizedForQuery } from '../models/WorkOrderOptimizedForQuery'; +import type { WorkOrderMaterialForAddMaterialResponse } from '../models/WorkOrderMaterialForAddMaterialResponse'; +import type { WorkOrderServiceOperationJsonPatch } from '../models/WorkOrderServiceOperationJsonPatch'; +import type { WorkOrderTypes } from '../models/WorkOrderTypes'; import type { WorkOrderWithOperationList } from '../models/WorkOrderWithOperationList'; import type { CancelablePromise } from '../core/CancelablePromise'; @@ -36,119 +49,6 @@ import { request as __request } from '../core/request'; export class ModifiedEndpointsService { - /** - * Maintenance records - Search - * ### Overview - * Search for Maintenance records regardless of type through predefined filters. - * Each filter has a defined action and a set of parameters as described below. - * - * ### Response - * The response does not include all details for each Maintenance record. - * This can be found by subsequent call to lookup for the respective maintenance record resource type - * - * ### Filter: by-external-partner-record-id - * Find open Maintenance records for an id in an external partner system. Note: In theory different external system could have the same `external-partner-record-id` but it's very unlikely. Clients are recommended to filter the response based on the plants they are interested in to avoid any issues. - * - * Parameters: - * - external-partner-record-id - * - * ### Filter: my-recent-maintenance-records - * Find maintenance record created by the logged in user. - * - * Parameters: - * - created-after-datetime (optional) - * - * ### Filter: recently-changed - * Find maintenance records which have been recently changed (created or updated) for a given plant. Normally, clients will provide parameters changed-since-datetime and plant-id and in this case the endpoint will return any changed maintenance record from changed-since-datetime and to now. It is also possible to add before-datetime query parameter and the endpoint will then return any changed maintenance between changed-since-datetime and before-datetime. - * - * Parameters: - * - plant-id - * - changed-since-datetime - * - before-datetime (optional) - * - * ### Update release 1.2.0 - * Added filter `my-recent-maintenance-records`. - * - * ### Update release 1.5.0 - * Added filter `recently-changed` and maintenance record types `modification-proposal`, `certification-report`,`technical-information-update-request` and `technical-clarification`. - * - * ### Update release 1.8.0 - * Added properties hasUnsafeFailureMode and unsafeFailureModeStatus for failure reports. - * - * ### Update release 1.9.0 - * Renamed property plannerGroupPlantId to planningPlantId. - * - * ### Update release 1.12.0 - * Added property `maintenanceRecordTypeId`. - * - * ### Update release 1.16.0 - * Added property `workCenterId` to `maintenanceRecords.failureReports` - * - * ### Update release 1.35.0 - * Added `workOrderTypeId` and `workOrderId` to the response for failure reports. `workOrderId` - * includes the id of work orders, not constrained to only showing corrective work orders. - * - * @returns MaintenanceRecordList Success - * @returns ProblemDetails Response for other HTTP status codes - * @throws ApiError - */ - public static searchMaintenanceRecords({ - filter, - externalPartnerRecordId, - createdAfterDatetime, - plantId, - changedSinceDatetime, - beforeDatetime, - includeMaintenanceRecordTypes, - }: { - /** - * Filter to limit the failure reports by - */ - filter: 'by-external-partner-record-id' | 'my-recent-maintenance-records' | 'recently-changed', - /** - * If failure report was initially created in an external system, this represent the unique id of it - */ - externalPartnerRecordId?: string, - /** - * Optional parameter to limit the response to only maintenance records changed after changed-since-datetime but before this datetime - */ - createdAfterDatetime?: string, - /** - * Plant identifier - */ - plantId?: string, - /** - * Earliest datetime to returned changed work orders for - */ - changedSinceDatetime?: string, - /** - * Optional parameter to limit the response to only work orders changed after changed-since-datetime but before this datetime - */ - beforeDatetime?: string, - /** - * Include which types of maintenance records - */ - includeMaintenanceRecordTypes?: Array<'failure-report' | 'activity-report' | 'certification-report' | 'technical-information-update-request' | 'technical-clarification' | 'modification-proposal'>, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/maintenance-records', - query: { - 'filter': filter, - 'external-partner-record-id': externalPartnerRecordId, - 'created-after-datetime': createdAfterDatetime, - 'plant-id': plantId, - 'changed-since-datetime': changedSinceDatetime, - 'before-datetime': beforeDatetime, - 'include-maintenance-record-types': includeMaintenanceRecordTypes, - }, - errors: { - 400: `Bad request, for example if \`before-datetime\` is before \`changed-since-datetime\``, - 404: `The specified resource was not found`, - }, - }); - } - /** * Tag - Lookup * ### Overview @@ -223,6 +123,18 @@ export class ModifiedEndpointsService { * ### Update release 1.35.0 * Added new fields `maintenancePlantId`, `createdOnDate` and `changedOnDate`. * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * + * ### Update future release + * + * Added new property `hasCommunication` + * * @returns Tag Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -266,7 +178,7 @@ export class ModifiedEndpointsService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Include installed equipment */ @@ -432,6 +344,15 @@ export class ModifiedEndpointsService { * ### Update release 1.35.0 * Added new fields `maintenancePlantId`, `createdOnDate` and `changedOnDate`. * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * Added new work order type `overHeadMaintenanceWorkOrders` to response. + * * @returns Equipment Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -479,7 +400,7 @@ export class ModifiedEndpointsService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Limit include-work-orders to only open work order */ @@ -562,51 +483,6 @@ export class ModifiedEndpointsService { }); } - /** - * Equipment - Create - * ### Overview - * Create equipment and possibly install at tag. - * - * ### Important information - * In the current version of the endpoint, it's only possible to create equipment with equipmentCategoryId `R` = Process Equipment. - * - * If the request includes `installedAtTag`, the equipment will inherit properties such as `planningPlantId`, `plannerGroupId`, `workCenterId`, `ABCId`, `systemId` and `locationId`from the tag. - * - * Access to the role `YO059 - Static Process Equipment Data Establisher (SAPP03)` is required. - * - * ### Update release 1.26.0 - * Added properties `tagId` and `tagPlantId` to response body. - * - * ### Update release 1.31.0 - * Added properties `manufacturerPartNumber`, `technicalIdentificationNumber`, `objectWeight` and `unitOfWeight` to response body. - * - * ### Update release 1.35.0 - * Added new fields `maintenancePlantId`, `equipmentCategoryId`, `maintenanceConceptId`, `createdOnDate` and `changedOnDate` to response body. - * - * @returns ProblemDetails Response for other HTTP status codes - * @returns EquipmentBasicV2 Created - * @throws ApiError - */ - public static createEquipment({ - requestBody, - }: { - /** - * Equipment to create - */ - requestBody: EquipmentCreate, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/equipment', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request, for example if missing required properties, \`equipmentCategoryId\` is not \`R\` or if \`installedAtTag\` is invalid or is not in service.`, - 403: `User does not have sufficient rights to create an equipment.`, - }, - }); - } - /** * Equipment - Search * ### Overview @@ -713,6 +589,15 @@ export class ModifiedEndpointsService { * * Added new filters based on the new fields - `maintenancePlantId`, `equipmentCategoryId`, `maintenanceConceptId`, `createdOnDate` and `changedOnDate`. * + * ### Update release 1.36.0 + * Added new properies `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * Added new work order type `overHeadMaintenanceWorkOrders` to response. + * * @returns EquipmentSearchItem Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -856,7 +741,7 @@ export class ModifiedEndpointsService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Limit include-work-orders to only open work order */ @@ -927,433 +812,366 @@ export class ModifiedEndpointsService { } /** - * Document - Search + * Measuring point - Lookup * ### Overview - * Search documents and include related information such as characteristics, materials, equipment and attachments. + * Lookup a single measuring point. * + * A measuring point represents the physical or virtual location at which process values, events or conditions are described. For instance a temperature reader, pressure sensor, or a spot on a pipe where thickness is measured. * - * The client must in the request provide at least one of the following search parameters: - * * `document-type-any-of` - * * `document-number-any-of` - * * `characteristic-value-any-of` + * Measuring points indicate where measurements (or derived/calculated values) occur. * - * **N.B** The link in the attachment object is in the first iteration always routed via the equipment attachment endpoint. - * In a future release we will implement a general endpoint `documents/attachment/{attachment-id}` for downloading attachments which will be displayed here. + * A measuring point is normally connected to a tag or equipment, facilitating the monitoring of its state and performance. * - * ### Update release 1.31.0 - * Added `include-inventory-count` query parameter to include `equipmentInventoryCount` and `materialInventoryCount` property in the response. + * ### Important information + * Measuring points support quantitative (example 3mm), qualitative (example YES) or combination of the two when creating measurements for the measuring point. * - * Added support for including more business objects: `include-tags`, `include-measuring-points` and `include-maintenance-records`. + * Quantitative measurements are defined by quantitativeCharacteristicId and have a unit of measure. * - * ### Update release 1.32.0 - * Added `include-url-references` query parameter to include URL references in the response. + * Qualitative measurement codes are defined by qualitativeCodeGroupId. + * + * ### Update release 1.10.0 + * Added property `maintenanceRecordId` to measurements. * - * Added properties `statusId` and `statusText` to the response. + * Added `include-characteristics` and `include-characteristics-without-value` query parameter. * - * Added properties `partNumber` & `manufacturer` to `material` in the response. + * ### Update release 1.15.0 + * Added `workOrderId` to response. * - * ### Update release 1.35.0 - * Added new fields `maintenancePlantId`, `equipmentCategoryId`, `maintenanceConceptId`, `createdOnDate` and `changedOnDate` for `equipment`. + * ### Update release 1.21.0 + * Measuring points for equipment now include the `tagId` and `tagPlantId` of the tag the equipment is installed on. + * + * ### Update release 1.37.0 + * Added `include-measurement-text` query parameter to include measurement text in the response. * - * @returns Document Success + * @returns MeasuringPoint Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static searchDocuments({ - documentTypeAnyOf, - documentNumberAnyOf, - characteristicValueAnyOf, - characteristicId, - classId, + public static lookupMeasuringPoint({ + pointId, + includeLastMeasurement = false, + includeMeasurements = false, + includeQualitativeCodeGroup = false, includeCharacteristics = false, - includeMaterial = false, - includeEquipment = false, - includeTags = false, - includeMaintenanceRecords = false, - includeMeasuringPoints = false, - includeAttachments = false, - includeInventoryCount = false, - includeUrlReferences = false, - perPage = 50, - page = 1, + includeCharacteristicsWithoutValue = false, + includeMeasurementText = false, }: { /** - * Search based on `documentType`. + * Measuring point id */ - documentTypeAnyOf?: Array, + pointId: string, /** - * Search based on `documentNumber`. - */ - documentNumberAnyOf?: Array, - /** - * Search based on characteristic values. Must be used in combination with `class-id` and `characteristic-id` Wildcards are not supported. Make sure to encode the parameters if they contain special characters. + * Include last measurement for the measuring points (only relevant if include-measuring-points is true or if looking up measuring point) */ - characteristicValueAnyOf?: string, + includeLastMeasurement?: boolean, /** - * Required field if `characteristic-value-any-of` is supplied. Endpoint [/characteristics/{class-id}](#operation/LookupClass) can be used to find characteristic ids + * Include measurements of the measuring point */ - characteristicId?: string | null, + includeMeasurements?: boolean, /** - * Required field if `characteristic-value-any-of` is supplied. + * Include possible codes for qualitative measurements if qualitativeCodeGroupId is set */ - classId?: string | null, + includeQualitativeCodeGroup?: boolean, /** - * Include characteristics' + * Include characteristics with defined value for the measuring point. Use `include-characteristics-without-value` to retrieve all characteristics available for the measuring point. */ includeCharacteristics?: boolean, /** - * Include material related to the object - */ - includeMaterial?: boolean, - /** - * Include equipment related to the object - */ - includeEquipment?: boolean, - /** - * Include tags. - */ - includeTags?: boolean, - /** - * Include maintenance records. If include-maintenance-record-types is not supplied, all supported types are returned - */ - includeMaintenanceRecords?: boolean, - /** - * Include measuring points for this tag - */ - includeMeasuringPoints?: boolean, - /** - * Include equipment or tag attachments - */ - includeAttachments?: boolean, - includeInventoryCount?: boolean, - /** - * Include URL references for object - */ - includeUrlReferences?: boolean, - /** - * Results to return pr page + * Include all characteristics available for the measuring point regardless if they have a defined value or not. Use `include-characteristics` to only include characteristics with defined value for the measuring point. */ - perPage?: number, + includeCharacteristicsWithoutValue?: boolean, /** - * Page to fetch + * Include measurement text in the response */ - page?: number, - }): CancelablePromise | ProblemDetails> { + includeMeasurementText?: boolean, + }): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/documents', + url: '/measuring-points/{point-id}', + path: { + 'point-id': pointId, + }, query: { - 'document-type-any-of': documentTypeAnyOf, - 'document-number-any-of': documentNumberAnyOf, - 'characteristic-value-any-of': characteristicValueAnyOf, - 'characteristic-id': characteristicId, - 'class-id': classId, + 'include-last-measurement': includeLastMeasurement, + 'include-measurements': includeMeasurements, + 'include-qualitative-code-group': includeQualitativeCodeGroup, 'include-characteristics': includeCharacteristics, - 'include-material': includeMaterial, - 'include-equipment': includeEquipment, - 'include-tags': includeTags, - 'include-maintenance-records': includeMaintenanceRecords, - 'include-measuring-points': includeMeasuringPoints, - 'include-attachments': includeAttachments, - 'include-inventory-count': includeInventoryCount, - 'include-url-references': includeUrlReferences, - 'per-page': perPage, - 'page': page, + 'include-characteristics-without-value': includeCharacteristicsWithoutValue, + 'include-measurement-text': includeMeasurementText, }, errors: { - 400: `Request is missing required parameters`, - 403: `User does not have sufficient rights to view document`, 404: `The specified resource was not found`, }, }); } /** - * Document - Lookup - * ### Overview - * Lookup document by id. Use the different include parameters to include additional information about the document. - * [POST document-relationships/{relationship-type}/{source-id}](#operation/AddRelationshipsToDocument) can be used to link the document to a business object. + * Measurement - Create + * Create new measurement for measuring point. * - * **N.B** The link in the attachment object is in the first iteration always routed via the equipment attachment endpoint. - * In a future release we will implement a general endpoint `documents/attachment/{attachment-id}` for downloading attachments which will be displayed here. - * - * ### Update release 1.31.0 - * Added `include-inventory-count` query parameter to include `equipmentInventoryCount` and `materialInventoryCount` property in the response. - * - * Added support for including more business objects: `include-tags`, `include-measuring-points` and `include-maintenance-records`. + * ### Important information + * Measuring points support quantitative (example 3mm), qualitative (example YES) or combination of the two when creating measurements for the measuring point. * - * ### Update release 1.32.0 - * Added `include-url-references` query parameter to include URL references in the response. + * Quantitative measurements are defined by quantitativeCharacteristicId property of the measuring point. Make sure the quantitativeReading is in the reading unit of the measuring point. * - * Added `changedDateTime` for attachments. + * Qualitative measurement codes are defined by qualitativeCodeGroupId property of the measuring point. * - * Added properties `statusId` and `statusText` to the response. + * ### Update release 1.10.0 + * Added `maintenanceRecordId` to request. * - * Added properties `partNumber` & `manufacturer` to `material` in the response. + * ### Update release 1.15.0 + * Added `workOrderId` to request and response. * - * ### Update release 1.35.0 - * Added new fields `maintenancePlantId`, `equipmentCategoryId`, `maintenanceConceptId`, `createdOnDate` and `changedOnDate` for `equipment`. + * ### Update release 1.37.0 + * Add support for `text` in the request body and response. * - * @returns Document Success * @returns ProblemDetails Response for other HTTP status codes + * @returns Measurement Created * @throws ApiError */ - public static lookupDocument({ - documentId, - includeCharacteristics = false, - includeMaterial = false, - includeEquipment = false, - includeTags = false, - includeMaintenanceRecords = false, - includeMeasuringPoints = false, - includeAttachments = false, - includeInventoryCount = false, - includeUrlReferences = false, + public static createMeasurement({ + pointId, + requestBody, }: { /** - * Unique id for the document to be used against endpoints for the `/documents` resource - */ - documentId: string, - /** - * Include characteristics' - */ - includeCharacteristics?: boolean, - /** - * Include material related to the object - */ - includeMaterial?: boolean, - /** - * Include equipment related to the object - */ - includeEquipment?: boolean, - /** - * Include tags. - */ - includeTags?: boolean, - /** - * Include maintenance records. If include-maintenance-record-types is not supplied, all supported types are returned - */ - includeMaintenanceRecords?: boolean, - /** - * Include measuring points for this tag - */ - includeMeasuringPoints?: boolean, - /** - * Include equipment or tag attachments + * Measuring point id */ - includeAttachments?: boolean, - includeInventoryCount?: boolean, + pointId: string, /** - * Include URL references for object + * Measurement of measuring point to create */ - includeUrlReferences?: boolean, - }): CancelablePromise { + requestBody: MeasurementCreate, + }): CancelablePromise { return __request(OpenAPI, { - method: 'GET', - url: '/documents/{document-id}', + method: 'POST', + url: '/measuring-points/{point-id}/measurements', path: { - 'document-id': documentId, - }, - query: { - 'include-characteristics': includeCharacteristics, - 'include-material': includeMaterial, - 'include-equipment': includeEquipment, - 'include-tags': includeTags, - 'include-maintenance-records': includeMaintenanceRecords, - 'include-measuring-points': includeMeasuringPoints, - 'include-attachments': includeAttachments, - 'include-inventory-count': includeInventoryCount, - 'include-url-references': includeUrlReferences, + 'point-id': pointId, }, + body: requestBody, + mediaType: 'application/json', errors: { - 400: `Request is missing required parameters`, - 403: `User does not have sufficient rights to view document`, - 404: `The specified resource was not found`, + 400: `Bad request - Can occur if quantitative and qualitative measurements provided are not supported by measuring point`, + 403: `User does not have sufficient rights to create a measurement of measuring point`, }, }); } /** - * Revisions - Search - * ### Overview - * Search revisions for a single plant with related information. + * Measurement - Update + * Update a measurement for measuring point. + * The supported fields are: `measurementTitle` and `processingStatusId`. * - * ### Filter: by-revision-id - * Search by revision ids for a single plant + * ### Update release 1.37.0 + * Add support for `text` in the request body. * - * Parameters: - * - revision-id-any-of - * - include-work-order-operations (default: false) - * - include-work-order-operation-text (default: false) - * - include-only-work-order-operations-with-materials (default: false) - * - * ### Examples - * `/plants/1310/revisions?filter=by-revision-id&revision-id-any-of=OFP,OFP%202022,&include-work-order-operations=true&include-only-work-order-operations-with-materials=true&include-work-order-operation-text=true&api-version=v1` - * - * ### Update release 1.19.0 - * Added parameter `include-text-item-materials`. - * - * ### Update release 1.31.0 - * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` - * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. - * - * ### Update release 1.33.1 - * Added `include-cost-data-for-materials` query parameter. - * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. - * - * ### Update release 1.35.0 - * Added new properties `requisitionerId` and `deliveryComplete` to `materials` in `operations`. - * - * @returns PlanningPlantRevision Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static searchRevisions({ - plantId, - filter, - revisionIdAnyOf, - includeWorkOrderOperations = false, - includeOnlyWorkOrderOperationsWithMaterials = false, - includeTextItemMaterials = false, - includeCostDataForMaterials = false, + public static updateMeasurement({ + pointId, + measurementId, + requestBody, }: { - plantId: string, /** - * Filter to limit revisions + * Measuring point id */ - filter: 'by-revision-id', + pointId: string, /** - * Comma-separated list of revision-id - */ - revisionIdAnyOf?: string, - /** - * Include the work order operations - */ - includeWorkOrderOperations?: boolean, - /** - * Limit the work order operations to only those which have material - */ - includeOnlyWorkOrderOperationsWithMaterials?: boolean, - /** - * Include text item materials + * Measurement id */ - includeTextItemMaterials?: boolean, + measurementId: string, /** - * Include cost data for materials. Additional authorization will be required to retrieve these fields. + * Fields in measuring point to update */ - includeCostDataForMaterials?: boolean, - }): CancelablePromise | ProblemDetails> { + requestBody: Array, + }): CancelablePromise { return __request(OpenAPI, { - method: 'GET', - url: '/plants/{plant-id}/revisions', + method: 'PATCH', + url: '/measuring-points/{point-id}/measurements/{measurement-id}', path: { - 'plant-id': plantId, - }, - query: { - 'filter': filter, - 'revision-id-any-of': revisionIdAnyOf, - 'include-work-order-operations': includeWorkOrderOperations, - 'include-only-work-order-operations-with-materials': includeOnlyWorkOrderOperationsWithMaterials, - 'include-text-item-materials': includeTextItemMaterials, - 'include-cost-data-for-materials': includeCostDataForMaterials, + 'point-id': pointId, + 'measurement-id': measurementId, }, + body: requestBody, + mediaType: 'application/json', errors: { - 404: `The specified resource was not found`, + 400: `Request is missing required parameters`, + 403: `User does not have sufficient rights to update a measurement of measuring point`, }, }); } /** - * Revisions Work Order Operations - Search + * Work order plan - Get * ### Overview - * Search revision work order operations on a plant. + * Get work order activities planned to be performed for a single planning plant. + * The response is normally based on the planned scheduling of work order operations through the properties `earliestStartDateTime` and `earliestFinishDateTime`. It does not use assignment to baseline plan as a source as this does not cover all work. * - * Parameters: - * - include-work-order-operation-text (default: false) - * - include-only-work-order-operations-with-materials (default: false) + * It is possible to use the defined periods from the baseline plans as basis for the query parameters `planPeriodStartDate` and `planPeriodDuration`. Use `/plants/{plant-id}?include-baseline-plan=true&api-version=v1` for this purpose. * - * ### Examples - * `/plants/1310/revisions/PS01-23?include-only-work-order-operations-with-materials=true&include-work-order-operation-text=true&page=1&per-page=10&api-version=v1` + * `personResponsibleId` will normally not be populated as planning is performed on the work center as a whole. * - * ### Update release 1.28.0 - * Added `changedDateTime`,`changedById`, `changedBy`, `changedByEmail`. + * This endpoint returns only Work Order with status 'PLAN'. The field `requiredEndDate` is dependent on workOrderType. * - * ### Update release 1.29.0 - * Added `progressChangedDateTime`, `progressChangedBy`, `progressChangedById` and `progressChangedByEmail` to response. These values represent the last update datetime for technical feedback. - * Altered `changedDateTime`, `changedBy`, `changedById` and `changedByEmail` to only represent last update to the operation. * - * ### Update release 1.30.1 - * Added fields `confirmationDateTime`, `confirmationBy`, `confirmationByEmail` and `confirmationById`. + * ### Filter: by-plan-period + * Provide the plan for a specific planning plant based on a defined plan period. This is the main usage of this endpoint. * - * ### Update release 1.31.0 - * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` + * **For this filter, `plan-period-start` is required.** + * All other parameters are optional. * - * Split parts of `location` on `materials` into `finalLocation` and `temporaryLocation` in the response. + * Example of usage: + * - `/work-order-plan/{planning-plant-id}?filter=by-plan-period&plan-period-start=2023-03-02&plan-period-duration=P21D&location-id-any-of=CD00&include-completed-work-order-operations=false&work-order-types-any-of=preventiveWorkOrders,correctiveWorkOrders&api-version=v1` + * - `/work-order-plan/{planning-plant-id}?filter=by-plan-period&plan-period-start=2023-03-02&plan-period-duration=P21D&work-center-id-any-of=C31*&include-completed-work-order-operations=false&api-version=v1` * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. + * ### Filter: by-person-responsible + * Get the work order plan for a specific planning plant, but only for work orders assigned to a specific user. + * Normally, work orders will not be assigned directly to a user, but in some work processes (such as inspection), this occurs. * - * ### Update release 1.33.1 - * Added `include-cost-data-for-materials` query parameter. - * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. + * **For this filter, it is required to provide either `person-responsible-id` or `person-responsible-email` (but not both).** + * All other parameters are optional. * - * ### Update release 1.35.0 - * Added new properties `requisitionerId` and `deliveryComplete` to `materials` in `operations`. + * Example of usage: + * - `/work-order-plan/{planning-plant-id}?filter=by-person-responsible&person-responsible-email=shortname@equinor.com&include-completed-work-order-operations=false&work-order-types-any-of=preventiveWorkOrders,correctiveWorkOrders&api-version=v1` + * + * ### Update release 1.26.0 + * Added query parameter `work-center-id-any-of`. + * + * ### Update release 1.29.0 + * Added properties `cmrIndicator` and `maintenanceRecordId`. + * + * ### Update release 1.34.0 + * Added following filter options: + * - `main-work-center-id-any-of` + * - `status-any-of` + * - `status-not` + * - `operation-notes-any-of` * - * @returns RevisionWorkOrderOperation Success + * Added following fields to the response: + * - `personResponsible` + * - `mainWorkCenterId` + * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * Added `overheadMaintenanceWorkOrders` to `work-order-types-any-of` query parameter. + * + * @returns WorkOrderInPlan Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static searchRevisionWorkOrderOperations({ - plantId, - revisionId, - includeOnlyWorkOrderOperationsWithMaterials = false, - includeTextItemMaterials = false, - includeCostDataForMaterials = false, - perPage, - page = 1, + public static getWorkOrderPlan({ + planningPlantId, + filter, + planPeriodStart, + planPeriodDuration, + personResponsibleEmail, + personResponsibleId, + includeCompletedWorkOrderOperations = false, + includePersonResponsible = false, + workOrderTypesAnyOf, + workCenterIdAnyOf, + mainWorkCenterIdAnyOf, + revisionIdAnyOf, + locationIdAnyOf, + statusAnyOf, + statusNot, + operationNotesAnyOf, }: { - plantId: string, - revisionId: string, /** - * Limit the work order operations to only those which have material + * Planning plant to retrieve work order plan for */ - includeOnlyWorkOrderOperationsWithMaterials?: boolean, + planningPlantId: string, /** - * Include text item materials + * Filter to limit the work order plan by */ - includeTextItemMaterials?: boolean, + filter: 'by-plan-period' | 'by-person-responsible', /** - * Include cost data for materials. Additional authorization will be required to retrieve these fields. + * Start of plan period (`/plants/{plant-id}?include-baseline-plans=true` can be used as a reference). Required for `filter=by-plan-period`. */ - includeCostDataForMaterials?: boolean, + planPeriodStart?: string, /** - * Results to return pr page + * Duration of plan period */ - perPage?: number, + planPeriodDuration?: string, /** - * Page to fetch + * Email address for responsible person. Should not be used in combination with `person-responsible-id`. */ - page?: number, - }): CancelablePromise | ProblemDetails> { + personResponsibleEmail?: string, + /** + * Id for responsible person. Should not be used in combination with `person-responsible-email`. + */ + personResponsibleId?: string, + /** + * Include Work Order Plans with completed work order operations + */ + includeCompletedWorkOrderOperations?: boolean, + /** + * Include person responsible information in response, for example the email or name of the person responsible. May have a slight performance impact. + */ + includePersonResponsible?: boolean, + /** + * Limit to specific work order types (any-of). Default includes all types + */ + workOrderTypesAnyOf?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, + /** + * Comma-separated list of work-center-id + */ + workCenterIdAnyOf?: string, + /** + * Comma-separated list of main-work-center-id + */ + mainWorkCenterIdAnyOf?: string, + /** + * Comma-separated list of revision-id + */ + revisionIdAnyOf?: string, + /** + * Comma-separated list of location-id + */ + locationIdAnyOf?: string, + /** + * Query based on statusIds (not all statuses are supported) + */ + statusAnyOf?: Array<'STRT' | 'RDOP' | 'TECO' | 'REL' | 'CRTD'>, + /** + * Query based on statusIds (not all statuses are supported) + */ + statusNot?: Array<'STRT' | 'RDOP' | 'TECO' | 'REL' | 'CRTD'>, + /** + * Query based on `planNotes` in operations + */ + operationNotesAnyOf?: string, + }): CancelablePromise | ProblemDetails> { return __request(OpenAPI, { method: 'GET', - url: '/plants/{plant-id}/revisions/{revision-id}/work-order-operations', + url: '/work-order-plan/{planning-plant-id}', path: { - 'plant-id': plantId, - 'revision-id': revisionId, + 'planning-plant-id': planningPlantId, }, query: { - 'include-only-work-order-operations-with-materials': includeOnlyWorkOrderOperationsWithMaterials, - 'include-text-item-materials': includeTextItemMaterials, - 'include-cost-data-for-materials': includeCostDataForMaterials, - 'per-page': perPage, - 'page': page, + 'filter': filter, + 'plan-period-start': planPeriodStart, + 'plan-period-duration': planPeriodDuration, + 'person-responsible-email': personResponsibleEmail, + 'person-responsible-id': personResponsibleId, + 'include-completed-work-order-operations': includeCompletedWorkOrderOperations, + 'include-person-responsible': includePersonResponsible, + 'work-order-types-any-of': workOrderTypesAnyOf, + 'work-center-id-any-of': workCenterIdAnyOf, + 'main-work-center-id-any-of': mainWorkCenterIdAnyOf, + 'revision-id-any-of': revisionIdAnyOf, + 'location-id-any-of': locationIdAnyOf, + 'status-any-of': statusAnyOf, + 'status-not': statusNot, + 'operation-notes-any-of': operationNotesAnyOf, }, errors: { - 404: `The specified resource was not found`, + 400: `Request is missing required parameters`, + 403: `User does not have sufficient rights`, }, }); } @@ -1481,13 +1299,13 @@ export class ModifiedEndpointsService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. - * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * + * ### Update release 1.33.0 + * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. + * * ### Update release 1.34.0 * Added new properties `callNumber`, `previousCall`, and `completionDate` to `maintenancePlan`. * @@ -1507,6 +1325,23 @@ export class ModifiedEndpointsService { * * Added new query parameter `include-estimated-costs`. Set to `true` to include `estimatedCosts` array in the response. * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency`. + * + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * ### Upcoming future release + * Added new property `hasCommunication` + * * @returns PreventiveWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -1569,7 +1404,7 @@ export class ModifiedEndpointsService { */ includeStatusDetails?: boolean, /** - * Include detailed for the main tag of the Work order + * Include detailed information for the main tag of the Work order */ includeTagDetails?: boolean, /** @@ -1635,145 +1470,364 @@ export class ModifiedEndpointsService { } /** - * Corrective Work order - Lookup + * Preventive Work order - Search * ### Overview - * Lookup single Corrective Work order with related information - * - * ### Technical feedback - * Technical feedback ensures a common and best practice maintenance based on the type of tag/equipment. It's mostly used by preventive work orders, but can in some cases be used in corrective work orders. - * As part of work order execution, the technical feedback will need to be completed. - * - * The endpoint `/work-orders/technical-feedback-master-data` describes the business rules for when it's necessary to create a maintenance record based on the status (`feedbackStatusId`) and reason (`feedbackReasonId`) found for the technical feedback. - * - * The `include-technical-feedback` query parameter for preventive and corrective work order lookup endpoints will return the technical feedback for each operation of the provided work order. - * - * If a technical feedback has `isDetailedFeedback: true`, it requires a very specific feedback type currently not supported by the Maintenance API. - * - * When executing a technical feedback item, the end-user will complete the steps described in `maintenanceActivityText` and end up with a result in the form of a status (`feedbackStatusId`) and a reason (`feedbackReasonId`). Compare the result with the business rules defined by `/work-orders/technical-feedback-master-data` and base the next step based on the value of `hasRequiredMaintenanceRecord`: - * - * * `hasRequiredMaintenanceRecord: true`: Create a new maintenance record for technical feedback using the `POST /maintenance-records/failure-reports` or `POST /maintenance-records/activity-reports` endpoints with the relatedWorkOrder properties in the request to specify the work order and technical feedback - * - * * `hasRequiredMaintenanceRecord: false` As no maintenance record is required, the technical feedback is completed using the endpoint `PATCH /work-order-operations/{operation-id}/technical-feedback/{feedback-id}` + * Search for Preventive Work orders through predefined filters. + * Each filter has a defined action and a set of parameters as described below. * - * If you want to include the maintenance records of a technical feedback, one needs to apply both `include-technical-feedback=True`, and `include-maintenance-records=True`. + * ### Response + * The response does not include all details for each preventive work order. + * This can be found by performing a subsequent request to lookup preventive-work-order. * - * ### Production Resources/Tool (PRT) - * Production resources/tools (PRT) are used for materials, tools and equipment that are needed to carry out the task and are to be returned after use. * - * In Equinor, this is normally added as part of maintenance program. - * Maintenance API supports the following PRT resources: - * - Attachments (through query parameter `include-attachments=true`) - * - Measuring points (through query parameter `include-measuring-points=true`) - * - URL references (through query parameter `include-url-references=true`) + * ### Filter: maintenance-plan-history + * Based on the maintenance plan of the Preventive Work order provided, find other instances sorted by start date. + * Parameters: + * - `work-order-id` + * - `earliest-date` (optional) + * - `max-work-orders` (optional) * - * For more information see governing document [GL1624 Guidelines for the establishment of a preventive maintenance programme in SAP](https://docmap.equinor.com/Docmap/page/doc/dmDocIndex.html?DOCKEYID=533758). + * ### Filter: recent-status-activations + * Find Preventive work orders based on recent status activations for the work order. + * Parameters: + * - `status-id` + * - `plant-id` + * - `max-days-since-activation` * - * ### Update release 1.0.0 - * Work order operation actualPercentageComplete now represents progress reported through technical feedback. - * If the Work order operation is completed, the value of actualPercentageComplete will always be 100. + * ### Filter: before-planned-date + * Find open Preventive work orders before the `before-planned-date`. + * Parameters: + * - `plant-id` + * - `planned-date` + * - `location-id` (optional) + * - `system-id` (optional) * - * ### Update release 1.1.0 - * If work-order-id exist, but is not a `correctiveWorkOrder`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. + * ### Filter: by-maintenance-type-id + * Find open Preventive work orders by `maintenance-type-id`. + * Parameters: + * - `plant-id` + * - `maintenance-type-id` * - * ### Update release 1.3.0 - * Introduced holdDeliveryOnshore and requiredDatetime properties for materials. + * ### Update release 0.9.0 + * Added filter by-maintenance-type-id. * - * ### Update release 1.4.0 - * Introduced property calculationKey for operations. + * ### Update release 0.11.0 + * Added `system-id` as optional parameter for filter `before-planned-date`. * * ### Update release 1.5.0 - * Added createdDateTime for attachments. - * - * Added revisionId and revision to work order response (represents shutdown or campaign work). - * - * ### Update release 1.7.0 - * Added equipmentId and equipment to the response of tagsRelated. - * - * Adding sourceId to related maintenance records. - * - * ### Update release 1.8.0 - * Introduced property activeStatusIds for operations. - * - * ### Update release 1.12.0 - * Added new query parameter `include-technical-feedback`. It returns related technical feedback required to be completed as part of work order execution. Technical feedback is mostly used for preventive work orders, but can also be used for corrective work orders. - * - * Introduced property `detectionMethodGroupId` and `detectionMethodId` for technical feedback. - * - * ### Update release 1.15.0 - * Added new query parameter `include-measurements`. - * - * ### Update release 1.16.0 - * Added new query parameters `include-measuring-points`, `include-last-measurement` and `include-url-references`. `include-attachments` extended to also return PRT attachments of an operation. `attachments` now include properties `documentType`, `documentNumber` and `documentTitle`. - * - * ### Update release 1.19.0 - * Added properties `systemCondition` and `isExcludedFromWorkOrderPlan` for operations. + * Added `revisionId` and `revision` to work order response (represents shutdown or campaign work). * * ### Update release 1.21.0 - * Added properties `costs` and `costsCurrency`. - * Added property `area` to tag details. - * - * Added ability to read text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a * configuration switch, which will initially be disabled, and when appropriate, enabled. * - * ### Update release 1.22.0 - * Added new query parameter `include-service-operations`. Operations of type Service - PM03 previously available in the `operations` have been moved to `serviceOperations`. - * - * Added activeStatusIds to related maintenance records. - * * ### Update release 1.24.0 - * `attachments` now include the property `documentCreatedDate` - * - * Removed 'urlReferences' field from response object, and removed 'include-url-references' query parameter. URLReferences are only supported for Notifications. - * * Added property `cmrIndicator` in the response. * - * ### Update release 1.26.0 - * Added property `isEquipmentRental` to services in serviceOperations. - * Added `materials` to serviceOperations. - * - * 'tagDetails' object now includes the new field 'maintenanceConceptId' - * * ### Update release 1.27.0 * Work orders now include the property 'isOpen' * - * ### Update release 1.28.0 - * Added new query parameter `include-safety-measure` - * - * Added new query parameter `include-estimated-costs` - * - * Added `tag` and `title` to `maintenanceRecords` expand. - * - * ### Update release 1.29.0 - * Added new properties for `additionalCostWBSId` and `costWBSId`. - * - * ### Update release 1.31.0 - * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` - * - * Split parts of `location` on `operations.materials` into `finalLocation` and `temporaryLocation` in the response. - * - * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services` - * - * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials` - * - * ### Update release 1.33.1 - * Added `include-cost-data-for-materials` query parameter. - * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. - * - * ### Update release 1.34.0 - * Added new property `relatedOperations` to `maintenanceRecords` and `tagsRelated`. - * Also added query parameter `include-related-operations` to include the property `relatedOperations`. + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency`. * - * Added new properties `isHSECritical` and `isProductionCritical` to the response. + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. * - * ### Update release 1.35.0 - * Added new properties `requisitionerId` and `deliveryComplete` to `materials` in `operations`. + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * @returns PreventiveWorkOrderSimple Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static searchPreventiveWorkOrders({ + filter, + statusId, + plantId, + maxDaysSinceActivation, + workOrderId, + earliestDate, + maxWorkOrders, + locationId, + plannedDate, + systemId, + maintenanceTypeId, + }: { + /** + * Filter to limit the failure reports by + */ + filter: 'recent-status-activations' | 'before-planned-date' | 'by-maintenance-type-id' | 'maintenance-plan-history', + /** + * Status + */ + statusId?: string, + /** + * Plant identifier + */ + plantId?: string, + /** + * Define how many days from the current day to include results for. 0 if only include for today + */ + maxDaysSinceActivation?: number, + /** + * Preventive Work order id + */ + workOrderId?: string, + /** + * Earliest date to find maintenance plan history for (optional for filter) + */ + earliestDate?: string, + /** + * Maximal numbers of results returned (optional for filter) + */ + maxWorkOrders?: number, + /** + * Structured location within the plant. Use /plants/{plant-id}/locations for possible values + */ + locationId?: string, + /** + * Earliest date to find maintenance plan history for (optional for filter) + */ + plannedDate?: string, + /** + * system-id of the preventive work order + * @deprecated + */ + systemId?: string, + /** + * Type of maintenance for the work order + */ + maintenanceTypeId?: string, + }): CancelablePromise | ProblemDetails> { + return __request(OpenAPI, { + method: 'GET', + url: '/work-orders/preventive-work-orders', + query: { + 'filter': filter, + 'status-id': statusId, + 'plant-id': plantId, + 'max-days-since-activation': maxDaysSinceActivation, + 'work-order-id': workOrderId, + 'earliest-date': earliestDate, + 'max-work-orders': maxWorkOrders, + 'location-id': locationId, + 'planned-date': plannedDate, + 'system-id': systemId, + 'maintenance-type-id': maintenanceTypeId, + }, + errors: { + 404: `The specified resource was not found`, + }, + }); + } + + /** + * @deprecated + * Preventive Work order - Create + * ### Overview + * Create new Preventive Work order. + * + * In addition to the required fields, one also needs to supply either `equipmentId` or a Tag (`tagPlantId`-`tagId`) + * + * It's possible to supply operations in the add operations endpoint. If no operations are passed, a default operation will be created automatically. + * + * To lookup the created preventive work order use endpoint `/work-orders/preventive-work-orders/{work-order-id}` + * + * ### Important information ### + * There is an on-going initiative to prevent the possibility to create PM02 work orders in SAP (with the exception of MaintenancePlans). As of Release 1.36.0 on 21.01.2025, the usage of this endpoint is limited to applications with dispensation for usage, documented in disp.equinor.com. + * + * + * To use this endpoint, your business process must be approved by O&M owners. To raise this request, please create a disp on disp.equinor.com, and raise this in O&M [Stryo board](https://equinor.service-now.com/rm_story.do?sys_id=-1&sysparm_stack=rm_story_list.do&sysparm_view=scrum&sysparm_query=rm_story.do%3Fsys_id%3D-1%26sysparm_query%3Dactive%3Dtrue%26sysparm_stack%3Drm_story_list.do%3Fsysparm_query%3Dactive%3Dtrue). + * + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' + * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to the response. + * + * Endpoint is now limited. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * @returns ProblemDetails Response for other HTTP status codes + * @returns PreventiveWorkOrderBasic Created + * @throws ApiError + */ + public static createPreventiveWorkOrder({ + requestBody, + }: { + /** + * Preventive Work order to create + */ + requestBody: PreventiveWorkOrderCreate, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/work-orders/preventive-work-orders', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `The request body is invalid`, + 403: `Client is not allowed to access the endpoint. Please contact the APIphany-team to request access.`, + 404: `The specified resource was not found`, + }, + }); + } + + /** + * Corrective Work order - Lookup + * ### Overview + * Lookup single Corrective Work order with related information + * + * ### Technical feedback + * Technical feedback ensures a common and best practice maintenance based on the type of tag/equipment. It's mostly used by preventive work orders, but can in some cases be used in corrective work orders. + * As part of work order execution, the technical feedback will need to be completed. + * + * The endpoint `/work-orders/technical-feedback-master-data` describes the business rules for when it's necessary to create a maintenance record based on the status (`feedbackStatusId`) and reason (`feedbackReasonId`) found for the technical feedback. + * + * The `include-technical-feedback` query parameter for preventive and corrective work order lookup endpoints will return the technical feedback for each operation of the provided work order. + * + * If a technical feedback has `isDetailedFeedback: true`, it requires a very specific feedback type currently not supported by the Maintenance API. + * + * When executing a technical feedback item, the end-user will complete the steps described in `maintenanceActivityText` and end up with a result in the form of a status (`feedbackStatusId`) and a reason (`feedbackReasonId`). Compare the result with the business rules defined by `/work-orders/technical-feedback-master-data` and base the next step based on the value of `hasRequiredMaintenanceRecord`: + * + * * `hasRequiredMaintenanceRecord: true`: Create a new maintenance record for technical feedback using the `POST /maintenance-records/failure-reports` or `POST /maintenance-records/activity-reports` endpoints with the relatedWorkOrder properties in the request to specify the work order and technical feedback + * + * * `hasRequiredMaintenanceRecord: false` As no maintenance record is required, the technical feedback is completed using the endpoint `PATCH /work-order-operations/{operation-id}/technical-feedback/{feedback-id}` + * + * If you want to include the maintenance records of a technical feedback, one needs to apply both `include-technical-feedback=True`, and `include-maintenance-records=True`. + * + * ### Production Resources/Tool (PRT) + * Production resources/tools (PRT) are used for materials, tools and equipment that are needed to carry out the task and are to be returned after use. + * + * In Equinor, this is normally added as part of maintenance program. + * Maintenance API supports the following PRT resources: + * - Attachments (through query parameter `include-attachments=true`) + * - Measuring points (through query parameter `include-measuring-points=true`) + * - URL references (through query parameter `include-url-references=true`) + * + * For more information see governing document [GL1624 Guidelines for the establishment of a preventive maintenance programme in SAP](https://docmap.equinor.com/Docmap/page/doc/dmDocIndex.html?DOCKEYID=533758). + * + * ### Update release 1.0.0 + * Work order operation actualPercentageComplete now represents progress reported through technical feedback. + * If the Work order operation is completed, the value of actualPercentageComplete will always be 100. + * + * ### Update release 1.1.0 + * If work-order-id exist, but is not a `correctiveWorkOrder`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. + * + * ### Update release 1.3.0 + * Introduced holdDeliveryOnshore and requiredDatetime properties for materials. + * + * ### Update release 1.4.0 + * Introduced property calculationKey for operations. + * + * ### Update release 1.5.0 + * Added createdDateTime for attachments. + * + * Added revisionId and revision to work order response (represents shutdown or campaign work). + * + * ### Update release 1.7.0 + * Added equipmentId and equipment to the response of tagsRelated. + * + * Adding sourceId to related maintenance records. + * + * ### Update release 1.8.0 + * Introduced property activeStatusIds for operations. + * + * ### Update release 1.12.0 + * Added new query parameter `include-technical-feedback`. It returns related technical feedback required to be completed as part of work order execution. Technical feedback is mostly used for preventive work orders, but can also be used for corrective work orders. + * + * Introduced property `detectionMethodGroupId` and `detectionMethodId` for technical feedback. + * + * ### Update release 1.15.0 + * Added new query parameter `include-measurements`. + * + * ### Update release 1.16.0 + * Added new query parameters `include-measuring-points`, `include-last-measurement` and `include-url-references`. `include-attachments` extended to also return PRT attachments of an operation. `attachments` now include properties `documentType`, `documentNumber` and `documentTitle`. + * + * ### Update release 1.19.0 + * Added properties `systemCondition` and `isExcludedFromWorkOrderPlan` for operations. + * + * ### Update release 1.21.0 + * Added properties `costs` and `costsCurrency`. + * Added property `area` to tag details. + * + * Added ability to read text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. + * + * ### Update release 1.22.0 + * Added new query parameter `include-service-operations`. Operations of type Service - PM03 previously available in the `operations` have been moved to `serviceOperations`. + * + * Added activeStatusIds to related maintenance records. + * + * ### Update release 1.24.0 + * `attachments` now include the property `documentCreatedDate` + * + * Removed 'urlReferences' field from response object, and removed 'include-url-references' query parameter. URLReferences are only supported for Notifications. + * + * Added property `cmrIndicator` in the response. + * + * ### Update release 1.26.0 + * Added property `isEquipmentRental` to services in serviceOperations. + * Added `materials` to serviceOperations. + * + * 'tagDetails' object now includes the new field 'maintenanceConceptId' + * + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' + * + * ### Update release 1.28.0 + * Added new query parameter `include-safety-measure` + * + * Added new query parameter `include-estimated-costs` + * + * Added `tag` and `title` to `maintenanceRecords` expand. + * + * ### Update release 1.29.0 + * Added new properties for `additionalCostWBSId` and `costWBSId`. + * + * ### Update release 1.31.0 + * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` + * + * Split parts of `location` on `operations.materials` into `finalLocation` and `temporaryLocation` in the response. + * + * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services` + * + * ### Update release 1.32.0 + * Added `include-cost-data-for-materials` query parameter. + * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. + * + * ### Update release 1.33.0 + * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials` + * + * ### Update release 1.34.0 + * Added new property `relatedOperations` to `maintenanceRecords` and `tagsRelated`. + * Also added query parameter `include-related-operations` to include the property `relatedOperations`. + * + * Added new properties `isHSECritical` and `isProductionCritical` to the response. + * + * ### Update release 1.35.0 + * Added new properties `requisitionerId` and `deliveryComplete` to `materials` in `operations`. * * Added new properties `personResponsible`, `personResponsibleId` and `personResponsibleEmail` to `operations`. * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * ### Upcoming future release + * Added new property `hasCommunication` + * * @returns CorrectiveWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -1831,7 +1885,7 @@ export class ModifiedEndpointsService { */ includeStatusDetails?: boolean, /** - * Include detailed for the main tag of the Work order + * Include detailed information for the main tag of the Work order */ includeTagDetails?: boolean, /** @@ -1896,22 +1950,236 @@ export class ModifiedEndpointsService { } /** - * Project Work order - Lookup + * Corrective Work order - Search * ### Overview - * Lookup single Project Work order with related information + * Search for corrective Work orders through predefined filters. + * Each filter has a defined action and a set of parameters as described below. * - * ### Update release 1.0.0 - * Work order operation actualPercentageComplete now represents progress reported through technical feedback. - * If the Work order operation is completed, the value of actualPercentageComplete will always be 100. + * ### Response + * The response does not include all details for each corrective work order. + * This can be found by performing a subsequent request to Lookup corrective-work-order. * - * ### Update release 1.1.0 - * If work-order-id exist, but is not a `projectWorkOrder`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. + * ### Filter: recent-status-activations + * Find Corrective work orders based on recent status activations for the work orders. + * Parameters: + * - `status-id` + * - `plant-id` + * - `max-days-since-activation` * - * ### Update release 1.3.0 - * Introduced holdDeliveryOnshore and requiredDatetime properties for materials. + * ### Filter: before-required-end-date + * Find open Corrective work orders before the `required-end-date`. + * Parameters: + * - `plant-id` + * - `required-end-date` + * - `location-id` (optional) + * - `system-id` (optional) * - * ### Update release 1.4.0 - * Introduced property calculationKey for operations. + * ### Filter: by-maintenance-type-id + * Find open Corrective work orders by `maintenance-type-id`. + * Parameters: + * - `plant-id` + * - `maintenance-type-id` + * + * ### Update release 0.9.0 + * Added filter `by-maintenance-type-id`. + * + * ### Update release 0.11.0 + * Added `system-id` as optional parameter for filter `before-required-end-date`. + * + * ### Update release 1.5.0 + * Added `revisionId` and `revision` to work order response (represents shutdown or campaign work). + * + * ### Update release 1.21.0 + * Added properties `costs` and `costsCurrency`. + * + * Added ability to read text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. + * + * ### Update release 1.24.0 + * Added property `cmrIndicator` in the response. + * + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' + * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * @returns CorrectiveWorkOrderSimple Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static searchCorrectiveWorkOrder({ + filter, + statusId, + plantId, + maxDaysSinceActivation, + maxWorkOrders, + locationId, + requiredEndDate, + systemId, + maintenanceTypeId, + }: { + /** + * Filter to limit the Corrective work order by + */ + filter: 'recent-status-activations' | 'same-maintenance-plan' | 'before-required-end-date' | 'by-maintenance-type-id', + /** + * Status + */ + statusId?: string, + /** + * Plant identifier + */ + plantId?: string, + /** + * Define how many days from the current day to include results for. 0 if only include for today + */ + maxDaysSinceActivation?: number, + /** + * Maximal numbers of results returned (optional for filter) + */ + maxWorkOrders?: number, + /** + * Structured location within the plant. Use /plants/{plant-id}/locations for possible values + */ + locationId?: string, + /** + * placeholder + */ + requiredEndDate?: string, + /** + * system-id of the corrective work order + * @deprecated + */ + systemId?: string, + /** + * Type of maintenance for the work order + */ + maintenanceTypeId?: string, + }): CancelablePromise | ProblemDetails> { + return __request(OpenAPI, { + method: 'GET', + url: '/work-orders/corrective-work-orders', + query: { + 'filter': filter, + 'status-id': statusId, + 'plant-id': plantId, + 'max-days-since-activation': maxDaysSinceActivation, + 'max-work-orders': maxWorkOrders, + 'location-id': locationId, + 'required-end-date': requiredEndDate, + 'system-id': systemId, + 'maintenance-type-id': maintenanceTypeId, + }, + errors: { + 404: `The specified resource was not found`, + }, + }); + } + + /** + * Corrective Work order - Create + * ### Overview + * Create new Corrective Work order based on a supplied failure report. + * + * It's possible to supply operations in the create operation. If no operations are passed, a default operation will be created automatically. + * + * To lookup the created corrective work order use endpoint `/work-orders/corrective-work-orders/{work-order-id}` + * + * ### Important information + * + * Up until release 1.32.0, we have enabled creating operations with `operationId` `0010` through the API, allowing the user to customize this operation during creation. + * + * Starting from release 1.32.0, the API logic for creating operations has been aligned with the new logic enforced by the SAP backend system. The new logic adds operations from the task list of any failure report that the work order is created from. + * + * As a result, creating an operation with a reserved `operationId` is no longer allowed. + * This always affects operations with `operationId` equal to `0010`, but can also apply to other operations. + * + * To see which operations are already reserved, use `/maintenance-api/maintenance-records/failure-reports/{record-id}&include-task-list=true` + * + * ### Update release 1.1.0 + * Added externalPartnerWorkOrderId property to be used as reference to work order in external partner system. + * + * ### Update release 1.5.0 + * Added revisionId and revision to work order response (represents shutdown or campaign work). + * + * ### Update release 1.6.0 + * Added sortField and revisionId to create request. Use `/plants/{plant-id}?include-revisions=true&api-version=v1` to get a list of possible values for `revisionId`. + * + * ### Update release 1.8.0 + * Added support for calculation key on operation level. It determines the relationship between plannedWorkDuration, plannedWorkHours, and capacityCount. + * + * ### Update release 1.21.0 + * Add property `IsExcludedFromWorkOrderPlan` to operations model. + * + * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. + * + * ### Update release 1.24.0 + * Added property `cmrIndicator` in the response. + * + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' + * + * ### Update release 1.31.0 + * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` + * + * ### Update release 1.32.0 + * Restriction to create a work order with operationId `0010` and other reserved operationIds. + * + * To see which operationIds are already reserved, use `/maintenance-api/maintenance-records/failure-reports/{record-id}&include-task-list=true` + * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from the response. See STRY0261073 in ServiceNow for more details. + * + * @returns ProblemDetails Response for other HTTP status codes + * @returns CorrectiveWorkOrderBasic Created + * @throws ApiError + */ + public static createCorrectiveWorkOrder({ + requestBody, + }: { + /** + * Corrective Work order to create + */ + requestBody: CorrectiveWorkOrderCreate, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/work-orders/corrective-work-orders', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `The request body is invalid`, + 403: `User does not have sufficient rights to create a Project Work order`, + 404: `The specified resource was not found`, + }, + }); + } + + /** + * Project Work order - Lookup + * ### Overview + * Lookup single Project Work order with related information + * + * ### Update release 1.0.0 + * Work order operation actualPercentageComplete now represents progress reported through technical feedback. + * If the Work order operation is completed, the value of actualPercentageComplete will always be 100. + * + * ### Update release 1.1.0 + * If work-order-id exist, but is not a `projectWorkOrder`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. + * + * ### Update release 1.3.0 + * Introduced holdDeliveryOnshore and requiredDatetime properties for materials. + * + * ### Update release 1.4.0 + * Introduced property calculationKey for operations. * * ### Update release 1.5.0 * Added createdDateTime for attachments. @@ -1941,133 +2209,378 @@ export class ModifiedEndpointsService { * ### Update release 1.24.0 * Added property `cmrIndicator` in the response. * - * ### Update release 1.26.0 - * Added property `isEquipmentRental` to services in serviceOperations. - * Added `materials` to serviceOperations. + * ### Update release 1.26.0 + * Added property `isEquipmentRental` to services in serviceOperations. + * Added `materials` to serviceOperations. + * + * `tagDetails` object now includes the new field `maintenanceConceptId` + * + * ### Update release 1.27.0 + * Work orders now include the property `isOpen` + * + * Added `tag` and `title` to `maintenanceRecords` expand. + * + * ### Update release 1.28.0 + * Added new query parameter `include-safety-measures`. + * + * ### Update release 1.31.0 + * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` + * + * Split parts of `location` on `operations.materials` into `finalLocation` and `temporaryLocation` in the response. + * + * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. + * + * ### Update release 1.32.0 + * Added `include-cost-data-for-materials` query parameter. + * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. + * + * ### Update release 1.33.0 + * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. + * + * ### Update release 1.34.0 + * Added new property `relatedOperations` to `maintenanceRecords` and `tagsRelated`. + * Also added query parameter `include-related-operations` to include the property `relatedOperations`. + * + * Added properties `additionalCostWBSId`, `additionalCostWBS`, `requiredEndDate`, `isHSECritical` and `isProductionCritical` to the response. + * + * ### Update release 1.35.0 + * Added new properties `requisitionerId` and `deliveryComplete` to `materials` in `operations`. + * + * Added new properties `personResponsible`, `personResponsibleId` and `personResponsibleEmail` to `operations`. + * + * Added new property `requisitionerId` to `serviceOperations`. + * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * @returns ProjectWorkOrder Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static lookupProjectWorkOrder({ + workOrderId, + includeOperations = true, + includeServiceOperations = true, + includeMaterials = true, + includeCostDataForMaterials = false, + includeMaintenanceRecords = false, + includeAttachments = false, + includeStatusDetails = false, + includeTagDetails = false, + includeRelatedTags = false, + includeSafetyMeasures = false, + includeRelatedOperations = false, + }: { + workOrderId: string, + /** + * Include Work order operations + */ + includeOperations?: boolean, + /** + * Include Work order service operations + */ + includeServiceOperations?: boolean, + /** + * Include materials for Work order operations + */ + includeMaterials?: boolean, + /** + * Include cost data for materials. Additional authorization will be required to retrieve these fields. + */ + includeCostDataForMaterials?: boolean, + /** + * Include related maintenance records (from object list) + */ + includeMaintenanceRecords?: boolean, + /** + * Include Work order attachments (on header and for operation) + */ + includeAttachments?: boolean, + /** + * Include detailed information for statuses (both active and non-active) + */ + includeStatusDetails?: boolean, + /** + * Include detailed information for the main tag of the Work order + */ + includeTagDetails?: boolean, + /** + * Include related tags (from object list) + */ + includeRelatedTags?: boolean, + /** + * Include safety-measures in work order operations + */ + includeSafetyMeasures?: boolean, + /** + * Includes the property `relatedOperations` in the response to expose operations that are related to an object in the objectlist (only relevant for related tags and related maintenance records). + */ + includeRelatedOperations?: boolean, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/work-orders/project-work-orders/{work-order-id}', + path: { + 'work-order-id': workOrderId, + }, + query: { + 'include-operations': includeOperations, + 'include-service-operations': includeServiceOperations, + 'include-materials': includeMaterials, + 'include-cost-data-for-materials': includeCostDataForMaterials, + 'include-maintenance-records': includeMaintenanceRecords, + 'include-attachments': includeAttachments, + 'include-status-details': includeStatusDetails, + 'include-tag-details': includeTagDetails, + 'include-related-tags': includeRelatedTags, + 'include-safety-measures': includeSafetyMeasures, + 'include-related-operations': includeRelatedOperations, + }, + errors: { + 301: `If work-order-id exist, but is not a \`projectWorkOrder\`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. + `, + 404: `The specified resource was not found`, + }, + }); + } + + /** + * Project Work order - Search + * ### Overview + * Search for project Work orders through predefined filters. + * Each filter has a defined action and a set of parameters as described below. + * + * ### Response + * The response does not include all details for each project work order. + * This can be found by performing a subsequent request to Lookup project-work-order. + * + * ### Filter: open-by-plant + * Find open Project Work orders by `plant-id`. + * Parameters: + * - `plant-id` + * - `location-id` (optional) + * - `system-id` (optional) + * + * ### Filter: recent-status-activations + * Find Project work orders based on recent status activations for the work orders. + * Parameters: + * - `status-id` + * - `plant-id` + * - `max-days-since-activation` + * + * ### Filter: by-cost-network + * Find Project work orders based on Cost Network Id. + * Parameters: + * - `cost-network-id` + * - `plant-id` (optional) + * + * ### Filter: by-cost-wbs + * Project work orders based on Cost WBS Id. + * Parameters: + * - `cost-wbs-id` + * - `plant-id` (optional) + * + * ### Update release 1.4.0 + * Added location-id and system-id to filter `open-by-plant`. + * + * ### Update release 1.5.0 + * Added revisionId and revision to work order response (represents shutdown or campaign work). + * + * ### Update release 1.21.0 + * Added filter `by-cost-network`, with required parameter `cost-network-id` and optional parameter `plant-id`. + * + * ### Update release 1.24.0 + * Added filter `by-cost-wbs`, with required parameter `cost-wbs-id`. Can be used in combination with optional parameter `plant-id`. + * This filter only includes work orders where the WBS is represented on the work order level. + * It does not include work orders where WBS is only represented in the settlement rules. + * + * Added property `cmrIndicator` in the response. + * + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' + * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * @returns ProjectWorkOrderSimple Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static searchProjectWorkOrders({ + filter, + statusId, + plantId, + costNetworkId, + costWbsId, + locationId, + systemId, + maxDaysSinceActivation, + }: { + /** + * Filter to limit the Project work order by + */ + filter: 'open-by-plant' | 'recent-status-activations' | 'by-cost-network' | 'by-cost-wbs', + /** + * Status + */ + statusId?: string, + /** + * Plant identifier + */ + plantId?: string, + /** + * Required parameter if `filter=by-cost-network` + */ + costNetworkId?: string, + /** + * Required parameter if `filter=by-cost-wbs` + */ + costWbsId?: string, + /** + * Structured location within the plant. Use /plants/{plant-id}/locations for possible values + */ + locationId?: string, + /** + * System id to filter by + */ + systemId?: string, + /** + * Define how many days from the current day to include results for. 0 if only include for today + */ + maxDaysSinceActivation?: number, + }): CancelablePromise | ProblemDetails> { + return __request(OpenAPI, { + method: 'GET', + url: '/work-orders/project-work-orders', + query: { + 'filter': filter, + 'status-id': statusId, + 'plant-id': plantId, + 'cost-network-id': costNetworkId, + 'cost-wbs-id': costWbsId, + 'location-id': locationId, + 'system-id': systemId, + 'max-days-since-activation': maxDaysSinceActivation, + }, + errors: { + 404: `The specified resource was not found`, + }, + }); + } + + /** + * Project Work order - Create + * ### Overview + * Create new Project Work order + * + * + * ### Update release 1.4.0 + * Fixed bug related to costNetworkId. + * + * ### Update release 1.5.0 + * Added revisionId and revision to work order response (represents shutdown or campaign work). + * + * ### Update release 1.6.0 + * Added sortField and revisionId to create request. Use `/plants/{plant-id}?include-revisions=true&api-version=v1` to get a list of possible values for `revisionId`. + * + * ### Update release 1.8.0 + * Added support for calculation key on operation level. It determines the relationship between plannedWorkDuration, plannedWorkHours, and capacityCount. + * + * ### Update release 1.19.0 + * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. + * + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' + * + * ### Update release 1.31.0 + * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` to the response. See STRY0261073 in ServiceNow for more details. + * + * @returns ProblemDetails Response for other HTTP status codes + * @returns ProjectWorkOrderBasic Created + * @throws ApiError + */ + public static createProjectWorkOrder({ + requestBody, + }: { + /** + * Project Work order to create + */ + requestBody: ProjectWorkOrderCreate, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/work-orders/project-work-orders', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `The request body is invalid`, + 403: `User does not have sufficient rights to create a Project Work order`, + 404: `The specified resource was not found`, + }, + }); + } + + /** + * Modification Work order - Create + * ### Overview + * Create new Modification Work order based on a supplied failure report. + * + * It's possible to supply operations in the create operation. If no operations are passed, a default operation will be created automatically. * - * `tagDetails` object now includes the new field `maintenanceConceptId` + * To lookup the created corrective work order use endpoint `/work-orders/modification-work-orders/{work-order-id}`. * - * ### Update release 1.27.0 - * Work orders now include the property `isOpen` + * ### Important information + * The primary cost wbs of a modification work order is typically resolved automatically from the provided tag. However, in order to later set the modification work order to status `REL - Release`, you need to provide an additional cost wbs (property `additionalCostWBSId`) on creation. * - * Added `tag` and `title` to `maintenanceRecords` expand. + * ### Update release 1.19.0 + * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. * - * ### Update release 1.28.0 - * Added new query parameter `include-safety-measures`. + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' * * ### Update release 1.31.0 * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` * - * Split parts of `location` on `operations.materials` into `finalLocation` and `temporaryLocation` in the response. - * - * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. - * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. - * - * ### Update release 1.33.1 - * Added `include-cost-data-for-materials` query parameter. - * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. - * - * ### Update release 1.34.0 - * Added new property `relatedOperations` to `maintenanceRecords` and `tagsRelated`. - * Also added query parameter `include-related-operations` to include the property `relatedOperations`. - * - * Added properties `additionalCostWBSId`, `additionalCostWBS`, `requiredEndDate`, `isHSECritical` and `isProductionCritical` to the response. - * - * ### Update release 1.35.0 - * Added new properties `requisitionerId` and `deliveryComplete` to `materials` in `operations`. - * - * Added new properties `personResponsible`, `personResponsibleId` and `personResponsibleEmail` to `operations`. - * - * Added new property `requisitionerId` to `serviceOperations`. + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from the response. See STRY0261073 in ServiceNow for more details. * - * @returns ProjectWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes + * @returns ModificationWorkOrderBasic Created * @throws ApiError */ - public static lookupProjectWorkOrder({ - workOrderId, - includeOperations = true, - includeServiceOperations = true, - includeMaterials = true, - includeCostDataForMaterials = false, - includeMaintenanceRecords = false, - includeAttachments = false, - includeStatusDetails = false, - includeTagDetails = false, - includeRelatedTags = false, - includeSafetyMeasures = false, - includeRelatedOperations = false, + public static createModificationWorkOrder({ + requestBody, }: { - workOrderId: string, - /** - * Include Work order operations - */ - includeOperations?: boolean, - /** - * Include Work order service operations - */ - includeServiceOperations?: boolean, /** - * Include materials for Work order operations - */ - includeMaterials?: boolean, - /** - * Include cost data for materials. Additional authorization will be required to retrieve these fields. - */ - includeCostDataForMaterials?: boolean, - /** - * Include related maintenance records (from object list) - */ - includeMaintenanceRecords?: boolean, - /** - * Include Work order attachments (on header and for operation) - */ - includeAttachments?: boolean, - /** - * Include detailed information for statuses (both active and non-active) - */ - includeStatusDetails?: boolean, - /** - * Include detailed for the main tag of the Work order - */ - includeTagDetails?: boolean, - /** - * Include related tags (from object list) - */ - includeRelatedTags?: boolean, - /** - * Include safety-measures in work order operations - */ - includeSafetyMeasures?: boolean, - /** - * Includes the property `relatedOperations` in the response to expose operations that are related to an object in the objectlist (only relevant for related tags and related maintenance records). + * Modification Work order to create */ - includeRelatedOperations?: boolean, - }): CancelablePromise { + requestBody: ModificationWorkOrderCreate, + }): CancelablePromise { return __request(OpenAPI, { - method: 'GET', - url: '/work-orders/project-work-orders/{work-order-id}', - path: { - 'work-order-id': workOrderId, - }, - query: { - 'include-operations': includeOperations, - 'include-service-operations': includeServiceOperations, - 'include-materials': includeMaterials, - 'include-cost-data-for-materials': includeCostDataForMaterials, - 'include-maintenance-records': includeMaintenanceRecords, - 'include-attachments': includeAttachments, - 'include-status-details': includeStatusDetails, - 'include-tag-details': includeTagDetails, - 'include-related-tags': includeRelatedTags, - 'include-safety-measures': includeSafetyMeasures, - 'include-related-operations': includeRelatedOperations, - }, + method: 'POST', + url: '/work-orders/modification-work-orders', + body: requestBody, + mediaType: 'application/json', errors: { - 301: `If work-order-id exist, but is not a \`projectWorkOrder\`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. - `, + 400: `The request body is invalid`, + 403: `User does not have sufficient rights to create a Project Work order`, 404: `The specified resource was not found`, }, }); @@ -2136,7 +2649,7 @@ export class ModifiedEndpointsService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * @@ -2153,6 +2666,18 @@ export class ModifiedEndpointsService { * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns ModificationWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -2201,7 +2726,7 @@ export class ModifiedEndpointsService { */ includeStatusDetails?: boolean, /** - * Include detailed for the main tag of the Work order + * Include detailed information for the main tag of the Work order */ includeTagDetails?: boolean, /** @@ -2298,7 +2823,7 @@ export class ModifiedEndpointsService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * @@ -2312,6 +2837,18 @@ export class ModifiedEndpointsService { * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns SubseaWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -2463,6 +3000,14 @@ export class ModifiedEndpointsService { * - `changed-before-date` * - `changed-after-date` * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * * @returns TagSearch Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -2553,7 +3098,7 @@ export class ModifiedEndpointsService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Include installed equipment */ @@ -2714,7 +3259,7 @@ export class ModifiedEndpointsService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * @@ -2731,6 +3276,18 @@ export class ModifiedEndpointsService { * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns SASChangeWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -2749,75 +3306,252 @@ export class ModifiedEndpointsService { includeSafetyMeasures = false, includeRelatedOperations = false, }: { - workOrderId: string, + workOrderId: string, + /** + * Include Work order operations + */ + includeOperations?: boolean, + /** + * Include Work order service operations + */ + includeServiceOperations?: boolean, + /** + * Include materials for Work order operations + */ + includeMaterials?: boolean, + /** + * Include cost data for materials. Additional authorization will be required to retrieve these fields. + */ + includeCostDataForMaterials?: boolean, + /** + * Include related maintenance records (from object list) + */ + includeMaintenanceRecords?: boolean, + /** + * Include Work order attachments (on header and for operation) + */ + includeAttachments?: boolean, + /** + * Include detailed information for statuses (both active and non-active) + */ + includeStatusDetails?: boolean, + /** + * Include detailed information for the main tag of the Work order + */ + includeTagDetails?: boolean, + /** + * Include related tags (from object list) + */ + includeRelatedTags?: boolean, + /** + * Include safety-measures in work order operations + */ + includeSafetyMeasures?: boolean, + /** + * Includes the property `relatedOperations` in the response to expose operations that are related to an object in the objectlist (only relevant for related tags and related maintenance records). + */ + includeRelatedOperations?: boolean, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/work-orders/sas-change-work-orders/{work-order-id}', + path: { + 'work-order-id': workOrderId, + }, + query: { + 'include-operations': includeOperations, + 'include-service-operations': includeServiceOperations, + 'include-materials': includeMaterials, + 'include-cost-data-for-materials': includeCostDataForMaterials, + 'include-maintenance-records': includeMaintenanceRecords, + 'include-attachments': includeAttachments, + 'include-status-details': includeStatusDetails, + 'include-tag-details': includeTagDetails, + 'include-related-tags': includeRelatedTags, + 'include-safety-measures': includeSafetyMeasures, + 'include-related-operations': includeRelatedOperations, + }, + errors: { + 301: `If work-order-id exist, but is not a \`sasChangeWorkOrder\`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. + `, + 404: `The specified resource was not found`, + }, + }); + } + + /** + * SAS Change Work order - Search + * ### Overview + * Search for SAS Change Work orders through predefined filters. + * Each filter has a defined action and a set of parameters as described below. + * + * ### Response + * The response does not include all details for each SAS Change Work order. + * This can be found by performing a subsequent request to Lookup sas-change-work-orders. + * + * ### Filter: open-by-plant + * Find open SAS Change Work orders by plant. + * Parameters: + * - `plant-id` + * - `location-id` (optional) + * - `system-id` (optional) + * + * ### Filter: recent-status-activations + * SAS Change Work orders based on recent status activations for the work orders. + * Parameters: + * - `status-id` + * - `plant-id` + * - `max-days-since-activation` + * + * ### Filter: by-cost-network + * Find SAS Change work orders based on Cost Network Id. + * Parameters: + * - `cost-network-id` + * - `plant-id` (optional) + * + * ### Filter: by-cost-wbs + * Find SAS Change Work orders based on Cost WBS Id. + * Parameters: + * - `cost-wbs-id` + * - `plant-id` (optional) + * + * ### Update release 1.4.0 + * Added location-id and system-id to filter `open-by-plant`. + * + * ### Update release 1.5.0 + * Added revisionId to work order response (represents shutdown or campaign work). + * + * ### Update release 1.19.0 + * Added ability to read text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. + * + * ### Update release 1.24.0 + * Added filter `by-cost-wbs`, with required parameter `cost-wbs-id`. Can be used in combination with optional parameter`plant-id`. + * This filter only includes work orders where the WBS is represented on the work order level. It does not include work orders where WBS is only represented in the settlement rules. + * + * Added filter `by-cost-network`, with required parameter `cost-network-id` and optional parameter `plant-id`. + * + * Added property `cmrIndicator` in the response. + * + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' + * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * @returns SASChangeWorkOrderSimple Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static searchSasChangeWorkOrders({ + filter, + statusId, + plantId, + locationId, + systemId, + maxDaysSinceActivation, + costWbsId, + costNetworkId, + }: { /** - * Include Work order operations - */ - includeOperations?: boolean, - /** - * Include Work order service operations - */ - includeServiceOperations?: boolean, - /** - * Include materials for Work order operations - */ - includeMaterials?: boolean, - /** - * Include cost data for materials. Additional authorization will be required to retrieve these fields. + * Filter to limit the SAS Change work order by */ - includeCostDataForMaterials?: boolean, + filter: 'open-by-plant' | 'recent-status-activations' | 'by-cost-wbs' | 'by-cost-network', /** - * Include related maintenance records (from object list) + * Status */ - includeMaintenanceRecords?: boolean, + statusId?: string, /** - * Include Work order attachments (on header and for operation) + * Plant identifier */ - includeAttachments?: boolean, + plantId?: string, /** - * Include detailed information for statuses (both active and non-active) + * Structured location within the plant. Use /plants/{plant-id}/locations for possible values */ - includeStatusDetails?: boolean, + locationId?: string, /** - * Include detailed for the main tag of the Work order + * System id to filter by */ - includeTagDetails?: boolean, + systemId?: string, /** - * Include related tags (from object list) + * Define how many days from the current day to include results for. 0 if only include for today */ - includeRelatedTags?: boolean, + maxDaysSinceActivation?: number, /** - * Include safety-measures in work order operations + * Required parameter if `filter=by-cost-wbs` */ - includeSafetyMeasures?: boolean, + costWbsId?: string, /** - * Includes the property `relatedOperations` in the response to expose operations that are related to an object in the objectlist (only relevant for related tags and related maintenance records). + * Required parameter if `filter=by-cost-network` */ - includeRelatedOperations?: boolean, - }): CancelablePromise { + costNetworkId?: string, + }): CancelablePromise | ProblemDetails> { return __request(OpenAPI, { method: 'GET', - url: '/work-orders/sas-change-work-orders/{work-order-id}', - path: { - 'work-order-id': workOrderId, - }, + url: '/work-orders/sas-change-work-orders', query: { - 'include-operations': includeOperations, - 'include-service-operations': includeServiceOperations, - 'include-materials': includeMaterials, - 'include-cost-data-for-materials': includeCostDataForMaterials, - 'include-maintenance-records': includeMaintenanceRecords, - 'include-attachments': includeAttachments, - 'include-status-details': includeStatusDetails, - 'include-tag-details': includeTagDetails, - 'include-related-tags': includeRelatedTags, - 'include-safety-measures': includeSafetyMeasures, - 'include-related-operations': includeRelatedOperations, + 'filter': filter, + 'status-id': statusId, + 'plant-id': plantId, + 'location-id': locationId, + 'system-id': systemId, + 'max-days-since-activation': maxDaysSinceActivation, + 'cost-wbs-id': costWbsId, + 'cost-network-id': costNetworkId, }, + }); + } + + /** + * SAS Change Work order - Create + * ### Overview + * Create new SAS Change Work order + * + * + * ### Update release 1.5.0 + * Added revisionId and revision to work order response (represents shutdown or campaign work). + * + * ### Update release 1.6.0 + * Added sortField and revisionId to create request. Use `/plants/{plant-id}?include-revisions=true&api-version=v1` to get a list of possible values for `revisionId`. + * ### Update release 1.8.0 + * Added support for calculation key on operation level. It determines the relationship between plannedWorkDuration, plannedWorkHours, and capacityCount. + * + * ### Update release 1.19.0 + * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. + * + * ### Update release 1.27.0 + * Work orders now include the property 'isOpen' + * + * ### Update release 1.31.0 + * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from the response. See STRY0261073 in ServiceNow for more details. + * + * @returns ProblemDetails Response for other HTTP status codes + * @returns SASChangeWorkOrderBasic Created + * @throws ApiError + */ + public static createSasChangeWorkOrder({ + requestBody, + }: { + /** + * SAS Change Work order to create + */ + requestBody: SASChangeWorkOrderCreate, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/work-orders/sas-change-work-orders', + body: requestBody, + mediaType: 'application/json', errors: { - 301: `If work-order-id exist, but is not a \`sasChangeWorkOrder\`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. - `, - 404: `The specified resource was not found`, + 400: `The request body is invalid`, + 403: `User does not have sufficient rights to create a SAS Change Work order`, }, }); } @@ -2935,6 +3669,15 @@ export class ModifiedEndpointsService { * * Added property `confirmationId`, `RemainingWork` and `RemainingWorkUnit` to `operations` * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * Added `overheadMaintenanceWorkOrders` to `include-work-order-types` filter in Parameters and to the response. + * * @returns WorkOrderWithOperationList Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -2983,7 +3726,7 @@ export class ModifiedEndpointsService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Include operations for the Work orders in the response. */ @@ -3013,285 +3756,108 @@ export class ModifiedEndpointsService { */ workCenterIdAnyOf?: string, /** - * Comma-separated list of `work-order-id`. - */ - workOrderIdsAnyOf?: string, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/work-orders', - query: { - 'filter': filter, - 'plant-id': plantId, - 'changed-since-datetime': changedSinceDatetime, - 'before-datetime': beforeDatetime, - 'include-work-order-text': includeWorkOrderText, - 'include-work-order-operation-text': includeWorkOrderOperationText, - 'include-work-order-types': includeWorkOrderTypes, - 'include-operations': includeOperations, - 'basic-end-date': basicEndDate, - 'location-id': locationId, - 'external-partner-work-order-id': externalPartnerWorkOrderId, - 'cost-wbs-id': costWbsId, - 'cost-network-id': costNetworkId, - 'work-center-id-any-of': workCenterIdAnyOf, - 'work-order-ids-any-of': workOrderIdsAnyOf, - }, - }); - } - - /** - * Work orders - Optimized for query - * ### Overview - * Query work orders for potentially complicated patterns where speed is of the essence. - * - * `planning-plants` is the only mandatory fields, but clients should normally provide at least one more query criteria. - * - * A normal use case would be to first provide an initial query criteria based on user input. Then allow the end-users based on the resulting data select unwanted results based on specific attributes. The unwanted results should then be added to the exclusion list (for example `keywords-not` or `work-centers-not)` and the API call repeated. - * - * `max-results` have a default value of 1000 and is necessary to provide a quick response. - * - * The multi-line `text` property is not included by default, but can included by setting `include-text=true` in the request. This will influence performance significantly. - * - * Pagination is supported for this endpoint by setting values for `page` and `per-page`. If these parameteres are omitted, the result will be returned without pagination. - * - * ### Response - * The response schema differs slightly from the other work order endpoints as a result of the optimization for speed. - * - * ### Examples - * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&tags-all-of=10B9` - Return work orders where tag is 10B9 - * - * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&tags-all-of=AA15*&tags-not=AA15002` - Return work orders where tag has pattern `AA15*` but is not AA15002 - * - * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&keywords-all-of=heli,male` - Return work orders where the title contains both `heli` and `male` - * - * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&status-any-of=PREP,RDEX&created-after-date=2021-06-01` - Return work orders with status PREP or RDEX and created after a certain date - * - * ### Update release 1.5.0 - * Added revisionId to work order response (represents shutdown or campaign work). - * - * ### Update release 1.12.0 - * Added query parameter `include-maintenance-record`. - * - * ### Update release 1.16.0 - * Added property `workCenterId` to `maintenanceRecords.failureReports` - * - * ### Update release 1.29.0 - * Added properties `revision` and `changedDatetime`. - * - * Allow searching by `changedOnDay` when `is-open` is set. Search by using the new query parameters `changed-after-date` and `changed-before-date`. - * - * ### Update release 1.31.0 - * Added list of supported statuses for `status-all-of`, `status-any-of` and `status-not` query parameters. Status `REL` is now supported. - * - * Added property `hasStatusREL` to the response. - * - * ### Update release 1.35.0 - * Added support for optional pagination. - * - * @returns WorkOrderOptimizedForQuery Success - * @returns ProblemDetails Response for other HTTP status codes - * @throws ApiError - */ - public static queryWorkOrdersOptimized({ - planningPlants, - keywordsAllOf, - keywordsAnyOf, - keywordsNot, - tagsAllOf, - tagsAnyOf, - tagsNot, - workCentersAnyOf, - workCentersNot, - systemsAnyOf, - systemsNot, - locationsAnyOf, - locationsNot, - sortFieldAnyOf, - sortFieldNot, - revisionCodeAnyOf, - revisionCodeNot, - statusAllOf, - statusAnyOf, - statusNot, - isOpen, - createdAfterDate, - createdBeforeDate, - changedAfterDate, - changedBeforeDate, - workOrderTypes, - sortBy, - includeText = false, - includeMaintenanceRecord = false, - maxResults, - perPage, - page = 1, - }: { - /** - * Query based on planningPlantIds (any-of) - */ - planningPlants: Array, - /** - * Query based on keywords in title (case insensitive) - */ - keywordsAllOf?: Array, - /** - * Query based on keywords in title (case insensitive) - */ - keywordsAnyOf?: Array, - /** - * Query based on keywords in title (case insensitive) - */ - keywordsNot?: Array, - /** - * Query based on tagIds. Expressions with wildcards can be used for example `1A*-6A`. Ensure the tagIds are url-encoded in order to handle special characters - */ - tagsAllOf?: Array, - /** - * Query based on tagIds. Expressions with wildcards can be used for example `1A*-6A`. Ensure the tagIds are url-encoded in order to handle special characters - */ - tagsAnyOf?: Array, - /** - * Query based on tagIds. Expressions with wildcards can be used for example `AE55*`. Ensure the tagIds are url-encoded in order to handle special characters - */ - tagsNot?: Array, - /** - * Query based on workCenterIds - */ - workCentersAnyOf?: Array, - /** - * Query based on workCenterIds - */ - workCentersNot?: Array, - /** - * Query based on systemIds - */ - systemsAnyOf?: Array, - /** - * Query based on systemIds - */ - systemsNot?: Array, - /** - * Query based on locationIds - */ - locationsAnyOf?: Array, - /** - * Query based on locationIds - */ - locationsNot?: Array, - /** - * Query based on sortField ()used for grouping work orders) - */ - sortFieldAnyOf?: Array, - /** - * Query based on sortField (used for grouping work orders) - */ - sortFieldNot?: Array, - /** - * Query based on revisionCode - */ - revisionCodeAnyOf?: Array, - /** - * Query based on sortField (often used for revision codes) - */ - revisionCodeNot?: Array, - /** - * Query based on statusIds (not all statuses are supported) - */ - statusAllOf?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL'>, - /** - * Query based on statusIds (not all statuses are supported) - */ - statusAnyOf?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL'>, - /** - * Query based on statusIds (not all statuses are supported) - */ - statusNot?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL'>, - /** - * Include only open work orders or only closed work orders. By default, all work orders are included. - */ - isOpen?: boolean, - /** - * Earliest creation date to include - */ - createdAfterDate?: string, - /** - * Latest creation date to include - */ - createdBeforeDate?: string, - /** - * Earliest `changedOnDay` date to include. Query parameter `is-open` must be set to `true` or `false` to use this parameter. - */ - changedAfterDate?: string, - /** - * Latest `changedOnDay` date to include. Query parameter `is-open` must be set to `true` or `false` to use this parameter. - */ - changedBeforeDate?: string, - /** - * Limit to specific work order types (one-of) - */ - workOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, - /** - * Property to sort the results by - */ - sortBy?: Array<'createdDateTime desc' | 'createdDateTime asc' | 'workOrderId desc' | 'workOrderId asc' | 'systemId desc' | 'systemId asc' | 'locationId desc' | 'locationId asc' | 'sortField desc' | 'sortField asc' | 'title desc' | 'title asc'>, - /** - * Include the multi-line text of the work order (will cause the endpoint to go significantly slower) - */ - includeText?: boolean, - /** - * Include the main maintenance record linked to the work order (if any) - */ - includeMaintenanceRecord?: boolean, - /** - * Maximum number of results to include. Default is 1000. - */ - maxResults?: number, - /** - * Results to return pr page + * Comma-separated list of `work-order-id`. */ - perPage?: number, + workOrderIdsAnyOf?: string, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/work-orders', + query: { + 'filter': filter, + 'plant-id': plantId, + 'changed-since-datetime': changedSinceDatetime, + 'before-datetime': beforeDatetime, + 'include-work-order-text': includeWorkOrderText, + 'include-work-order-operation-text': includeWorkOrderOperationText, + 'include-work-order-types': includeWorkOrderTypes, + 'include-operations': includeOperations, + 'basic-end-date': basicEndDate, + 'location-id': locationId, + 'external-partner-work-order-id': externalPartnerWorkOrderId, + 'cost-wbs-id': costWbsId, + 'cost-network-id': costNetworkId, + 'work-center-id-any-of': workCenterIdAnyOf, + 'work-order-ids-any-of': workOrderIdsAnyOf, + }, + }); + } + + /** + * Work orders - Types + * ### Overview + * Get type of a work order based on the work order id. + * + * ### Update release 1.37.0 + * Added support for new work order type `overheadMaintenanceWorkOrder`. + * + * @returns WorkOrderTypes Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static getWorkOrderType({ + workOrderIdsAnyOf, + }: { /** - * Page to fetch + * The work orders as a comma separated list. */ - page?: number, - }): CancelablePromise | ProblemDetails> { + workOrderIdsAnyOf: string, + }): CancelablePromise | ProblemDetails> { return __request(OpenAPI, { method: 'GET', - url: '/work-orders-optimized-for-query', + url: '/work-order-types', query: { - 'planning-plants': planningPlants, - 'keywords-all-of': keywordsAllOf, - 'keywords-any-of': keywordsAnyOf, - 'keywords-not': keywordsNot, - 'tags-all-of': tagsAllOf, - 'tags-any-of': tagsAnyOf, - 'tags-not': tagsNot, - 'work-centers-any-of': workCentersAnyOf, - 'work-centers-not': workCentersNot, - 'systems-any-of': systemsAnyOf, - 'systems-not': systemsNot, - 'locations-any-of': locationsAnyOf, - 'locations-not': locationsNot, - 'sort-field-any-of': sortFieldAnyOf, - 'sort-field-not': sortFieldNot, - 'revision-code-any-of': revisionCodeAnyOf, - 'revision-code-not': revisionCodeNot, - 'status-all-of': statusAllOf, - 'status-any-of': statusAnyOf, - 'status-not': statusNot, - 'is-open': isOpen, - 'created-after-date': createdAfterDate, - 'created-before-date': createdBeforeDate, - 'changed-after-date': changedAfterDate, - 'changed-before-date': changedBeforeDate, - 'work-order-types': workOrderTypes, - 'sort-by': sortBy, - 'include-text': includeText, - 'include-maintenance-record': includeMaintenanceRecord, - 'max-results': maxResults, - 'per-page': perPage, - 'page': page, + 'work-order-ids-any-of': workOrderIdsAnyOf, + }, + }); + } + + /** + * Work order - Update service operation + * ### Overview + * Convert an operation to a service operation. + * This will change the type of operation to `PM03 - service` and subsequently remove it from the operations list. + * Required fields must be supplied: `materialGroup`, `purchasingGroup`, `purchasingOrganization`. + * One service has to be created with the following data: + * `lineId`, `quantity`, `unit`, `materialGroup`, `costElement`, and either a `title` (for a text item service) or `serviceId`. + * + * Note: There is a known bug on the SAP side that prevents updating `standardTextTemplate` for service operations. + * + * ### Update release 1.31.0 + * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` + * + * ### Update release 1.36.0 + * Added support for updating property `isExcludedFromWorkOrderPlan`. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static updateWorkOrderServiceOperation({ + operationId, + requestBody, + }: { + operationId: string, + /** + * Update of Work order service operation details + */ + requestBody: Array, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/work-order-service-operations/{operation-id}', + path: { + 'operation-id': operationId, + }, + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Request is missing required parameters`, + 403: `User does not have sufficient rights to update operation`, + 404: `The specified resource was not found`, + 409: `Work order is locked by other user`, }, }); } @@ -3329,6 +3895,9 @@ export class ModifiedEndpointsService { * ### Update release 1.35.0 * Added new property `requisitionerId` to the response. * + * ### Update release 1.37.0 + * Added property `unloadingPoint` to the response. + * * @returns ProblemDetails Response for other HTTP status codes * @returns any Created * @throws ApiError @@ -3342,7 +3911,7 @@ export class ModifiedEndpointsService { * Add material details */ requestBody: Array, - }): CancelablePromise> { + }): CancelablePromise> { return __request(OpenAPI, { method: 'POST', url: '/work-order-operations/{operation-id}/materials', @@ -3362,265 +3931,73 @@ export class ModifiedEndpointsService { } /** - * Failure report - Lookup + * Work orders change log - Search * ### Overview - * Lookup a single failure report - * - * ### Update release 0.9.0 - * Added failureMechanismId,failureMechanismGroupId to additionalMetadata. - * - * ### Update release 1.0.0 - * Added tasks for failure reports through query option include-tasks. - * Added properties plannerGroupId, plannerGroup and planningPlantId. - * - * ### Update release 1.1.0 - * Added isOpen and completedDateTime. - * - * Added hasUnsafeFailureMode and unsafeFailureModeStatus properties according to business process requirement `R-12137 - Give immediate warning of unsafe failure modes`. - * ### Update release 1.3.0 - * Added `priorityId` to response. - * - * ### Update release 1.4.0 - * Added `workCenter` and `equipment` to response. Fields include descriptions of workCenterId and equipmentId - * - * ### Update release 1.5.0 - * Added `createdDateTime` for attachments. - * - * ### Update release 1.6.0 - * Added `301` response. - * - * ### Update release 1.10.0 - * Added query parameter `include-url-references`. - * - * ### Update release 1.11.0 - * Added `quantity` for tasks. - * - * Added properties `createdById`,`createdBy` and `createdByEmail`. - * `createdById` will always be have value in response. `createdBy` and `createdByEmail` will only have value in response if the `include-created-by-details` query parameter is `true`. - * - * ### Update release 1.15.0 - * Added property `documentTitle` to `urlReferences`. - * - * ### Update release 1.16.0 - * `urlReferences` and `attachments` now include properties `documentType`, `documentNumber` and `documentTitle`. - * - * ### Update release 1.17.0 - * Added query parameter `include-measurements`. - * - * ### Update release 1.19.0 - * Added query parameter `include-additional-data-characteristics`. - * - * ### Update release 1.21.0 - * Added property `area` to tag details. - * - * ### Update release 1.24.0 - * `urlReferences` and `attachments` now include the property `documentCreatedDate` - * - * ### Update release 1.26.0 - * `tagDetails` object now includes the new field `maintenanceConceptId` - * - * ### Update release 1.27.0 - * Added `maintenanceRecordTypeId` to the response. - * - * ### Update release 1.28.0 - * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a - * configuration switch, which will initially be disabled, and when appropriate, enabled. + * Search for Work orders changes done recently. * - * Added properties `codingGroupId` and `codingId`. + * ### Response + * The response contains only minimum information about the change made to the work orders. + * For more information about each individual work order, use the lookup end-point referenced in `_links.related`. * - * ### Update release 1.31.0 - * Added `isReadonlyText` property to `activities` in the response. + * ### Important information + * This endpoint relies on change log being activated for the plant in question. * - * ### Update release 1.32.0 - * Added `changedDateTime` for attachments. + * ### Filter: recently-changed-property + * Find Work orders which have recently had a change in a specific property. + * Parameters: + * - plant-id + * - property-name - Values supported `basicStartDateTime` and `basicEndDateTime` + * - changed-since-datetime * - * Added a query parameter `include-task-list` and `taskList` in the response. When a work order is created based on this notification, operations from the `taskList` will be automatically copied into the work order. + * include-work-order-types is an optional parameter to define which work orders to return changes for. * - * ### Update release 1.33.0 - * Added `taskResponsible` and `taskResponsibleEmail` for `tasks` in response when the new query parameter `include-task-responsible-details` is set to true. + * ### Important information + * The response contains list of changes to work orders (not list of work orders changed). Therefore, an individual work order may be represented multiple times. Consumers can use changeDateTime to identify the last change. * - * ### Update release 1.35.0 - * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. - * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. + * ### Update release 1.37.0 + * Added `overheadMaintenanceWorkOrders` to include-work-order-types filter in Parameters and `overheadMaintenanceWorkOrdersChanged` to response. * - * @returns FailureReport Success + * @returns WorkOrderChangeLogs Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static lookupFailureReport({ - recordId, - includeStatusDetails = false, - includeTagDetails = false, - includeActivities = false, - includeTasks = false, - includeAttachments = false, - includeAdditionalMetadata = false, - includeAdditionalDataCharacteristics = false, - includeCreatedByDetails = false, - includeUrlReferences = false, - includeMeasurements = false, - includeTaskList = false, - includeTaskResponsibleDetails = false, + public static searchWorkOrderChangeLog({ + filter, + plantId, + changedSinceDatetime, + propertyName, + includeWorkOrderTypes, }: { /** - * The recordId of the failure report. - */ - recordId: string, - /** - * Include detailed information for statuses (both active and non-active) - */ - includeStatusDetails?: boolean, - /** - * Include details about tag for failure report - */ - includeTagDetails?: boolean, - /** - * Include detailed information for activities - */ - includeActivities?: boolean, - /** - * Include detailed information for tasks - */ - includeTasks?: boolean, - /** - * Include attachments - */ - includeAttachments?: boolean, - /** - * Include extra metadata related to additional failure modes and detection modes. This is only used in rare cases - */ - includeAdditionalMetadata?: boolean, - /** - * Include characteristics for additional metadata - */ - includeAdditionalDataCharacteristics?: boolean, - /** - * Include name and email of user represented in `createdById`. If not supplied, `createdBy` and `createdByEmail` will have null value. + * Filter to limit the work order by */ - includeCreatedByDetails?: boolean, + filter: 'recently-changed-property', /** - * Include URL references for failure report. See `POST /maintenance-record-relationships/{record-id}/url-references` + * Plant identifier */ - includeUrlReferences?: boolean, + plantId?: string, /** - * Include related measurements + * Earliest datetime to returned changed work orders for */ - includeMeasurements?: boolean, + changedSinceDatetime?: string, /** - * Include task list with task list operations + * The property which was recently changed */ - includeTaskList?: boolean, + propertyName?: 'basicStartDateTime' | 'basicEndDateTime', /** - * Include task responsible details. Can have a slight performance impact. + * Include which types of work orders. Use comma-separated list of entries. */ - includeTaskResponsibleDetails?: boolean, - }): CancelablePromise { + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, + }): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/maintenance-records/failure-reports/{record-id}', - path: { - 'record-id': recordId, - }, + url: '/work-orders-change-log', query: { - 'include-status-details': includeStatusDetails, - 'include-tag-details': includeTagDetails, - 'include-activities': includeActivities, - 'include-tasks': includeTasks, - 'include-attachments': includeAttachments, - 'include-additional-metadata': includeAdditionalMetadata, - 'include-additional-data-characteristics': includeAdditionalDataCharacteristics, - 'include-created-by-details': includeCreatedByDetails, - 'include-url-references': includeUrlReferences, - 'include-measurements': includeMeasurements, - 'include-task-list': includeTaskList, - 'include-task-responsible-details': includeTaskResponsibleDetails, - }, - errors: { - 301: `The specified resource exists in another location - This can occur when requesting a resource which type does not match the route you are using. - - Example: \`/maintenance-api/resource-a/{resource-b-id}/\` gives \`301\` response. - `, - 404: `The specified resource was not found`, - }, - }); - } - - /** - * Failure report - Update - * ## Overview - * Update key fields of a failure report. - * - * The following endpoints can be used to find possible values for input: - * 1. `workCenterId` - [/plants/{plant-id}?include-work-centers](#operation/LookupPlant) - * 1. `plannerGroupId` - [/plants/{plant-id}?include-planner-groups=true](#operation/LookupPlant) - * 1. `locationId` - [/plants/{plant-id}?include-locations=true](#operation/LookupPlant) - * 1. `detectionMethodId`, `failureMechanismId`, `failureModeId` - [/plants/{plant-id}/tags/{tag-id}?include-catalog-profile-details=true](#operation/LookupTag) or [/equipment/{equipment-id}?include-catalog-profile-details=true](#operation/LookupEquipment) - * 1. `codingId` - [/catalogs/{catalog-id}/code-groups](#operation/SearchCodeGroup) - * - * - * ## Important information - * To avoid accidentally overwriting the multi-line text property, the endpoint will reject any requests with an empty text property. - * - * ### Update release 1.0.0 - * Added possibility to update plannerGroupId. - * - * ### Update release 1.1.0 - * Added hasUnsafeFailureMode and unsafeFailureModeStatus properties to response according to business process requirement `R-12137 - Give immediate warning of unsafe failure modes`. - * - * ### Update release 1.3.0 - * Added `priorityId` to response. - * - * ### Update release 1.4.0 - * Added `workCenter` and `equipment` to response. Fields include descriptions of workCenterId and equipmentId - * - * ### Update release 1.28.0 - * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a - * configuration switch, which will initially be disabled, and when appropriate, enabled. - * - * Added properties `codingGroupId` and `codingId`. - * - * ### Update release 1.29.0 - * Deprecated update of the property `failureImpactId`. See [Deprecation](#section/Deprecation/Deprecation-policy) for more information. - * - * ### Update release 1.32.0 - * Added ability to append text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. - * - * ### Update release 1.33.0 - * Added possibility to prepend text. Use the operation `prepend` in the request body to prepend text to the current text. - * - * ### Update release 1.35.0 - * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. - * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. - * - * @returns FailureReportBasic Success, the failure report has been updated - * @returns ProblemDetails Response for other HTTP status codes - * @throws ApiError - */ - public static updateFailureReport({ - recordId, - requestBody, - }: { - /** - * The recordId of the failure report. - */ - recordId: string, - /** - * Details on how to update the Failure Report - */ - requestBody: Array, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/maintenance-records/failure-reports/{record-id}', - path: { - 'record-id': recordId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request. For example that an empty text property was supplied`, - 403: `User does not have sufficient rights to update the failure report`, + 'filter': filter, + 'plant-id': plantId, + 'changed-since-datetime': changedSinceDatetime, + 'property-name': propertyName, + 'include-work-order-types': includeWorkOrderTypes, }, }); } @@ -3667,6 +4044,9 @@ export class ModifiedEndpointsService { * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. * + * ### Update release 1.37.0 + * Added support for new work order type `overheadMaintenanceWorkOrders` to `workOrderTypeId` enum of allowed types. + * * @returns FailureReportSimpleForSearch Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -3778,6 +4158,9 @@ export class ModifiedEndpointsService { * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. * + * ### Update release 1.37.0 + * Added support for `overheadMaintenanceWorkOrders`. + * * @returns ProblemDetails Response for other HTTP status codes * @returns FailureReportBasic Created * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/NewEndpointsService.ts b/packages/api/maintenance-api/src/lib/generated/services/NewEndpointsService.ts index ef6fa280..9777f1c6 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/NewEndpointsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/NewEndpointsService.ts @@ -2,9 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { CharacteristicForSearch } from '../models/CharacteristicForSearch'; -import type { CostCategory } from '../models/CostCategory'; -import type { EqHubAndSemiUsage } from '../models/EqHubAndSemiUsage'; +import type { EstimatedCostsJsonPatch } from '../models/EstimatedCostsJsonPatch'; +import type { OverheadMaintenanceWorkOrder } from '../models/OverheadMaintenanceWorkOrder'; import type { ProblemDetails } from '../models/ProblemDetails'; import type { CancelablePromise } from '../core/CancelablePromise'; @@ -14,147 +13,138 @@ import { request as __request } from '../core/request'; export class NewEndpointsService { /** - * Search characteristics + * Preventive Work order - Update estimated costs * ### Overview - * Search for characteristics by class type and class id. + * Update estimated costs for preventive work order. Cost needs to be provided in the currency of the work order. + * The Cost Category ID needs to be: + * - `COST_CUTBACK` + * - `COST_EXTERNAL_SERVICES` + * - `COST_INTERNAL_SERVICES` + * - `COST_INTERNAL_PERSONELL` + * - `COST_MATERIALS_OF_CONSUMPTION` + * - `COST_OTHER_EXPENCES` + * - `COST_REPAIR_AND_MAINTENANCE` * - * The class-type can be any of the following: - * | class-type | Description | - * |-----------------------|---------------------------------| - * | 002 | Equipment | - * | 003 | Tags | - * | 015 | Notification Item | - * | 017 | Equipment | - * | 037 | Measuring Point | - * - * @returns CharacteristicForSearch Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static searchCharacteristics({ - filter, - classType, - characteristicIdsAnyOf, - classTypeKeyPrefix, - perPage = 100, - page = 1, + public static addPreventiveWoEstimatedCosts({ + workOrderId, + costCategoryId, + requestBody, }: { - filter: 'by-characteristic-ids-any-of', - classType: '002' | '003' | '015' | '037', - /** - * Required if filter is `by-characteristic-id-any-of` - * - */ - characteristicIdsAnyOf?: string, - /** - * Pre-fix of the object key, if searching for class type "003" (Tags) this may be set to "1100" to fetch all - * characteristics from Tags starting with 1100, which would mean all tags for this plant. - * - */ - classTypeKeyPrefix?: string, - /** - * Results to return per page - */ - perPage?: number, + workOrderId: string, + costCategoryId: string, /** - * Page to fetch + * Estimated cost for cost category */ - page?: number, - }): CancelablePromise | ProblemDetails> { + requestBody: Array, + }): CancelablePromise { return __request(OpenAPI, { - method: 'GET', - url: '/characteristics', - query: { - 'filter': filter, - 'characteristic-ids-any-of': characteristicIdsAnyOf, - 'class-type-key-prefix': classTypeKeyPrefix, - 'class-type': classType, - 'per-page': perPage, - 'page': page, + method: 'PATCH', + url: '/work-orders/preventive-work-orders/{work-order-id}/estimated-costs/{cost-category-id}', + path: { + 'work-order-id': workOrderId, + 'cost-category-id': costCategoryId, }, + body: requestBody, + mediaType: 'application/json', errors: { - 400: `Request is missing required parameters`, + 400: `The request body is invalid`, + 403: `User does not have sufficient rights to update estimated costs`, 404: `The specified resource was not found`, + 409: `Work order is locked by other user`, }, }); } /** - * Work orders - Get cost categories - * ### Overview - * Get a list of cost categories. They can be added to a work order when it requires special cost tracking. + * @deprecated + * Overhead Maintenance Work order - Lookup + * ### Deprecated + * This endpoint is marked as deprecated due to currently being unavailable. This endpoint is only a draft. Calling the endpoint until available will result in a `404- Not Found`. Deprecation will be removed when the endpoint is available. * - * @returns CostCategory Success - * @returns ProblemDetails Response for other HTTP status codes - * @throws ApiError - */ - public static getCostCategories(): CancelablePromise | ProblemDetails> { - return __request(OpenAPI, { - method: 'GET', - url: '/work-orders/cost-categories', - errors: { - 400: `Request is missing required parameters`, - 403: `User does not have sufficient rights`, - }, - }); - } - - /** - * Report for EqHub and SEMI usage - Get * ### Overview + * Lookup single Overhead Maintenance Work order related information. * - * Get the list of EqHub and SEMI usage. T-code in backend system `ZOMPM_SEMI_USAGE`. + * ### Important information + * By default `include-person-responsible` is false and then the fields `personResponsibleId` and `personResponsibleEmail` will always have null value. * - * @returns EqHubAndSemiUsage Success + * @returns OverheadMaintenanceWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static getEqHubAndSemiUsage({ - eqhubIdAnyOf, - semiIdAnyOf, - filter, - includeStatus = false, - perPage = 100, - page = 1, + public static lookupoverheadMaintenanceWorkOrders({ + workOrderId, + includeOperations = true, + includeServiceOperations = true, + includeMaterials = true, + includeCostDataForMaterials = false, + includeAttachments = false, + includePersonResponsible = false, + includeStatusDetails = false, + includeRelatedTags = false, + includeSafetyMeasures = false, }: { + workOrderId: string, + /** + * Include Work order operations + */ + includeOperations?: boolean, + /** + * Include Work order service operations + */ + includeServiceOperations?: boolean, /** - * Comma-separated List of eqhub id's + * Include materials for Work order operations */ - eqhubIdAnyOf?: string, + includeMaterials?: boolean, /** - * Comma-separated List of SEMI id's + * Include cost data for materials. Additional authorization will be required to retrieve these fields. */ - semiIdAnyOf?: string, + includeCostDataForMaterials?: boolean, /** - * Filter between eqhub or SEMI + * Include Work order attachments (on header and for operation) */ - filter?: 'eqhub' | 'SEMI', + includeAttachments?: boolean, /** - * Include status in response + * Include person responsible information in response, for example the email or name of the person responsible. May have a slight performance impact. */ - includeStatus?: boolean, + includePersonResponsible?: boolean, /** - * Results to return per page + * Include detailed information for statuses (both active and non-active) */ - perPage?: number, + includeStatusDetails?: boolean, /** - * Page to fetch + * Include related tags (from object list) */ - page?: number, - }): CancelablePromise | ProblemDetails> { + includeRelatedTags?: boolean, + /** + * Include safety-measures in work order operations + */ + includeSafetyMeasures?: boolean, + }): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/reports/eqhub-and-semi-usage', + url: '/work-orders/overhead-maintenance-work-orders/{work-order-id}', + path: { + 'work-order-id': workOrderId, + }, query: { - 'eqhub-id-any-of': eqhubIdAnyOf, - 'SEMI-id-any-of': semiIdAnyOf, - 'filter': filter, - 'include-status': includeStatus, - 'per-page': perPage, - 'page': page, + 'include-operations': includeOperations, + 'include-service-operations': includeServiceOperations, + 'include-materials': includeMaterials, + 'include-cost-data-for-materials': includeCostDataForMaterials, + 'include-attachments': includeAttachments, + 'include-person-responsible': includePersonResponsible, + 'include-status-details': includeStatusDetails, + 'include-related-tags': includeRelatedTags, + 'include-safety-measures': includeSafetyMeasures, }, errors: { - 403: `User does not have sufficient rights to use T-code ZOMPM_SEMI_USAGE`, + 301: `If work-order-id exist, but is not a \`OverheadMaintenanceWorkOrder\`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. + `, + 404: `The specified resource was not found`, }, }); } diff --git a/packages/api/maintenance-api/src/lib/generated/services/OverheadMaintenanceWorkOrdersService.ts b/packages/api/maintenance-api/src/lib/generated/services/OverheadMaintenanceWorkOrdersService.ts new file mode 100644 index 00000000..051e6b04 --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/services/OverheadMaintenanceWorkOrdersService.ts @@ -0,0 +1,105 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { OverheadMaintenanceWorkOrder } from '../models/OverheadMaintenanceWorkOrder'; +import type { ProblemDetails } from '../models/ProblemDetails'; + +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; + +export class OverheadMaintenanceWorkOrdersService { + + /** + * @deprecated + * Overhead Maintenance Work order - Lookup + * ### Deprecated + * This endpoint is marked as deprecated due to currently being unavailable. This endpoint is only a draft. Calling the endpoint until available will result in a `404- Not Found`. Deprecation will be removed when the endpoint is available. + * + * ### Overview + * Lookup single Overhead Maintenance Work order related information. + * + * ### Important information + * By default `include-person-responsible` is false and then the fields `personResponsibleId` and `personResponsibleEmail` will always have null value. + * + * @returns OverheadMaintenanceWorkOrder Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static lookupoverheadMaintenanceWorkOrders({ + workOrderId, + includeOperations = true, + includeServiceOperations = true, + includeMaterials = true, + includeCostDataForMaterials = false, + includeAttachments = false, + includePersonResponsible = false, + includeStatusDetails = false, + includeRelatedTags = false, + includeSafetyMeasures = false, + }: { + workOrderId: string, + /** + * Include Work order operations + */ + includeOperations?: boolean, + /** + * Include Work order service operations + */ + includeServiceOperations?: boolean, + /** + * Include materials for Work order operations + */ + includeMaterials?: boolean, + /** + * Include cost data for materials. Additional authorization will be required to retrieve these fields. + */ + includeCostDataForMaterials?: boolean, + /** + * Include Work order attachments (on header and for operation) + */ + includeAttachments?: boolean, + /** + * Include person responsible information in response, for example the email or name of the person responsible. May have a slight performance impact. + */ + includePersonResponsible?: boolean, + /** + * Include detailed information for statuses (both active and non-active) + */ + includeStatusDetails?: boolean, + /** + * Include related tags (from object list) + */ + includeRelatedTags?: boolean, + /** + * Include safety-measures in work order operations + */ + includeSafetyMeasures?: boolean, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/work-orders/overhead-maintenance-work-orders/{work-order-id}', + path: { + 'work-order-id': workOrderId, + }, + query: { + 'include-operations': includeOperations, + 'include-service-operations': includeServiceOperations, + 'include-materials': includeMaterials, + 'include-cost-data-for-materials': includeCostDataForMaterials, + 'include-attachments': includeAttachments, + 'include-person-responsible': includePersonResponsible, + 'include-status-details': includeStatusDetails, + 'include-related-tags': includeRelatedTags, + 'include-safety-measures': includeSafetyMeasures, + }, + errors: { + 301: `If work-order-id exist, but is not a \`OverheadMaintenanceWorkOrder\`, the response is a HTTP 301 Moved Permanently with the url to the resource in the HTTP header Location. + `, + 404: `The specified resource was not found`, + }, + }); + } + +} diff --git a/packages/api/maintenance-api/src/lib/generated/services/PreventiveWorkOrdersService.ts b/packages/api/maintenance-api/src/lib/generated/services/PreventiveWorkOrdersService.ts index c53fca2d..dc8c1ddf 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/PreventiveWorkOrdersService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/PreventiveWorkOrdersService.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { EstimatedCostsJsonPatch } from '../models/EstimatedCostsJsonPatch'; import type { PreventiveWorkOrder } from '../models/PreventiveWorkOrder'; import type { PreventiveWorkOrderBasic } from '../models/PreventiveWorkOrderBasic'; import type { PreventiveWorkOrderCreate } from '../models/PreventiveWorkOrderCreate'; @@ -142,13 +143,13 @@ export class PreventiveWorkOrdersService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. - * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * + * ### Update release 1.33.0 + * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. + * * ### Update release 1.34.0 * Added new properties `callNumber`, `previousCall`, and `completionDate` to `maintenancePlan`. * @@ -168,6 +169,23 @@ export class PreventiveWorkOrdersService { * * Added new query parameter `include-estimated-costs`. Set to `true` to include `estimatedCosts` array in the response. * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency`. + * + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * + * ### Upcoming future release + * Added new property `hasCommunication` + * * @returns PreventiveWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -230,7 +248,7 @@ export class PreventiveWorkOrdersService { */ includeStatusDetails?: boolean, /** - * Include detailed for the main tag of the Work order + * Include detailed information for the main tag of the Work order */ includeTagDetails?: boolean, /** @@ -372,6 +390,52 @@ export class PreventiveWorkOrdersService { }); } + /** + * Preventive Work order - Update estimated costs + * ### Overview + * Update estimated costs for preventive work order. Cost needs to be provided in the currency of the work order. + * The Cost Category ID needs to be: + * - `COST_CUTBACK` + * - `COST_EXTERNAL_SERVICES` + * - `COST_INTERNAL_SERVICES` + * - `COST_INTERNAL_PERSONELL` + * - `COST_MATERIALS_OF_CONSUMPTION` + * - `COST_OTHER_EXPENCES` + * - `COST_REPAIR_AND_MAINTENANCE` + * + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static addPreventiveWoEstimatedCosts({ + workOrderId, + costCategoryId, + requestBody, + }: { + workOrderId: string, + costCategoryId: string, + /** + * Estimated cost for cost category + */ + requestBody: Array, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/work-orders/preventive-work-orders/{work-order-id}/estimated-costs/{cost-category-id}', + path: { + 'work-order-id': workOrderId, + 'cost-category-id': costCategoryId, + }, + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `The request body is invalid`, + 403: `User does not have sufficient rights to update estimated costs`, + 404: `The specified resource was not found`, + 409: `Work order is locked by other user`, + }, + }); + } + /** * Preventive Work order - Add operation(s) * Add operations @@ -703,6 +767,14 @@ export class PreventiveWorkOrdersService { * ### Update release 1.27.0 * Work orders now include the property 'isOpen' * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns PreventiveWorkOrderSimple Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -801,13 +873,22 @@ export class PreventiveWorkOrdersService { * To lookup the created preventive work order use endpoint `/work-orders/preventive-work-orders/{work-order-id}` * * ### Important information ### - * Endpoint will be removed as of 31.12.2024. + * There is an on-going initiative to prevent the possibility to create PM02 work orders in SAP (with the exception of MaintenancePlans). As of Release 1.36.0 on 21.01.2025, the usage of this endpoint is limited to applications with dispensation for usage, documented in disp.equinor.com. + * * - * There is an on-going initiative to prevent the possibility to create in SAP PM02 work orders outside of MaintenancePlans, hence the planned removal of this endpoint. + * To use this endpoint, your business process must be approved by O&M owners. To raise this request, please create a disp on disp.equinor.com, and raise this in O&M [Stryo board](https://equinor.service-now.com/rm_story.do?sys_id=-1&sysparm_stack=rm_story_list.do&sysparm_view=scrum&sysparm_query=rm_story.do%3Fsys_id%3D-1%26sysparm_query%3Dactive%3Dtrue%26sysparm_stack%3Drm_story_list.do%3Fsysparm_query%3Dactive%3Dtrue). * * ### Update release 1.27.0 * Work orders now include the property 'isOpen' * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to the response. + * + * Endpoint is now limited. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns ProblemDetails Response for other HTTP status codes * @returns PreventiveWorkOrderBasic Created * @throws ApiError @@ -827,7 +908,7 @@ export class PreventiveWorkOrdersService { mediaType: 'application/json', errors: { 400: `The request body is invalid`, - 403: `User does not have sufficient rights to create a Project Work order`, + 403: `Client is not allowed to access the endpoint. Please contact the APIphany-team to request access.`, 404: `The specified resource was not found`, }, }); diff --git a/packages/api/maintenance-api/src/lib/generated/services/ProjectWorkOrdersService.ts b/packages/api/maintenance-api/src/lib/generated/services/ProjectWorkOrdersService.ts index 15140c8b..8fe5187f 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/ProjectWorkOrdersService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/ProjectWorkOrdersService.ts @@ -111,13 +111,13 @@ export class ProjectWorkOrdersService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.0 - * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. - * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * + * ### Update release 1.33.0 + * Added new properties `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup` to `materials`. + * * ### Update release 1.34.0 * Added new property `relatedOperations` to `maintenanceRecords` and `tagsRelated`. * Also added query parameter `include-related-operations` to include the property `relatedOperations`. @@ -131,6 +131,18 @@ export class ProjectWorkOrdersService { * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns ProjectWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -179,7 +191,7 @@ export class ProjectWorkOrdersService { */ includeStatusDetails?: boolean, /** - * Include detailed for the main tag of the Work order + * Include detailed information for the main tag of the Work order */ includeTagDetails?: boolean, /** @@ -399,6 +411,12 @@ export class ProjectWorkOrdersService { * ### Update release 1.27.0 * Work orders now include the property 'isOpen' * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns ProjectWorkOrderSimple Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -493,6 +511,9 @@ export class ProjectWorkOrdersService { * ### Update release 1.31.0 * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` to the response. See STRY0261073 in ServiceNow for more details. + * * @returns ProblemDetails Response for other HTTP status codes * @returns ProjectWorkOrderBasic Created * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/SasChangeWorkOrdersService.ts b/packages/api/maintenance-api/src/lib/generated/services/SasChangeWorkOrdersService.ts index 92b7d4d4..9892fd18 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/SasChangeWorkOrdersService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/SasChangeWorkOrdersService.ts @@ -110,7 +110,7 @@ export class SasChangeWorkOrdersService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * @@ -127,6 +127,18 @@ export class SasChangeWorkOrdersService { * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns SASChangeWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -175,7 +187,7 @@ export class SasChangeWorkOrdersService { */ includeStatusDetails?: boolean, /** - * Include detailed for the main tag of the Work order + * Include detailed information for the main tag of the Work order */ includeTagDetails?: boolean, /** @@ -397,6 +409,12 @@ export class SasChangeWorkOrdersService { * ### Update release 1.27.0 * Work orders now include the property 'isOpen' * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns SASChangeWorkOrderSimple Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -484,6 +502,9 @@ export class SasChangeWorkOrdersService { * ### Update release 1.31.0 * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from the response. See STRY0261073 in ServiceNow for more details. + * * @returns ProblemDetails Response for other HTTP status codes * @returns SASChangeWorkOrderBasic Created * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/SubseaWorkOrdersService.ts b/packages/api/maintenance-api/src/lib/generated/services/SubseaWorkOrdersService.ts index 6e80fdd5..0fd7cc7e 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/SubseaWorkOrdersService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/SubseaWorkOrdersService.ts @@ -65,7 +65,7 @@ export class SubseaWorkOrdersService { * * Added `agreement` & `agreementItem` on `serviceOperations` and `grossPrice`, `netValue` & `currency` on `services`. * - * ### Update release 1.33.1 + * ### Update release 1.32.0 * Added `include-cost-data-for-materials` query parameter. * When this parameter is set to `true`, the following properties will be included in `materials` expand: `goodsRecipientId`, `price`, `priceCurrency`, `unloadingPoint`, and `purchasingGroup`. * @@ -79,6 +79,18 @@ export class SubseaWorkOrdersService { * * Added new property `requisitionerId` to `serviceOperations`. * + * ### Update release 1.36.0 + * Added new property `planNotes` to `operations`. + * + * Added new properties `location` and `locationId` to `tagsRelated` and `maintenanceRecords`. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * * @returns SubseaWorkOrder Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/TagService.ts b/packages/api/maintenance-api/src/lib/generated/services/TagService.ts index 1016ddfb..0999b10d 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/TagService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/TagService.ts @@ -94,6 +94,18 @@ export class TagService { * ### Update release 1.35.0 * Added new fields `maintenancePlantId`, `createdOnDate` and `changedOnDate`. * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * + * ### Update future release + * + * Added new property `hasCommunication` + * * @returns Tag Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -137,7 +149,7 @@ export class TagService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Include installed equipment */ @@ -662,6 +674,14 @@ export class TagService { * - `changed-before-date` * - `changed-after-date` * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * * @returns TagSearch Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -752,7 +772,7 @@ export class TagService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Include installed equipment */ diff --git a/packages/api/maintenance-api/src/lib/generated/services/TechnicalInformationUpdateRequestsService.ts b/packages/api/maintenance-api/src/lib/generated/services/TechnicalInformationUpdateRequestsService.ts index 0cb6c450..8d48e782 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/TechnicalInformationUpdateRequestsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/TechnicalInformationUpdateRequestsService.ts @@ -195,7 +195,7 @@ export class TechnicalInformationUpdateRequestsService { * Technical information update request - Update status * Update status of technical information update request. * - * The statuses available for the failure report can be found by querying `/maintenance-records/technical-information-update-requests/{record-id}?include-status-details=true`. + * The statuses available for the technical information update requests can be found by querying `/maintenance-records/technical-information-update-requests/{record-id}?include-status-details=true`. * * * ### Important information @@ -656,15 +656,16 @@ export class TechnicalInformationUpdateRequestsService { * - TSRL Task Released * - TSCO Task Completed * - TSSC Task successful + * + * It is possible to activate and deactivate following statuses: * - TCMP WF when task completed - * - RIND Returned - Wait for info + * - RTND Returned - Wait for info * - CANC Cancelled * - PRCR - Product Created * - * ### Upcoming changes - * Enabled activation of user statuses like `TCMP - WF when task completed`, `RIND - Returned - Wait for info` and `CANC - Cancelled` - * - * Enabled activation of user statuses related to products, such as `PRCR - Product Created` + * ### Update release 1.36.0 + * Enabled activation and deactivation of user statuses like `TCMP - WF when task completed`, `RTND - Returned - Wait for info`, `CANC - Cancelled` + * and `PRCR - Product Created`. * * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError diff --git a/packages/api/maintenance-api/src/lib/generated/services/UpcomingModifiedEndpointsService.ts b/packages/api/maintenance-api/src/lib/generated/services/UpcomingModifiedEndpointsService.ts index 60a8f0ff..eb0101b5 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/UpcomingModifiedEndpointsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/UpcomingModifiedEndpointsService.ts @@ -2,9 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { FailureReport } from '../models/FailureReport'; +import type { FailureReportBasic } from '../models/FailureReportBasic'; +import type { FailureReportJsonPatch } from '../models/FailureReportJsonPatch'; +import type { MeasuringPoint } from '../models/MeasuringPoint'; import type { ProblemDetails } from '../models/ProblemDetails'; -import type { StatusUpdateJsonPatch } from '../models/StatusUpdateJsonPatch'; -import type { WorkOrderOperationJsonPatch } from '../models/WorkOrderOperationJsonPatch'; +import type { WorkOrderOptimizedForQuery } from '../models/WorkOrderOptimizedForQuery'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; @@ -13,216 +16,733 @@ import { request as __request } from '../core/request'; export class UpcomingModifiedEndpointsService { /** - * Work order - Update operation + * Measuring points - Search * ### Overview - * Update the work order operation for all work order types. - * The `operation-id` parameter to use in the url can be found using the various lookup and search endpoints for work orders. `operation-id` consists of two internal ids from the ERP system called routing number and counter separated by the `-` character. - * - * The following fields are possible to update: - * - actualPercentageComplete - * - isCompleted - * - schedulingStartConstraintId - Value one of: `MSO` - Must start on, `SNET` - Start no earlier than or `SNLT` - Start no later than - * - schedulingStartConstraintDateTime - * - schedulingFinishConstraintId - Value one of: `MFO ` - Must finish on, `FNET` - Finish no earlier than or `FNLT` - Finish no later than - * - schedulingFinishConstraintDateTime - * - systemCondition - * - operationId - * - title - * - text - * - workCenterId - * - workCenterPlantId - * - standardTextTemplate - * - plannedWorkHours - * - plannedWorkDuration - * - capacityCount - * - calculationKey - * - * Individual operations can be updated with relevant codes for `systemCondition` to describe required process conditions for each operation. Possible values for the `systemCondition`: - * - 0 - Unit shutdown - * - 1 – In operation - * - 2 – System shutdown - * - 3 – Partial production shutdown - * - 4 – Full production shutdown - * - 5 - Reset condition value + * Search measuring points. * - * ### Update release 1.19.0 - * Added support for `operationId`, `title`, `text`, `workCenterId`, `workCenterPlantId`, `standardTextTemplate`, `plannedWorkHours`, `plannedWorkDuration`, `capacityCount`, `calculationKey`, `systemCondition,` and `isExcludedFromWorkOrderPlan`. + * ### Filter: by-plant + * Search measuring points based on plant and one other property of the measuring point. + * Parameters: + * - plant-id + * + * At least one of the following parameters is required: + * + * - `tag-prefix` + * - `measuring-position` + * - `quantitative-characteristic` + * - `qualitative-code-group` + * - `measuring-point-name` + * - `characteristic-value-any-of` + * + * ### Examples + * `/measuring-points?filter=by-plant&plant-id=1180&tag-prefix=18HV10&api-version=v1` + * `/measuring-points?filter=by-plant&plant-id=1102&quantitative-characteristic=SURFACE_MAINTEANC&api-version=v1` + * + * `/measuring-points?filter=by-plant&plant-id=1180&tag-prefix=18HV10&position=VALVE%20STATUS&include-last-measurement=true&api-version=v1` + * + * + * When using the `characteristic-value-any-of` it is important to URI Encode the input data especially when there are special characters as part of the input: + * + * `/measuring-points?characteristic-value-any-of=%3D17445%2F9818,%3D17433/6333&class-id=L_PART&characteristic-id=L_E3DREF&plant-id=1201&api-version=v1` + * + * ### Update release 1.10.0 + * Added property `maintenanceRecordId` to measurements. + * + * Added `include-characteristics` and `include-characteristics-without-value` query parameter. + * + * ### Update release 1.15.0 + * Added `workOrderId` to response. + * + * ### Update release 1.20.0 + * Edited the response structure to support pagination. Use the parameters `page` and `per-page` in the parameters to edit wanted response. * * ### Update release 1.21.0 - * Added ability to update text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a - * configuration switch, which will initially be disabled, and when appropriate, enabled. + * Measuring points for equipment are now included in searches based on `plant-id`. + * Measuring points for equipment now include the `tagId` and `tagPlantId` of the tag the equipment is installed on. * * ### Update release 1.22.0 - * Added support to reset `systemCondition` by passing in the value `5`. + * To limit the response data for filter `by-plant`, at least one of the additional parameters must be provided. * - * ### Update release 1.31.0 - * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` + * ### Update release 1.30.0 + * Added `characteristic-value-any-of`, `class-id` and `characteristic-id` query parameters. + * Can be used to search for measuring points based on values of a characteristic. * - * ### Update release 1.35.0 - * Added support for updating the person responsible for the operation by using the path `personResponsibleEmail`. The value used for this path should be the equinor email of an employee with a SAP user. - * - * ### Upcoming changes - * Added support for updating property `isExcludedFromWorkOrderPlan`. + * ### Update future release + * Added `include-measurement-text` query parameter to include measurement text in the response. * + * @returns MeasuringPoint Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static updateWorkOrderOperation({ - operationId, - requestBody, + public static searchMeasuringPoints({ + filter, + plantId, + tagPrefix, + measuringPosition, + quantitativeCharacteristic, + qualitativeCodeGroup, + measuringPointName, + includeLastMeasurement = false, + includeMeasurements = false, + includeQualitativeCodeGroup = false, + includeCharacteristics = false, + includeCharacteristicsWithoutValue = false, + perPage = 50, + page = 1, + characteristicId, + classId, + characteristicValueAnyOf, + includeMeasurementText = false, }: { - operationId: string, /** - * Update of Work order details + * Filter to limit the measuring points by + */ + filter: 'by-plant', + /** + * Plant the tag-prefix belongs to + */ + plantId?: string, + /** + * The first few characters of the tag + */ + tagPrefix?: string, + /** + * Limit result based on a specific measuring position value + */ + measuringPosition?: string, + /** + * Limit result based on a specific quantitative characteristic value + */ + quantitativeCharacteristic?: string, + /** + * Limit result based on a specific qualitative code group value + */ + qualitativeCodeGroup?: string, + /** + * Limit result based on a specific measuring point name value */ - requestBody: Array, - }): CancelablePromise { + measuringPointName?: string, + /** + * Include the last measurement of the measuring points + */ + includeLastMeasurement?: boolean, + /** + * Include measurements of the measuring points + */ + includeMeasurements?: boolean, + /** + * Include possible codes for qualitative measurements if qualitativeCodeGroupId is set + */ + includeQualitativeCodeGroup?: boolean, + /** + * Include characteristics with defined value for the measuring points. Use `include-characteristics-without-value` to retrieve all characteristics available for the measuring points. + */ + includeCharacteristics?: boolean, + /** + * Include all characteristics available for the measuring points regardless if they have a defined value or not. Use `include-characteristics` to only include characteristics with defined value for the measuring points. + */ + includeCharacteristicsWithoutValue?: boolean, + /** + * Results to return pr page + */ + perPage?: number, + /** + * Page to fetch + */ + page?: number, + /** + * Required field if `characteristic-value-any-of` is supplied. Endpoint [/characteristics/{class-id}](#operation/LookupClass) can be used to find characteristic ids. + */ + characteristicId?: string | null, + /** + * Required field if `characteristic-value-any-of` is supplied. + */ + classId?: string | null, + /** + * Search based on characteristic values. Must be used in combination with `class-id` and `characteristic-id`. Wildcards are not supported. Make sure to encode the parameters if they contain special characters. + */ + characteristicValueAnyOf?: string, + /** + * Include measurement text in the response + */ + includeMeasurementText?: boolean, + }): CancelablePromise | ProblemDetails> { return __request(OpenAPI, { - method: 'PATCH', - url: '/work-order-operations/{operation-id}', - path: { - 'operation-id': operationId, + method: 'GET', + url: '/measuring-points', + query: { + 'filter': filter, + 'plant-id': plantId, + 'tag-prefix': tagPrefix, + 'measuring-position': measuringPosition, + 'quantitative-characteristic': quantitativeCharacteristic, + 'qualitative-code-group': qualitativeCodeGroup, + 'measuring-point-name': measuringPointName, + 'include-last-measurement': includeLastMeasurement, + 'include-measurements': includeMeasurements, + 'include-qualitative-code-group': includeQualitativeCodeGroup, + 'include-characteristics': includeCharacteristics, + 'include-characteristics-without-value': includeCharacteristicsWithoutValue, + 'per-page': perPage, + 'page': page, + 'characteristic-id': characteristicId, + 'class-id': classId, + 'characteristic-value-any-of': characteristicValueAnyOf, + 'include-measurement-text': includeMeasurementText, }, - body: requestBody, - mediaType: 'application/json', errors: { - 400: `Request is missing required parameters`, - 403: `User does not have sufficient rights to update operation`, 404: `The specified resource was not found`, - 409: `Work order is locked by other user`, }, }); } /** - * Failure report - Update task status + * Work orders - Optimized for query + * ### Overview + * Query work orders for potentially complicated patterns where speed is of the essence. + * + * `planning-plants` is the only mandatory fields, but clients should normally provide at least one more query criteria. + * + * A normal use case would be to first provide an initial query criteria based on user input. Then allow the end-users based on the resulting data select unwanted results based on specific attributes. The unwanted results should then be added to the exclusion list (for example `keywords-not` or `work-centers-not)` and the API call repeated. + * + * `max-results` have a default value of 1000 and is necessary to provide a quick response. + * + * The multi-line `text` property is not included by default, but can included by setting `include-text=true` in the request. This will influence performance significantly. + * + * Pagination is supported for this endpoint by setting values for `page` and `per-page`. If these parameteres are omitted, the result will be returned without pagination. + * + * ### Response + * The response schema has been optimized for speed, enabling the retrieval of work orders only from the past three years. + * + * ### Examples + * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&tags-all-of=10B9` - Return work orders where tag is 10B9 + * + * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&tags-all-of=AA15*&tags-not=AA15002` - Return work orders where tag has pattern `AA15*` but is not AA15002 + * + * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&keywords-all-of=heli,male` - Return work orders where the title contains both `heli` and `male` + * + * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&status-any-of=PREP,RDEX&created-after-date=2021-06-01` - Return work orders with status PREP or RDEX and created after a certain date + * + * ### Update release 1.5.0 + * Added revisionId to work order response (represents shutdown or campaign work). + * + * ### Update release 1.12.0 + * Added query parameter `include-maintenance-record`. + * + * ### Update release 1.16.0 + * Added property `workCenterId` to `maintenanceRecords.failureReports` + * + * ### Update release 1.29.0 + * Added properties `revision` and `changedDatetime`. + * + * Allow searching by `changedOnDay` when `is-open` is set. Search by using the new query parameters `changed-after-date` and `changed-before-date`. + * + * ### Update release 1.31.0 + * Added list of supported statuses for `status-all-of`, `status-any-of` and `status-not` query parameters. Status `REL` is now supported. + * + * Added property `hasStatusREL` to the response. + * + * ### Update release 1.35.0 + * Added support for optional pagination. + * + * ### Update release 1.37.0 + * Added query parameter `work-order-ids-any-of` & add support for SWNG in `status-all-of`, `status-any-of` and `status-not` query parameters. + * + * Deprecated query parameter `max-results` as the same functionality can be achieved with `per-page`. + * + * Added properties `tag`, `requiredEndDate`, `hseCritical` & `productionCritical`. + * + * Added query parameter `include-status-details` and the object `statuses` + * + * ### Upcoming future release + * Added `overheadMaintenanceWorkOrders` to `work-order-types` query parameter. + * + * @returns WorkOrderOptimizedForQuery Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static queryWorkOrdersOptimized({ + planningPlants, + keywordsAllOf, + keywordsAnyOf, + keywordsNot, + tagsAllOf, + tagsAnyOf, + tagsNot, + workCentersAnyOf, + workCentersNot, + systemsAnyOf, + systemsNot, + locationsAnyOf, + locationsNot, + sortFieldAnyOf, + sortFieldNot, + revisionCodeAnyOf, + revisionCodeNot, + statusAllOf, + statusAnyOf, + statusNot, + isOpen, + createdAfterDate, + createdBeforeDate, + changedAfterDate, + changedBeforeDate, + workOrderTypes, + workOrderIdsAnyOf, + sortBy, + includeText = false, + includeMaintenanceRecord = false, + includeStatusDetails = false, + maxResults, + perPage, + page = 1, + }: { + /** + * Query based on planningPlantIds (any-of) + */ + planningPlants: Array, + /** + * Query based on keywords in title (case insensitive) + */ + keywordsAllOf?: Array, + /** + * Query based on keywords in title (case insensitive) + */ + keywordsAnyOf?: Array, + /** + * Query based on keywords in title (case insensitive) + */ + keywordsNot?: Array, + /** + * Query based on tagIds. Expressions with wildcards can be used for example `1A*-6A`. Ensure the tagIds are url-encoded in order to handle special characters + */ + tagsAllOf?: Array, + /** + * Query based on tagIds. Expressions with wildcards can be used for example `1A*-6A`. Ensure the tagIds are url-encoded in order to handle special characters + */ + tagsAnyOf?: Array, + /** + * Query based on tagIds. Expressions with wildcards can be used for example `AE55*`. Ensure the tagIds are url-encoded in order to handle special characters + */ + tagsNot?: Array, + /** + * Query based on workCenterIds + */ + workCentersAnyOf?: Array, + /** + * Query based on workCenterIds + */ + workCentersNot?: Array, + /** + * Query based on systemIds + */ + systemsAnyOf?: Array, + /** + * Query based on systemIds + */ + systemsNot?: Array, + /** + * Query based on locationIds + */ + locationsAnyOf?: Array, + /** + * Query based on locationIds + */ + locationsNot?: Array, + /** + * Query based on sortField ()used for grouping work orders) + */ + sortFieldAnyOf?: Array, + /** + * Query based on sortField (used for grouping work orders) + */ + sortFieldNot?: Array, + /** + * Query based on revisionCode + */ + revisionCodeAnyOf?: Array, + /** + * Query based on sortField (often used for revision codes) + */ + revisionCodeNot?: Array, + /** + * Query based on statusIds (not all statuses are supported) + */ + statusAllOf?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL' | 'SWNG'>, + /** + * Query based on statusIds (not all statuses are supported) + */ + statusAnyOf?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL' | 'SWNG'>, + /** + * Query based on statusIds (not all statuses are supported) + */ + statusNot?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL' | 'SWNG'>, + /** + * Include only open work orders or only closed work orders. By default, all work orders are included. + */ + isOpen?: boolean, + /** + * Earliest creation date to include + */ + createdAfterDate?: string, + /** + * Latest creation date to include + */ + createdBeforeDate?: string, + /** + * Earliest `changedOnDay` date to include. Query parameter `is-open` must be set to `true` or `false` to use this parameter. + */ + changedAfterDate?: string, + /** + * Latest `changedOnDay` date to include. Query parameter `is-open` must be set to `true` or `false` to use this parameter. + */ + changedBeforeDate?: string, + /** + * Limit to specific work order types (one-of) + */ + workOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + /** + * Comma-separated list of `work-order-id`. + */ + workOrderIdsAnyOf?: string, + /** + * Property to sort the results by + */ + sortBy?: Array<'createdDateTime desc' | 'createdDateTime asc' | 'workOrderId desc' | 'workOrderId asc' | 'systemId desc' | 'systemId asc' | 'locationId desc' | 'locationId asc' | 'sortField desc' | 'sortField asc' | 'title desc' | 'title asc'>, + /** + * Include the multi-line text of the work order (will cause the endpoint to go significantly slower) + */ + includeText?: boolean, + /** + * Include the main maintenance record linked to the work order (if any) + */ + includeMaintenanceRecord?: boolean, + /** + * Include status details for the work orders + */ + includeStatusDetails?: boolean, + /** + * Maximum number of results to include. Default is 1000. + * @deprecated + */ + maxResults?: number, + /** + * Results to return pr page + */ + perPage?: number, + /** + * Page to fetch + */ + page?: number, + }): CancelablePromise | ProblemDetails> { + return __request(OpenAPI, { + method: 'GET', + url: '/work-orders-optimized-for-query', + query: { + 'planning-plants': planningPlants, + 'keywords-all-of': keywordsAllOf, + 'keywords-any-of': keywordsAnyOf, + 'keywords-not': keywordsNot, + 'tags-all-of': tagsAllOf, + 'tags-any-of': tagsAnyOf, + 'tags-not': tagsNot, + 'work-centers-any-of': workCentersAnyOf, + 'work-centers-not': workCentersNot, + 'systems-any-of': systemsAnyOf, + 'systems-not': systemsNot, + 'locations-any-of': locationsAnyOf, + 'locations-not': locationsNot, + 'sort-field-any-of': sortFieldAnyOf, + 'sort-field-not': sortFieldNot, + 'revision-code-any-of': revisionCodeAnyOf, + 'revision-code-not': revisionCodeNot, + 'status-all-of': statusAllOf, + 'status-any-of': statusAnyOf, + 'status-not': statusNot, + 'is-open': isOpen, + 'created-after-date': createdAfterDate, + 'created-before-date': createdBeforeDate, + 'changed-after-date': changedAfterDate, + 'changed-before-date': changedBeforeDate, + 'work-order-types': workOrderTypes, + 'work-order-ids-any-of': workOrderIdsAnyOf, + 'sort-by': sortBy, + 'include-text': includeText, + 'include-maintenance-record': includeMaintenanceRecord, + 'include-status-details': includeStatusDetails, + 'max-results': maxResults, + 'per-page': perPage, + 'page': page, + }, + }); + } + + /** + * Failure report - Lookup * ### Overview - * Update status of an existing task for failure report. + * Lookup a single failure report + * + * ### Update release 0.9.0 + * Added failureMechanismId,failureMechanismGroupId to additionalMetadata. + * + * ### Update release 1.0.0 + * Added tasks for failure reports through query option include-tasks. + * Added properties plannerGroupId, plannerGroup and planningPlantId. + * + * ### Update release 1.1.0 + * Added isOpen and completedDateTime. + * + * Added hasUnsafeFailureMode and unsafeFailureModeStatus properties according to business process requirement `R-12137 - Give immediate warning of unsafe failure modes`. + * ### Update release 1.3.0 + * Added `priorityId` to response. + * + * ### Update release 1.4.0 + * Added `workCenter` and `equipment` to response. Fields include descriptions of workCenterId and equipmentId + * + * ### Update release 1.5.0 + * Added `createdDateTime` for attachments. + * + * ### Update release 1.6.0 + * Added `301` response. + * + * ### Update release 1.10.0 + * Added query parameter `include-url-references`. + * + * ### Update release 1.11.0 + * Added `quantity` for tasks. + * + * Added properties `createdById`,`createdBy` and `createdByEmail`. + * `createdById` will always be have value in response. `createdBy` and `createdByEmail` will only have value in response if the `include-created-by-details` query parameter is `true`. + * + * ### Update release 1.15.0 + * Added property `documentTitle` to `urlReferences`. * - * To find tasks available on a failure report, use the `/maintenance-records/failure-reports/{record-id}?include-tasks=true`. + * ### Update release 1.16.0 + * `urlReferences` and `attachments` now include properties `documentType`, `documentNumber` and `documentTitle`. * - * When a task is created, it will have status `TSOS - Outstanding task` and `CRTE - Created`. - * The status `TSRL - Task Released` can be set afterwards. + * ### Update release 1.17.0 + * Added query parameter `include-measurements`. * - * Now it is possible to set following statuses: - * - TSRL Task Released - * - TSCO Task Completed - * - TSSC Task successful - * - TCMP WF when task completed - * - RIND Returned - Wait for info - * - CANC Cancelled + * ### Update release 1.19.0 + * Added query parameter `include-additional-data-characteristics`. + * + * ### Update release 1.21.0 + * Added property `area` to tag details. + * + * ### Update release 1.24.0 + * `urlReferences` and `attachments` now include the property `documentCreatedDate` + * + * ### Update release 1.26.0 + * `tagDetails` object now includes the new field `maintenanceConceptId` + * + * ### Update release 1.27.0 + * Added `maintenanceRecordTypeId` to the response. + * + * ### Update release 1.28.0 + * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. * - * ### Upcoming changes - * Enabled activation of user statuses like `TCMP - WF when task completed`, `RIND - Returned - Wait for info` and `CANC - Cancelled` + * Added properties `codingGroupId` and `codingId`. + * + * ### Update release 1.31.0 + * Added `isReadonlyText` property to `activities` in the response. + * + * ### Update release 1.32.0 + * Added `changedDateTime` for attachments. + * + * Added a query parameter `include-task-list` and `taskList` in the response. When a work order is created based on this notification, operations from the `taskList` will be automatically copied into the work order. + * + * ### Update release 1.33.0 + * Added `taskResponsible` and `taskResponsibleEmail` for `tasks` in response when the new query parameter `include-task-responsible-details` is set to true. + * + * ### Update release 1.35.0 + * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. + * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. * + * ### Update release 1.37.0 + * Added support for new work order type `overheadMaintenanceWorkOrders` to `workOrderTypeId` enum of allowed types. + * + * @returns FailureReport Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static updateFailureReportTaskStatuses({ + public static lookupFailureReport({ recordId, - taskId, - statusId, - requestBody, + includeStatusDetails = false, + includeTagDetails = false, + includeActivities = false, + includeTasks = false, + includeAttachments = false, + includeAdditionalMetadata = false, + includeAdditionalDataCharacteristics = false, + includeCreatedByDetails = false, + includeUrlReferences = false, + includeMeasurements = false, + includeTaskList = false, + includeTaskResponsibleDetails = false, }: { /** - * id of the failure report + * The recordId of the failure report. */ recordId: string, /** - * id of the task + * Include detailed information for statuses (both active and non-active) + */ + includeStatusDetails?: boolean, + /** + * Include details about tag for failure report + */ + includeTagDetails?: boolean, + /** + * Include detailed information for activities + */ + includeActivities?: boolean, + /** + * Include detailed information for tasks + */ + includeTasks?: boolean, + /** + * Include attachments + */ + includeAttachments?: boolean, + /** + * Include extra metadata related to additional failure modes and detection modes. This is only used in rare cases + */ + includeAdditionalMetadata?: boolean, + /** + * Include characteristics for additional metadata */ - taskId: string, + includeAdditionalDataCharacteristics?: boolean, /** - * id of the status + * Include name and email of user represented in `createdById`. If not supplied, `createdBy` and `createdByEmail` will have null value. */ - statusId: string, + includeCreatedByDetails?: boolean, /** - * Task status to update + * Include URL references for failure report. See `POST /maintenance-record-relationships/{record-id}/url-references` */ - requestBody: Array, - }): CancelablePromise { + includeUrlReferences?: boolean, + /** + * Include related measurements + */ + includeMeasurements?: boolean, + /** + * Include task list with task list operations + */ + includeTaskList?: boolean, + /** + * Include task responsible details. Can have a slight performance impact. + */ + includeTaskResponsibleDetails?: boolean, + }): CancelablePromise { return __request(OpenAPI, { - method: 'PATCH', - url: '/maintenance-records/failure-reports/{record-id}/tasks/{task-id}/statuses/{status-id}', + method: 'GET', + url: '/maintenance-records/failure-reports/{record-id}', path: { 'record-id': recordId, - 'task-id': taskId, - 'status-id': statusId, }, - body: requestBody, - mediaType: 'application/json', + query: { + 'include-status-details': includeStatusDetails, + 'include-tag-details': includeTagDetails, + 'include-activities': includeActivities, + 'include-tasks': includeTasks, + 'include-attachments': includeAttachments, + 'include-additional-metadata': includeAdditionalMetadata, + 'include-additional-data-characteristics': includeAdditionalDataCharacteristics, + 'include-created-by-details': includeCreatedByDetails, + 'include-url-references': includeUrlReferences, + 'include-measurements': includeMeasurements, + 'include-task-list': includeTaskList, + 'include-task-responsible-details': includeTaskResponsibleDetails, + }, errors: { - 403: `User does not have sufficient rights to update failure report task`, + 301: `The specified resource exists in another location + This can occur when requesting a resource which type does not match the route you are using. + + Example: \`/maintenance-api/resource-a/{resource-b-id}/\` gives \`301\` response. + `, 404: `The specified resource was not found`, - 409: `Failure report is locked by other user`, }, }); } /** - * Technical information update request - Update task status - * ### Overview - * Update status of an existing task for technical information update request. + * Failure report - Update + * ## Overview + * Update key fields of a failure report. + * + * The following endpoints can be used to find possible values for input: + * 1. `workCenterId` - [/plants/{plant-id}?include-work-centers](#operation/LookupPlant) + * 1. `plannerGroupId` - [/plants/{plant-id}?include-planner-groups=true](#operation/LookupPlant) + * 1. `locationId` - [/plants/{plant-id}?include-locations=true](#operation/LookupPlant) + * 1. `detectionMethodId`, `failureMechanismId`, `failureModeId` - [/plants/{plant-id}/tags/{tag-id}?include-catalog-profile-details=true](#operation/LookupTag) or [/equipment/{equipment-id}?include-catalog-profile-details=true](#operation/LookupEquipment) + * 1. `codingId` - [/catalogs/{catalog-id}/code-groups](#operation/SearchCodeGroup) + * * - * To find tasks available on a technical information update request, use the `/maintenance-records/technical-information-update-requests/{record-id}?include-tasks=true`. + * ## Important information + * To avoid accidentally overwriting the multi-line text property, the endpoint will reject any requests with an empty text property. * - * When a task is created, it will have status `TSOS - Outstanding task` and `CRTE - Created`. - * The status `TSRL - Task Released` can be set afterwards. + * ### Update release 1.0.0 + * Added possibility to update plannerGroupId. * - * Now it is possible to set following statuses: - * - TSRL Task Released - * - TSCO Task Completed - * - TSSC Task successful - * - TCMP WF when task completed - * - RIND Returned - Wait for info - * - CANC Cancelled - * - PRCR - Product Created + * ### Update release 1.1.0 + * Added hasUnsafeFailureMode and unsafeFailureModeStatus properties to response according to business process requirement `R-12137 - Give immediate warning of unsafe failure modes`. * - * ### Upcoming changes - * Enabled activation of user statuses like `TCMP - WF when task completed`, `RIND - Returned - Wait for info` and `CANC - Cancelled` + * ### Update release 1.3.0 + * Added `priorityId` to response. * - * Enabled activation of user statuses related to products, such as `PRCR - Product Created` + * ### Update release 1.4.0 + * Added `workCenter` and `equipment` to response. Fields include descriptions of workCenterId and equipmentId * + * ### Update release 1.28.0 + * Added ability to create text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. This feature is controlled by a + * configuration switch, which will initially be disabled, and when appropriate, enabled. + * + * Added properties `codingGroupId` and `codingId`. + * + * ### Update release 1.29.0 + * Deprecated update of the property `failureImpactId`. See [Deprecation](#section/Deprecation/Deprecation-policy) for more information. + * + * ### Update release 1.32.0 + * Added ability to append text with advanced formatting. See the heading [Resource text](#section/Modelling-of-resources/Resource-text) in the description for more info. + * + * ### Update release 1.33.0 + * Added possibility to prepend text. Use the operation `prepend` in the request body to prepend text to the current text. + * + * ### Update release 1.35.0 + * Added `workOrderTypeId` and `workOrderId` to the response. `workOrderId` includes the id of work orders, not constrained to only showing corrective work orders. + * `correctiveWorkOrderId` has been corrected to only show the work order id if it is a corrective work order. + * + * ### Update release 1.37.0 + * Added support for new work order type `overheadMaintenanceWorkOrders` to `workOrderTypeId` enum of allowed types. + * + * @returns FailureReportBasic Success, the failure report has been updated * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ - public static updateTechnicalInformationUpdateRequestTaskStatuses({ + public static updateFailureReport({ recordId, - taskId, - statusId, requestBody, }: { /** - * id of the technical information update request + * The recordId of the failure report. */ recordId: string, /** - * id of the task - */ - taskId: string, - /** - * id of the status + * Details on how to update the Failure Report */ - statusId: string, - /** - * Task status to update - */ - requestBody: Array, - }): CancelablePromise { + requestBody: Array, + }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', - url: '/maintenance-records/technical-information-update-requests/{record-id}/tasks/{task-id}/statuses/{status-id}', + url: '/maintenance-records/failure-reports/{record-id}', path: { 'record-id': recordId, - 'task-id': taskId, - 'status-id': statusId, }, body: requestBody, mediaType: 'application/json', errors: { - 403: `User does not have sufficient rights to update technical information update request`, - 404: `The specified resource was not found`, - 409: `Technical information update request is locked by other user`, + 400: `Bad request. For example that an empty text property was supplied`, + 403: `User does not have sufficient rights to update the failure report`, }, }); } diff --git a/packages/api/maintenance-api/src/lib/generated/services/UpcomingNewEndpointsService.ts b/packages/api/maintenance-api/src/lib/generated/services/UpcomingNewEndpointsService.ts new file mode 100644 index 00000000..d5ff34a0 --- /dev/null +++ b/packages/api/maintenance-api/src/lib/generated/services/UpcomingNewEndpointsService.ts @@ -0,0 +1,165 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CertificationReportBasic } from '../models/CertificationReportBasic'; +import type { ProblemDetails } from '../models/ProblemDetails'; +import type { PSVCertificationReportCreate } from '../models/PSVCertificationReportCreate'; +import type { WorkOrderOperationForSearchFull } from '../models/WorkOrderOperationForSearchFull'; + +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; + +export class UpcomingNewEndpointsService { + + /** + * @deprecated + * Work order operations - Search + * ### Deprecated + * This endpoint is marked as deprecated due to currently being unavailable. This endpoint is only a draft. Calling the endpoint until available will result in a `404- Not Found`. Deprecation will be removed when the endpoint is available. + * + * ### Overview + * Search for work order operations from any work order type. + * + * ### Query parameter filters + * + * The following query parameters are supported for filtering the work order operations. + * All the query parameters are optional, but at least one must be provided to get a response. + * + * Parameters: + * - `work-center-id-any-of` + * - `plant-id` + * - `changed-since-datetime` + * - `changed-before-datetime` + * - `operation-id-any-of` + * - `work-order-ids-any-of` + * + * @returns WorkOrderOperationForSearchFull Success + * @returns ProblemDetails Response for other HTTP status codes + * @throws ApiError + */ + public static searchWorkOrderOperations({ + plantId, + changedSinceDatetime, + changedBeforeDatetime, + workCenterIdAnyOf, + workOrderIdsAnyOf, + operationIdAnyOf, + includeMaterials = false, + includeAttachments = false, + includeSafetyMeasures = false, + perPage = 100, + page = 1, + }: { + /** + * Plant identifier + */ + plantId?: string, + /** + * Earliest `changedOnDate` to return work order operations for + */ + changedSinceDatetime?: string, + /** + * Limit the response to only work order operations changed after `changed-since-datetime` but before this datetime + */ + changedBeforeDatetime?: string, + /** + * Comma-separated list of `work-center-id`. Wildcard endings are supported + */ + workCenterIdAnyOf?: string, + /** + * Comma-separated list of `work-order-id`. + */ + workOrderIdsAnyOf?: string, + /** + * Comma-separated list of `operation-id`. + */ + operationIdAnyOf?: string, + /** + * Include materials for Work order operations + */ + includeMaterials?: boolean, + /** + * Include attachments for Work order operations + */ + includeAttachments?: boolean, + /** + * Include safety measures for Work order operations + */ + includeSafetyMeasures?: boolean, + /** + * Results to return per page + */ + perPage?: number, + /** + * Page to fetch + */ + page?: number, + }): CancelablePromise | ProblemDetails> { + return __request(OpenAPI, { + method: 'GET', + url: '/work-order-operations', + query: { + 'plant-id': plantId, + 'changed-since-datetime': changedSinceDatetime, + 'changed-before-datetime': changedBeforeDatetime, + 'work-center-id-any-of': workCenterIdAnyOf, + 'work-order-ids-any-of': workOrderIdsAnyOf, + 'operation-id-any-of': operationIdAnyOf, + 'include-materials': includeMaterials, + 'include-attachments': includeAttachments, + 'include-safety-measures': includeSafetyMeasures, + 'per-page': perPage, + 'page': page, + }, + errors: { + 400: `Request is missing required parameters`, + }, + }); + } + + /** + * @deprecated + * Certification report - Create PSV Certification Report + * ### Deprecated + * This endpoint is marked as deprecated due to currently being unavailable. This endpoint is only a draft. Calling the endpoint until available will result in a `404- Not Found`. Deprecation will be removed when the endpoint is available. + * + * ### Overview + * Create new Certification report through Technical Feedback, also known as a PSV Certification. + * + * ### Important information + * This endpoint is only applicable if you have a valid work order. Using this endpoint will also set the status of a technical feedback to `Done`. + * + * @returns ProblemDetails Response for other HTTP status codes + * @returns CertificationReportBasic Created + * @throws ApiError + */ + public static createPsvCertificationReport({ + operationId, + requestBody, + }: { + /** + * The operationId of the technical feedback + */ + operationId: string, + /** + * PSV certification report to create + */ + requestBody: PSVCertificationReportCreate, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/maintenance-records/certification-reports/psv/{operation-id}', + path: { + 'operation-id': operationId, + }, + body: requestBody, + mediaType: 'application/json', + errors: { + 403: `User does not have sufficient rights to create a PSV certification report`, + }, + }); + } + +} diff --git a/packages/api/maintenance-api/src/lib/generated/services/WorkOrderOperationsService.ts b/packages/api/maintenance-api/src/lib/generated/services/WorkOrderOperationsService.ts index 05a1ec35..23df5845 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/WorkOrderOperationsService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/WorkOrderOperationsService.ts @@ -5,10 +5,10 @@ import type { AddSafetyMeasure } from '../models/AddSafetyMeasure'; import type { ProblemDetails } from '../models/ProblemDetails'; import type { SafetyMeasure } from '../models/SafetyMeasure'; -import type { SubseaWorkOrderMaterialForAddMaterialRespone } from '../models/SubseaWorkOrderMaterialForAddMaterialRespone'; +import type { SubseaWorkOrderMaterialForAddMaterialResponse } from '../models/SubseaWorkOrderMaterialForAddMaterialResponse'; import type { TechnicalFeedbackJsonPatch } from '../models/TechnicalFeedbackJsonPatch'; import type { WorkOrderMaterialAdd } from '../models/WorkOrderMaterialAdd'; -import type { WorkOrderMaterialForAddMaterialRespone } from '../models/WorkOrderMaterialForAddMaterialRespone'; +import type { WorkOrderMaterialForAddMaterialResponse } from '../models/WorkOrderMaterialForAddMaterialResponse'; import type { WorkOrderMaterialJsonPatch } from '../models/WorkOrderMaterialJsonPatch'; import type { WorkOrderOperationJsonPatch } from '../models/WorkOrderOperationJsonPatch'; import type { WorkOrderServiceOperationJsonPatch } from '../models/WorkOrderServiceOperationJsonPatch'; @@ -68,7 +68,7 @@ export class WorkOrderOperationsService { * ### Update release 1.35.0 * Added support for updating the person responsible for the operation by using the path `personResponsibleEmail`. The value used for this path should be the equinor email of an employee with a SAP user. * - * ### Upcoming changes + * ### Update release 1.36.0 * Added support for updating property `isExcludedFromWorkOrderPlan`. * * @returns ProblemDetails Response for other HTTP status codes @@ -141,9 +141,17 @@ export class WorkOrderOperationsService { * One service has to be created with the following data: * `lineId`, `quantity`, `unit`, `materialGroup`, `costElement`, and either a `title` (for a text item service) or `serviceId`. * + * Note: There is a known bug on the SAP side that prevents updating `standardTextTemplate` for service operations. + * * ### Update release 1.31.0 * Fixed enum values for `schedulingStartConstraintId` and `schedulingFinishConstraintId` * + * ### Update release 1.36.0 + * Added support for updating property `isExcludedFromWorkOrderPlan`. + * + * ### Update release 1.37.0 + * Added new properties `plannedWorkHours`, `actualWorkHours`, `capacityCount`, `plannedDuration`, `calculationKey`, `earliestStartDateTime`, `earliestFinishDateTime` and `safetyMeasures` to `serviceOperations`. + * * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError */ @@ -262,6 +270,9 @@ export class WorkOrderOperationsService { * ### Update release 1.35.0 * Added new property `requisitionerId` to the response. * + * ### Update release 1.37.0 + * Added property `unloadingPoint` to the response. + * * @returns ProblemDetails Response for other HTTP status codes * @returns any Created * @throws ApiError @@ -275,7 +286,7 @@ export class WorkOrderOperationsService { * Add material details */ requestBody: Array, - }): CancelablePromise> { + }): CancelablePromise> { return __request(OpenAPI, { method: 'POST', url: '/work-order-operations/{operation-id}/materials', diff --git a/packages/api/maintenance-api/src/lib/generated/services/WorkOrdersService.ts b/packages/api/maintenance-api/src/lib/generated/services/WorkOrdersService.ts index b90c8bad..169893cb 100644 --- a/packages/api/maintenance-api/src/lib/generated/services/WorkOrdersService.ts +++ b/packages/api/maintenance-api/src/lib/generated/services/WorkOrdersService.ts @@ -65,6 +65,13 @@ export class WorkOrdersService { * - `personResponsible` * - `mainWorkCenterId` * + * ### Update release 1.36.0 + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator`. See STRY0261073 in ServiceNow for more details. + * Added `overheadMaintenanceWorkOrders` to `work-order-types-any-of` query parameter. + * * @returns WorkOrderInPlan Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -122,7 +129,7 @@ export class WorkOrdersService { /** * Limit to specific work order types (any-of). Default includes all types */ - workOrderTypesAnyOf?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + workOrderTypesAnyOf?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Comma-separated list of work-center-id */ @@ -295,6 +302,15 @@ export class WorkOrdersService { * * Added property `confirmationId`, `RemainingWork` and `RemainingWorkUnit` to `operations` * + * ### Update release 1.36.0 + * Added properties `costs` and `costsCurrency` to preventive work orders. + * + * Marked `cmrIndicator` as deprecated. See [Deprecation](#section/Deprecation) for more information. + * + * ### Update release 1.37.0 + * Removed deprecated property `cmrIndicator` from work orders. See STRY0261073 in ServiceNow for more details. + * Added `overheadMaintenanceWorkOrders` to `include-work-order-types` filter in Parameters and to the response. + * * @returns WorkOrderWithOperationList Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -343,7 +359,7 @@ export class WorkOrdersService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, /** * Include operations for the Work orders in the response. */ @@ -405,6 +421,9 @@ export class WorkOrdersService { * ### Overview * Get type of a work order based on the work order id. * + * ### Update release 1.37.0 + * Added support for new work order type `overheadMaintenanceWorkOrder`. + * * @returns WorkOrderTypes Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -442,7 +461,7 @@ export class WorkOrdersService { * Pagination is supported for this endpoint by setting values for `page` and `per-page`. If these parameteres are omitted, the result will be returned without pagination. * * ### Response - * The response schema differs slightly from the other work order endpoints as a result of the optimization for speed. + * The response schema has been optimized for speed, enabling the retrieval of work orders only from the past three years. * * ### Examples * `/work-orders-optimized-for-query?api-version=v1&planning-plants=1100,1101,1102&tags-all-of=10B9` - Return work orders where tag is 10B9 @@ -475,6 +494,18 @@ export class WorkOrdersService { * ### Update release 1.35.0 * Added support for optional pagination. * + * ### Update release 1.37.0 + * Added query parameter `work-order-ids-any-of` & add support for SWNG in `status-all-of`, `status-any-of` and `status-not` query parameters. + * + * Deprecated query parameter `max-results` as the same functionality can be achieved with `per-page`. + * + * Added properties `tag`, `requiredEndDate`, `hseCritical` & `productionCritical`. + * + * Added query parameter `include-status-details` and the object `statuses` + * + * ### Upcoming future release + * Added `overheadMaintenanceWorkOrders` to `work-order-types` query parameter. + * * @returns WorkOrderOptimizedForQuery Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -506,9 +537,11 @@ export class WorkOrdersService { changedAfterDate, changedBeforeDate, workOrderTypes, + workOrderIdsAnyOf, sortBy, includeText = false, includeMaintenanceRecord = false, + includeStatusDetails = false, maxResults, perPage, page = 1, @@ -584,15 +617,15 @@ export class WorkOrdersService { /** * Query based on statusIds (not all statuses are supported) */ - statusAllOf?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL'>, + statusAllOf?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL' | 'SWNG'>, /** * Query based on statusIds (not all statuses are supported) */ - statusAnyOf?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL'>, + statusAnyOf?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL' | 'SWNG'>, /** * Query based on statusIds (not all statuses are supported) */ - statusNot?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL'>, + statusNot?: Array<'PREP' | 'PRCO' | 'RDEX' | 'STRT' | 'CANC' | 'RDOP' | 'CRTD' | 'TECO' | 'REL' | 'SWNG'>, /** * Include only open work orders or only closed work orders. By default, all work orders are included. */ @@ -617,6 +650,10 @@ export class WorkOrdersService { * Limit to specific work order types (one-of) */ workOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + /** + * Comma-separated list of `work-order-id`. + */ + workOrderIdsAnyOf?: string, /** * Property to sort the results by */ @@ -629,8 +666,13 @@ export class WorkOrdersService { * Include the main maintenance record linked to the work order (if any) */ includeMaintenanceRecord?: boolean, + /** + * Include status details for the work orders + */ + includeStatusDetails?: boolean, /** * Maximum number of results to include. Default is 1000. + * @deprecated */ maxResults?: number, /** @@ -672,9 +714,11 @@ export class WorkOrdersService { 'changed-after-date': changedAfterDate, 'changed-before-date': changedBeforeDate, 'work-order-types': workOrderTypes, + 'work-order-ids-any-of': workOrderIdsAnyOf, 'sort-by': sortBy, 'include-text': includeText, 'include-maintenance-record': includeMaintenanceRecord, + 'include-status-details': includeStatusDetails, 'max-results': maxResults, 'per-page': perPage, 'page': page, @@ -706,6 +750,9 @@ export class WorkOrdersService { * ### Important information * The response contains list of changes to work orders (not list of work orders changed). Therefore, an individual work order may be represented multiple times. Consumers can use changeDateTime to identify the last change. * + * ### Update release 1.37.0 + * Added `overheadMaintenanceWorkOrders` to include-work-order-types filter in Parameters and `overheadMaintenanceWorkOrdersChanged` to response. + * * @returns WorkOrderChangeLogs Success * @returns ProblemDetails Response for other HTTP status codes * @throws ApiError @@ -736,7 +783,7 @@ export class WorkOrdersService { /** * Include which types of work orders. Use comma-separated list of entries. */ - includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders'>, + includeWorkOrderTypes?: Array<'correctiveWorkOrders' | 'preventiveWorkOrders' | 'modificationWorkOrders' | 'sasChangeWorkOrders' | 'projectWorkOrders' | 'subseaWorkOrders' | 'overheadMaintenanceWorkOrders'>, }): CancelablePromise { return __request(OpenAPI, { method: 'GET',