Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: '2.0'
- info:
- title: Armário Virtual API
- description: API dos serviços do sistema Armário Virtual
- version: 0.0.1
- # during dev, should point to your local machine
- host: localhost:10010
- # basePath prefixes all resource paths
- basePath: /_aV
- #
- schemes:
- # tip: remove http to make production-grade
- - http
- - https
- # format of bodies a client can send (Content-Type)
- consumes:
- - application/json
- # format of the responses to the client (Accepts)
- produces:
- - application/json
- securityDefinitions:
- basicAuth:
- type: basic
- OAuth2:
- type: oauth2
- flow: accessCode
- authorizationUrl: https://example.com/oauth/authorize
- tokenUrl: https://example.com/oauth/token
- scopes:
- read: Grants read access
- write: Grants write access
- paths:
- /m/user:
- x-swagger-router-controller: User
- post:
- summary: Post a new user
- operationId: createNewUser
- description: Submit a new user to be saved
- tags:
- - user
- #security:
- # - basicAuth: []
- parameters:
- - name: data
- in: body
- required: true
- description: Basic data of new user
- schema:
- $ref: '#/definitions/basic_user'
- #$ref: '#/definitions/client'
- responses:
- 201:
- description: Created confirmation
- schema:
- $ref: '#/definitions/basic_user'
- #$ref: '#/definitions/client'
- 409:
- description: Must be sended when user email already exist
- default:
- description: Error
- /m/user/{id}:
- x-swagger-router-controller: User
- get:
- summary: Get user data
- description: Return user data
- operationId: getUserById
- tags:
- - user
- #security: []
- parameters:
- - name: id
- in: path
- description: User id to get
- type: string
- required: true
- responses:
- 200:
- description: OK
- schema:
- $ref: '#/definitions/basic_user'
- #$ref: '#/definitions/client'
- 404:
- description: User not found
- default:
- description: ERROR
- put:
- summary: Edit an user
- operationId: editUserById
- description: Submit changes on user data
- tags:
- - user
- #security:
- # - OAuth2: [write]
- parameters:
- - name: id
- in: path
- description: User id to edit
- type: string
- required: true
- - name: data
- in: body
- description: Data to replace
- schema:
- properties:
- username:
- type: string
- email:
- type: string
- pattern: '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]{2,62}$'
- password:
- type: string
- format: password
- contact:
- type: string
- responses:
- 200:
- description: Update confirmation
- schema:
- $ref: '#/definitions/basic_user'
- #$ref: '#/definitions/client'
- 304:
- description: Must be sended when some error was founded
- default:
- description: Error
- /m/user/{id}/address:
- x-swagger-router-controller: User
- get:
- summary: Get user addresses
- description: Provide all addresses of user
- operationId: getUserAddresses
- tags:
- - user
- - address
- #security:
- # - OAuth2: [read]
- parameters:
- - name: id
- in: path
- description: User id to get all addresses
- type: string
- required: true
- responses:
- 200:
- description: OK
- schema:
- required:
- - addresses
- properties:
- addresses:
- type: array
- items:
- $ref: '#/definitions/address'
- default:
- description: ERROR
- post:
- summary: Post a new user address
- operationId: addUserAddress
- description: Submit a new user address to be saved
- tags:
- - user
- - address
- #$security:
- # - OAuth2: [write]
- parameters:
- - name: id
- in: path
- description: User id edit
- type: string
- required: true
- - name: data
- in: body
- required: true
- description: Basic data of new user
- schema:
- $ref: '#/definitions/address'
- responses:
- 201:
- description: Created confirmation
- schema:
- required:
- - addresses
- properties:
- addresses:
- type: array
- items:
- $ref: '#/definitions/address'
- 500:
- description: Server error
- default:
- description: Error
- delete:
- summary: Delete a user address
- operationId: deleteUserAddress
- description: Submit changes on user address
- tags:
- - user
- - address
- #security:
- # - OAuth2: [write]
- parameters:
- - name: id
- in: path
- description: User id
- type: string
- required: true
- - name: address_id
- in: header
- description: Address id
- type: string
- format: int32
- required: true
- responses:
- 200:
- description: Delete confirmation
- schema:
- required:
- - addresses
- properties:
- addresses:
- type: array
- items:
- $ref: '#/definitions/address'
- default:
- description: Error
- /m/user/{id}/address/{address_id}:
- x-swagger-router-controller: User
- put:
- summary: Update a existing user address
- operationId: editUserAddress
- description: Submit data for update a existing address.
- tags:
- - user
- - address
- #$security:
- # - OAuth2: [write]
- parameters:
- - name: id
- in: path
- description: User id edit
- type: string
- required: true
- - name: address_id
- in: path
- description: Address id
- type: string
- format: int32
- required: true
- - name: data
- in: body
- required: true
- description: Basic data to update existing user address
- schema:
- $ref: '#/definitions/address'
- responses:
- 200:
- description: Updated confirmation
- schema:
- required:
- - addresses
- properties:
- addresses:
- type: array
- items:
- $ref: '#/definitions/address'
- 500:
- description: Server error
- default:
- description: Error
- /m/user/{id}/clothes:
- x-swagger-router-controller: User
- get:
- summary: Get all user clothes informations
- description: Provide all user clothes without images
- operationId: getAllUserClothes
- tags:
- - user
- - clothes
- #security:
- # - OAuth2: [read]
- parameters:
- - name: id
- in: path
- description: User id to get all clothes
- type: string
- required: true
- responses:
- 200:
- description: OK
- schema:
- required:
- - clothes
- properties:
- clothes:
- type: array
- items:
- type: object
- #$ref: '#/definitions/clothes'
- default:
- description: ERROR
- post:
- summary: Create a new user clothes without photos
- description: Submit a new clothes to be saved
- operationId: postNewClothes
- tags:
- - user
- - clothes
- #security:
- # - OAuth2: [write]
- parameters:
- - name: id
- in: path
- description: User id to associate
- type: string
- required: true
- - name: data
- in: body
- description: Clothes data
- required: true
- schema:
- type: object
- properties:
- type:
- type: string
- brand:
- type: string
- color:
- type: string
- print:
- type: string
- station:
- type: string
- observations:
- type: array
- items:
- type: string
- responses:
- 201:
- description: OK
- schema:
- type: object
- properties:
- type:
- type: string
- brand:
- type: string
- color:
- type: string
- print:
- type: string
- station:
- type: string
- observations:
- type: array
- items:
- type: string
- #$ref: '#/definitions/clothes'
- default:
- description: ERROR
- /m/clothes/{clothes_id}:
- x-swagger-router-controller: Clothes
- get:
- summary: Get a clothes
- description: Return a clothes by id
- operationId: getClothesById
- tags:
- - clothes
- #security:
- # - OAuth2: [read]
- parameters:
- - name: clothes_id
- in: path
- description: Clothes id to get
- type: string
- required: true
- responses:
- 200:
- description: OK
- schema:
- type: object
- #$ref: '#/definitions/clothes'
- put:
- summary: Update clothes
- description: Update a clothes data. Every time this run, a new version of clothes is created and presisted a old version.
- operationId: updateClothes
- tags:
- - clothes
- #security:
- # - OAuth2: [write]
- parameters:
- - name: clothes_id
- in: path
- description: Clothes id to edit
- type: string
- required: true
- - name: data
- in: body
- description: Clothes data
- schema:
- type: object
- properties:
- type:
- type: string
- brand:
- type: string
- color:
- type: string
- print:
- type: string
- station:
- type: string
- responses:
- 200:
- description: Update confirmation
- schema:
- type: object
- #$ref: '#/definitions/clothes'
- default:
- description: ERROR
- delete:
- summary: Disable a clothes
- description: Disable a specified clothes. Blocking her to be consulted or edited
- operationId: disableClothes
- tags:
- - clothes
- #security:
- # - OAuth2: [write]
- parameters:
- - name: clothes_id
- in: path
- description: Clothes id to edit
- type: string
- required: true
- responses:
- 200:
- description: Delete confirmation
- schema:
- type: object
- default:
- description: ERROR
- /m/clothes/{clothes_id}/observation:
- x-swagger-router-controller: Clothes
- post:
- summary: Create a new observation for an clothes
- description: Receive a new clothes observation and response with a updated clothes
- operationId: postClothesObservation
- tags:
- - clothes
- #security:
- # - OAuth2: [write]
- parameters:
- - name: clothes_id
- in: path
- description: Clothes id to associate observation
- type: string
- required: true
- - name: observations
- in: body
- description: New clothes observation
- required: true
- schema:
- type: array
- items:
- type: string
- responses:
- 200:
- description: Update confirmation
- schema:
- type: object
- delete:
- summary: Remove clothes observation
- description: Delete a clothes observation and response with a updated clothes
- operationId: deleteClothesObservation
- tags:
- - clothes
- security:
- - OAuth2: [write]
- parameters:
- - name: clothes_id
- in: path
- description: Clothes id to associate observation
- type: string
- required: true
- - name: observations
- in: body
- description: Index of all observations that will be deleted
- required: true
- schema:
- type: array
- items:
- type: number
- responses:
- 200:
- description: Operation confirmation
- /m/clothes/{clothes_id}/photo:
- x-swagger-router-controller: clothes
- post:
- summary: Receive a new clothes photo
- description: Receive a new clothes photo and response with a updated clothes
- operationId: postClothesPhoto
- tags:
- - clothes
- - static files
- security:
- - OAuth2: [write]
- consumes:
- - multipart/form-data
- parameters:
- - name: clothes_id
- in: path
- description: Clothes id to associate photo
- type: string
- required: true
- - type: file
- in: formData
- name: photo
- description: Clothes compressed photo
- required: true
- responses:
- 200:
- description: Post confirmation
- schema:
- $ref: '#/definitions/clothes'
- default:
- description: Error
- /m/clothes/{clothes_id}/photo/{index}:
- x-swagger-router-controller: clothes
- get:
- summary: Provide a photo of specified clothes
- description: Provide all user clothes without images
- operationId: getClothesPhoto
- tags:
- - clothes
- - static files
- security:
- - OAuth2: [read]
- produces:
- - multipart/form-data
- parameters:
- - name: clothes_id
- in: path
- description: Clothes id to get photo
- type: string
- required: true
- - name: index
- in: path
- description: Photo index
- type: number
- format: int32
- required: true
- responses:
- 200:
- description: OK
- schema:
- type: file
- default:
- description: ERROR
- delete:
- summary: Remove clothes photo
- description: Delete a clothes photo and response with a updated clothes
- operationId: deleteClothesPhoto
- tags:
- - clothes
- - static files
- security:
- - OAuth2: [write]
- parameters:
- - name: clothes_id
- in: path
- description: Clothes id of associated photo
- type: string
- required: true
- - name: index
- in: path
- description: Photo index to be excluded
- type: string
- required: true
- responses:
- 200:
- description: Operation confirmation
- schema:
- $ref: '#/definitions/clothes'
- /m/stores:
- x-swagger-router-controller: store
- get:
- summary: Get all filtered stores
- description: Get stores filtring by State, City and Franchise
- operationId: getStoresByFilter
- tags:
- - stores
- security:
- - OAuth2: [read]
- parameters:
- - name: state
- in: query
- type: string
- required: true
- description: State of store
- - name: city
- in: query
- type: string
- required: true
- description: City of store
- - name: franchise_id
- in: query
- type: string
- required: false
- description: Franchise id
- responses:
- 200:
- description: OK
- schema:
- type: array
- items:
- type: object
- properties:
- objectId:
- type: string
- name:
- type: string
- /m/stores/{store_id}/washebles:
- x-swagger-router-controller: store
- get:
- summary: Get washebles of an store
- description: Get all actives washebles of store
- operationId: getWasheblesByStore
- tags:
- - stores
- security:
- - OAuth2: [read]
- parameters:
- - name: store_id
- in: path
- description: Store id for consult
- type: string
- required: true
- responses:
- 200:
- description: Operation confirmation
- schema:
- type: array
- items:
- type: object
- properties:
- objectId:
- type: string
- name:
- type: string
- /m/stores/{store_id}/services:
- x-swagger-router-controller: store
- get:
- summary: Get services ofered by an store
- description: Get all activated services ofered by an store
- operationId: getServicesByStore
- tags:
- - stores
- security:
- - OAuth2: [read]
- parameters:
- - name: store_id
- in: path
- description: Store id for consult
- type: string
- required: true
- responses:
- 200:
- description: Operation confirmation
- schema:
- $ref: '#/definitions/especial_service'
- /m/stores/{store_id}/order:
- x-swagger-router-controller: store
- post:
- summary: Post new order to Store
- description: Receive a new order from client. Process and send the order to respective store.
- operationId: postNewOrderFromStore
- tags:
- - stores
- - orders
- security:
- - OAuth2: [write]
- parameters:
- - name: store_id
- in: path
- description: Store id for associate order
- type: string
- required: true
- - name: data
- in: body
- description: Order data
- required: true
- schema:
- type: object
- properties:
- cart_itens:
- type: object
- properties:
- clothes_set:
- type: array
- description: Itens do pedido
- items:
- type: object
- properties:
- clothes:
- type: object
- description: Id e observações para a roupa
- properties:
- objectId:
- type: string
- observation:
- type: string
- whase_type:
- $ref: '#/definitions/basic_services'
- services:
- type: string
- responses:
- 200:
- description: Operation confirmation
- /m/stores/{store_id}/order/estimate:
- x-swagger-router-controller: store
- get:
- summary: Get order estimate
- description: Receive a clothes and pretend service from client to calculate the price of service
- operationId: getOrderEstimate
- tags:
- - stores
- - orders
- security:
- - OAuth2: [read]
- parameters:
- - name: store_id
- in: path
- description: Store id for associate order
- type: string
- required: true
- - name: data
- in: body
- description: Order data
- required: true
- schema:
- type: object
- description: Id da roupa
- properties:
- objectId:
- type: string
- whase_type:
- $ref: '#/definitions/basic_services'
- responses:
- 200:
- description: Operation confirmation
- schema:
- type: object
- properties:
- clothes_set:
- type: array
- description: Itens do pedido
- items:
- type: object
- properties:
- clothes:
- type: object
- description: Id e observações para a roupa
- properties:
- objectId:
- type: string
- whase_type:
- $ref: '#/definitions/basic_services'
- price:
- type: number
- title: Price
- format: float
- /swagger:
- x-swagger-pipe: swagger_raw
- # complex objects have schema definitions
- definitions:
- basic_user:
- type: object
- properties:
- username:
- type: string
- email:
- type: string
- password:
- type: string
- format: password
- required:
- - username
- - email
- - password
- post_response_address:
- properties:
- message:
- type: string
- response_user:
- type: object
- properties:
- user:
- type: object
- description: return a user object
- required:
- - user
- status_pedido:
- type: object
- title: Estado do pedido
- description: Relação de estados assumíveis para um pedido
- enum: &STATUS
- - Entregue
- - Finalizado
- - Solicitado
- - Em andamento
- basic_services:
- type: object
- title: Serviços básicos
- description: Relação de serviços básicos
- enum: &BASIC_SERVICES
- - Completo
- - Passadoria
- - Recuperação
- especial_service:
- type: object
- title: Serviço especial
- description: Serviço especial oferecido pela lavanderia
- properties:
- name:
- type: string
- description: Nome do serviço especial
- price:
- type: number
- format: float
- description: Custo do serviço especial
- description:
- type: string
- description: Descrição do serviço especial
- icon:
- type: string
- description: URL para icone representativo do serviço especial
- clothes:
- type: object
- title: Clothes
- description: Peça de roupa
- #uniqueItems: true
- properties:
- enabled:
- type: boolean
- description: Status da peça (false, caso desabilitado/excluida)
- version:
- type: number
- title: Versão do documento
- description: Contador que deve ser incrementado sempre que uma alteração no documento for realizada. Uma cópia do documento antigo deve ser gerado
- pictures:
- type: array
- description: URL para as peças de roupas. Deve ser limitada a três fotos por peça
- items:
- type: string
- description: URL para foto da peça
- type:
- type: string
- description: Tipo da peça de roupa EX... Camisa, Calça, Meia
- brand:
- type: string
- description: Marca da roupa
- color:
- type: string
- description: Cor predominante da roupa
- print:
- type: string
- description: Estampa da roupa
- station:
- type: string
- description: Estação para uso da roupa
- observations:
- type: array
- description: Observações individuais da peça de roupa
- items:
- type: string
- whashes:
- type: integer
- description: Número de lavagens sofridas pela peça
- register_date:
- type: string
- format: date
- description: Data de cadastro da peça
- orders:
- type: object
- title: Order
- description: Pedido realizado pelo usuário
- properties:
- solicitation_time:
- type: string
- format: date-time
- description: Data de realização do pedido
- finish_time:
- type: string
- format: date-time
- description: Data de finalização do pedido
- removal_time:
- type: string
- format: date-time
- description: Data de retirada/entrega do pedido
- status:
- $ref: '#/definitions/status_pedido'
- cart_itens:
- type: object
- properties:
- clothes_set:
- type: array
- description: Itens do pedido
- items:
- type: object
- properties:
- clothes:
- $ref: '#/definitions/clothes'
- whase_type:
- $ref: '#/definitions/basic_services'
- price:
- type: number
- title: Price
- format: float
- services:
- type: array
- items:
- type: object
- properties:
- service:
- $ref: '#/definitions/especial_service'
- price:
- type: number
- title: Price
- format: float
- agent:
- type: object
- title: Agent
- description: Dados do representante da loja
- properties:
- name:
- type: string
- description: Nome do representante da loja
- email:
- type: string
- description: Email do representante da loja
- pattern: '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]{2,62}$'
- cpf:
- type: string
- description: CPF do representante da loja
- password:
- type: string
- format: password
- description: Chave de acesso do usuário ao sistema
- administrator:
- type: object
- title: Administrator
- description: Usário administrador do sistema
- properties:
- email:
- type: string
- description: Email de contato do administrator do sistema
- password:
- type: string
- format: password
- washebles:
- title: Laváveis
- type: object
- properties:
- name:
- type: string
- description: Tipo de peça pré-autorizado pela loja
- enabled:
- type: boolean
- description: Status de disponibilidade da peça
- icon:
- type: string
- format: byte
- description: URL para icone default
- services:
- type: object
- description: Serviço básicos oferecidos pela loja. Limitados a três
- properties:
- complete:
- type: object
- description: Serviço básico 1
- properties:
- price:
- type: number
- format: float
- enabled:
- type: boolean
- description: Disponibilidade do serviço básico
- recovery:
- type: object
- description: Serviço básico 2
- properties:
- price:
- type: number
- format: float
- enabled:
- type: boolean
- description: Disponibilidade do serviço básico
- ironing:
- type: object
- description: Serviço básico 3
- properties:
- price:
- type: number
- format: float
- enabled:
- type: boolean
- description: Disponibilidade do serviço básico
- store:
- type: object
- title: Store
- description: Entidade que ofereçe os serviços e é selecionavel pelo usuário
- properties:
- tipo:
- type: object
- description: Tipo de loja EX:. Franqueado, Autonoma
- enum: &laundery_type
- - Franqueado
- - Autonoma
- name:
- type: string
- description: Nome fantasia da loja
- social_reason:
- type: string
- description: Razão social da loja
- cnpj:
- type: string
- description: CNPJ da loja
- ie:
- type: string
- description: Inscrição estadual
- adrress:
- type: string
- description: Endereço da loja
- agent:
- $ref: '#/definitions/agent'
- especial_services:
- type: array
- description: Relação de servicos especiais oferecidos
- items:
- $ref: '#/definitions/especial_service'
- delivery_services:
- type: object
- properties:
- delivery:
- type: boolean
- description: Disponibilidade do serviço de delivery
- checkin:
- type: boolean
- description: Disponibilidade do serviço de entrega e retirada na loja
- washebles:
- type: array
- description: Lista de ids para os laváveis da loja
- items:
- type: string
- franchise:
- type: object
- title: Franchise
- properties:
- name:
- type: string
- description: Nome fantasia da loja
- social_reason:
- type: string
- description: Razão social da loja
- cnpj:
- type: string
- description: CNPJ da loja
- ie:
- type: string
- description: Inscrição estadual
- adrress:
- type: string
- description: Endereço da loja
- agent:
- $ref: '#/definitions/agent'
- stores:
- type: array
- items:
- $ref: '#/definitions/store'
- address:
- type: object
- title: Address of client
- properties:
- postal_code:
- type: string
- description: Código postal (CEP) do endereço
- city:
- type: string
- description: Nome da Cidade
- neighborhood:
- type: string
- description: Nome do bairro
- place:
- type: string
- description: Logradouro do endereço
- client:
- type: object
- title: Client
- required:
- - username
- - email
- - password
- properties:
- username:
- type: string
- description: Nome completo do usuário do sistema
- email:
- type: string
- description: Email ativo do usuário
- password:
- type: string
- format: password
- description: Chave de acesso do usuário ao sistema
- contact:
- type: string
- description: Telefone do usuário
- status:
- type: boolean
- description: Status do usuário
- register_date:
- type: string
- format: date
- description: Data de registro do usuário
- closet:
- type: array
- description: Array de ObjectId para as roupas do usuário
- items:
- type: string
- format: hexadecimal
- orders:
- type: array
- description: Array de ObjectId para os pedidos do usuário
- items:
- type: string
- format: hexadecimal
- addresses:
- type: array
- description: Lista de endereços ativos do usuário
- items:
- $ref: '#/definitions/address'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement