Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Konnect syncing fails for certain user types #736

Open
ansal opened this issue Sep 29, 2017 · 4 comments
Open

Konnect syncing fails for certain user types #736

ansal opened this issue Sep 29, 2017 · 4 comments
Assignees

Comments

@ansal
Copy link
Collaborator

ansal commented Sep 29, 2017

When the sync data contains user (respondent) types of GO, HM and EO, the sync fails. Sample data -

{"stories":[{"synced":0,"sysid":"","group_id":18,"image":"","respondent_type":"GO","created_at":1505988827423,"school_id":1919,"_id":1,"lat":0,"user_id":1825,"lng":0,"answers":[{"text":"Yes","question_id":144,"created_at":1503906234111,"_id":41,"story_id":1},{"text":"Yes","question_id":138,"created_at":1503906234111,"_id":42,"story_id":1},{"text":"Yes","question_id":147,"created_at":1503906234111,"_id":43,"story_id":1},{"text":"Yes","question_id":270,"created_at":1503906234111,"_id":44,"story_id":1},{"text":"Yes","question_id":145,"created_at":1503906234111,"_id":45,"story_id":1},{"text":"Yes","question_id":143,"created_at":1503906234111,"_id":46,"story_id":1},{"text":"Yes","question_id":269,"created_at":1503906234111,"_id":47,"story_id":1},{"text":"Yes","question_id":148,"created_at":1503906234111,"_id":48,"story_id":1},{"text":"Yes","question_id":150,"created_at":1503906234111,"_id":49,"story_id":1},{"text":"Yes","question_id":149,"created_at":1503906234111,"_id":50,"story_id":1},{"text":"Yes","question_id":143,"created_at":1505988827423,"_id":51,"story_id":1},{"text":"Yes","question_id":269,"created_at":1505988827423,"_id":52,"story_id":1},{"text":"Yes","question_id":270,"created_at":1505988827423,"_id":53,"story_id":1},{"text":"Yes","question_id":149,"created_at":1505988827423,"_id":54,"story_id":1},{"text":"Yes","question_id":145,"created_at":1505988827423,"_id":55,"story_id":1},{"text":"Yes","question_id":148,"created_at":1505988827423,"_id":56,"story_id":1},{"text":"Yes","question_id":147,"created_at":1505988827423,"_id":57,"story_id":1},{"text":"Yes","question_id":138,"created_at":1505988827423,"_id":58,"story_id":1},{"text":"Yes","question_id":150,"created_at":1505988827423,"_id":59,"story_id":1},{"text":"Yes","question_id":144,"created_at":1505988827423,"_id":60,"story_id":1}]}]}

@prajdataspect
Copy link
Collaborator

Which api is this? Can you give the link?

@prajdataspect
Copy link
Collaborator

It'll be good to have the link /curl to test the API. However, the types GO, HM, EO are not there in the usertype table. That must be the issue.
dubdubdub=> select * from stories_usertype;
id | name
----+------
1 | AS
2 | PR
3 | TR
4 | VR
5 | CM
6 | SM
7 | EY
8 | LL
9 | ER
14 | CH
(10 rows)

@ansal
Copy link
Collaborator Author

ansal commented Oct 4, 2017

@prajdataspect https://www.getpostman.com/collections/486f337b22b5d7333f51 contains all the Konnect API end points.

However, the types GO, HM, EO are not there in the usertype table. That must be the issue.

Can you please write a management script that creates these user types?

@prajdataspect
Copy link
Collaborator

insert into stories_usertype values (10, 'GO');
insert into stories_usertype values (11, 'HM');
insert into stories_usertype values (12, 'EO');

Did the above in dev and the test case worked successfully. Here you go:

id | user_id | school_id | group_id | is_verified | name | email | date | telephone | entered_timestamp | comments | sysid | created_at | date_of_visit | updated_at | user_type_id | location
--------+---------+-----------+----------+-------------+---------+------------------------------------+------+------------+-------------------------------+----------+-------+-------------------------------+------------------------+-------------------------------+--------------+----------------------------------------------------
420993 | 7159 | 1919 | 18 | t | Ansal S | [email protected] | | 9900247365 | 2017-10-06 10:31:41.88949+00 | | | 2017-10-06 10:31:41.889407+00 | 2017-09-21 10:13:47+00 | 2017-10-06 10:31:41.909324+00 | 10 | 0101000020E610000000000000000000000000000000000000

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

No branches or pull requests

2 participants