Skip to content

Feature/add unique users counter#11

Open
ptjuanramos wants to merge 3 commits intothe-urlist:masterfrom
ptjuanramos:feature/Add-Unique-Users-Counter
Open

Feature/add unique users counter#11
ptjuanramos wants to merge 3 commits intothe-urlist:masterfrom
ptjuanramos:feature/Add-Unique-Users-Counter

Conversation

@ptjuanramos
Copy link
Contributor

Proposal description

Simple way of getting the unique views of a link bundle.
After a request is made to GetLinks endpoint, the new implemention gets the user IP address and in order to safely store the IP address in the new collection property, the IP goes through a RFC 2898 hash function, which uses the LinkBundle id as his salt.

If the user IP wasn't added before, the new implementon increments the number of unique views, described by the new uniqueViews property.

{
   "id": "ee5af123-4384-46bb-a837-54eef2158828",
   "userId": "",
   "vanityUrl": "postman-test",
   "description": "",
   "links": [
   ],
+    "uniqueViews": 1,
+    "hashedIps": [
+       "CugZGyXRtR5Th5BOHCg0NkLyIQxqK+cs"
+    ]
}

… to HashedIp hashset. If the ip didn't already exist, increment the property UniqueViews that is going to be persisted as a document.
@ptjuanramos ptjuanramos closed this Jun 7, 2021
@ptjuanramos ptjuanramos reopened this Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant