Split isn't calculated properly for the TS endpoints.
The Split is saved in DDB as a String, with the format: {"sean.saifahn.li@gmail.com":0,"tomom1.k.725@gmail.com":1} - essentially a JSON.stringified map.
We should handle this for the TS endpoints.
Specs
Retrieving from store
[x] DDB returns a string map like above, it should be converted to a regular map/dictionary and returned to the FE
[x] The FE will convert it to a string for the input userid-1:0.4,userid-2:0.6 format
[x] Otherwise, the FE will use the regular map/dictionary for calculations
Sending to endpoint
[x] The FE represents the value in the input format above
[x] When sent to the endpoint, it will be converted to a dictionary before being sent
[x] The endpoint will stringify it and store it
One thing I was considering was just sending the string value to the backend. One issue is that the FE needs the map/dictionary anyway for the calculations.
If we think about how it might change in the future, I think this makes sense. The FE can use the map as-is in the future potentially.
Overview
Split isn't calculated properly for the TS endpoints.
The Split is saved in DDB as a String, with the format:
{"sean.saifahn.li@gmail.com":0,"tomom1.k.725@gmail.com":1}
- essentially a JSON.stringified map.We should handle this for the TS endpoints.
Specs
userid-1:0.4,userid-2:0.6
formatOne thing I was considering was just sending the string value to the backend. One issue is that the FE needs the map/dictionary anyway for the calculations.
If we think about how it might change in the future, I think this makes sense. The FE can use the map as-is in the future potentially.