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

TOLK-2836 Skill Sync #733

Merged
merged 16 commits into from
Feb 12, 2025
Merged

TOLK-2836 Skill Sync #733

merged 16 commits into from
Feb 12, 2025

Conversation

its-me2000
Copy link
Contributor

@its-me2000 its-me2000 commented Feb 7, 2025

Fix: skill deletion for other than NKS ServiceResources.
Update: set Domain field on ServiceResource creation
Update: check skills only for ServiceResource on given Domain
Added: customization of Domain, Subdomain, PermissionSetGroup, Fotrolig group and Skjermede group for possible sync for other services
Added: Callable interface to make call from independent packages(hot-servicetjenesten)

!IMPORTANT! relevant ServiceResourse´s should be updated to have correct domain. Looks like NKS missing some.
Something like:
List<ServiceResource> srToUpdate = new List>serviceResource>(); for(ServiceResource sr : [SELECT Id, ResourceType, IsActive, CRM_Domain__c, RelatedRecordId, RelatedRecord.Profile.Name, CreatedBy.Name, CreatedDate, LastModifiedDate FROM ServiceResource WHERE RelatedRecordId IN (SELECT AssigneeId FROM PermissionSetAssignment WHERE PermissionSetGroup.DeveloperName = 'Kontaktsenter')]){ sr.CRM_Domain__c = 'NKS'; srToUpdate.add(sr); } update srToUpdate

@its-me2000 its-me2000 requested a review from a team as a code owner February 7, 2025 12:19
@its-me2000 its-me2000 requested review from a team and removed request for a team February 7, 2025 12:20
Copy link
Contributor

@EirikFladby EirikFladby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Likte veldig godt Test.loadData(),. Den kan vi få bruk for på andre områder og.
Noen kommentarer:

  • Her kan du vel fjerne "this" prefix stort sett overalt bortsett fra i konstruktøren, så blir det litt ryddigere 😄
  • Jeg tenker at getterne kunne egentlig bare vært initialisert i en init() som kalles i konstruktøren nå, men getter funker greit det og!
  • Vi må oppdatere domain på våre ServiceResources som du sier. Det kan kanskje du gjøre for oss ettersom du har tilgang til det?

Comment on lines 26 to 33
private Map<Id, User> userMap {
get {
if (nksUserMap == null) {
nksUserMap = new Map<Id, User>();
for (User usr : [
SELECT Id, Name
FROM User
WHERE
Id IN (
SELECT AssigneeId
FROM PermissionSetAssignment
WHERE PermissionSetGroup.DeveloperName = 'Kontaktsenter'
)
if (userMap == null) {
List<User> userList = new List<User>();
for (PermissionSetAssignment psa : [
SELECT Assignee.Id, Assignee.Name, PermissionSetGroup.DeveloperName
FROM PermissionSetAssignment
WHERE PermissionSetGroup.DeveloperName = :this.permsetGroupName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan ikke dette gjøres direkte om til en map så slipper vi listen?

userMap = new Map<Id, User>([SELECT Id, Name FROM User WHERE Id IN (SELECT AssigneeId osv osv ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!

@its-me2000
Copy link
Contributor Author

  • Fjernet this. for instans metoder og vars (egentlig liker best med this =)
  • Flyttet getter til init* metoder og alt initialiseres i handleGroupAndSkillSync metode.
  • Fjernet konstruktørene, da initialisation skjer i handleGroupAndSkillSync

@its-me2000 its-me2000 merged commit 848465b into main Feb 12, 2025
6 checks passed
@its-me2000 its-me2000 deleted the TOLK-2836 branch February 12, 2025 13:35
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.

2 participants