Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Application listings
Browse files Browse the repository at this point in the history
Lucieo committed Feb 22, 2024
1 parent 1380afe commit b2667b5
Showing 35 changed files with 1,319 additions and 151 deletions.
2 changes: 1 addition & 1 deletion back/api/application/config/routes.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"routes": [
{
"method": "GET",
"path": "/applications/me",
"path": "/applications/me/:campaignId",
"handler": "application.myApplications",
"config": {
"policies": ["global::is-authenticated"],
3 changes: 2 additions & 1 deletion back/api/application/controllers/application.js
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
module.exports = {
async myApplications(ctx) {
const { id, type } = ctx.state.user;
const query = type === "place" ? { 'disponibility.espace.users_permissions_user.id':id} : { company: id };
const {query: initialQuery}=ctx.request;
const query = type === "place" ? {...initialQuery, 'disponibility.espace.users_permissions_user.id':id} : {...initialQuery, company: id };
const populate = type==="place"? ['disponibility.espace','company']:['disponibility.espace', 'place','disponibility.espace.users_permissions_user']

return strapi
32 changes: 30 additions & 2 deletions back/api/application/documentation/1.0.0/application.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"paths": {
"/applications/me": {
"/applications/me/{campaignId}": {
"get": {
"deprecated": false,
"description": "Get applications related to current user",
@@ -54,7 +54,18 @@
"tags": [
"Application"
],
"parameters": []
"parameters": [
{
"name": "campaignId",
"in": "path",
"description": "",
"deprecated": false,
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/applications": {
@@ -853,6 +864,9 @@
"type": "string"
}
},
"preselections_max": {
"type": "integer"
},
"published_at": {
"type": "string"
},
@@ -1166,6 +1180,13 @@
}
}
},
"status": {
"type": "string",
"enum": [
"preselected",
"confirmed"
]
},
"published_at": {
"type": "string",
"format": "date-time"
@@ -1216,6 +1237,13 @@
"espace": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"preselected",
"confirmed"
]
},
"published_at": {
"type": "string",
"format": "date-time"
149 changes: 148 additions & 1 deletion back/api/application/documentation/1.0.0/overrides/application.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"paths": {
"/applications/me": {
"/applications/me/{campaignId}": {
"get": {
"deprecated": false,
"description": "Get applications related to current user",
@@ -55,6 +55,153 @@
"Application"
],
"parameters": [
{
"name": "campaignId",
"in": "path",
"description": "",
"deprecated": false,
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "_limit",
"in": "query",
"required": false,
"description": "Maximum number of results possible",
"schema": {
"type": "integer"
},
"deprecated": false
},
{
"name": "_sort",
"in": "query",
"required": false,
"description": "Sort according to a specific field.",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_start",
"in": "query",
"required": false,
"description": "Skip a specific number of entries (especially useful for pagination)",
"schema": {
"type": "integer"
},
"deprecated": false
},
{
"name": "=",
"in": "query",
"required": false,
"description": "Get entries that matches exactly your input",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_ne",
"in": "query",
"required": false,
"description": "Get records that are not equals to something",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_lt",
"in": "query",
"required": false,
"description": "Get record that are lower than a value",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_lte",
"in": "query",
"required": false,
"description": "Get records that are lower than or equal to a value",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_gt",
"in": "query",
"required": false,
"description": "Get records that are greater than a value",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_gte",
"in": "query",
"required": false,
"description": "Get records that are greater than or equal a value",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_contains",
"in": "query",
"required": false,
"description": "Get records that contains a value",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_containss",
"in": "query",
"required": false,
"description": "Get records that contains (case sensitive) a value",
"schema": {
"type": "string"
},
"deprecated": false
},
{
"name": "_in",
"in": "query",
"required": false,
"description": "Get records that matches any value in the array of values",
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"deprecated": false
},
{
"name": "_nin",
"in": "query",
"required": false,
"description": "Get records that doesn't match any value in the array of values",
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"deprecated": false
}


]
}
11 changes: 9 additions & 2 deletions back/api/application/models/application.settings.json
Original file line number Diff line number Diff line change
@@ -59,8 +59,8 @@
"type": "json"
},
"campaign": {
"model": "campaign",
"via": "applications"
"via": "applications",
"model": "campaign"
},
"company": {
"plugin": "users-permissions",
@@ -70,6 +70,13 @@
"espace": {
"model": "espace",
"via": "applications"
},
"status": {
"type": "enumeration",
"enum": [
"preselected",
"confirmed"
]
}
}
}
13 changes: 13 additions & 0 deletions back/api/campaign/documentation/1.0.0/campaign.json
Original file line number Diff line number Diff line change
@@ -896,6 +896,13 @@
"espace": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"preselected",
"confirmed"
]
},
"published_at": {
"type": "string"
},
@@ -908,6 +915,9 @@
}
}
},
"preselections_max": {
"type": "integer"
},
"published_at": {
"type": "string",
"format": "date-time"
@@ -1003,6 +1013,9 @@
"type": "string"
}
},
"preselections_max": {
"type": "integer"
},
"published_at": {
"type": "string",
"format": "date-time"
3 changes: 3 additions & 0 deletions back/api/campaign/models/campaign.settings.json
Original file line number Diff line number Diff line change
@@ -87,6 +87,9 @@
"applications": {
"via": "campaign",
"collection": "application"
},
"preselections_max": {
"type": "integer"
}
}
}
10 changes: 10 additions & 0 deletions back/api/disponibility/documentation/1.0.0/disponibility.json
Original file line number Diff line number Diff line change
@@ -1023,6 +1023,9 @@
"type": "string"
}
},
"preselections_max": {
"type": "integer"
},
"published_at": {
"type": "string"
},
@@ -1092,6 +1095,13 @@
"espace": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"preselected",
"confirmed"
]
},
"published_at": {
"type": "string"
},
2 changes: 2 additions & 0 deletions back/api/espace/controllers/espace.js
Original file line number Diff line number Diff line change
@@ -22,9 +22,11 @@ const populate = [

module.exports = {
async myPlaces(ctx) {
const {query}=ctx.request;
const { id } = ctx.state.user;
return strapi.query("espace").find(
{
...query,
users_permissions_user: id,
deleted: false,
_sort: "name:asc",
7 changes: 7 additions & 0 deletions back/api/espace/documentation/1.0.0/espace.json
Original file line number Diff line number Diff line change
@@ -1211,6 +1211,13 @@
"espace": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"preselected",
"confirmed"
]
},
"published_at": {
"type": "string"
},
Loading

0 comments on commit b2667b5

Please sign in to comment.