Basic Assignments
 
Options & Settings
 
Main Time Information
Color Code: Pink
Assigned To: JM Developments LLC
Created By: Cory Warden
Created Date/Time: 11/3/2020 2:25 pm
 
Action Status: Completed
Show On The Web: Yes - (public)
Priority: 0
Finished/Done: Yes - 12/15/2020 9:40 am
Finished/Done By: Cory Warden
Budgeted/Estimated Value: 800.00  
Actual/Real Value: 600.00   [donate]
Invoice/Quote Status: Blank (n/a)
General Amount: $0.00
 
Time Id: 1891
Template/Type: Community Funded Projects
Title/Caption: Allow for multiple customer profiles
Start Date: 11/3/2020
End Date: Unknown... (open or blank)
Total Time: Unknown... (open or blank)
Target/Due Date: 11/3/2020
Main Status: Active

Sorry, no photos available for this element of time.


Notes:

12/2/20: As of today, 4.07 hours for JM

11/18/2020: As of today, 2.22 hours for John

11/3/2020: Add another argument: check for dups (yes/no)= in this case no.

Pass in a variable
Will need to cascade
Not a database change. Standard API

1)Put in documentation
2)Pass to method
3)Code to method
4)Check internally

John M or Bryan


Additional Comments/Notes - Subs (1)
Title/Caption Date Time Done By Comment/Note
Add Multiple customer profiles 11/5/2020 3:55 pm Cory Warden

11/5/2020:
Intro: This project deals with an API socket to add and edit customers. We use this socket both internally and externally. Currently there are checks in place to make sure we don't get a duplicate. There are two known checks that it does right now. They are checking for an existing business name match or checking for a first, last name and address combo match. Either way, the method stops an additional customer from being added. We want to keep that as the default, but this project is dealing with adding a bypass so that you could get multiple records if needed. Ex. They want to have Fred Flintstone, web user (customer type) and Fred Flintstone, adult use (another customer type for in store shopping).

1) Start with new documentation.
This deals with API socket documentation. The API socket documentation is all held on data 0 server box and then cascaded to all other servers. This also includes your local environment (get data from data 0). To get to this section of the application, go to classic homepage. Then go to maintenance section. Got to add/edit web api documentation. You will want to do this from the main adilas site. Make sure when you are choosing your corporation, choose adilas.biz site, otherwise you won't have the permissions. https://data0.adilas.biz/top_secret/secure/web_api_documentation_home.cfm 

Once you are here, the two methods in question are 1)addCustomer (id 168) and 2)updateCustomer (id 169) Once you click into this, go down to the section that deals with add new parameter. This will open up a new form for you to add new information to. You will select arguments, the parameter name in all caps will be ALLOW_DUPS, and the default will be no. The description will be: pass in the value no; if you want the duplicate record checks or if you want to skip the checks, pass in the value yes.

This will be required. The data type will be a string/text. All other fields will stay as they are and click add page parameter. Once that is done, you should see the new parameter in the list. If you need to edit feel free to click on it and change anything that is needed.

2) Code the API socket to allow for new argument.
This is actual physical code inside the web page. You will need to change two different files. They are both in the web/webapi folder. The two files are addcustomer.cfm and updatecustomer.cfm. Put a note at the top. You will go down to the section where you create new things to put in a param array. On the addcustomer.cfm page this will be right around line 135. Make sure that the new entry is alphabetic and yours will go in right after the one which is address2 which is line 138. Your parameters will be very similar to the address2 other than it will be from 0 to 10 (0=min, 10=max). We also need to set a default of no. If you need to know which the default is, it's the very last argument. There is a comment at the top of the argument section that talks about what the positions are.

You will need to follow this procedure for the updatecustomer.cfm. The lines will change but the same everything else.

3) Modify the underlying method.
These are going to be physical changes to the cfc's. They are located at top_secret/cfc/assets.cfc. Some of the steps you'll need to do to make these changes are: You'll need to put a modification log at the top of the page.
You will then need to find some of the methods and add the new arguments in alphabetical order. You might want to look for the address2 argument as a handrail. Once again set the default to no. Next you'll need to find where the duplication stops exist in the method. Once you have found these, you'll need to code a new conditional if statement to wrap the current duplication pieces. We basically want to be able to skip those if needed.

4) Search and cascade changes internally.
This assumes that all the code and methods are in place(steps above). We need to make sure that all of our code that calls the methods on any page get updated with the defaults that we need. You will need to do a search for everything that has "addCustomer" and "updateCustomer". Once you find all of the entries (we don't know how many there are) you will need to add a new argument to the method. This is a sample of what you will be adding. <cfinvokeargument name="allowDups" value="no" />

5) Create a new sample for the API's.
This goes back to the step one, documentation. Once everything is ready and good to go, we want to make sure the sample includes the new argument. These end of becoming JSON samples so we can tell people what it needs to look like. You can modify the existing one or generate a new one with the new argument along with the sample.

6) Cascade documentation to all servers.
This requires you to go to all the servers (0-20) and physically pull all the data over from data 0. Make sure first the data is good as it is going to all servers. This will be something to get with Brandon on and he can show you how.

7) Code sign off and deployment.