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

Update type AssignmentStatus in Ticket Assignment Manager #1267

Open
alexkuc opened this issue Sep 26, 2023 · 3 comments
Open

Update type AssignmentStatus in Ticket Assignment Manager #1267

alexkuc opened this issue Sep 26, 2023 · 3 comments
Labels
C: services 🤝 category D: Packages 📦 domain: Barista Packages P3: med priority 😐 priority: medium S1: new 👶🏻 status

Comments

@alexkuc
Copy link
Contributor

alexkuc commented Sep 26, 2023

For type AssignmentStatus, need to replace status of null (currently implied due to how TypeScript strictness is configured) with NO_RELATION or similar as it is currently done in the Ticket Assignment Manager (TAM) legend:

export type AssignmentStatus = 'OLD' | 'NEW' | 'REMOVED';

image

Currently, type maps as follows to the legend:

Type Legend
OLD existing relationship
NEW add new relationship
REMOVED remove existing relationship
n\a invalid relationship
n\a no relationship

The code that generates the actual status as follows:

const getAssignmentStatus = useCallback(
({ datetimeId, ticketId }): AssignmentStatus => {
const oldRelatedTickets = getOldRelation({ datetimeId });
const newRelatedTickets = assignmentManager.getAssignedTickets({ datetimeId });
const isInOld = oldRelatedTickets.includes(ticketId);
const isInNew = newRelatedTickets.includes(ticketId);
switch (true) {
case isInOld && isInNew:
return 'OLD';
case !isInOld && isInNew:
return 'NEW';
case isInOld && !isInNew:
return 'REMOVED';
case !isInOld && !isInNew:
return null;
}
},
[assignmentManager, getOldRelation]
);

Curiously enough, there is no provisioning for the so-called "invalid relationship" status.

@alexkuc alexkuc added C: services 🤝 category D: Packages 📦 domain: Barista Packages P3: med priority 😐 priority: medium S1: new 👶🏻 status labels Sep 26, 2023
@tn3rb
Copy link
Member

tn3rb commented Sep 26, 2023

there is no provisioning for the so-called "invalid relationship" status.

if we add one... then wouldn't that make it a "valid" status 🤔

@alexkuc
Copy link
Contributor Author

alexkuc commented Sep 26, 2023

Well… that's the curious thing about it. The legend has the status but the codebase does not. So, either legend was created before the code responsible for generating the status or the status "invalid" existed but was the removed from the database whereas legend was not updated.

@tn3rb
Copy link
Member

tn3rb commented Mar 27, 2024

would be easier then to fix the legend, but having an explicit type for no relation (maybe NONE) would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: services 🤝 category D: Packages 📦 domain: Barista Packages P3: med priority 😐 priority: medium S1: new 👶🏻 status
Projects
None yet
Development

No branches or pull requests

2 participants