Add UserGroup to chill (import from branch ticket-app-master)

Import the UserGrou feature from ticket-app-master branch. This includes:

- import all the entities and migrations, modification of typescript types, templating, and so on;
- apply some verification and formatting rules, like:
  - reformat file on chill.api.specs.yaml (MainBundle)
  - reformat file on types.ts (Main Bundle)

Migrations kept the same filename.
This commit is contained in:
2024-09-26 11:17:50 +02:00
parent 42438d5bb5
commit b4fa478177
16 changed files with 823 additions and 259 deletions

View File

@@ -5,8 +5,8 @@ info:
title: "Chill api"
description: "Api documentation for chill. Currently, work in progress"
servers:
- url: "/api"
description: "Your current dev server"
- url: "/api"
description: "Your current dev server"
components:
schemas:
@@ -29,6 +29,42 @@ components:
type: string
text:
type: string
UserById:
type: object
properties:
id:
type: integer
type:
type: string
enum:
- user
UserGroup:
type: object
properties:
id:
type: integer
type:
type: string
enum:
- user_group
label:
type: object
additionalProperties: true
backgroundColor:
type: string
foregroundColor:
type: string
exclusionKey:
type: string
UserGroupById:
type: object
properties:
id:
type: integer
type:
type: string
enum:
- user_group
Center:
type: object
properties:
@@ -181,25 +217,25 @@ paths:
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
- household
- 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
- household
responses:
200:
description: "OK"
@@ -236,7 +272,7 @@ paths:
minItems: 2
maxItems: 2
postcode:
$ref: "#/components/schemas/PostalCode"
$ref: '#/components/schemas/PostalCode'
steps:
type: string
street:
@@ -260,14 +296,14 @@ paths:
- 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
- name: id
in: path
required: true
description: The address id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -284,14 +320,14 @@ paths:
- address
summary: patch an address
parameters:
- name: id
in: path
required: true
description: The address id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The address id
schema:
type: integer
format: integer
minimum: 1
requestBody:
required: true
content:
@@ -349,14 +385,14 @@ paths:
- 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
- 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"
@@ -375,12 +411,12 @@ paths:
- 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
- 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"
@@ -390,14 +426,14 @@ paths:
- 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
- name: id
in: path
required: true
description: The reference address id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -417,20 +453,20 @@ paths:
- search
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
- name: q
in: query
required: true
description: The search pattern
schema:
type: string
- name: id
in: path
required: true
description: The reference address id
schema:
type: integer
format: integer
minimum: 1
- name: q
in: query
required: true
description: The search pattern
schema:
type: string
responses:
200:
description: "ok"
@@ -450,12 +486,12 @@ paths:
- 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
- in: query
name: country
required: false
schema:
type: integer
description: The id of a country to filter the postal code
responses:
200:
description: "ok"
@@ -494,14 +530,14 @@ paths:
- 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
- name: id
in: path
required: true
description: The postal code id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -521,18 +557,18 @@ paths:
- search
summary: Search a postal code
parameters:
- name: q
in: query
required: true
description: The search pattern
schema:
type: string
- name: country
in: query
required: false
description: The country id
schema:
type: integer
- name: q
in: query
required: true
description: The search pattern
schema:
type: string
- name: country
in: query
required: false
description: The country id
schema:
type: integer
responses:
200:
description: "ok"
@@ -559,14 +595,14 @@ paths:
- 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
- name: id
in: path
required: true
description: The country id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -609,14 +645,14 @@ paths:
- 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
- name: id
in: path
required: true
description: The user id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -646,14 +682,14 @@ paths:
- 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
- name: id
in: path
required: true
description: The scope id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -721,14 +757,14 @@ paths:
- location
summary: Return the given location
parameters:
- name: id
in: path
required: true
description: The location id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The location id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -788,14 +824,14 @@ paths:
- notification
summary: mark a notification as read
parameters:
- name: id
in: path
required: true
description: The notification id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The notification id
schema:
type: integer
format: integer
minimum: 1
responses:
202:
description: "accepted"
@@ -807,14 +843,14 @@ paths:
- notification
summary: mark a notification as unread
parameters:
- name: id
in: path
required: true
description: The notification id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The notification id
schema:
type: integer
format: integer
minimum: 1
responses:
202:
description: "accepted"
@@ -846,7 +882,7 @@ paths:
type: array
items:
type: integer
example: [1, 2, 3] # Example array of IDs
example: [ 1, 2, 3 ] # Example array of IDs
responses:
"202":
description: Notifications marked as unread successfully
@@ -934,6 +970,22 @@ paths:
schema:
type: array
items:
$ref: "#/components/schemas/NewsItem"
$ref: '#/components/schemas/NewsItem'
403:
description: "Unauthorized"
/1.0/main/user-group.json:
get:
tags:
- user-group
summary: Return a list of users-groups
responses:
200:
description: "ok"
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UserGroup'
403:
description: "Unauthorized"