Giter Club home page Giter Club logo

conference-server's People

Contributors

aldomx avatar basultobdks avatar javiermijangosksquare avatar mishelashala avatar pinkusksquare avatar robertocervera avatar victorburgosk avatar

Watchers

 avatar

Forkers

abrahamep

conference-server's Issues

Fix: Edition of booking doesnt work when both start time and end time doesn't change

Case 1 the bug happens:
1- having a booking and wanting to edit it.
2- Edit the end time.
3- the server returns a 204 but the database is not updated
badRes

this happens when the new time of the meeting collides with the time in the database, if you try to edit without changing the time this error happens too.

Case 2 the bug doesn't happens:
1- having a booking from 3:00 pm to 4:00 pm and wanting to edit it.
2- Edit the start time to 4 pm to 5 pm.
3- the server returns a 200 and the database is updated.
goodRes

Room status is incorrect

Consider this:
when compute room status the following date 2019-01-11T10:26:50-06:00 is considered as 2019-01-11T16:26:50, so the room status can be incorrect

add filters

add filters when get booking, consider:

  • start date, gte & lte
  • end date, gte & lte
  • room id, eq

Request

GET api/v2/booking?start[gte]=2019-03-07T12:00:00Z&end[lte]=2019-03-11T00:00:00Z&roomId[eq]=1

Returns all the bookings between 2019-03-07T12:00:00 - 2019-03-11 in the room 1

Add pagination

add pagination to URI /api/v2/booking

Request: /api/v2/booking?page=1&pageSize=2

Response:

{
    "_pagination": {
        "size": 2
        "prev": null,
        "next": 2
    },
    "bookings": []
}

Constrains:

  • page must be a positive number
  • pageSize must be a positive number

Fix: server timezone

Change the time zone of the server to match the time of México City (GMT-06:00).

Schedule Meeting

Scenario 1: The user provides the following data:

  1. future date
  2. start date (during working hours)
  3. end date (during working hours)
  4. Conference room registered and available
  5. People involved (emails)
  6. A reason for the appointment

System response: Show the scheduled meeting details


Scenario 2: The user provides the following data:

  1. future date
  2. start date (during working hours)
  3. end date (during working hours)
  4. Conference room registered and available
  5. No emails provided
  6. No reason provided

System response: Show error messaging detailing what data is wrong and why

Add: Request Validation middleware

Implement a middleware to validate the data at the request level so that we can eliminate the data validation in controllers which does not currently follow the SRP.

Add: localStorage wrapper

Instead of having repeated logic and validations all over the place add a storageService

Instead of this:

if (localStorage.getItem('cb_jwt') && localStorage.getItem('cb_user')) {
  const user = JSON.parse(localStorage.getItem('cb_user'));
  const jwt = JSON.parse(localStorage.getItem('cb_jwt'));
  this.setState({ user, jwt });
}

Favor this:

const item = storage.getAuthToken();
if (item) {
  // ...
}

Add room and user info

Request

POST api/v2/booking

Response

{
    "_pagination": {
        "size": 10,
        "prev": null,
        "next": null
    },
    "bookings": [
        {
            "id": 1,
            "description": "This is a booking",
            "start": "2019-03-28T18:24:00.000Z",
            "end": "2019-03-28T18:25:00.000Z",
            "user_id": 1,
            "room_id": 1,
            "event_id": "fhlffd8j6ts4erqp6fi316fB3B",
            "updated_at": "2019-03-20T14:42:58.000Z",
            "created_at": "2019-03-20T14:42:58.000Z",
            "attendees": [
                "[email protected]"
            ],
            "room": {
                "id": 1,
                "name": "Conference 1",
                "color": "Red",
                "presence": false,
                "created_at": "2019-03-19T21:08:56.000Z",
                "updated_at": "2019-03-19T21:08:56.000Z"
            },
            "user": {
                "id": 1,
                "picture": ,
                "name": "Admin",
                "email": "[email protected]"
            }
        }
    ]
}

Define a architecture to rewrite code

At the beginning of the project didn't follow the best practices, so the code is a little bit messy, define a strategy to refactor/rewrite the code

Fix: Handling intersection of hours in bookings

Case A:
1.- There is a booking in room 1 that goes from 10 am to 11 am.
2.- There is a request to create a booking that goes from 9 am to 10:15 am.
3.- Backedn should response that the hours are colliding.

Case B:
1.- There is a booking in room 1 that goes from 10 am to 11 am.
2.- There is a request to create a booking that goes from 9 am to 13 pm.
3.- Backedn should response that the hours are colliding.

Case C:
1.- There is a booking in room 1 that goes from 10 am to 11 am.
2.- There is a request to create a booking that goes from 10:15 am to 10:30 pm.
3.- Backedn should response that the hours are colliding.

Case D:
1.- There is a booking in room 1 that goes from 10 am to 11 am.
2.- There is a request to create a booking that goes from 10:30 am to 13 pm.
3.- Backedn should response that the hours are colliding.

Enhancement: room interfaces

Actually the frontend is not consuming the room API, brecause the admin site is not ready yet.

The interfaces use is little confusing, because the front is sending th room info in the camelCase style, so the maybe the mappers are not necessary at all in that case. The backend is sending as response a room in dto format, maybe is not necessary also.

Maybe a little check will be good!

Schedule Meeting using the calendar

Scenario 1: The user provides the following data dragging the mouse:

  1. future date

  2. start date (during working hours)

The user provides the following data typing in their corresponding fields

  1. end date (during working hours)

  2. Conference room registered and available

  3. People involved (emails)

  4. A reason for the appointment

System response: Show the scheduled meeting details

update readme

We must keep the README file up to date. Please add the missing info

Remove: frontend dockerfile

The frontend and the backend now are in different repositories. The docker-compose try to build the frontend which not exists, so its necessary to remove the frontend.dockerfile and update the docker-compose

add asocciations in query

GET api/v2/booking must support associations

Request

GET api/v2/booking?include=["Room","User"]

Response

{
    "_pagination": {
        "size": 10,
        "prev": null,
        "next": null
    },
    "bookings": [
        {
            "id": 1,
            "description": "This is a booking",
            "start": "2019-03-26T16:24:00.000Z",
            "end": "2019-03-26T16:25:00.000Z",
            "room_id": 2,
            "user_id": 43,
            "created_at": "2019-03-11T14:28:49.000Z",
            "updated_at": "2019-03-11T14:28:49.000Z",
            "room": {
                "id": 2,
                "name": "Conference 2",
                "color": "Red"
            },
            "user": {
                "id": 43,
                "name": "Admin",
                "email": "[email protected]"
            },
            "attendees": [
                "[email protected]"
            ]
        }
    ]
}

Improve Slack appointment slash command

In slack is possible to add a text at the right of the command as we are working with console commands. Ej.

/booking this is a text

The proposal is to use the channel and user information that slack provides for improve the way the user add new attendees, for example:

/booking @DanielB @Javier Mijangos

Using this format and enabling the Escape channels, users, and links sent to your app option in slack app's admin can allow to "translate" channel or user mentions into their correlated IDs; so the command above will send a text with the following text content:

/booking <@U012ABCDEF> <@U016PBFDES>

Having the user id's, we can do some request to the Slackl Web API for get info about that specific user's, particularly the email first part (daniel.basulto in [email protected]) and automatize the attendees adding and and build a simpler new appointment dialog.

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.