Skip to content

Commit

Permalink
Merge pull request #97 from UoaWDCC/feat/Backend-Schemas
Browse files Browse the repository at this point in the history
Feat/Backend-Schemas
  • Loading branch information
gmat224 authored Jun 19, 2024
2 parents 90aeb68 + c009dc2 commit 860386c
Show file tree
Hide file tree
Showing 25 changed files with 797 additions and 0 deletions.
32 changes: 32 additions & 0 deletions strapi/src/api/answer/content-types/answer/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"kind": "collectionType",
"collectionName": "answers",
"info": {
"singularName": "answer",
"pluralName": "answers",
"displayName": "Answer",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"Answer": {
"type": "text",
"required": true
},
"People_ID": {
"type": "relation",
"relation": "manyToOne",
"target": "api::people.people",
"inversedBy": "Answer_ID"
},
"Question_ID": {
"type": "relation",
"relation": "manyToOne",
"target": "api::question.question",
"inversedBy": "Answer_ID"
}
}
}
9 changes: 9 additions & 0 deletions strapi/src/api/answer/controllers/answer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* answer controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::answer.answer');
9 changes: 9 additions & 0 deletions strapi/src/api/answer/routes/answer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* answer router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::answer.answer');
9 changes: 9 additions & 0 deletions strapi/src/api/answer/services/answer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* answer service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::answer.answer');
74 changes: 74 additions & 0 deletions strapi/src/api/event/content-types/event/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"kind": "collectionType",
"collectionName": "events",
"info": {
"singularName": "event",
"pluralName": "events",
"displayName": "Event",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"Title": {
"type": "string",
"required": true
},
"Description": {
"type": "text",
"required": true
},
"Subtitle": {
"type": "string",
"required": false
},
"Location": {
"type": "string",
"required": true
},
"Location_Link": {
"type": "string"
},
"Event_Date_Start": {
"type": "datetime",
"required": true
},
"Event_Date_End": {
"type": "datetime",
"required": true
},
"Event_Capacity": {
"type": "integer",
"required": true
},
"Is_Live": {
"type": "boolean",
"default": false,
"required": true
},
"Image": {
"type": "media",
"multiple": false,
"required": true,
"allowedTypes": [
"images"
]
},
"Terms_And_Conditions": {
"type": "text",
"required": true
},
"Event_Capacity_Remaining": {
"type": "integer",
"required": true
},
"Ticket_ID": {
"type": "relation",
"relation": "oneToMany",
"target": "api::ticket.ticket",
"mappedBy": "Event_ID"
}
}
}
9 changes: 9 additions & 0 deletions strapi/src/api/event/controllers/event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* event controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::event.event');
9 changes: 9 additions & 0 deletions strapi/src/api/event/routes/event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* event router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::event.event');
9 changes: 9 additions & 0 deletions strapi/src/api/event/services/event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* event service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::event.event');
79 changes: 79 additions & 0 deletions strapi/src/api/people/content-types/people/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"kind": "collectionType",
"collectionName": "peoples",
"info": {
"singularName": "people",
"pluralName": "peoples",
"displayName": "People",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"Name": {
"type": "string",
"required": true
},
"Email": {
"type": "string",
"required": true
},
"University_ID": {
"type": "string",
"required": false
},
"UPI": {
"type": "string",
"required": false
},
"Year_Of_Study": {
"type": "string",
"required": false
},
"Study_Field": {
"type": "string",
"required": false
},
"Is_Member": {
"type": "boolean",
"default": false,
"required": true
},
"Status": {
"type": "enumeration",
"enum": [
"Domestic",
"International"
],
"required": true
},
"Member_Expiry_Date": {
"type": "date",
"required": true
},
"People_Ticket_ID": {
"type": "relation",
"relation": "oneToMany",
"target": "api::user-ticket.user-ticket",
"mappedBy": "People_ID"
},
"Answer_ID": {
"type": "relation",
"relation": "oneToMany",
"target": "api::answer.answer",
"mappedBy": "People_ID"
},
"Institution": {
"type": "enumeration",
"enum": [
"UoA",
"AUT",
"Other",
"None"
],
"required": true
}
}
}
9 changes: 9 additions & 0 deletions strapi/src/api/people/controllers/people.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* people controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::people.people');
9 changes: 9 additions & 0 deletions strapi/src/api/people/routes/people.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* people router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::people.people');
9 changes: 9 additions & 0 deletions strapi/src/api/people/services/people.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* people service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::people.people');
37 changes: 37 additions & 0 deletions strapi/src/api/question/content-types/question/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"kind": "collectionType",
"collectionName": "questions",
"info": {
"singularName": "question",
"pluralName": "questions",
"displayName": "Question",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"Question": {
"type": "string",
"required": true
},
"Check_For_Member_Email": {
"type": "boolean",
"required": true,
"default": false
},
"Ticket_ID": {
"type": "relation",
"relation": "manyToOne",
"target": "api::ticket.ticket",
"inversedBy": "Question_ID"
},
"Answer_ID": {
"type": "relation",
"relation": "oneToMany",
"target": "api::answer.answer",
"mappedBy": "Question_ID"
}
}
}
9 changes: 9 additions & 0 deletions strapi/src/api/question/controllers/question.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* question controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::question.question');
9 changes: 9 additions & 0 deletions strapi/src/api/question/routes/question.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* question router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::question.question');
9 changes: 9 additions & 0 deletions strapi/src/api/question/services/question.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* question service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::question.question');
Loading

0 comments on commit 860386c

Please sign in to comment.