Lang.java

  1. package no.nav.data.team.shared;

  2. import lombok.experimental.UtilityClass;
  3. import no.nav.data.common.storage.domain.TypeRegistration;
  4. import no.nav.data.team.cluster.domain.Cluster;
  5. import no.nav.data.team.po.domain.AreaType;
  6. import no.nav.data.team.po.domain.ProductArea;
  7. import no.nav.data.team.resource.domain.ResourceType;
  8. import no.nav.data.team.shared.domain.Membered;
  9. import no.nav.data.team.team.domain.TeamOwnershipType;
  10. import no.nav.data.team.team.domain.TeamRole;
  11. import no.nav.data.team.team.domain.TeamType;

  12. @UtilityClass
  13. public class Lang {

  14.     public static final String MEMBERS = "Medlemmer";
  15.     public static final String RELATION = "Tilknyttning";
  16.     public static final String AREA_ID = "Område id";
  17.     public static final String AREA = "Område";
  18.     public static final String CLUSTER = "Klynge";
  19.     public static final String TEAM_ID = "Team id";
  20.     public static final String TEAM = "Team";
  21.     public static final String IDENT = "Ident";
  22.     public static final String GIVEN_NAME = "Fornavn";
  23.     public static final String FAMILY_NAME = "Etternavn";
  24.     public static final String TEAM_TYPE = "Teamtype";
  25.     public static final String OWNERSHIP_TYPE = "Eierskapstype";
  26.     public static final String RESOURCE_TYPE = "Type";
  27.     public static final String ROLES = "Roller";
  28.     public static final String OTHER = "Annet";
  29.     public static final String EMAIL = "Epost";
  30.     public static final String START_DATE = "Startdato";
  31.     public static final String END_DATE = "Sluttdato";
  32.     public static final String STATUS = "Status";
  33.     public static final String CONTACT_PERSON = "Kontaktperson";
  34.     public static final String OFFICE_HOURS = "Tilstedeværelse";
  35.     public static final String LOCATION = "Lokasjon";

  36.     public static final String NAME = "Navn";
  37.     public static final String TEAM_LEADS = "Teamledere";
  38.     public static final String PRODUCT_OWNERS = "Produkteiere";
  39.     public static final String QA_DONE = "Kvalitetssikret";
  40.     public static final String NAIS_TEAMS = "Nais team";
  41.     public static final String TAGS = "Tags";
  42.     public static final String INTERNAL = "Interne";
  43.     public static final String EXTERNAL = "Eksterne";
  44.     public static final String SLACK = "Slack";
  45.     public static final String DESCRIPTION = "Beskrivelse";

  46.     public static String roleName(TeamRole role) {
  47.         return switch (role) {
  48.             case LEAD -> "Teamleder";
  49.             case DEVELOPER -> "Utvikler";
  50.             case TESTER -> "Tester";
  51.             case TECH_DOMAIN_SPECIALIST -> "Teknisk domenespesialist";
  52.             case TECH_LEAD -> "Tech lead";
  53.             case TEST_LEAD -> "Testleder";
  54.             case PRODUCT_OWNER -> "Produkteier";
  55.             case PRODUCT_LEAD -> "Produktleder";
  56.             case SECURITY_ARCHITECT -> "Sikkerhetsarkitekt";
  57.             case SOLUTION_ARCHITECT -> "Løsningsarkitekt";
  58.             case BUSINESS_ANALYST -> "Forretningsutvikler";
  59.             case DOMAIN_EXPERT -> "Domeneekspert";
  60.             case DOMAIN_RESPONSIBLE -> "Fagansvarlig";
  61.             case DOMAIN_RESOURCE -> "Fagressurs";
  62.             case ARCHITECT -> "Arkitekt";
  63.             case AGILE_COACH -> "Agile coach";
  64.             case DATA_MANAGER -> "Data manager";
  65.             case DATA_SCIENTIST -> "Data scientist";
  66.             case MAINTENANCE_MANAGER -> "Vedlikeholdsansvarlig";
  67.             case DESIGNER -> "Designer";
  68.             case DESIGN_LEAD -> "Design lead";
  69.             case OPERATIONS -> "Drift";
  70.             case FUNCTIONAL_ADVISER -> "Funksjonell rådgiver";
  71.             case TECHNICAL_ADVISER -> "Teknisk rådgiver";
  72.             case TECHNICAL_TESTER -> "Teknisk tester";
  73.             case COMMUNICATION_ADVISER -> "Kommunikasjonsrådgiver";
  74.             case AREA_LEAD -> "Områdeleder";
  75.             case LEGAL_ADVISER -> "Jurist";
  76.             case SECURITY_CHAMPION -> "Security champion";
  77.             case UU_CHAMPION -> "UU champion";
  78.             case PROFIT_COACH -> "Gevinst Coach";
  79.             case DESIGN_RESEARCHER -> "Design researcher";
  80.             case HEAD_OF_LEGAL -> "Juridisk ansvarlig";
  81.             case PRINCIPAL -> "Prinsipal";
  82.             case CONTROLLER -> "Controller";
  83.             case STAFFING_MANAGER -> "Bemanningsansvarlig";
  84.             case PLATFORM_SYSTEM_TECHNICIAN -> "Systemtekniker plattform";
  85.             case TEAMCOACH -> "Teamcoach";
  86.             case WEB_ANALYST -> "Webanalytiker";
  87.             case UU_SPECIALIST -> "UU-spesialist";
  88.             case VISUAL_ANALYTICS_ENGINEER -> "Visual analytics engineer";
  89.             case DATA_ENGINEER -> "Data engineer";
  90.             case SUBJECT_MATTER_EXPERT -> "Fagekspert";
  91.             case OTHER -> "Annet";
  92.         };
  93.     }

  94.     public static String memberType(ResourceType resourceType) {
  95.         return switch (resourceType) {
  96.             case INTERNAL -> "Intern";
  97.             case EXTERNAL -> "Ekstern";
  98.             case OTHER -> "Annet";
  99.         };
  100.     }

  101.     public static String teamOwnershipType(TeamOwnershipType teamOwnershipType) {
  102.         if (teamOwnershipType == null) {
  103.             return "";
  104.         }
  105.         return switch (teamOwnershipType) {
  106.             case IT -> "IT-team";
  107.             case PRODUCT -> "Produktteam";
  108.             case ADMINISTRATION -> "Forvaltningsteam";
  109.             case PROJECT -> "Prosjektteam";
  110.             case OTHER -> "Annet";
  111.             case UNKNOWN -> "Ukjent";
  112.         };
  113.     }

  114.     public static String teamType(TeamType teamType) {
  115.         if (teamType == null) {
  116.             return "";
  117.         }
  118.         return switch (teamType) {
  119.             case STREAM_ALIGNED -> "Verdistrømteam";
  120.             case ENABLING -> "Tilretteleggingsteam";
  121.             case PLATFORM -> "Plattformteam";
  122.             case COMPLICATED_SUBSYSTEM -> "Subsystemteam";
  123.             case WORKGROUP -> "Arbeidsgruppe";
  124.             case MANAGEMENT -> "Ledergruppe";
  125.             case PROJECTGROUP -> "Prosjektgruppe";
  126.             case OTHER -> "Annet";
  127.             case UNKNOWN -> "Ukjent";
  128.         };
  129.     }
  130.     public static String areaType(AreaType type) {
  131.         if (type == null) {
  132.             return "";
  133.         }
  134.         return switch (type) {
  135.             case IT -> "IT-område";
  136.             case PRODUCT_AREA -> "Produktområde";
  137.             case PROJECT -> "Prosjekt";
  138.             case OTHER -> "Annet";
  139.         };
  140.     }

  141.     public static String objectType(Class<? extends Membered> type) {
  142.         if (type.equals(ProductArea.class)) {
  143.             return AREA;
  144.         } else if (type.equals(Cluster.class)) {
  145.             return CLUSTER;
  146.         }
  147.         return TypeRegistration.typeOf(type);
  148.     }
  149. }