Code Monkey home page Code Monkey logo

eventhandler-api's Introduction

Hi there ๐Ÿ‘‹

Github Contributions

eventhandler-api's People

Contributors

dependabot[bot] avatar larsverp avatar rubenfricke avatar

Watchers

 avatar

eventhandler-api's Issues

New scope for admins

A new scope has te be made for admins.
Everything a Rockstar can right now, has to be an admin.

Rockstars can subscribe to different events.

Get one user

For editing a user, you have to be able to return the data form ONE user

Updating event categories error

Event update is not working when updating categories

"message": "SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"id\" does not exist\nLINE 1: ...ed_at\", \"created_at\") values ($1, $2, $3, $4) returning \"id\"\n                                                                   ^ (SQL: insert into \"cat__eves\" (\"event_id\", \"category_id\", \"updated_at\", \"created_at\") values (fe96c915-e4d6-4991-b498-45259ee99f57, 82ab4964-69aa-4a81-b72d-9e0797d5316a, 2020-05-14 13:40:06, 2020-05-14 13:40:06) returning \"id\")",
    "exception": "Illuminate\\Database\\QueryException",
    "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php",
    "line": 669,

Every endpoint gives an error message

Got the /api/users/login endpoint working, but now every other endpoint gives an error. I think it has something to do with middleware(['auth:api', 'scope:rockstar,partner,guest']);

re-sub for a ticket

Whenever the ticket is closed, you have to be able to sign up again for an event.

Loading events is too slow

When events are get it takes almost 3 seconds to load (!!)
This is probably because of the slow outgoing speed of heroku. The postcode API has to be modified..

When updating event oopsie!

"{\n "message": "SQLSTATE[22008]: Datetime field overflow: 7 ERROR: date/time field value out of range: \"30-05-2020 08:30:00\"\nHINT: Perhaps you need a different \"datestyle\" setting. (SQL: update \"events\" set \"title\" = How I hacked NASA with CSS!!!, \"begin_date\" = 30-05-2020 08:30:00, \"end_date\" = 30-05-2020 11:30:00, \"thumbnail\" = https://images.unsplash.com/photo-1588615419957-bf66d53c6b49?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1267&q=80, \"notification\" = 0, \"updated_at\" = 2020-05-25 13:13:42 where \"id\" = 046b4f2a-428a-4f3b-bd7d-b890a2633e70)",\n "exception": "Illuminate\\Database\\QueryException",\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php",\n "line": 669,\n "trace": [\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php",\n "line": 629,\n "function": "runQueryCallback",\n "class": "Illuminate\\Database\\Connection",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php",\n "line": 495,\n "function": "run",\n "class": "Illuminate\\Database\\Connection",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php",\n "line": 428,\n "function": "affectingStatement",\n "class": "Illuminate\\Database\\Connection",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php",\n "line": 2736,\n "function": "update",\n "class": "Illuminate\\Database\\Connection",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php",\n "line": 792,\n "function": "update",\n "class": "Illuminate\\Database\\Query\\Builder",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",\n "line": 771,\n "function": "update",\n "class": "Illuminate\\Database\\Eloquent\\Builder",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",\n "line": 686,\n "function": "performUpdate",\n "class": "Illuminate\\Database\\Eloquent\\Model",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",\n "line": 631,\n "function": "save",\n "class": "Illuminate\\Database\\Eloquent\\Model",\n "type": "->"\n },\n {\n "file": "/app/app/Http/Controllers/EventsController.php",\n "line": 110,\n "function": "update",\n "class": "Illuminate\\Database\\Eloquent\\Model",\n "type": "->"\n },\n {\n "function": "update",\n "class": "App\\Http\\Controllers\\EventsController",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",\n "line": 54,\n "function": "call_user_func_array"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",\n "line": 45,\n "function": "callAction",\n "class": "Illuminate\\Routing\\Controller",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php",\n "line": 225,\n "function": "dispatch",\n "class": "Illuminate\\Routing\\ControllerDispatcher",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php",\n "line": 182,\n "function": "runController",\n "class": "Illuminate\\Routing\\Route",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php",\n "line": 681,\n "function": "run",\n "class": "Illuminate\\Routing\\Route",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 128,\n "function": "Illuminate\\Routing\\{closure}",\n "class": "Illuminate\\Routing\\Router",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/passport/src/Http/Middleware/CheckForAnyScope.php",\n "line": 28,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Laravel\\Passport\\Http\\Middleware\\CheckForAnyScope",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",\n "line": 41,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",\n "line": 59,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php",\n "line": 44,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Illuminate\\Auth\\Middleware\\Authenticate",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 103,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php",\n "line": 683,\n "function": "then",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php",\n "line": 658,\n "function": "runRouteWithinStack",\n "class": "Illuminate\\Routing\\Router",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php",\n "line": 624,\n "function": "runRoute",\n "class": "Illuminate\\Routing\\Router",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php",\n "line": 613,\n "function": "dispatchToRoute",\n "class": "Illuminate\\Routing\\Router",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",\n "line": 165,\n "function": "dispatch",\n "class": "Illuminate\\Routing\\Router",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 128,\n "function": "Illuminate\\Foundation\\Http\\{closure}",\n "class": "Illuminate\\Foundation\\Http\\Kernel",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",\n "line": 21,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",\n "line": 21,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",\n "line": 27,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",\n "line": 63,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",\n "type": "->"\n },\n {\n "file": "/app/vendor/fruitcake/laravel-cors/src/HandleCors.php",\n "line": 36,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Fruitcake\\Cors\\HandleCors",\n "type": "->"\n },\n {\n "file": "/app/vendor/fideloper/proxy/src/TrustProxies.php",\n "line": 57,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 167,\n "function": "handle",\n "class": "Fideloper\\Proxy\\TrustProxies",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",\n "line": 103,\n "function": "Illuminate\\Pipeline\\{closure}",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",\n "line": 140,\n "function": "then",\n "class": "Illuminate\\Pipeline\\Pipeline",\n "type": "->"\n },\n {\n "file": "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",\n "line": 109,\n "function": "sendRequestThroughRouter",\n "class": "Illuminate\\Foundation\\Http\\Kernel",\n "type": "->"\n },\n {\n "file": "/app/public/index.php",\n "line": 55,\n "function": "handle",\n "class": "Illuminate\\Foundation\\Http\\Kernel",\n "type": "->"\n }\n ]\n}"

Adding API key for applications

Adding another key that is required to get the user tokes is more secure. This way we will have full control over who used the API

Admins should be able to re-host previous events

There should be an endpoint to "copy" an event. Admins will check if all values are still accurate and will select a new date. After the event is saved, all users that left a positive review (3+ stars) or no review will be notified about this event via email.

Create the point system

Every user starts with 0 points for everything

Event:

  • Cat & Speaker: +1

Review:

  • Cat & Speaker:
    • 1-star -3
    • 2-star -2
    • 3-star +1
    • 4-star +2
    • 5-star +3

Tinder:

  • Cat & Speaker:
    • Right-swipe +5
    • Left-swipe -5

EventController date formatting

EventController gives back the same date field as the user sends in. This is not right, it should format the date and time to a timestamp before returning to the user. Otherwise the API can't guarantee to send the same date format each time.

$ValidateAttributes = request()->validate([
'title' => 'required|max:191|string|unique:events,title',
'description' => 'required|string',
'date' => 'required|date|after_or_equal:today',
'thumbnail' => 'required|max:191|active_url',
'seats' => 'required|integer|min:0',
'postal_code' => 'required|postal_code:NL,BE,DE',
'hnum' => 'required|max:191|string',
'notification' => 'required|boolean'
]);
Events::create($ValidateAttributes);
return response($ValidateAttributes, 201);

All migrations need to be linked

All migrations need to be linked so record will be deleted when de main record is deleted.
Example:

Categories user_id <-- User user_id
(Category points will be deleted when user is deleted)

This is a MUST

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.