all repos — caroster @ 3f36f7140b41721e898b57f036cd828e2c6e29ea

[Octree] Group carpool to your event https://caroster.io

feat: :sparkles: Add 'modules' configuration for instance
Tim Izzo tim@octree.ch
Mon, 29 Jan 2024 14:24:23 +0000
commit

3f36f7140b41721e898b57f036cd828e2c6e29ea

parent

a39140195ebca61d87447a3caac3d6e1ec49104f

M backend/config/permissions.tsbackend/config/permissions.ts

@@ -23,7 +23,11 @@ "plugin::users-permissions.user.find",

"api::vehicle.vehicle.find", ]; -const authenticated = [...publicPerms, "plugin::users-permissions.user.me"]; +const authenticated = [ + ...publicPerms, + "api::module.module.find", + "plugin::users-permissions.user.me", +]; export default { roles: {
A backend/src/api/module/content-types/module/schema.json

@@ -0,0 +1,56 @@

+{ + "kind": "singleType", + "collectionName": "modules", + "info": { + "singularName": "module", + "pluralName": "modules", + "displayName": "Modules", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "attributes": { + "caroster_plus_enabled": { + "pluginOptions": { + "i18n": { + "localized": false + } + }, + "type": "boolean", + "default": false + }, + "caroster_plus_price": { + "pluginOptions": { + "i18n": { + "localized": false + } + }, + "type": "decimal", + "default": 0 + }, + "caroster_plus_name": { + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "type": "string", + "required": true + }, + "caroster_plus_description": { + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "type": "text", + "required": true + } + } +}
A backend/src/api/module/controllers/module.ts

@@ -0,0 +1,7 @@

+/** + * module controller + */ + +import { factories } from '@strapi/strapi' + +export default factories.createCoreController('api::module.module');
A backend/src/api/module/routes/module.ts

@@ -0,0 +1,7 @@

+/** + * module router + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::module.module');
A backend/src/api/module/services/module.ts

@@ -0,0 +1,7 @@

+/** + * module service + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::module.module');
M backend/types/generated/contentTypes.d.tsbackend/types/generated/contentTypes.d.ts

@@ -904,6 +904,74 @@ Attribute.Private;

}; } +export interface ApiModuleModule extends Schema.SingleType { + collectionName: 'modules'; + info: { + singularName: 'module'; + pluralName: 'modules'; + displayName: 'Modules'; + description: ''; + }; + options: { + draftAndPublish: false; + }; + pluginOptions: { + i18n: { + localized: true; + }; + }; + attributes: { + caroster_plus_enabled: Attribute.Boolean & + Attribute.SetPluginOptions<{ + i18n: { + localized: false; + }; + }> & + Attribute.DefaultTo<false>; + caroster_plus_price: Attribute.Decimal & + Attribute.SetPluginOptions<{ + i18n: { + localized: false; + }; + }> & + Attribute.DefaultTo<0>; + caroster_plus_name: Attribute.String & + Attribute.Required & + Attribute.SetPluginOptions<{ + i18n: { + localized: true; + }; + }>; + caroster_plus_description: Attribute.Text & + Attribute.Required & + Attribute.SetPluginOptions<{ + i18n: { + localized: true; + }; + }>; + createdAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'api::module.module', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + updatedBy: Attribute.Relation< + 'api::module.module', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + localizations: Attribute.Relation< + 'api::module.module', + 'oneToMany', + 'api::module.module' + >; + locale: Attribute.String; + }; +} + export interface ApiNotificationNotification extends Schema.CollectionType { collectionName: 'notifications'; info: {

@@ -1220,6 +1288,7 @@ 'plugin::users-permissions.role': PluginUsersPermissionsRole;

'plugin::users-permissions.user': PluginUsersPermissionsUser; 'plugin::email-designer.email-template': PluginEmailDesignerEmailTemplate; 'api::event.event': ApiEventEvent; + 'api::module.module': ApiModuleModule; 'api::notification.notification': ApiNotificationNotification; 'api::page.page': ApiPagePage; 'api::passenger.passenger': ApiPassengerPassenger;