openapi: 3.2.0 info: title: Kelowna Production TSS - Customer Management API version: v1 tags: - name: TSS - Customer Management paths: /Customers/Management/Corporations: get: tags: - TSS - Customer Management summary: Gets a list of the corporations responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/Corporation' application/json: schema: type: array items: $ref: '#/components/schemas/Corporation' text/json: schema: type: array items: $ref: '#/components/schemas/Corporation' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementCorporations x-operation-id-source: derived /Customers/Management/Corporations/{id}: get: tags: - TSS - Customer Management summary: Gets the details of a corporation parameters: - name: id in: path description: The ID of the corporation to get required: true schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/Corporation' application/json: schema: $ref: '#/components/schemas/Corporation' text/json: schema: $ref: '#/components/schemas/Corporation' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementCorporationsById x-operation-id-source: derived /Customers/Management/Corporations/WithoutMixerUnits: get: tags: - TSS - Customer Management summary: Returns a list of corporations with plants that do not have mixer units responses: '200': description: OK security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementCorporationsWithoutMixerUnits x-operation-id-source: derived /Customers/Management/Corporations/TssReps: get: tags: - TSS - Customer Management summary: Gets a list of TSS representatives description: Mostly for use in dropdowns. Is sorted. responses: '200': description: OK content: text/plain: schema: type: array items: type: string application/json: schema: type: array items: type: string text/json: schema: type: array items: type: string security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementCorporationsTssReps x-operation-id-source: derived /Customers/Management/Corporations/Names: get: tags: - TSS - Customer Management summary: Gets a list of corporation names + IDs description: Mostly for use in dropdowns. Is sorted by name. parameters: - name: clientsOnly in: query description: Whether to return only corporations who are CarbonCure clients schema: type: boolean responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/CorporationName' application/json: schema: type: array items: $ref: '#/components/schemas/CorporationName' text/json: schema: type: array items: $ref: '#/components/schemas/CorporationName' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementCorporationsNames x-operation-id-source: derived /Customers/Management/Plants: get: tags: - TSS - Customer Management summary: Gets a list of the plants parameters: - name: corporationId in: query description: Get only plants for this corporation schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/PlantArgsDropdown' application/json: schema: type: array items: $ref: '#/components/schemas/PlantArgsDropdown' text/json: schema: type: array items: $ref: '#/components/schemas/PlantArgsDropdown' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementPlants x-operation-id-source: derived post: tags: - TSS - Customer Management summary: Updates a plant description: 'Because we track history for some plant fields, we include a timestamp for each of them, representing since when this was the value. Null timestamp values indicate "always", like averageCementCutTimestamp=null means "the average cement cut was always this value"' requestBody: description: Updated attributes for the plant content: application/json: schema: $ref: '#/components/schemas/PlantArgsInput' text/json: schema: $ref: '#/components/schemas/PlantArgsInput' application/*+json: schema: $ref: '#/components/schemas/PlantArgsInput' responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PlantArgsResponse' application/json: schema: $ref: '#/components/schemas/PlantArgsResponse' text/json: schema: $ref: '#/components/schemas/PlantArgsResponse' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: postCustomersManagementPlants x-operation-id-source: derived /Customers/Management/Plants/{id}: get: tags: - TSS - Customer Management summary: Gets the details of a plant parameters: - name: id in: path description: The ID of the plant to get required: true schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PlantArgsDropdown' application/json: schema: $ref: '#/components/schemas/PlantArgsDropdown' text/json: schema: $ref: '#/components/schemas/PlantArgsDropdown' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementPlantsById x-operation-id-source: derived /Customers/Management/Plants/Overview: get: tags: - TSS - Customer Management summary: Returns an overview of all the plants with mixer units 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: plantsWithAlarms in: query description: Only include plants possessing a mixer unit with an active alarm. schema: type: boolean default: false responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/PlantOverviewTable' application/json: schema: type: array items: $ref: '#/components/schemas/PlantOverviewTable' text/json: schema: type: array items: $ref: '#/components/schemas/PlantOverviewTable' deprecated: true security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementPlantsOverview x-operation-id-source: derived /Customers/Management/Plants/OverviewRowCount: get: tags: - TSS - Customer Management summary: Returns an overview of all the plants with mixer units 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: plantsWithAlarms in: query description: Only include plants possessing a mixer unit with an active alarm. schema: type: boolean default: false responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PlantOverviewTableTableResults' application/json: schema: $ref: '#/components/schemas/PlantOverviewTableTableResults' text/json: schema: $ref: '#/components/schemas/PlantOverviewTableTableResults' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementPlantsOverviewRowCount x-operation-id-source: derived /Customers/Management/Plants/Production: get: tags: - TSS - Customer Management summary: Gets the production volumes of a plant over time description: Uses customer data where it can, and estimates where it can't. Does not include non-CarbonCure volumes. parameters: - name: plantId in: query description: The ID of the plant to get data for schema: type: integer format: int32 - name: startDate in: query description: Get data only after this datetime schema: type: string format: date-time - name: endDate in: query description: Get data only before this datetime schema: type: string format: date-time - name: bucketSize in: query description: The size of the time bucket schema: $ref: '#/components/schemas/TimestampPrecision' responses: '200': description: OK security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementPlantsProduction x-operation-id-source: derived /Customers/Management/Plants/ByDivision/{id}: get: tags: - TSS - Customer Management summary: Returns plants under a division parameters: - name: id in: path description: The ID of the division you'd like to filter by required: true schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/PlantArgsDropdown' application/json: schema: type: array items: $ref: '#/components/schemas/PlantArgsDropdown' text/json: schema: type: array items: $ref: '#/components/schemas/PlantArgsDropdown' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementPlantsByDivisionById x-operation-id-source: derived /Customers/Management/Plants/FilterOptions: get: tags: - TSS - Customer Management summary: Retrieves filtering options used in the Editable Plants Table description: Includes list of divisions, TSEs, and plant states. responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/EditablePlantsFilterOptions' application/json: schema: $ref: '#/components/schemas/EditablePlantsFilterOptions' text/json: schema: $ref: '#/components/schemas/EditablePlantsFilterOptions' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: getCustomersManagementPlantsFilterOptions x-operation-id-source: derived /Customers/Management/Plants/Table: post: tags: - TSS - Customer Management summary: Get filterable plant data for "editable plants table" feature requestBody: description: Table args and filter settings for table data content: application/json: schema: $ref: '#/components/schemas/EditablePlantsTableFilterArgs' text/json: schema: $ref: '#/components/schemas/EditablePlantsTableFilterArgs' application/*+json: schema: $ref: '#/components/schemas/EditablePlantsTableFilterArgs' responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PlantArgsResponseTableResults' application/json: schema: $ref: '#/components/schemas/PlantArgsResponseTableResults' text/json: schema: $ref: '#/components/schemas/PlantArgsResponseTableResults' security: - OrcaAuth: - applicationId - roles - {} - {} operationId: postCustomersManagementPlantsTable x-operation-id-source: derived components: schemas: GreyWaterRecyclingSolution: enum: - Pit - Pond - AgitatedTank - ValidatedNone type: string EditablePlantsFilterSettings: type: object properties: divisionIds: type: - array - 'null' items: type: integer format: int32 tseList: type: - array - 'null' items: type: string states: type: - array - 'null' items: type: string cementTypes: type: - array - 'null' items: $ref: '#/components/schemas/MaterialType' missingColumns: $ref: '#/components/schemas/MissingDataColumnName' onlyPlantsWithInstalls: type: boolean additionalProperties: false PlantArgsDropdown: type: object properties: plantId: type: integer format: int32 divisionId: type: integer format: int32 name: type: - string - 'null' displayName: type: - string - 'null' readOnly: true deprecated: true plantType: $ref: '#/components/schemas/PlantType' additionalProperties: false PlantOverviewTableTableResults: type: object properties: count: type: integer format: int32 results: type: - array - 'null' items: $ref: '#/components/schemas/PlantOverviewTable' additionalProperties: false PlantArgsInput: type: object properties: plantId: type: integer format: int32 divisionId: type: integer format: int32 name: type: - string - 'null' displayName: type: - string - 'null' readOnly: true deprecated: true plantType: $ref: '#/components/schemas/PlantType' divisionName: type: - string - 'null' state: type: - string - 'null' averageLoadSizeM3: type: - number - 'null' format: double averageCementLoadingKgPerM3: type: - number - 'null' format: double averageCementLoadingKgPerM3Timestamp: type: - string - 'null' format: date-time residentialPercent: type: - number - 'null' format: double commercialPercent: type: - number - 'null' format: double dotPercent: type: - number - 'null' format: double installDate: type: - string - 'null' format: date-time averageCementCut: type: - number - 'null' format: double averageCementCutTimestamp: type: - string - 'null' format: date-time cO2DosePercent: type: - number - 'null' format: double cO2DosePercentTimestamp: type: - string - 'null' format: date-time cementPlantId: type: - integer - 'null' format: int32 cementPlantIdTimestamp: type: - string - 'null' format: date-time tse: type: - string - 'null' tssNote: type: - string - 'null' rwCementCompensationPercent: type: - number - 'null' format: double rwCementCompensationPercentTimestamp: type: - string - 'null' format: date-time tankRentalFee: type: - number - 'null' format: double tankRentalFeeTimestamp: type: - string - 'null' format: date-time plantEditNote: $ref: '#/components/schemas/PlantEditNoteArgs' additionalProperties: false PlantTemporalArgs: type: object properties: plantId: type: integer format: int32 timestamp: type: string format: date-time cementPlantId: type: - integer - 'null' format: int32 cementPlantName: type: - string - 'null' averageCementCut: type: - number - 'null' format: double cO2DosePercent: type: - number - 'null' format: double averageCementLoadingKgPerM3: type: - number - 'null' format: double rwCementCompensationPercent: type: - number - 'null' format: double tankRentalFeeUsd: type: - number - 'null' format: double additionalProperties: false MissingDataColumnName: type: object properties: cO2Dosage: type: boolean cementReduction: type: boolean avgCementLoading: type: boolean avgYardsPerTruck: type: boolean tankRentalFee: type: boolean cementSupply: type: boolean residentialPercent: type: boolean commercialPercent: type: boolean dotPercent: type: boolean tse: type: boolean isActive: type: boolean readOnly: true additionalProperties: false Corporation: required: - name type: object properties: corporationId: type: integer format: int32 name: minLength: 1 type: string sfAccountId: type: - string - 'null' creationTimestamp: type: string format: date-time clientStatus: $ref: '#/components/schemas/ClientStatus' currency: type: - string - 'null' isVerticallyIntegrated: type: boolean greyWaterRecyclingSolution: $ref: '#/components/schemas/GreyWaterRecyclingSolution' mixFamiliesAtCorpLevel: type: boolean churnDate: type: - string - 'null' format: date creditExclusionReason: type: - string - 'null' additionalProperties: false PlantOverviewTable: type: object properties: corporationId: type: integer format: int32 corporationName: type: - string - 'null' plantId: type: integer format: int32 plantName: type: - string - 'null' lastSeen: type: string format: date-time activeAlarms: type: - array - 'null' items: type: integer format: int32 remotes: type: - array - 'null' items: $ref: '#/components/schemas/ReadyMixUnitRow' activeAlarmCount: type: integer format: int32 remoteUnitCount: type: integer format: int32 additionalProperties: false TimestampPrecision: enum: - Day - Month - Year type: string CorporationName: type: object properties: corporationId: type: integer format: int32 name: type: - string - 'null' additionalProperties: false PlantEditNoteArgs: type: object properties: columnName: type: - string - 'null' previousValue: type: - string - 'null' updatedValue: type: - string - 'null' reason: type: - string - 'null' additionalProperties: false ReadyMixUnitRow: type: object properties: remoteUnitId: type: integer format: int32 lastSeen: type: string format: date-time additionalProperties: false PlantArgsResponse: type: object properties: plantId: type: integer format: int32 divisionId: type: integer format: int32 name: type: - string - 'null' displayName: type: - string - 'null' readOnly: true deprecated: true plantType: $ref: '#/components/schemas/PlantType' divisionName: type: - string - 'null' state: type: - string - 'null' averageLoadSizeM3: type: - number - 'null' format: double averageCementLoadingKgPerM3: type: - number - 'null' format: double averageCementLoadingKgPerM3Timestamp: type: - string - 'null' format: date-time residentialPercent: type: - number - 'null' format: double commercialPercent: type: - number - 'null' format: double dotPercent: type: - number - 'null' format: double installDate: type: - string - 'null' format: date-time averageCementCut: type: - number - 'null' format: double averageCementCutTimestamp: type: - string - 'null' format: date-time cO2DosePercent: type: - number - 'null' format: double cO2DosePercentTimestamp: type: - string - 'null' format: date-time cementPlantId: type: - integer - 'null' format: int32 cementPlantIdTimestamp: type: - string - 'null' format: date-time tse: type: - string - 'null' tssNote: type: - string - 'null' rwCementCompensationPercent: type: - number - 'null' format: double rwCementCompensationPercentTimestamp: type: - string - 'null' format: date-time tankRentalFee: type: - number - 'null' format: double tankRentalFeeTimestamp: type: - string - 'null' format: date-time plantTemporals: type: - array - 'null' items: $ref: '#/components/schemas/PlantTemporalArgs' additionalProperties: false ClientStatus: enum: - CurrentClient - PotentialClient - FormerClient - TestClient type: string CementPlantName: type: object properties: cementPlantId: type: integer format: int32 name: type: - string - 'null' additionalProperties: false EditablePlantsFilterOptions: type: object properties: divisions: type: - array - 'null' items: $ref: '#/components/schemas/DivisionName' cementPlants: type: - array - 'null' items: $ref: '#/components/schemas/CementPlantName' tseList: type: - array - 'null' items: type: string plantStates: type: - array - 'null' items: type: string additionalProperties: false PlantArgsResponseTableResults: type: object properties: count: type: integer format: int32 results: type: - array - 'null' items: $ref: '#/components/schemas/PlantArgsResponse' additionalProperties: false PlantType: enum: - ReadyMix - Masonry - Precast type: string DivisionName: type: object properties: divisionId: type: integer format: int32 name: type: - string - 'null' additionalProperties: false 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 SortOrder: enum: - Ascending - Descending type: string EditablePlantsTableFilterArgs: type: object properties: tableArgs: $ref: '#/components/schemas/TableArgs' filterSettings: $ref: '#/components/schemas/EditablePlantsFilterSettings' additionalProperties: false TableArgs: type: object properties: limit: type: - integer - 'null' description: Limit number of responses. Used for pagination. format: int32 offset: type: - integer - 'null' description: Skip this many rows in the query. Used for pagination. format: int32 sortColumn: type: - string - 'null' description: The name of the column to sort by. sortOrder: $ref: '#/components/schemas/SortOrder' additionalProperties: false description: Common fields provided by the frontend when accessing a table endpoint 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: {}