-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Add cht-datasource APIs for creation and update of contacts and reports #9835
Comments
I like the direction we are going with this design! Couple of thoughts here:
Validation rulesOne of the most valuable things these new APIs can provide is consistent enforcement of some rules. The tricky part is going to be making the rules strict enough to be useful, but lax enough to not break everything. I think we can probably follow the pattern from our read APIs where we only enforce the rules necessary for basic functionality in All persons/places/reports
|
Agreed to all. Thanks @jkuester . I'll update the description accordingly. |
Before anyone actually starts working on this issue, @sugat009, I do think it would be helpful to capture the precise API function signatures and TSDoc here in the issue for the new code that we want to add to cht-datasource (similar to what I tried to do in #9586). You are probably a better judge of it than me 😅 , but I felt like that helped streamline the development process by clarifying as much as possible up front. You have already got a great start going in the above description, but the precise types/docs will be helpful too! |
Description
We have an internal package called
cht-datasource
inshared-libs/cht-datasource
used to query and fetchcontacts
(person
orplace
) andreports
from the database. There are APIs for fetching the list ofcontacts
andreports
UUIDs and fetching the detail of thecontacts
andreports
using that UUID. We need to add APIs to create and updatecontacts
andreports
. DocumentationGoals
Expected Outcome
The library should be able to be used in the following ways.
For Create:
For Create:
For Create:
Only the required fields have been listed out. A valid
type
for the contact can be found in the database in thesettings
doc under thecontact_types
key, whereasreported_date
should be of format 'YYYY-MM-DDTHH:mm:ssZ', 'YYYY-MM-DDTHH:mm:ss.SSSZ', or<unix epoch>
.The text was updated successfully, but these errors were encountered: