Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Add "Attending" functionality to a User Profile #2327

Open
dreadpool2 opened this issue Feb 10, 2018 · 15 comments
Open

Add "Attending" functionality to a User Profile #2327

dreadpool2 opened this issue Feb 10, 2018 · 15 comments

Comments

@dreadpool2
Copy link

Actual Behaviour

The app doesnt collect information about the number of people attending the summit.

Expected Behaviour

The app should let the user post himself as attending the regarded conference.
The information can be posted as it is present in the api https://open-event-api.herokuapp.com/#attendees

Would you like to work on the issue?
Yes

@iamareebjamal Has this issue been already covered ?, if not can I start working on it?

@dreadpool2 dreadpool2 changed the title Add Attendees functionality to a User Profile Add "Attending" functionality to a User Profile Feb 10, 2018
@iamareebjamal
Copy link
Member

Please propose steps about how you will implement this

@dreadpool2
Copy link
Author

@iamareebjamal Like I tend to make two sections in the profile section of the app where , after logging in, it will show the number of already registered attendees and a section where it will allow you to change the status of attending the event or not. All the data can be received using the API.

@iamareebjamal
Copy link
Member

I don't think anyone would be interested in knowing who are all the attendees, and my initial request about proposal of implementation was about the fetching of data from API, saving in db and all. What do you propose about that

@dreadpool2
Copy link
Author

@iamareebjamal Actually I meant only the number of attendees will be shown, not all their names as they are not necessary.
I plan to fetch the data same as it is fetched in the case of speakers, locations , sessions etc.
Is there going to be a conflict if I go with the same way?

@dreadpool2
Copy link
Author

dreadpool2 commented Feb 10, 2018

@iamareebjamal Like the stats shown might convince the user to attend the concerned summit and thats why I want to show that in the user profile.
I further planned by adding attendance attribute to the User object and when the login process will occur I will thus fetch the status of the person's attendance. PATCH requests will be send again if the person change his mind. The userUpdate PATCH request is to be used for changes.

@iamareebjamal
Copy link
Member

If the API does not have attendance attribute, then it has no significance to add in the app. Also, did you check the permissions required to get the attendee information from API.

Is there going to be a conflict if I go with the same way?

The question is not about conflict but about does a contributor knows what he has to do, i.e, fetch data, whether or not to store in the database, handling authentication and about the roles required in the API.

@dreadpool2
Copy link
Author

dreadpool2 commented Feb 11, 2018

@iamareebjamal As far I have planned I thought of receiving the data from the API and then storing it in the RealmDataRepository and then fetching it from there and showing it in the app. But as authentication is coming into picture, things get complex as I realized I am mixing two different things, one is the Attendees part of the API and other is the Users part. Like I cant directly update a variable of a User object. So that initital thought of attendance variable cant be done. I realized this after your comment 😅

So, what I propose is that first after the user is logged in with his email id and password, the Attendees data will be fetched by the API and stored in db. The number of attendees will be shown. Now, if the person changes his status to attending, then a search query in the results of the already loaded Attendees in the db will be done. If no same email matches as that is unique, then a POST request will be sent which will thus register him as attending. If a same email id is present then a PATCH request will be sent which will update his status of attending.
I havent yet checked the permissions required and will be straight away doing them. Am I heading in the right direction ?

@iamareebjamal
Copy link
Member

Hmm, loading all attendees in order of magnitudes of 1000s, sometimes millions and saving them in db just to show count seems unnecessary. Secondly, then you are suggesting to operate on that data to find a unique email or something, also unnecessary. The reason to this is that you just need to send PATCH request toggling the status no matter if you are attending or not. But attendee logic is not a boolean at all, an attendee is attendee if it has bought a ticket (or got a free ticket), so there is no boolean field for attending or not AFAIK. The ticket handling is too broad a job for the app and cannot be handled now.

And yes this was the reason of me intriguing you to check about permissions, because then you would have wasted that time in solving an issue which couldn't be completed

@dreadpool2
Copy link
Author

dreadpool2 commented Feb 11, 2018

@iamareebjamal Pardon me but where do I find in the API about special permissions required ? Just found out that an authorization key was required to post the data. Is that a blocked permission?

@dreadpool2
Copy link
Author

@iamareebjamal No permissions are required to fetch the data.
I have a doubt which is not based with the app. Like can we introduce a count attribute in the Attendee part of the API?

@iamareebjamal
Copy link
Member

That is related to JSONAPI spec

@dreadpool2
Copy link
Author

@iamareebjamal As you said that the amount of information will be quite high as to load all attendees, I want to change my proposal.
In the API there is provision of getting details of a single attendee and that is possible if the attendee who has bought the ticket knows his id. So if the user (who has already bought the ticket) has logged in and entered his id, it will show him as attending and if no result returns upon him attending the summit, he will be shown as not attending. So, like I want to bring a change in the Login window as well. There email, name and attendee id(if the user has one) can be entered.

@iamareebjamal
Copy link
Member

I don't think the user will ever be aware of attendee ID at all, it is a system internal ID and is not tied to one user. A user can have thousand attendee ID if thousand tickets are bought on his account

@dreadpool2
Copy link
Author

@iamareebjamal I have tried all possibilities and it seems that it's either going to be tough to implement the huge data or unnecessary. Do you have any suggestions to implement any kind of attending functionality? or should I just close the issue ?

@iamareebjamal
Copy link
Member

I think if there is a possibility to just mark that you are attending, that is enough. If not, then please close the issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants