mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
540 lines
12 KiB
YAML
540 lines
12 KiB
YAML
---
|
|
openapi: "3.0.0"
|
|
info:
|
|
version: "1.0.0"
|
|
title: "Chill api"
|
|
description: "Api documentation for chill. Currently, work in progress"
|
|
servers:
|
|
- url: "/api"
|
|
description: "Your current dev server"
|
|
|
|
components:
|
|
schemas:
|
|
User:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
type:
|
|
type: string
|
|
enum:
|
|
- user
|
|
username:
|
|
type: string
|
|
text:
|
|
type: string
|
|
Center:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
Address:
|
|
type: object
|
|
properties:
|
|
address_id:
|
|
type: integer
|
|
text:
|
|
type: string
|
|
postcode:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
|
|
Country:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: object
|
|
countryCode:
|
|
type: string
|
|
|
|
PostalCode:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
code:
|
|
type: string
|
|
country:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: object
|
|
countryCode:
|
|
type: string
|
|
|
|
AddressReference:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
refId:
|
|
type: string
|
|
street:
|
|
type: string
|
|
streetNumber:
|
|
type: string
|
|
postcode:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
code:
|
|
type: string
|
|
country:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: object
|
|
countryCode:
|
|
type: string
|
|
municipalityCode:
|
|
type: string
|
|
source:
|
|
type: string
|
|
point:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
coordinates:
|
|
type: array
|
|
items:
|
|
type: number
|
|
minItems: 2
|
|
maxItems: 2
|
|
|
|
|
|
paths:
|
|
/1.0/search.json:
|
|
get:
|
|
summary: perform a search across multiple entities
|
|
tags:
|
|
- search
|
|
- person
|
|
- thirdparty
|
|
description: >
|
|
The search is performed across multiple entities. The entities must be listed into
|
|
`type` parameters.
|
|
|
|
The results are ordered by relevance, from the most to the lowest relevant.
|
|
|
|
parameters:
|
|
- name: q
|
|
in: query
|
|
required: true
|
|
description: the pattern to search
|
|
schema:
|
|
type: string
|
|
- name: type[]
|
|
in: query
|
|
required: true
|
|
description: the type entities amongst the search is performed
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
enum:
|
|
- person
|
|
- thirdparty
|
|
- user
|
|
responses:
|
|
200:
|
|
description: "OK"
|
|
/1.0/main/address.json:
|
|
get:
|
|
tags:
|
|
- address
|
|
summary: Return a list of all Chill addresses
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
post:
|
|
tags:
|
|
- address
|
|
summary: create a new address
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
buildingName:
|
|
type: string
|
|
corridor:
|
|
type: string
|
|
distribution:
|
|
type: string
|
|
extra:
|
|
type: string
|
|
flat:
|
|
type: string
|
|
floor:
|
|
type: string
|
|
isNoAddress:
|
|
type: boolean
|
|
point:
|
|
type: array
|
|
items:
|
|
type: number
|
|
minItems: 2
|
|
maxItems: 2
|
|
postcode:
|
|
$ref: '#/components/schemas/PostalCode'
|
|
steps:
|
|
type: string
|
|
street:
|
|
type: string
|
|
streetNumber:
|
|
type: string
|
|
responses:
|
|
401:
|
|
description: "Unauthorized"
|
|
404:
|
|
description: "Not found"
|
|
200:
|
|
description: "OK"
|
|
422:
|
|
description: "Unprocessable entity (validation errors)"
|
|
400:
|
|
description: "transition cannot be applyed"
|
|
patch:
|
|
tags:
|
|
- address
|
|
summary: patch an address
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
buildingName:
|
|
type: string
|
|
corridor:
|
|
type: string
|
|
distribution:
|
|
type: string
|
|
extra:
|
|
type: string
|
|
flat:
|
|
type: string
|
|
floor:
|
|
type: string
|
|
isNoAddress:
|
|
type: boolean
|
|
point:
|
|
type: array
|
|
items:
|
|
type: number
|
|
minItems: 2
|
|
maxItems: 2
|
|
postcode:
|
|
$ref: '#/components/schemas/PostalCode'
|
|
steps:
|
|
type: string
|
|
street:
|
|
type: string
|
|
streetNumber:
|
|
type: string
|
|
validFrom:
|
|
type: string
|
|
validTo:
|
|
type: string
|
|
responses:
|
|
401:
|
|
description: "Unauthorized"
|
|
404:
|
|
description: "Not found"
|
|
200:
|
|
description: "OK"
|
|
422:
|
|
description: "Unprocessable entity (validation errors)"
|
|
400:
|
|
description: "transition cannot be applyed"
|
|
|
|
/1.0/main/address/{id}.json:
|
|
get:
|
|
tags:
|
|
- address
|
|
summary: Return an address by id
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The address id
|
|
schema:
|
|
type: integer
|
|
format: integer
|
|
minimum: 1
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Address'
|
|
404:
|
|
description: "not found"
|
|
401:
|
|
description: "Unauthorized"
|
|
|
|
/1.0/main/address/{id}/duplicate.json:
|
|
post:
|
|
tags:
|
|
- address
|
|
summary: Duplicate an existing address
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The address id that will be duplicated
|
|
schema:
|
|
type: integer
|
|
format: integer
|
|
minimum: 1
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Address'
|
|
404:
|
|
description: "not found"
|
|
401:
|
|
description: "Unauthorized"
|
|
|
|
/1.0/main/address-reference.json:
|
|
get:
|
|
tags:
|
|
- address
|
|
summary: Return a list of all reference addresses
|
|
parameters:
|
|
- in: query
|
|
name: postal_code
|
|
required: false
|
|
schema:
|
|
type: integer
|
|
description: The id of a postal code to filter the reference addresses
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
/1.0/main/address-reference/{id}.json:
|
|
get:
|
|
tags:
|
|
- address
|
|
summary: Return a reference address by id
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The reference address id
|
|
schema:
|
|
type: integer
|
|
format: integer
|
|
minimum: 1
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AddressReference'
|
|
404:
|
|
description: "not found"
|
|
401:
|
|
description: "Unauthorized"
|
|
|
|
/1.0/main/postal-code.json:
|
|
get:
|
|
tags:
|
|
- address
|
|
summary: Return a list of all postal-code
|
|
parameters:
|
|
- in: query
|
|
name: country
|
|
required: false
|
|
schema:
|
|
type: integer
|
|
description: The id of a country to filter the postal code
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
post:
|
|
tags:
|
|
- address
|
|
summary: create a new PostalCode
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
code:
|
|
type: string
|
|
country:
|
|
$ref: '#/components/schemas/Country'
|
|
responses:
|
|
401:
|
|
description: "Unauthorized"
|
|
404:
|
|
description: "Not found"
|
|
200:
|
|
description: "OK"
|
|
422:
|
|
description: "Unprocessable entity (validation errors)"
|
|
400:
|
|
description: "transition cannot be applyed"
|
|
|
|
/1.0/main/postal-code/{id}.json:
|
|
get:
|
|
tags:
|
|
- address
|
|
summary: Return a postal code by id
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The postal code id
|
|
schema:
|
|
type: integer
|
|
format: integer
|
|
minimum: 1
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PostalCode'
|
|
404:
|
|
description: "not found"
|
|
401:
|
|
description: "Unauthorized"
|
|
|
|
/1.0/main/country.json:
|
|
get:
|
|
tags:
|
|
- address
|
|
summary: Return a list of all countries
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
/1.0/main/country/{id}.json:
|
|
get:
|
|
tags:
|
|
- address
|
|
summary: Return a country by id
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The country id
|
|
schema:
|
|
type: integer
|
|
format: integer
|
|
minimum: 1
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Country'
|
|
404:
|
|
description: "not found"
|
|
401:
|
|
description: "Unauthorized"
|
|
|
|
|
|
/1.0/main/user.json:
|
|
get:
|
|
tags:
|
|
- user
|
|
summary: Return a list of all user
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
/1.0/main/whoami.json:
|
|
get:
|
|
tags:
|
|
- user
|
|
summary: Return the currently authenticated user
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
/1.0/main/user/{id}.json:
|
|
get:
|
|
tags:
|
|
- user
|
|
summary: Return a user by id
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The user id
|
|
schema:
|
|
type: integer
|
|
format: integer
|
|
minimum: 1
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
404:
|
|
description: "not found"
|
|
401:
|
|
description: "Unauthorized"
|
|
|
|
/1.0/main/scope.json:
|
|
get:
|
|
tags:
|
|
- scope
|
|
summary: return a list of scopes
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
401:
|
|
description: "Unauthorized"
|
|
|
|
/1.0/main/scope/{id}.json:
|
|
get:
|
|
tags:
|
|
- scope
|
|
summary: return a list of scopes
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The scope id
|
|
schema:
|
|
type: integer
|
|
format: integer
|
|
minimum: 1
|
|
responses:
|
|
200:
|
|
description: "ok"
|
|
401:
|
|
description: "Unauthorized"
|