-
Notifications
You must be signed in to change notification settings - Fork 22
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
Session ID - A ID to track execution between use cases #57
Comments
How would this be used since the auditTrail info is attached to an use case? From where could we get this data from? Wouldn't this make more sense for rest and graphql glues? |
Having a code sample on how to use (not the implementation) the session ID would be a great start. |
I imagine some changes that start inside this library, but that can expand to the entire ecosystem, mainly when it comes to passing the session ID, but for now, I imagine something internal to the application cycle itself (when a use case calls another use case). Since we don't officially have a feature to explicitly use a use case as a step, I imagined creating a new parameter, not mandatory in the use case request. We can also discuss passing this information through context. when run uc.auditTrail: {
type: 'use case',
description: 'Add or Update an Item on a to-do List',
sessionId: '6545fb7f-f5dd-466a-b466-3330d1d48411',
transactionId: '9985fb70-f56d-466a-b466-e200d1d4848c',
elapsedTime: 1981800n, // in nanosecods
user: { name: 'John', id: '923b8b9a', isAdmin: true },
authorized: true,
return: {
Ok: { item: { id: 100, name: 'Do not forget this', position: 9 } }
},
steps: [ ]
} Inside usecase.js, something like that: Line 38 in 0d661f4
// audit trail
this._auditTrail = this._mainStep._auditTrail
this._auditTrail.type = this.type
this._auditTrail.description = description
this._auditTrail.transactionId = uuidv4()
this._auditTrail.sessionId = body.sessionId ?? uuidv4() or like that: //sessionId
if(body.sessionId ){
this._auditTrail.sessionId = body.sessionId
delete body.sessionId
} else {
this._auditTrail.sessionId = uuidv4()
}
|
I wanna take this issue, can you tag for me @jhomarolo ? |
@jhomarolo the question was about the way to call it in a UC, not the implementation. ex (not a suggestion, just what I would like to analyze): const response = await usecase.run(request, sessionID) One more thing: in order for a |
@dalssoft I think in a two step work, first I'll implement a sessionID between UC, in another implementation, apply this in a transport layer |
Sorry guys, I'll retake that! |
Hi @BritoDoug any updates here? |
Not yet @jhomarolo but I will send updates this week |
@BritoDoug do you still in this issue? |
Is your feature request related to a problem? Please describe.
To improve the audit trail, the library should have an ID similar to the use case track id, but for a long track, between use cases.
Describe the solution you'd like
Implement a new ID called session ID that is created if is not exist (first run) and send through use cases by request. So when the audit trail executes, we should see a new ID there.
The text was updated successfully, but these errors were encountered: