Skip to content

Instantly share code, notes, and snippets.

@cn007b
Last active March 4, 2022 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cn007b/d49e78e4229c05bfb79870a507b35c28 to your computer and use it in GitHub Desktop.
Save cn007b/d49e78e4229c05bfb79870a507b35c28 to your computer and use it in GitHub Desktop.
tmp
swagger: "2.0"
info:
version: "1.0.0"
title: "API."
description: "API for dispatch lane and flow rack."
host: td.to-api.com
schemes:
- http
- https
basePath: "/v2"
parameters:
clientId:
name: clientId
in: path
required: true
type: string
mfcId:
name: mfcId
in: path
required: true
type: string
toteAssignmentId:
name: toteAssignmentId
in: path
required: true
type: string
laneId:
name: laneId
in: path
required: true
type: string
toteId:
name: toteId
in: path
required: true
type: string
definitions:
ToteAssignment:
type: object
properties:
id:
type: string
example: 99800700119149
clientId:
type: string
example: maf
mfcId:
type: string
example: do1
orderId:
type: string
example: "pp_052-101102934"
toteId:
type: string
example: 99800700119149
laneId:
type: string
example: DISPATCH01
createdAt:
type: integer
example: 1640249542
listConfigsResponse:
type: object
properties:
configs:
type: object
description: "Map of config key/value pairs."
properties:
errorRamp:
type: string
example: DISPATCH99
count:
type: integer
example: 17
depth:
type: integer
example: 3
IdGen:
type: string
example: "DISPATCH%02d."
description: "Format string to generate/format id."
start:
type: integer
example: 1
listToteAssignmentsResponse:
type: object
properties:
"toteAssignments <!-- default -->":
type: array
items:
$ref: "#/definitions/ToteAssignment"
"balance <!-- when view=groupedByOrder -->":
type: object
description: "Map where key looks like: sc-a:0124:DISPATCH04,
and value is array of totes, like: ['99800700116902', '99900700125314']."
example: '{"sc-a:0124:DISPATCH07": ["99800700116902"]}'
additionalProperties:
type: array
items:
type: string
"orders <!-- when view=groupedByOrder -->":
type: object
description: "Map where key is order id and value is array of totes, like: ['99800700116902']."
example: '{"pp_052-101102934": ["99800700119149"]}'
additionalProperties:
type: array
items:
type: string
updateToteAssignmentRequest:
type: object
properties:
toteAssignment:
type: object
properties:
laneId:
type: string
description: "Particular laneId like: DISPATCH01 or error in case of error lane."
example: DISPATCH01
toteId:
type: string
example: 99800700119149
updateToteAssignmentResponse:
type: object
properties:
data:
type: object
properties:
toteAssignment:
$ref: "#/definitions/ToteAssignment"
deleteToteAssignmentResponse:
type: object
properties:
data:
type: object
properties:
toteAssignment:
$ref: "#/definitions/ToteAssignment"
createToteAssignmentRequest:
type: object
properties:
toteAssignment:
type: object
properties:
orderId:
type: string
toteId:
type: string
createToteAssignmentResponse:
type: object
properties:
toteAssignment:
$ref: "#/definitions/ToteAssignment"
Response400:
type: object
properties:
errors:
type: array
items:
type: object
properties:
error:
type: string
description: "Actual error message."
example: "Invalid clientId."
ref:
type: string
description: "In case when provided invalid parameter 'clientId'
this field will contain 'clientId' as reference to source of error."
example: "clientId"
type:
type: string
example: validation
paths:
/health:
get:
description: "Health check."
responses:
200:
description: "Successful response."
400:
description: "Bad Request."
schema:
$ref: "#/definitions/Response400"
/clients/{clientId}/mfcs/{mfcId}/configs:
get:
description: "Get configs."
parameters:
- $ref: "#/parameters/clientId"
- $ref: "#/parameters/mfcId"
responses:
200:
description: "Successful response."
schema:
$ref: "#/definitions/listConfigsResponse"
400:
description: "Bad Request."
schema:
$ref: "#/definitions/Response400"
/clients/{clientId}/mfcs/{mfcId}/toteAssignments:
get:
description: "List tote assignments."
externalDocs:
description: "Previous endpoint: https://host/api/v1/command-server/message/ramp-state"
url: "https://ims-api-maf-uat.tom.takeoff.com/api/v1/command-server/index.html#/message"
parameters:
- $ref: "#/parameters/clientId"
- $ref: "#/parameters/mfcId"
- name: view
type: string
in: query
enum:
- groupedByOrder
- name: orderId
type: string
in: query
responses:
200:
description: "Successful response."
schema:
$ref: "#/definitions/listToteAssignmentsResponse"
400:
description: "Bad Request."
schema:
$ref: "#/definitions/Response400"
/clients/{clientId}/mfcs/{mfcId}/toteAssignments/{toteAssignmentId}:
post:
description: "Create tote assignment wit order and lane."
externalDocs:
description: "Previous endpoint: https://host/api/v1/command-server/message/allocate-channel"
url: "https://ims-api-maf-uat.tom.takeoff.com/api/v1/command-server/index.html#/message"
parameters:
- $ref: "#/parameters/clientId"
- $ref: "#/parameters/mfcId"
- $ref: "#/parameters/toteAssignmentId"
- name: dryRun
in: query
type: boolean
required: false
description: "Use it only for development purposes."
- name: rePlay
in: query
type: boolean
required: false
description: "Use it only for development purposes."
- name: body
in: body
required: true
schema:
$ref: "#/definitions/createToteAssignmentRequest"
responses:
200:
description: "Successful response."
schema:
$ref: "#/definitions/createToteAssignmentResponse"
400:
description: "Bad Request."
schema:
$ref: "#/definitions/Response400"
patch:
description: "Update tote assignment (not entire resource but only provided attributes like: laneId)."
externalDocs:
description: "Previous endpoint: https://host/api/v1/command-server/message/move-error-ramp"
url: "https://ims-api-maf-uat.tom.takeoff.com/api/v1/command-server/index.html#/message"
parameters:
- $ref: "#/parameters/clientId"
- $ref: "#/parameters/mfcId"
- $ref: "#/parameters/toteAssignmentId"
- name: body
in: body
required: true
schema:
$ref: "#/definitions/updateToteAssignmentRequest"
responses:
200:
description: "Successful response."
schema:
$ref: "#/definitions/updateToteAssignmentResponse"
400:
description: "Bad Request."
schema:
$ref: "#/definitions/Response400"
delete:
description: "Delete tote assignment."
externalDocs:
description: "Previous endpoint: https://host/api/v1/command-server/message/free-up-channel"
url: "https://ims-api-maf-uat.tom.takeoff.com/api/v1/command-server/index.html#/message"
parameters:
- $ref: "#/parameters/clientId"
- $ref: "#/parameters/mfcId"
- $ref: "#/parameters/toteAssignmentId"
- name: toteId
in: query
required: true
type: string
responses:
200:
description: "Successful response."
schema:
$ref: "#/definitions/deleteToteAssignmentResponse"
400:
description: "Bad Request."
schema:
$ref: "#/definitions/Response400"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment