serveit-ca / curastreamPlugin

Curastream
https://www.curastream.com
0 stars 0 forks source link

Refractor Body Parts, Sports & Occupations and How it Happened #60

Closed serveit-ca closed 5 years ago

serveit-ca commented 5 years ago

This ticket reference #51 and is part of the overall solution.

The goal of this ticket is to ensure that Body Parts, Sports & Occupations and How it Happened are all working off of ID's and arrays of ID's rather than arrays of Strings. This will ensure that a infinate number of programs are resolved.

The following steps will need to be completed

serveit-ca commented 5 years ago

@serveit-ca you need to talk to the developers on this one.

SideonDeaka commented 5 years ago

@serveit-ca Am I ok to continue on this?

SideonDeaka commented 5 years ago

Plugin Management - Refractor Body Parts, Sports & Occupations and How it Happened

SideonDeaka commented 5 years ago

@serveit-ca I have made a pull request for this, once the code is live, you will need to call the following code to rebuild the data into the structure we need it. Things WILL be broken until these lines of code have been run.

$database->updateNulls(); $programs->updateProgram(NULL, NULL, NULL, NULL, NULL, NULL, NULL, "No Body Part Assigned", NULL, NULL, NULL, NULL, NULL, 179); $database->fixProgramBodyParts(); $database->fixProgramSportsOcc(); $database->fixProgramHowItHappened();

SideonDeaka commented 5 years ago

https://github.com/serveit-ca/curastreamPlugin/pull/71

serveit-ca commented 5 years ago

@SideonDeaka Based on what I am reading here it appears I should be able to update the code on production and run the code in your comment above. The thing we will need to wait for this one on is the app to able to get the body parts, before we push this live or else the app will break.

serveit-ca commented 5 years ago

hey @SideonDeaka, We want to update the API Endpoint to give the string of body parts, occupations, how it happened, etc to still pass the string values rather than the ID's. This means we do not need to update the app but rather we can simply call a PHp function to grab the Names rather than ID's when the JSON endpoint is being built.

The current Endpoint is being constructed in the file Users/nathantymos/Documents/curaDev/curastream/wp-content/themes/medigroup-child/functions.php: 216: 'curastream', '/view_program_details/', 219: 'callback' => 'view_program_details', 1025: function view_program_details($request)

I would recommend that we delete this endpoint from living hear. Its an awful programming practice and instead we move it over to be part of the Curastream plugin.

We can then call the functions to convert the ID's to strings. We also want to ensure we are passing clean data. For example, Ankle, Hand, Arm rather than Ankle , Hand, arm, etc.

serveit-ca commented 5 years ago

Once we have this good to go, please let me know which functions I need to run on production to make things happen.

serveit-ca commented 5 years ago

Ensure that the new endpoint, after refactoring is identical to the current endpoint located at curastream.serveit.work/doc

SideonDeaka commented 5 years ago

This end point has been moved to the plugin. We will need to do cleanup on the theme repo at some point, I am now working towards getting the memberpress web hooks working with this endpoint.

SideonDeaka commented 5 years ago

I believe this is done and all that is left is ensuring the security of the endpoints #76