Skip to content
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 doc for API editLog #429

Open
12 of 14 tasks
paulgirard opened this issue Aug 24, 2017 · 0 comments
Open
12 of 14 tasks

add doc for API editLog #429

paulgirard opened this issue Aug 24, 2017 · 0 comments
Assignees
Milestone

Comments

@paulgirard
Copy link
Collaborator

paulgirard commented Aug 24, 2017

/editLog/model
/editLog/model?itemID=idmongo&whoID=id&isariLab=id&isariRole=value&startDate=2017-03-05&endDate=2017-05-08&path=value&accessMonitoring=value&action=value&activityType=value&limit=20&skip=250

API args directly binded to editLog Object :

  • model : 'People', 'Activity' or 'Organization' mandatory
  • itemID : mongo ID
  • whoID : mongo ID
  • startDate : iso format YYYY-MM-DD
  • endDate : iso format YYYY-MM-DD
  • action : 'create', 'delete' or 'update'
  • path : diff.path when action = 'update', data otherwise

API args pointing to isariAuthorizedCenters

  • isariLabID : isariAuthorizedCenters.organization mongoID
  • isariRole : isariAuthorizedCenters.role

accesMonitoring Filter

  • accesMonitoring: Value of accessMonitroing fields from schemas.
    Fecth list of paths from schemas then filter on diff.path or data in editLog objects.

pagination

  • limit
  • skip
  • count : if set this parameter will make the api to return the number of results. It automatically discard skip and limit parameter if it exist

TODO later

  • activityType : type field in Activity objects

data returned

response header might contain a fastforward parameter to warn the client to skip edits which were added to the response in place of filtered out edits

[{
 "who" : {
     id: "mongo id",
     'name': "firstname Name" ,
     'roles': [{
          "lab" : "organization acronym or name",
          "role" : "role"
   }]},
 "date" : "YYYY-MM-DD hh:mm",
 "item" : {
      "id": "mongo id",
      "name" : "name"
 },
 "action" : "update",
 "paths" : [
      {   "path": "fieldname",
          "valueBefore": {**value object ?**},
          "valueAfter": {**value object ?**},
          "accessMonitoring" : "" // should be handled in client as enums ?,
          "editType" : "update" | "delete" | "create"
      }]
}]

Example of one editlog object stored in mongo

See https://github.com/flitbit/diff#differences for diff format.

{
    "_id" : ObjectId("5898399c07f86e00018a614e"),
    "model" : "People",
    "item" : ObjectId("589488a211d0d100381bdf47"),
    "date" : ISODate("2017-02-06T08:53:48.727Z"),
    "action" : "update",
    "who" : "sophie.jacquot",
    "diff" : [ 
        [ 
            {
                "kind" : "E",
                "path" : [ 
                    "latestChangeBy"
                ],
                "lhs" : "IMPORT",
                "rhs" : "sophie.jacquot"
            }
        ], 
        [ 
            {
                "kind" : "E",
                "path" : [ 
                    "academicMemberships", 
                    0, 
                    "organization", 
                    "id", 
                    "11"
                ],
                "lhs" : 153,
                "rhs" : 157
            }
        ], 
        [ 
            {
                "kind" : "D",
                "path" : [ 
                    "academicMemberships", 
                    0, 
                    "endDate"
                ],
                "lhs" : "2013"
            }
        ], 
        [ 
            {
                "kind" : "A",
                "path" : [ 
                    "academicMemberships"
                ],
                "index" : 1,
                "item" : {
                    "kind" : "D",
                    "lhs" : {
                        "organization" : ObjectId("5894889a11d0d100381bcc9d"),
                        "startDate" : "2014",
                        "membershipType" : "membre"
                    }
                }
            }
        ]
    ],
    "__v" : 0
}
@paulgirard paulgirard added this to the Editlog milestone Aug 25, 2017
paulgirard added a commit that referenced this issue Aug 25, 2017
paulgirard added a commit that referenced this issue Aug 28, 2017
paulgirard added a commit that referenced this issue Aug 30, 2017
paulgirard added a commit that referenced this issue Aug 30, 2017
paulgirard added a commit that referenced this issue Aug 30, 2017
@paulgirard paulgirard changed the title API editLog add doc for API editLog Sep 1, 2017
@paulgirard paulgirard self-assigned this Sep 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant