Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Epic/hwsc-app-gateway-svc AddDocument #8

Open
faraonc opened this issue Nov 5, 2018 · 0 comments
Open

Epic/hwsc-app-gateway-svc AddDocument #8

faraonc opened this issue Nov 5, 2018 · 0 comments

Comments

@faraonc
Copy link
Member

faraonc commented Nov 5, 2018

Let us say Chrome wants to add a new document. At this point Chrome has the current User object, and it knows the user's uuid already.

  1. The user fills up the form in the website.
  2. Grabs the fields in the form and make a Document object. image_urls_map, audio_urls_map, video_urls_map, & file_urls_map are not filled up because there is no means of generating duid and fuids in the browser, therefore we have to send lists of urls.
  3. Chrome calls app-gateway-svc's AddDocument() with the following
message AppGatewayRequest{
    hwsc.User user = N; //this is not a complete User object, it may only have uuid
    hwsc.Document doc = N; //this is not a complete Document object, it may only have duid
    repeated string image_urls = N;
    repeated string audio_urls = N;
    repeated string video_urls = N;
    repeated string file_urls = N;
}
  1. app-gateway-svc calls document-svc's CreateDocument() which returns the newly Created Document with a now generated duid and fuids.
  2. app-gateway-svc calls user-svc's GetUser, which returns a full User object A with password as empty string.
  3. app-gateway-svc modifies the User object A, and adds the DUID in the:
map<string, UserDocumentMetadata > user_documents = 7;
  1. app-gateway-svc calls user-svc's UpdateUser, which returns a full User object with password as empty string.
    1. OPTION 1 - app-gateway-svc returns 2 objects (updated User and updated Document) to Chrome
    2. OPTION 2 - app-gateway-svc calls document-svc ListUserDocumentCollection, returns a list of user documents.
  2. Chrome renders page.
@faraonc faraonc changed the title Epic/hwsc-app-gateway-svc Epic/hwsc-app-gateway-svc AddDocument Nov 5, 2018
@kimlisa kimlisa transferred this issue from hwsc-org/hwsc-gateway-svc Dec 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants