Work on ad and social

This commit is contained in:
2025-08-07 12:33:27 +02:00
parent 789ab07afb
commit b6d18c2681
25 changed files with 27839 additions and 25 deletions

View File

@@ -0,0 +1,63 @@
{
"kind": "collectionType",
"collectionName": "ads",
"info": {
"singularName": "ad",
"pluralName": "ads",
"displayName": "Ad",
"description": ""
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"category": {
"type": "enumeration",
"enum": [
"hire",
"equipment",
"management",
"sheetmusic",
"local"
]
},
"description": {
"type": "text"
},
"validUntil": {
"type": "date"
},
"author": {
"type": "relation",
"relation": "oneToOne",
"target": "plugin::users-permissions.user"
},
"views": {
"type": "integer"
},
"applies": {
"type": "integer"
},
"location": {
"type": "component",
"repeatable": false,
"component": "address.full-address"
},
"contactname": {
"type": "string"
},
"contactemail": {
"type": "string"
},
"contactphone": {
"type": "string"
},
"featured": {
"type": "boolean"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* ad controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::ad.ad');

7
src/api/ad/routes/ad.ts Normal file
View File

@@ -0,0 +1,7 @@
/**
* ad router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::ad.ad');

View File

@@ -0,0 +1,7 @@
/**
* ad service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::ad.ad');

View File

@@ -0,0 +1,34 @@
{
"kind": "collectionType",
"collectionName": "comments",
"info": {
"singularName": "comment",
"pluralName": "comments",
"displayName": "Comment",
"description": ""
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"content": {
"type": "string"
},
"likes": {
"type": "relation",
"relation": "oneToMany",
"target": "plugin::users-permissions.user"
},
"owner": {
"type": "relation",
"relation": "oneToOne",
"target": "plugin::users-permissions.user"
},
"replies": {
"type": "relation",
"relation": "oneToMany",
"target": "api::comment.comment"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* comment controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::comment.comment');

View File

@@ -0,0 +1,7 @@
/**
* comment router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::comment.comment');

View File

@@ -0,0 +1,7 @@
/**
* comment service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::comment.comment');

View File

@@ -0,0 +1,43 @@
{
"kind": "collectionType",
"collectionName": "groups",
"info": {
"singularName": "group",
"pluralName": "groups",
"displayName": "Group"
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"banner": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": false
},
"users": {
"type": "relation",
"relation": "manyToMany",
"target": "plugin::users-permissions.user",
"inversedBy": "groups"
},
"owner": {
"type": "relation",
"relation": "manyToOne",
"target": "plugin::users-permissions.user",
"inversedBy": "groups"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* group controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::group.group');

View File

@@ -0,0 +1,7 @@
/**
* group router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::group.group');

View File

@@ -0,0 +1,7 @@
/**
* group service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::group.group');

View File

@@ -0,0 +1,57 @@
{
"kind": "collectionType",
"collectionName": "posts",
"info": {
"singularName": "post",
"pluralName": "posts",
"displayName": "Post",
"description": ""
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"content": {
"type": "text"
},
"media": {
"type": "media",
"multiple": true,
"required": false,
"allowedTypes": [
"images",
"files",
"videos",
"audios"
]
},
"author": {
"type": "relation",
"relation": "manyToOne",
"target": "plugin::users-permissions.user",
"inversedBy": "posts"
},
"likes": {
"type": "relation",
"relation": "oneToMany",
"target": "plugin::users-permissions.user"
},
"category": {
"type": "enumeration",
"enum": [
"photo",
"video",
"event"
]
},
"comments": {
"type": "relation",
"relation": "oneToMany",
"target": "api::comment.comment"
},
"shares": {
"type": "integer"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* post controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::post.post');

View File

@@ -0,0 +1,7 @@
/**
* post router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::post.post');

View File

@@ -0,0 +1,7 @@
/**
* post service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::post.post');

View File

@@ -0,0 +1,34 @@
{
"kind": "collectionType",
"collectionName": "reports",
"info": {
"singularName": "report",
"pluralName": "reports",
"displayName": "report",
"description": ""
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"details": {
"type": "text"
},
"reason": {
"type": "enumeration",
"enum": [
"inappropriate",
"fraudulent",
"duplicate",
"expired",
"other"
]
},
"reporter": {
"type": "relation",
"relation": "oneToOne",
"target": "plugin::users-permissions.user"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* report controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::report.report');

View File

@@ -0,0 +1,7 @@
/**
* report router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::report.report');

View File

@@ -0,0 +1,7 @@
/**
* report service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::report.report');

View File

@@ -0,0 +1,35 @@
{
"collectionName": "components_address_full_addresses",
"info": {
"displayName": "FullAddress",
"icon": "pinMap",
"description": ""
},
"options": {},
"attributes": {
"freeaddress": {
"type": "string"
},
"housenumber": {
"type": "string"
},
"road": {
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"postcode": {
"type": "string"
},
"long": {
"type": "decimal"
},
"lat": {
"type": "decimal"
}
}
}

View File

@@ -181,6 +181,23 @@
"relation": "oneToMany",
"target": "api::announcement.announcement",
"mappedBy": "author"
},
"posts": {
"type": "relation",
"relation": "oneToMany",
"target": "api::post.post",
"mappedBy": "author"
},
"groups": {
"type": "relation",
"relation": "oneToMany",
"target": "api::group.group",
"mappedBy": "owner"
},
"friends": {
"type": "relation",
"relation": "oneToMany",
"target": "plugin::users-permissions.user"
}
}
}