Skip to content

Commit

Permalink
Basis for applications place listing
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucieo committed Feb 21, 2024
1 parent 179c5df commit 9df0dc0
Show file tree
Hide file tree
Showing 22 changed files with 395 additions and 251 deletions.
5 changes: 3 additions & 2 deletions back/api/application/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
module.exports = {
async myApplications(ctx) {
const { id, type } = ctx.state.user;
const query = type === "place" ? { place: id } : { company: id };
const query = type === "place" ? { 'disponibility.espace.users_permissions_user.id':id} : { company: id };
const populate = type==="place"? ['disponibility.espace','company']:['disponibility.espace', 'place','disponibility.espace.users_permissions_user']

return strapi
.query("application")
Expand All @@ -17,7 +18,7 @@ module.exports = {
...query,
_sort: "disponibility.start:desc",
},
['disponibility.espace', 'place']
populate
)
.then((res) => {
return Promise.all(
Expand Down
172 changes: 83 additions & 89 deletions back/api/application/documentation/1.0.0/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@
}
}
},
"place": {
"company": {
"required": [
"id",
"email",
Expand Down Expand Up @@ -1018,147 +1018,141 @@
}
}
},
"company": {
"espace": {
"required": [
"id",
"email",
"username",
"firstname",
"lastname",
"structureName",
"name",
"surface",
"roomLength",
"width",
"height",
"mirror",
"danceBar",
"accomodation",
"technicalStaff",
"floor",
"address",
"zipCode",
"city",
"country",
"siret",
"ape",
"phone",
"license",
"type"
"latitude"
],
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"provider": {
"name": {
"type": "string"
},
"password": {
"type": "string"
"surface": {
"type": "number"
},
"resetPasswordToken": {
"type": "string"
"roomLength": {
"type": "number"
},
"confirmationToken": {
"type": "string"
"width": {
"type": "number"
},
"role": {
"type": "string"
"height": {
"type": "number"
},
"username": {
"type": "string"
"mirror": {
"type": "boolean"
},
"confirmed": {
"danceBar": {
"type": "boolean"
},
"blocked": {
"accomodation": {
"type": "boolean"
},
"accepted": {
"technicalStaff": {
"type": "boolean"
},
"firstname": {
"type": "string"
"floor": {
"type": "string",
"enum": [
"plancherDanse",
"parquetTraditionnel",
"other",
"todefine"
]
},
"lastname": {
"otherFloor": {
"type": "string"
},
"structureName": {
"about": {
"type": "string"
},
"socialReason": {
"details": {
"type": "string"
},
"address": {
"type": "string"
},
"zipCode": {
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"siret": {
"type": "string"
},
"ape": {
"type": "string"
},
"phone": {
"type": "string"
},
"license": {
"type": "string"
"files": {
"type": "array",
"items": {
"type": "string"
}
},
"website": {
"type": "string"
"images": {
"type": "array",
"items": {
"type": "string"
}
},
"legalRepresentative": {
"users_permissions_user": {
"type": "string"
},
"statusRepresentative": {
"type": "string"
"disponibilities": {
"type": "array",
"items": {
"type": "string"
}
},
"insuranceNumber": {
"scheduleDetails": {
"type": "string"
},
"insuranceName": {
"filledUntil": {
"type": "string"
},
"choreographer": {
"type": "string"
"published": {
"type": "boolean"
},
"espaces": {
"bookings": {
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"country": {
"type": "string"
},
"external_id": {
"type": "integer"
},
"danceCarpet": {
"type": "string",
"enum": [
"company",
"place"
"true",
"false",
"possible"
]
},
"external_id": {
"type": "integer"
"slug": {
"type": "string"
},
"companyDispositifs": {
"type": "array",
"items": {
"type": "string"
}
"city": {
"type": "string"
},
"placeDispositifs": {
"type": "array",
"items": {
"type": "string"
}
"latitude": {
"type": "number"
},
"campaigns": {
"type": "array",
"items": {
"type": "string"
}
"longitude": {
"type": "number"
},
"companyApplications": {
"deleted": {
"type": "boolean"
},
"applications": {
"type": "array",
"items": {
"type": "string"
Expand Down Expand Up @@ -1216,10 +1210,10 @@
"campaign": {
"type": "string"
},
"place": {
"company": {
"type": "string"
},
"company": {
"espace": {
"type": "string"
},
"published_at": {
Expand Down
8 changes: 4 additions & 4 deletions back/api/application/models/application.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@
"model": "campaign",
"via": "applications"
},
"place": {
"plugin": "users-permissions",
"model": "user"
},
"company": {
"plugin": "users-permissions",
"model": "user",
"via": "companyApplications"
},
"espace": {
"model": "espace",
"via": "applications"
}
}
}
6 changes: 6 additions & 0 deletions back/api/booking/documentation/1.0.0/booking.json
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,12 @@
"deleted": {
"type": "boolean"
},
"applications": {
"type": "array",
"items": {
"type": "string"
}
},
"created_by": {
"type": "string"
},
Expand Down
4 changes: 2 additions & 2 deletions back/api/campaign/documentation/1.0.0/campaign.json
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,10 @@
"campaign": {
"type": "string"
},
"place": {
"company": {
"type": "string"
},
"company": {
"espace": {
"type": "string"
},
"published_at": {
Expand Down
6 changes: 6 additions & 0 deletions back/api/city/documentation/1.0.0/city.json
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@
"deleted": {
"type": "boolean"
},
"applications": {
"type": "array",
"items": {
"type": "string"
}
},
"created_by": {
"type": "string"
},
Expand Down
10 changes: 8 additions & 2 deletions back/api/disponibility/documentation/1.0.0/disponibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,12 @@
"deleted": {
"type": "boolean"
},
"applications": {
"type": "array",
"items": {
"type": "string"
}
},
"created_by": {
"type": "string"
},
Expand Down Expand Up @@ -1080,10 +1086,10 @@
"campaign": {
"type": "string"
},
"place": {
"company": {
"type": "string"
},
"company": {
"espace": {
"type": "string"
},
"published_at": {
Expand Down
Loading

0 comments on commit 9df0dc0

Please sign in to comment.