openapi: 3.2.0 info: title: Kelowna Production TSS - Material Manager API version: v1 tags: - name: TSS - Material Manager paths: /TSS/MaterialManager/Table: get: tags: - TSS - Material Manager summary: Gets a list of mappings and materials for display in Material Manager description: Can also be used to pull data for a single material to be used in editing. parameters: - name: Limit in: query description: Limit number of responses. Used for pagination. schema: type: integer format: int32 - name: Offset in: query description: Skip this many rows in the query. Used for pagination. schema: type: integer format: int32 - name: SortColumn in: query description: The name of the column to sort by. schema: type: string - name: SortOrder in: query description: The order with which to sort the table by the sort column. schema: $ref: '#/components/schemas/SortOrder' - name: divisionId in: query description: Division ID to filter table by. schema: type: integer format: int32 - name: primaryMaterialType in: query description: Primary material type to filter table by. Names "Material Type" in UI schema: $ref: '#/components/schemas/PrimaryMaterialType' - name: materialType in: query description: Material type to filter by ("Material Subtype" in UI). schema: $ref: '#/components/schemas/MaterialType' - name: admixtureMaterialSubType in: query description: Admixture material type to filter by ("Secondary Material Subtype" in UI). schema: $ref: '#/components/schemas/AdmixtureMaterialSubType' - name: supplierCompany in: query description: Supplier company name to filter by. This is the cement plant company name in the case of cements. schema: type: string - name: supplierPlant in: query description: Supplier plant name to filter by. This is the cement plant plant name in the case of cements. schema: type: string - name: alias in: query description: Alias to filter table by. schema: type: string - name: isOrcaUpdated in: query description: "Only return materials updated via Orca if true; only return materials updated via digital integration if false.\n All materials returned if no value is specified." schema: type: boolean - name: materialMappingId in: query description: Specific ID of mapping to return. Used in edit material feature. schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/MaterialManagerTableTableResults' application/json: schema: $ref: '#/components/schemas/MaterialManagerTableTableResults' text/json: schema: $ref: '#/components/schemas/MaterialManagerTableTableResults' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getTSSMaterialManagerTable x-operation-id-source: derived /TSS/MaterialManager/Metadata: get: tags: - TSS - Material Manager summary: Returns the metadata used in material manager filter dropdowns and add/edit… responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/MaterialManagerMetadata' application/json: schema: $ref: '#/components/schemas/MaterialManagerMetadata' text/json: schema: $ref: '#/components/schemas/MaterialManagerMetadata' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getTSSMaterialManagerMetadata x-operation-id-source: derived /TSS/MaterialManager/ByDivision/{divisionId}: get: tags: - TSS - Material Manager summary: Returns a list of material mappings for a division description: 'It does not include all of the details as the main table endpoint, nor can it be paginated. Used for dropdown selection on add batch/mix pages.' parameters: - name: divisionId in: path description: ID of division to fetch mappings for. required: true schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/MaterialArgsShort' application/json: schema: type: array items: $ref: '#/components/schemas/MaterialArgsShort' text/json: schema: type: array items: $ref: '#/components/schemas/MaterialArgsShort' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getTSSMaterialManagerByDivisionByDivisionId x-operation-id-source: derived /TSS/MaterialManager/Material: post: tags: - TSS - Material Manager summary: Creates a new material mapping for a division description: 'If material defined in the args does not exist, it is also created. This endpoint can optionally also add an alias to another material mapping, as sometimes we need to do these two operations together. If plant compositions are being defined, the cement component `materialId` for the material being added must be null. This endpoint can throw one of four custom exceptions depending on user input. All exceptions have an "exceptionType" field (unique identifier for each exception) and an "error" field (short helpful message for developers). Exceptions can have additional fields, documented below. `InvalidFieldValue`: Thrown when any specific field fails validation (e.g. specific gravity is negative, mapping cannot be found by a specified ID, etc.). Includes additional field "fieldName" indicating which input failed validation. Sample response: ``` { "exceptionType": "InvalidFieldValue", "error": "Primary material type cannot be updated.", "fieldName": "PrimaryMaterialType" } ``` `DuplicateMapping`: Thrown when a material exactly matches an existing material. Includes additional field "existingMapping" of type MaterialArgs for comparison on the frontend. Sample response: ``` { "exceptionType": "DuplicateMapping", "error": "Mapping already exists.", "existingMapping": { "materialMappingId": 0, "divisionId": 0, "divisionName": "string", "isIngested": true, "primaryMaterialType": "Admixture", "materialType": "Cement", "specificGravity": 0, "supplierCompany": "string", "supplierPlant": "string", "cementSupplier": { "cementPlantId": 0, "plantName": "string", "companyName": "string" }, ... } } ``` `SimilarMapping`: Thrown when a material''s MaterialType and supplier information (plant and company names or cement plant for cements) match an existing material. Similar materials are permitted, so this check can be skipped by setting OverrideSimilarCheck=true in the input args. Includes additional field "existingMapping" of type MaterialArgs for comparison on the frontend. Sample response: ``` { "exceptionType": "SimilarMapping", "error": "Similar material found.", "existingMapping": { "materialMappingId": 0, "divisionId": 0, "divisionName": "string", "isIngested": true, "primaryMaterialType": "Admixture", ... } } ``` `DuplicateAlias`: Thrown when an alias is trying to be added to a material but it already exists and is associated with another material mapping. Includes additional field "existingMapping" of type MaterialArgs for comparison on the frontend. Sample response: ``` { "exceptionType": "DuplicateAlias", "error": "Alias already exists.", "existingMapping": { "materialMappingId": 0, "divisionId": 0, "divisionName": "string", "isIngested": true, "primaryMaterialType": "Admixture", ... } } ```' parameters: - name: materialMappingId in: query description: Optional - mapping to add an alias to. schema: type: integer format: int32 - name: aliasName in: query description: Optional - the alias to add to the mapping. schema: type: string requestBody: description: "Material manager args representing one row in the table.\n Contains information on both the mapping and the material." content: application/json: schema: $ref: '#/components/schemas/MaterialArgs' text/json: schema: $ref: '#/components/schemas/MaterialArgs' application/*+json: schema: $ref: '#/components/schemas/MaterialArgs' responses: '200': description: OK security: - OrcaAuth: - applicationId - roles - {} - {} operationId: postTSSMaterialManagerMaterial x-operation-id-source: derived put: tags: - TSS - Material Manager summary: Updates a material mapping for a division, as well as plant cement compositions… description: 'If material defined in the args does not exist, it is also created. This endpoint can optionally also add an alias to another material mapping, as sometimes we need to do these two operations together. If plant compositions are being defined, the cement component `materialId` for the material being edited must be null. This endpoint can throw one of four custom exceptions depending on user input. Refer to the exception definitions in `POST /TSS/MaterialManager/Material` for information on each exception.' parameters: - name: materialMappingId in: query description: Optional - mapping to add an alias to. schema: type: integer format: int32 - name: aliasName in: query description: Optional - the alias to add to the mapping. schema: type: string requestBody: description: "Material manager args representing one row in the table.\n Contains information on both the mapping and the material." content: application/json: schema: $ref: '#/components/schemas/MaterialArgs' text/json: schema: $ref: '#/components/schemas/MaterialArgs' application/*+json: schema: $ref: '#/components/schemas/MaterialArgs' responses: '200': description: OK security: - OrcaAuth: - applicationId - roles - {} - {} operationId: putTSSMaterialManagerMaterial x-operation-id-source: derived /TSS/MaterialManager/Alias: put: tags: - TSS - Material Manager summary: Adds a new alias to a material mapping's alias list for one or more mappings requestBody: description: List of material mapping IDs and aliases to add. content: application/json: schema: $ref: '#/components/schemas/AddAliasArgs' text/json: schema: $ref: '#/components/schemas/AddAliasArgs' application/*+json: schema: $ref: '#/components/schemas/AddAliasArgs' responses: '200': description: OK security: - OrcaAuth: - applicationId - roles - {} - {} operationId: putTSSMaterialManagerAlias x-operation-id-source: derived /TSS/MaterialManager/Merge: put: tags: - TSS - Material Manager summary: Merges two material mappings, combining their alias arrays. parameters: - name: sourceMappingId in: query description: ID of the material mapping that is being absorbed by the target mapping. schema: type: integer format: int32 - name: targetMappingId in: query description: ID of the material mapping that is the intended recipient of the merge. schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/MaterialArgs' application/json: schema: $ref: '#/components/schemas/MaterialArgs' text/json: schema: $ref: '#/components/schemas/MaterialArgs' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: putTSSMaterialManagerMerge x-operation-id-source: derived /TSS/MaterialManager/PlantCements: get: tags: - TSS - Material Manager summary: Gets the current and historical cement silo composition for all plants in a… description: 'Note - the history returned for each plant will be sorted by date, starting from the newest revision. Thus, to show the current composition, simply look at the first value in the CementCompositions list.' parameters: - name: divisionId in: query description: The division to get cement compositions for schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/PlantCementComposition' application/json: schema: type: array items: $ref: '#/components/schemas/PlantCementComposition' text/json: schema: type: array items: $ref: '#/components/schemas/PlantCementComposition' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getTSSMaterialManagerPlantCements x-operation-id-source: derived components: schemas: TransportMode: enum: - Truck - Rail - Barge - Plane type: string AggregateManufacturing: enum: - Manufactured - Natural type: string AggregateSize: enum: - _1 - _2 - _3 - _357 - _4 - _467 - _5 - _56 - _57 - _6 - _67 - _7 - _8 - _89 type: string FiberSize: enum: - Micro - Macro type: string SlagProcessing: enum: - Blast - AirCooled - BasicOxygen - ElectricArc type: string PrimaryMaterialType: enum: - Admixture - Aggregate - Cement - CO2 - Fiber - FlyAsh - ReclaimedWater - Slag - SilicaFume - SCM - Water - Filler type: string AddAliasArgs: type: object properties: divisionId: type: integer format: int32 materialMappingId: type: integer format: int32 aliasName: type: - string - 'null' additionalProperties: false MaterialArgsShort: type: object properties: materialMappingId: type: integer format: int32 materialId: type: integer format: int32 aliases: type: - array - 'null' items: type: string isIngested: type: boolean primaryMaterialType: $ref: '#/components/schemas/PrimaryMaterialType' materialType: $ref: '#/components/schemas/MaterialType' specificGravity: type: - number - 'null' format: double supplierCompany: type: - string - 'null' supplierPlant: type: - string - 'null' cementSupplier: $ref: '#/components/schemas/CementSupplierArgs' additionalProperties: false MaterialManagerMetadata: type: object properties: materialTypeMapping: type: - object - 'null' properties: Admixture: type: array items: $ref: '#/components/schemas/MaterialType' Aggregate: type: array items: $ref: '#/components/schemas/MaterialType' Cement: type: array items: $ref: '#/components/schemas/MaterialType' CO2: type: array items: $ref: '#/components/schemas/MaterialType' Fiber: type: array items: $ref: '#/components/schemas/MaterialType' FlyAsh: type: array items: $ref: '#/components/schemas/MaterialType' ReclaimedWater: type: array items: $ref: '#/components/schemas/MaterialType' Slag: type: array items: $ref: '#/components/schemas/MaterialType' SilicaFume: type: array items: $ref: '#/components/schemas/MaterialType' SCM: type: array items: $ref: '#/components/schemas/MaterialType' Water: type: array items: $ref: '#/components/schemas/MaterialType' Filler: type: array items: $ref: '#/components/schemas/MaterialType' additionalProperties: false fields: type: - array - 'null' items: $ref: '#/components/schemas/MaterialManagerProperty' additionalProperties: false MaterialManagerTableTableResults: type: object properties: count: type: integer format: int32 results: type: - array - 'null' items: $ref: '#/components/schemas/MaterialManagerTable' additionalProperties: false CementComponent: type: object properties: materialId: type: - integer - 'null' format: int32 aliases: type: - array - 'null' items: type: string cementType: $ref: '#/components/schemas/CementType' cementPlantName: type: - string - 'null' cementPercentage: type: number format: double additionalProperties: false CurrentPlantComposition: type: object properties: effectiveDate: type: string format: date cementComponents: type: - array - 'null' items: $ref: '#/components/schemas/CementComponent' plantId: type: integer format: int32 additionalProperties: false CementComposition: type: object properties: effectiveDate: type: string format: date cementComponents: type: - array - 'null' items: $ref: '#/components/schemas/CementComponent' additionalProperties: false MaterialManagerProperty: type: object properties: key: type: - string - 'null' displayName: type: - string - 'null' dataType: $ref: '#/components/schemas/DataType' applicableValues: type: - array - 'null' items: type: string applicablePrimaryMaterialType: $ref: '#/components/schemas/PrimaryMaterialType' cementPlants: type: - array - 'null' items: $ref: '#/components/schemas/CementSupplierArgs' additionalProperties: false DataType: enum: - Enum - Numeric - Object - String - StringArray type: string WaterTemperature: enum: - Hot - Cold - Ambient - Ice type: string AggregateRockType: enum: - Granite - Limestone - Silica type: string MaterialArgs: type: object properties: materialMappingId: type: - integer - 'null' format: int32 divisionId: type: integer format: int32 divisionName: type: - string - 'null' isIngested: type: boolean primaryMaterialType: $ref: '#/components/schemas/PrimaryMaterialType' admixtureMaterialSubType: $ref: '#/components/schemas/AdmixtureMaterialSubType' specificGravity: type: - number - 'null' format: double supplierCompany: type: - string - 'null' supplierPlant: type: - string - 'null' cementSupplier: $ref: '#/components/schemas/CementSupplierArgs' admixtureSolidsContentPercent: type: - number - 'null' format: double aggregateManufacturing: $ref: '#/components/schemas/AggregateManufacturing' aggregatePitId: type: - string - 'null' aggregateRockType: $ref: '#/components/schemas/AggregateRockType' aggregateSize: $ref: '#/components/schemas/AggregateSize' fiberManufacturing: $ref: '#/components/schemas/FiberManufacturing' fiberSize: $ref: '#/components/schemas/FiberSize' fiberDiameterMm: type: - number - 'null' format: double fiberLengthMm: type: - number - 'null' format: double flyAshLossOfIgnitionPercent: type: - number - 'null' format: double silicaFumeGrade: $ref: '#/components/schemas/SilicaFumeGrade' slagGrade: $ref: '#/components/schemas/SlagGrade' slagProcessing: $ref: '#/components/schemas/SlagProcessing' waterTemperature: $ref: '#/components/schemas/WaterTemperature' modeOfTransportation: $ref: '#/components/schemas/TransportMode' aliases: type: - array - 'null' items: type: string overrideSimilarCheck: type: boolean description: 'Used to skip the similar material check, since we do support similar materials its purpose is to warn the user that a similar material already exists.' currentPlantCompositions: type: - array - 'null' items: $ref: '#/components/schemas/CurrentPlantComposition' materialId: type: - integer - 'null' format: int32 materialType: $ref: '#/components/schemas/MaterialType' additionalProperties: false MaterialManagerTable: type: object properties: materialMappingId: type: - integer - 'null' format: int32 divisionId: type: integer format: int32 divisionName: type: - string - 'null' isIngested: type: boolean primaryMaterialType: $ref: '#/components/schemas/PrimaryMaterialType' admixtureMaterialSubType: $ref: '#/components/schemas/AdmixtureMaterialSubType' specificGravity: type: - number - 'null' format: double supplierCompany: type: - string - 'null' supplierPlant: type: - string - 'null' cementSupplier: $ref: '#/components/schemas/CementSupplierArgs' admixtureSolidsContentPercent: type: - number - 'null' format: double aggregateManufacturing: $ref: '#/components/schemas/AggregateManufacturing' aggregatePitId: type: - string - 'null' aggregateRockType: $ref: '#/components/schemas/AggregateRockType' aggregateSize: $ref: '#/components/schemas/AggregateSize' fiberManufacturing: $ref: '#/components/schemas/FiberManufacturing' fiberSize: $ref: '#/components/schemas/FiberSize' fiberDiameterMm: type: - number - 'null' format: double fiberLengthMm: type: - number - 'null' format: double flyAshLossOfIgnitionPercent: type: - number - 'null' format: double silicaFumeGrade: $ref: '#/components/schemas/SilicaFumeGrade' slagGrade: $ref: '#/components/schemas/SlagGrade' slagProcessing: $ref: '#/components/schemas/SlagProcessing' waterTemperature: $ref: '#/components/schemas/WaterTemperature' modeOfTransportation: $ref: '#/components/schemas/TransportMode' aliases: type: - array - 'null' items: type: string overrideSimilarCheck: type: boolean description: 'Used to skip the similar material check, since we do support similar materials its purpose is to warn the user that a similar material already exists.' currentPlantCompositions: type: - array - 'null' items: $ref: '#/components/schemas/CurrentPlantComposition' materialId: type: - integer - 'null' format: int32 materialType: $ref: '#/components/schemas/MaterialType' additionalProperties: false FiberManufacturing: enum: - Natural - Synthetic - Steel - Glass type: string SlagGrade: enum: - _80 - _100 - _120 type: string AdmixtureMaterialSubType: enum: - AirEntrainer - Retarder - SuperPlasticizer - WaterReducer - HighRangeWaterReducer - MidRangeWaterReducer - LowRangeWaterReducer - ViscosityModifier - HydrationStabilizer - CorrosionInhibitor - ShrinkageReducer - Accelerator - NonChlorideAccelerator - ChlorideAccelerator - AntiWashout - Waterproofer type: string MaterialType: enum: - Cement - CementTypeI - CementTypeIS - CementTypeIP - CementTypeIL - CementTypeII - CementTypeI_II - CementTypeI_IIMH - CementTypeI_II_LA - CementTypeIII - CementTypeIV - CementTypeII_V - CementTypeN - CementTypeS - CementCemI - CementCemII - CementCemIII - CementCemIV - CementCemV - CementCemVI - CementBlendedHydraulic - CoarseAggregate - IntermediateAggregate - FineAggregate - Fiber - FiberTypeI - FiberTypeII - FiberTypeIII - FiberTypeIV - Water - CO2 - SCM - Slag - SlagFerrous - SlagNonFerrous - SlagFerroalloy - FlyAsh - FlyAshC - FlyAshF - FlyAshN - SilicaFume - ReclaimedWater - Admixture - AirEntrainer - Retarder - SuperPlasticizer - WaterReducer - HighRangeWaterReducer - MidRangeWaterReducer - LowRangeWaterReducer - ViscosityModifier - HydrationStabilizer - CorrosionInhibitor - ShrinkageReducer - Accelerator - NonChlorideAccelerator - ChlorideAccelerator - StrengthEnhancer - AntiWashout - Waterproofer - Filler type: string CementType: enum: - CementTypeI - CementTypeIS - CementTypeIP - CementTypeIL - CementTypeII - CementTypeI_II - CementTypeI_IIMH - CementTypeI_II_LA - CementTypeIII - CementTypeIV - CementTypeII_V - CementTypeN - CementTypeS - CementCemI - CementCemII - CementCemIII - CementCemIV - CementCemV - CementCemVI - CementBlendedHydraulic type: string SortOrder: enum: - Ascending - Descending type: string SilicaFumeGrade: enum: - _85 - _90 - _92 - _95 type: string CementSupplierArgs: type: object properties: cementPlantId: type: integer format: int32 plantName: type: - string - 'null' companyName: type: - string - 'null' additionalProperties: false PlantCementComposition: type: object properties: plantId: type: integer format: int32 plantName: type: - string - 'null' cementCompositions: type: - array - 'null' items: $ref: '#/components/schemas/CementComposition' additionalProperties: false securitySchemes: OrcaAuth: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.carboncure.com/oauth2/authorize tokenUrl: https://auth.carboncure.com/oauth2/token scopes: {} MyCCAuth: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.carboncure.com/oauth2/authorize tokenUrl: https://auth.carboncure.com/oauth2/token scopes: {} M2MAuth: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.carboncure.com/oauth2/authorize tokenUrl: https://auth.carboncure.com/oauth2/token scopes: {}