PowerlineApp / powerline-mobile

Other
4 stars 16 forks source link

Update activity.isInNotificationZone() business logic to correspond specification #130

Closed petervojtek closed 8 years ago

petervojtek commented 8 years ago

As described here:

petervojtek commented 8 years ago

@jterps08 , in order to add priority zone detection for items below, I need t be able to somehow create them for testing purposes.

I am able to login to https://dev.powerli.ne/#/login as JTest1, however I would rather use my login Peter10 (which is unable to login there).

However I am also not sure what is the current status of https://dev.powerli.ne/#/login at all, some functionality seems to be broken there, e.g. it does not seem to be possible to start a petition (unable to write text into text fields) -- I guess that is what Marcin is supposed to work on..

jterps08 commented 8 years ago

Yes, @petervojtek - this is what Marcin is supposed to be working on and it is supposed to be complete. This is why it may make sense for you to spend a 2 or 3 days looking at the web app. I myself have not been able to test the creation of polls, fundraisers, etc. because we don't have this functionality built in the web app (the old API had it located at admin.powerli.ne, but the old API is the old API). That being said, it may be possible to utilize APIgee.com for something like this. Or we will have to coordinate tests with @austinpapp so that we can test 1) creation of items, 2) reception of push notification alerts, and 3) sorting of newsfeed....

jterps08 commented 8 years ago

Austin - can we utilize Apigee to do this? I'll need help with some examples as I haven't had this experience before (but gladly am looking forward to doing it)... Perhaps we can leverage these examples to include them in the api-doc too...

austinpapp commented 8 years ago

@jterps08 yup. any method to call the endpoints will work.

we can always start to build out https://github.com/PowerlineApp/powerline-testsuite which was used to hit the endpoints in some expected workflow. we'll chat offline.

jterps08 commented 8 years ago

@austinpapp where do we stand on this? Should we get Igor's help? Do you and I need to touch base on this? What's the next step?

austinpapp commented 8 years ago

@petervojtek if you join group id 308, i've just created an event. i'll create a few more things and let's see if we can get the priority sorted out. let me know if the event is returning correctly.

petervojtek commented 8 years ago

@austinpapp , I do not receive the event activity for group 308. When I create User post in the group 308, it is returned properly via GET https://api-dev.powerli.ne/api/v2/activities, however there does not seem to be any other activity item (event) for group 308:

user Peter2:

Request URL:https://api-dev.powerli.ne/api/v2/activities?page=1
Request Method:GET
Status Code:200 OK

{"page":1,"items":20,"payload":[{"id":448,"title":"","description":"test group 308","sent_at":"Sat, 23 Jul 2016 10:16:18 +0000","expire_at":"Sun, 24 Jul 2016 10:16:18 +0000","responses_count":0,"owner":{"id":65,"type":"user","official_title":"","first_name":"Peter2","last_name":"Peter2","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/576ba723a3058.jpeg"},"entity":{"type":"micro-petition:quorum","id":221,"group_id":308},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-23T10:16:18+0000","metadata":null,"quorum":0},{"id":447,"title":"","description":"give us more #pokemons","sent_at":"Fri, 22 Jul 2016 09:04:13 +0000","expire_at":"Sat, 23 Jul 2016 09:04:12 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:quorum","id":220,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-22T09:04:13+0000","metadata":null,"quorum":1},{"id":443,"title":"Test 1","description":"Test 2","sent_at":"Mon, 18 Jul 2016 17:12:28 +0000","expire_at":"Tue, 19 Jul 2016 17:12:28 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:long-petition","id":216,"group_id":296},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-18T17:12:28+0000","metadata":null,"quorum":0},{"id":441,"title":"","description":"Welcome to Peter10Group3","sent_at":"Sat, 16 Jul 2016 11:42:59 +0000","expire_at":"Sun, 17 Jul 2016 11:42:59 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:quorum","id":214,"group_id":296},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-16T11:42:59+0000","metadata":null,"quorum":0},{"id":419,"title":"","description":"test url in Post: trying https:\/\/sme.sk","sent_at":"Wed, 13 Jul 2016 13:16:35 +0000","expire_at":"Thu, 14 Jul 2016 13:16:33 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:quorum","id":192,"group_id":293},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-13T13:16:35+0000","metadata":{"title":"SME.sk | Naj\u010d\u00edtanej\u0161ie spr\u00e1vy na Slovensku","description":"R\u00fdchle a d\u00f4veryhodn\u00e9 spr\u00e1vy zo Slovenska, sveta i V\u00e1\u0161ho regi\u00f3nu. Prihl\u00e1senie do Post.sk.","image":null},"quorum":0},{"id":416,"title":"","description":"hello here","sent_at":"Tue, 12 Jul 2016 07:28:32 +0000","expire_at":"Wed, 13 Jul 2016 07:28:32 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:quorum","id":189,"group_id":290},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-12T07:28:32+0000","metadata":null,"quorum":0},{"id":402,"title":"","description":"Micropetition to work 20 hours a week only.","sent_at":"Fri, 01 Jul 2016 06:51:52 +0000","expire_at":"Sat, 02 Jul 2016 06:51:52 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:quorum","id":178,"group_id":6},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-01T06:51:52+0000","metadata":null,"quorum":1},{"id":401,"title":"Petition to save coal power plants","description":"Whatever","sent_at":"Fri, 01 Jul 2016 06:42:22 +0000","expire_at":"Sat, 02 Jul 2016 06:42:22 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:long-petition","id":177,"group_id":6},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-01T06:42:22+0000","metadata":null,"quorum":1},{"id":398,"title":"","description":"test 44","sent_at":"Thu, 30 Jun 2016 08:15:03 +0000","expire_at":"Fri, 01 Jul 2016 08:15:03 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:quorum","id":174,"group_id":1},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-06-30T08:15:03+0000","metadata":null,"quorum":6},{"id":396,"title":"","description":"test follow & ignore","sent_at":"Thu, 30 Jun 2016 08:07:49 +0000","expire_at":"Fri, 01 Jul 2016 08:07:49 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:quorum","id":172,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-06-30T08:07:49+0000","metadata":null,"quorum":0},{"id":391,"title":"","description":"Peter10's Post to USA group","sent_at":"Wed, 29 Jun 2016 14:35:45 +0000","expire_at":"Thu, 30 Jun 2016 14:35:45 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"micro-petition:quorum","id":170,"group_id":1},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-06-29T14:35:45+0000","metadata":null,"quorum":6}],"totalItems":11}
austinpapp commented 8 years ago

quick update here. i had created a few events and petitions for group 308. however, the issue is this logic is buried in the admin portal (a site we had that a group leader would log into and actually create the question content) which would not only publish the leader question but also update the activities table with that activity. so there were multiple things happening in the background that we just haven't built yet into our leader question endpoints.

with that said, i'm going to have to try and reverse engineer what was happening and see if i can just add something to activities table manually and properly formatted of course. this is my current focus. i'll update with more details when i think we have something useful. sorry for the delay on this.

jterps08 commented 8 years ago

Any update here? Would like to try to get this fixed before Wednesday's test build

petervojtek commented 8 years ago

ok, I will try this approach https://github.com/PowerlineApp/powerline-server/issues/255 to create the remaining leader content types

petervojtek commented 8 years ago

@igaponov , I try to create leader content data, e.g. Poll, however I miss an user which has the privileges to do that, i.e.:

Request URL:https://api-dev.powerli.ne/api/v2/groups/285/polls
Request Method:POST
Status Code:403 Forbidden

{"subject":"test Poll no1 subject","title":"test Poll no1 title","started_at":"2016-08-21'+0200'09:52:33","finished_at":"2016-08-29'+0200'09:52:33","petition_title":"Petition title","petition_body":"Petition body","type":"event"}
Name

[{"message":"You do not have the necessary permissions","class":"Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"\/srv\/civix\/vendor\/friendsofsymfony\/rest-bundle\/FOS\/RestBundle\/EventListener\/AccessDeniedListener.php","line":70,"args":[]},{"namespace":"FOS\\RestBundle\\EventListener","short_class":"AccessDeniedListener","class":"FOS\\RestBundle\\EventListener\\AccessDeniedListener","type":"->","function":"onKernelException","file":null,"line":null,"args":[["object","Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent"]]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func","file":"\/srv\/civix\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Debug\/TraceableEventDispatcher.php","line":458,"args":[["array",[["object","FOS\\RestBundle\\EventListener\\AccessDeniedListener"],["string","onKernelException"]]],["object","Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent"]]},{"namespace":"Symfony\\Component\\HttpKernel\\Debug","short_class":"TraceableEventDispatcher","class":"Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher","type":"->","function":"Symfony\\Component\\HttpKernel\\Debug\\{closure}","file":null,"line":null,"args":[["object","Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent"]]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func","file":"\/srv\/shm\/powerline\/cache\/dev\/classes.php","line":2987,"args":[["object","Closure"],["object","Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent"]]},{"namespace":"Symfony\\Component\\EventDispatcher","short_class":"EventDispatcher","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","function":"doDispatch","file":"\/srv\/shm\/powerline\/cache\/dev\/classes.php","line":2920,"args":[["array",[["object","Closure"],["object","Closure"],["object","Closure"],["object","Closure"]]],["string","kernel.exception"],["object","Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent"]]},{"namespace":"Symfony\\Component\\EventDispatcher","short_class":"EventDispatcher","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","function":"dispatch","file":"\/srv\/shm\/powerline\/cache\/dev\/classes.php","line":3084,"args":[["string","kernel.exception"],["object","Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent"]]},{"namespace":"Symfony\\Component\\EventDispatcher","short_class":"ContainerAwareEventDispatcher","class":"Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher","type":"->","function":"dispatch","file":"\/srv\/civix\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Debug\/TraceableEventDispatcher.php","line":139,"args":[["string","kernel.exception"],["object","Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent"]]},{"namespace":"Symfony\\Component\\HttpKernel\\Debug","short_class":"TraceableEventDispatcher","class":"Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher","type":"->","function":"dispatch","file":"\/srv\/civix\/app\/bootstrap.php.cache","line":2918,"args":[["string","kernel.exception"],["object","Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handleException","file":"\/srv\/civix\/app\/bootstrap.php.cache","line":2871,"args":[["object","Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException"],["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handle","file":"\/srv\/civix\/app\/bootstrap.php.cache","line":2995,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel\\DependencyInjection","short_class":"ContainerAwareHttpKernel","class":"Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel","type":"->","function":"handle","file":"\/srv\/civix\/app\/bootstrap.php.cache","line":2275,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"Kernel","class":"Symfony\\Component\\HttpKernel\\Kernel","type":"->","function":"handle","file":"\/srv\/civix\/web\/app.php","line":16,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"]]}]},{"message":"You are not allowed to access this resource..","class":"Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"\/srv\/civix\/src\/Civix\/ApiBundle\/EventListener\/SecureParamListener.php","line":89,"args":[]},{"namespace":"Civix\\ApiBundle\\EventListener","short_class":"SecureParamListener","class":"Civix\\ApiBundle\\EventListener\\SecureParamListener","type":"->","function":"checkPermission","file":"\/srv\/civix\/src\/Civix\/ApiBundle\/EventListener\/SecureParamListener.php","line":63,"args":[["object","Civix\\CoreBundle\\Entity\\Group"],["string","manage"]]},{"namespace":"Civix\\ApiBundle\\EventListener","short_class":"SecureParamListener","class":"Civix\\ApiBundle\\EventListener\\SecureParamListener","type":"->","function":"onKernelController","file":null,"line":null,"args":[["object","Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent"]]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func","file":"\/srv\/civix\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Debug\/TraceableEventDispatcher.php","line":458,"args":[["array",[["object","Civix\\ApiBundle\\EventListener\\SecureParamListener"],["string","onKernelController"]]],["object","Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent"]]},{"namespace":"Symfony\\Component\\HttpKernel\\Debug","short_class":"TraceableEventDispatcher","class":"Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher","type":"->","function":"Symfony\\Component\\HttpKernel\\Debug\\{closure}","file":null,"line":null,"args":[["object","Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent"]]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func","file":"\/srv\/shm\/powerline\/cache\/dev\/classes.php","line":2987,"args":[["object","Closure"],["object","Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent"]]},{"namespace":"Symfony\\Component\\EventDispatcher","short_class":"EventDispatcher","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","function":"doDispatch","file":"\/srv\/shm\/powerline\/cache\/dev\/classes.php","line":2920,"args":[["array",[["object","Closure"],["object","Closure"],["object","Closure"],["object","Closure"],["object","Closure"],["object","Closure"],["object","Closure"],["object","Closure"]]],["string","kernel.controller"],["object","Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent"]]},{"namespace":"Symfony\\Component\\EventDispatcher","short_class":"EventDispatcher","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","function":"dispatch","file":"\/srv\/shm\/powerline\/cache\/dev\/classes.php","line":3084,"args":[["string","kernel.controller"],["object","Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent"]]},{"namespace":"Symfony\\Component\\EventDispatcher","short_class":"ContainerAwareEventDispatcher","class":"Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher","type":"->","function":"dispatch","file":"\/srv\/civix\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Debug\/TraceableEventDispatcher.php","line":139,"args":[["string","kernel.controller"],["object","Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent"]]},{"namespace":"Symfony\\Component\\HttpKernel\\Debug","short_class":"TraceableEventDispatcher","class":"Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher","type":"->","function":"dispatch","file":"\/srv\/civix\/app\/bootstrap.php.cache","line":2889,"args":[["string","kernel.controller"],["object","Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handleRaw","file":"\/srv\/civix\/app\/bootstrap.php.cache","line":2866,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handle","file":"\/srv\/civix\/app\/bootstrap.php.cache","line":2995,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel\\DependencyInjection","short_class":"ContainerAwareHttpKernel","class":"Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel","type":"->","function":"handle","file":"\/srv\/civix\/app\/bootstrap.php.cache","line":2275,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"Kernel","class":"Symfony\\Component\\HttpKernel\\Kernel","type":"->","function":"handle","file":"\/srv\/civix\/web\/app.php","line":16,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"]]}]}]

Cal you please assign such privileges to e.g. user Peter10 (ID=73) ?

jterps08 commented 8 years ago

Argh, this is a zombie issue - it just will not die!

igaponov commented 8 years ago

@petervojtek I've added you to this group as an owner. Check docs for this endpoint please, event does't have petition_title and petition_body attributes.

petervojtek commented 8 years ago

@igaponov , thanks for reply.

Now I create the poll successfully:

Request URL:https://api-dev.powerli.ne/api/v2/groups/285/polls
Request Method:POST
Status Code:200 OK

request data:
{"subject":"test Poll no1 subject","title":"test Poll no1 title","started_at":"2016-08-21 09:52:33","finished_at":"2016-08-29 09:52:33","type":"event"}

response:
{"answer_entity":null,"share_picture":{},"id":194,"subject":"test Poll no1 subject","options":[],"educational_context":[],"created_at":"Tue, 23 Aug 2016 05:34:32 +0000","expire_at":null,"published_at":null,"is_answered":false,"answers_count":null,"recipients":null,"cached_hash_tags":[],"group":null,"title":"test Poll no1 title","is_allow_outsiders":false,"started_at":"Sun, 21 Aug 2016 09:52:33","finished_at":"Mon, 29 Aug 2016 09:52:33","user":{"id":285,"type":"group","group_type":3,"avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_group.png","official_title":"San Diego","group":{"id":6,"type":"group","group_type":2,"avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_group.png","official_title":"California","group":{"id":1,"type":"group","group_type":1,"avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_group.png","official_title":"The United States of America","group":null}}}}

But I am not sure what am I supposed to do to make the poll appear in GET /v2/activities.

I only guess that maybe I need to call PATCH /api/v2/polls/{id} to publish the poll. But when I try I end up with this:

Request URL:https://api-dev.powerli.ne/api/v2/polls/194
Request Method:PATCH
Status Code:400 Bad Request

request:
{"options":[{"id":1,"value":"optionA","payment_amount":10,"is_user_amount":true},{"id":1,"value":"optionB","payment_amount":10,"is_user_amount":true}]}

response:
{"code":400,"message":"Validation Failed","errors":{"children":{"options":{"errors":["You must specify at least two options"]}}}}

Actually I really don't know what am I doing when calling the API above as no one explained me how to use the leader content API in meaningful use cases, but my overall goal here is:

  1. to somehow create each kind of leader content
  2. receive each content type instance via GET /v2/activities
  3. make sure it is properly rendered in mobile app
igaponov commented 8 years ago

@petervojtek you should add at least two options to your question before publish: POST /api/v2/polls/{id}/options

petervojtek commented 8 years ago

thanks @igaponov . I successfully called POST /api/v2/polls/{id}/options and created two options, however then when I call publish (via PATCH), I face this access control header issue:

XMLHttpRequest cannot load https://api-dev.powerli.ne/api/v2/polls/194. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8101' is therefore not allowed access. The response had HTTP status code 500.

Request URL:https://api-dev.powerli.ne/api/v2/polls/194
Request Method:PATCH
Status Code:500 Internal Server Error
jterps08 commented 8 years ago

@petervojtek - Background information on use cases for leader content.

Fundraiser User Case If I am the leader of a group, Save the Whales, and I want to create a fundraiser. I will log into web app (when we have web app), create fundraiser description with different answer choice options ($10, $25, etc.) and descriptions ("sticker", "t-shirt", custom, etc.). I may choose to send this fundraiser to a subgroup 'division' or send it to all group members. I may attach a video or picture or extra text as 'educational context'. I may allow an answer choice to be "custom" so that the user can set his own amount (e.g. $14) via frontend when making donation. I may choose to make this fundraiser a 'crowdfunder'. If 'crowdfunder', then I choose a goal amount (e.g. $10,000) and a deadline (e.g. November 1, 2016) -- if crowdfunder, user will only be charged if total pledges meet or exceed the goal amount by the deadline. If no goal amount/deadline present, then direct fundraiser payment is made immediately when user selects option and confirms. I can create many different answer choices as part of the fundraiser.

I will save the fundraiser/crowdfunder. And, when I am ready, I will publish it. I should not be able to publish a fundraiser unless I have stored Save the Whales bank information first (via Stripe.js on web app). When I publish the fundraiser, all group members should instantly receive a push notification alert. The user's group counter and All counter should increase by 1. The item appears in the user's priority zone until a) the user donates, b) the user taps the ignore answer choice (comes with every fundraiser), or c) the fundraiser expires. When a group member opens the fundraiser, s/he will select an answer choice (e.g. T-Shirt for $25, Enter your own amount! for Custom). If user already has credit card information stored with Stripe, the frontend will show the Confirm Dialog box (if the user selected "custom" answer choice, the Confirm Dialog box also shows entry field for the amount the user wants to pay) and a Pay button. Pay button triggers the Stripe payment. If user does not have credit card information stored with Stripe, the frontend will show a Credit Card entry form and pre-populate it with the information it has in the user's profile before proceeding to Confirm Dialog box.... Once user pays (answers the fundraiser), the item is no longer priority zone. The counters decrease by 1. The item appears in non-priority zone as answered content.

Payment information via frontend must be handled by Stripe.js. At no time should Powerline store any credit card information, but it may be saved via encrypted Stripe.js connection on Stripe's payment system.

(I will update use cases for polls, events, discussions, and announcements later)

petervojtek commented 8 years ago

@igaponov , now the Poll (ID=194) is published, however I cannot see it in activity newsfeed. the poll was created by user Peter10 (ID=73) in group San Diego (ID=285).

Details:

this is how I know the poll is published:

Request URL:https://api-dev.powerli.ne/api/v2/polls/194
Request Method:PATCH
Status Code:400 Bad Request

{"code":400,"message":"Validation Failed","errors":{"children":[],"errors":["Poll is already published"]}}

And I expect the poll to appear here, but it is not present:

Request URL:https://api-dev.powerli.ne/api/v2/activities?page=1
Request Method:GET
Status Code:200 OK

{"page":1,"items":20,"payload":[{"zone":"prioritized","id":520,"title":"","description":"Test post create 1","description_html":"Test post create 1","sent_at":"Wed, 24 Aug 2016 14:35:52 +0000","expire_at":null,"responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"post","id":240,"group_id":6},"picture":null,"read":true,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T14:35:52+0000","petition":null,"post":{"is_subscribed":false},"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":0,"answers":[],"quorum":1},{"zone":"prioritized","id":518,"title":"Resurrect gold fever","description":"x","description_html":"x","sent_at":"Wed, 24 Aug 2016 13:44:01 +0000","expire_at":null,"responses_count":1,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":242,"group_id":6},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T13:44:01+0000","petition":{"is_subscribed":false},"post":null,"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":1,"answers":[],"quorum":1},{"zone":"prioritized","id":517,"title":"We need more water for our fancy swimming pools","description":":)","description_html":":)","sent_at":"Wed, 24 Aug 2016 13:41:55 +0000","expire_at":null,"responses_count":2,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":241,"group_id":6},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T13:41:55+0000","petition":{"is_subscribed":false},"post":null,"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":1,"answers":[],"quorum":1},{"zone":"prioritized","id":515,"title":"ha","description":"ha2","description_html":"ha2","sent_at":"Wed, 24 Aug 2016 13:36:58 +0000","expire_at":null,"responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":239,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T13:36:58+0000","petition":{"is_subscribed":false},"post":null,"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":1,"answers":[],"quorum":1},{"zone":"prioritized","id":514,"title":"ha","description":"ha2","description_html":"ha2","sent_at":"Wed, 24 Aug 2016 13:36:35 +0000","expire_at":null,"responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":238,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T13:36:35+0000","petition":{"is_subscribed":false},"post":null,"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":1,"answers":[],"quorum":1},{"zone":"prioritized","id":512,"title":"Desalinate pacific ocean","description":"test rename 2","description_html":"test rename 2","sent_at":"Wed, 24 Aug 2016 12:28:16 +0000","expire_at":null,"responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T12:28:16+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"prioritized","id":504,"title":"Desalinate pacific ocean","description":"test.","description_html":"test.","sent_at":"Wed, 24 Aug 2016 05:58:46 +0000","expire_at":null,"responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":true,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T05:58:46+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":501,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 08:09:20 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":true,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T08:09:20+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":500,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 08:08:45 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T08:08:45+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":499,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 07:47:48 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T07:47:48+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":498,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 07:47:27 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T07:47:27+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":497,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 07:47:16 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T07:47:16+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":488,"title":"Test sign ensign button here","description":"yes..","description_html":"","sent_at":"Thu, 04 Aug 2016 13:29:35 +0000","expire_at":"Fri, 05 Aug 2016 13:16:24 +0000","responses_count":2,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":235,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-04T13:29:35+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":487,"title":"Test sign ensign button here","description":"yes..","description_html":"","sent_at":"Thu, 04 Aug 2016 13:27:52 +0000","expire_at":"Fri, 05 Aug 2016 13:16:24 +0000","responses_count":2,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":235,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-04T13:27:52+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":486,"title":"Test sign ensign button here","description":"yes..","description_html":"","sent_at":"Thu, 04 Aug 2016 13:16:24 +0000","expire_at":"Fri, 05 Aug 2016 13:16:24 +0000","responses_count":2,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":235,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-04T13:16:24+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":481,"title":"sdf","description":"sdfsdf","description_html":"","sent_at":"Wed, 03 Aug 2016 07:34:10 +0000","expire_at":"Thu, 04 Aug 2016 07:34:10 +0000","responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":233,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-03T07:34:10+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":480,"title":"sdf","description":"sdfsdf","description_html":"","sent_at":"Wed, 03 Aug 2016 07:33:15 +0000","expire_at":"Thu, 04 Aug 2016 07:33:15 +0000","responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":232,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-03T07:33:15+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":478,"title":"","description":"test 45","description_html":"","sent_at":"Wed, 03 Aug 2016 07:30:51 +0000","expire_at":"Thu, 04 Aug 2016 07:30:51 +0000","responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"post","id":230,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-03T07:30:51+0000","petition":null,"post":{"is_subscribed":false},"metadata":null,"comments_count":0,"answers":[],"quorum":1}],"totalItems":18}
igaponov commented 8 years ago

@petervojtek there is no activity for this poll in db because of previous error. You should publish another poll to test activities.

petervojtek commented 8 years ago

@igaponov , I succesfully created another poll (ID=195), successfully added answers to it, but then when I try to publish it I experience the same problem I reported above:

XMLHttpRequest cannot load https://api-dev.powerli.ne/api/v2/polls/195. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8101' is therefore not allowed access. The response had HTTP status code 500.

Request URL:https://api-dev.powerli.ne/api/v2/polls/195
Request Method:PATCH
Status Code:500 Internal Server Error

but what is interesting, when I call it again, I receive this message:

Request URL:https://api-dev.powerli.ne/api/v2/polls/195
Request Method:PATCH
Status Code:400 Bad Request

{"code":400,"message":"Validation Failed","errors":{"children":[],"errors":["Poll is already published"]}}

However even after than the GET v2/activities does not seem to serve the poll. Here are (two pages) of the activities newsfeed, as far as I can see it is not there:

{"page":1,"items":20,"payload":[{"zone":"prioritized","id":520,"title":"","description":"Test post create 1","description_html":"Test post create 1","sent_at":"Wed, 24 Aug 2016 14:35:52 +0000","expire_at":null,"responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"post","id":240,"group_id":6},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T14:35:52+0000","petition":null,"post":{"is_subscribed":false},"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":0,"answers":[],"quorum":1},{"zone":"prioritized","id":518,"title":"Resurrect gold fever","description":"x","description_html":"x","sent_at":"Wed, 24 Aug 2016 13:44:01 +0000","expire_at":null,"responses_count":1,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":242,"group_id":6},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T13:44:01+0000","petition":{"is_subscribed":false},"post":null,"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":1,"answers":[],"quorum":1},{"zone":"prioritized","id":515,"title":"ha","description":"ha2","description_html":"ha2","sent_at":"Wed, 24 Aug 2016 13:36:58 +0000","expire_at":null,"responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":239,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T13:36:58+0000","petition":{"is_subscribed":false},"post":null,"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":1,"answers":[],"quorum":1},{"zone":"prioritized","id":514,"title":"ha","description":"ha2","description_html":"ha2","sent_at":"Wed, 24 Aug 2016 13:36:35 +0000","expire_at":null,"responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":238,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T13:36:35+0000","petition":{"is_subscribed":false},"post":null,"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":1,"answers":[],"quorum":1},{"zone":"prioritized","id":512,"title":"Desalinate pacific ocean","description":"test rename 2","description_html":"test rename 2","sent_at":"Wed, 24 Aug 2016 12:28:16 +0000","expire_at":null,"responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T12:28:16+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"prioritized","id":504,"title":"Desalinate pacific ocean","description":"test.","description_html":"test.","sent_at":"Wed, 24 Aug 2016 05:58:46 +0000","expire_at":null,"responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T05:58:46+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"non_prioritized","id":517,"title":"We need more water for our fancy swimming pools","description":":)","description_html":":)","sent_at":"Wed, 24 Aug 2016 13:41:55 +0000","expire_at":null,"responses_count":2,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":241,"group_id":6},"picture":null,"read":true,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-24T13:41:55+0000","petition":{"is_subscribed":false},"post":null,"metadata":{"title":null,"description":null,"image":null,"url":null},"comments_count":1,"answers":[{"option_id":1,"id":19,"created_at":"2016-08-24T17:43:50+0000"}],"quorum":1},{"zone":"expired","id":501,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 08:09:20 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T08:09:20+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":500,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 08:08:45 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T08:08:45+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":499,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 07:47:48 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T07:47:48+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":498,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 07:47:27 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T07:47:27+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":497,"title":"Desalinate pacific ocean","description":"test.","description_html":"","sent_at":"Fri, 05 Aug 2016 07:47:16 +0000","expire_at":"Sat, 06 Aug 2016 07:47:16 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":237,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-05T07:47:16+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":488,"title":"Test sign ensign button here","description":"yes..","description_html":"","sent_at":"Thu, 04 Aug 2016 13:29:35 +0000","expire_at":"Fri, 05 Aug 2016 13:16:24 +0000","responses_count":2,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":235,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-04T13:29:35+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[{"option_id":1,"id":7,"created_at":"2016-08-04T13:27:52+0000"}],"quorum":1},{"zone":"expired","id":487,"title":"Test sign ensign button here","description":"yes..","description_html":"","sent_at":"Thu, 04 Aug 2016 13:27:52 +0000","expire_at":"Fri, 05 Aug 2016 13:16:24 +0000","responses_count":2,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":235,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-04T13:27:52+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[{"option_id":1,"id":7,"created_at":"2016-08-04T13:27:52+0000"}],"quorum":1},{"zone":"expired","id":486,"title":"Test sign ensign button here","description":"yes..","description_html":"","sent_at":"Thu, 04 Aug 2016 13:16:24 +0000","expire_at":"Fri, 05 Aug 2016 13:16:24 +0000","responses_count":2,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":235,"group_id":285},"picture":null,"read":true,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-04T13:16:24+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[{"option_id":1,"id":7,"created_at":"2016-08-04T13:27:52+0000"}],"quorum":1},{"zone":"expired","id":481,"title":"sdf","description":"sdfsdf","description_html":"","sent_at":"Wed, 03 Aug 2016 07:34:10 +0000","expire_at":"Thu, 04 Aug 2016 07:34:10 +0000","responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":233,"group_id":285},"picture":null,"read":true,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-03T07:34:10+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":480,"title":"sdf","description":"sdfsdf","description_html":"","sent_at":"Wed, 03 Aug 2016 07:33:15 +0000","expire_at":"Thu, 04 Aug 2016 07:33:15 +0000","responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"user-petition","id":232,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-03T07:33:15+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":478,"title":"","description":"test 45","description_html":"","sent_at":"Wed, 03 Aug 2016 07:30:51 +0000","expire_at":"Thu, 04 Aug 2016 07:30:51 +0000","responses_count":0,"owner":{"id":77,"type":"user","official_title":"","first_name":"Peter21","last_name":"Peter21","avatar_file_path":"https:\/\/api-dev.powerli.ne\/bundles\/civixfront\/img\/default_user.png"},"entity":{"type":"post","id":230,"group_id":285},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-08-03T07:30:51+0000","petition":null,"post":{"is_subscribed":false},"metadata":null,"comments_count":0,"answers":[],"quorum":1},{"zone":"expired","id":476,"title":"Sign the no 5","description":"Sign the no 5","description_html":"","sent_at":"Sun, 31 Jul 2016 17:24:31 +0000","expire_at":"Mon, 01 Aug 2016 17:22:04 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":228,"group_id":309},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-31T17:24:31+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":0},{"zone":"expired","id":475,"title":"Sign the no 5","description":"Sign the no 5","description_html":"","sent_at":"Sun, 31 Jul 2016 17:22:04 +0000","expire_at":"Mon, 01 Aug 2016 17:22:04 +0000","responses_count":1,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"user-petition","id":228,"group_id":309},"picture":null,"read":false,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-31T17:22:04+0000","petition":{"is_subscribed":false},"post":null,"metadata":null,"comments_count":0,"answers":[],"quorum":0}],"totalItems":29}

{"page":2,"items":20,"payload":[{"zone":"expired","id":459,"title":"","description":"trying www.google.com link thumbnail","description_html":"","sent_at":"Wed, 27 Jul 2016 07:02:53 +0000","expire_at":"Thu, 28 Jul 2016 07:02:53 +0000","responses_count":0,"owner":{"id":73,"type":"user","official_title":"","first_name":"Peter10","last_name":"Peter10","avatar_file_path":"http:\/\/devpowerline.s3-website-eu-west-1.amazonaws.com\/avatars\/577cb68e6f276.jpeg"},"entity":{"type":"post","id":227,"group_id":296},"picture":null,"read":true,"rate_up":null,"rate_down":null,"image_src":null,"updated_at":"2016-07-27T07:02:53+0000","petition":null,"post":{"is_subscribed":false},"metadata":{"title":"Google","description":"Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.","image":null,"url":null},"comments_count":0,"answers":[],"quorum":0}],"totalItems":29}
igaponov commented 8 years ago

that change is not deployed yet.

austinpapp commented 8 years ago

https://github.com/PowerlineApp/powerline-server/pull/257 should have been released. if not, @igaponov can you log into TC, build dev on develop and deploy dev?

igaponov commented 8 years ago

deployed

petervojtek commented 8 years ago

ok, now the poll is successfully published, thanks.

I rather close this already too large issue and split it into several smaller issues.

@jterps08, I am not sure which are actually the principal data types which can arrive from backend (so that I don't miss any content when breaking this issue into smaller ones).

Current I am aware of following top-level* data types:

After then there I heard of these top-level data types, please confirm/add other top-level data types:

top-level data type is for me the string which is can appear in atrribute type in activity newsfeed item.

jterps08 commented 8 years ago

@petervojtek Unread leader-petition are priority zone by default. They cannot be boosted. They look the same as a user-petition. User-petitions are unboosted (non-priority zone). Only the author's followers in the group will receive a push notification alert when they are created in the group. If boosted, the user-petition is in the priority-zone until read by the user (and push notification alert sent to all group members). Fundraisers/crowdfunders are actually polls of type payment request. Once read, a leader-petition becomes non-priority zone.