package com.cgi.eoss.ftep.api.projections;

import com.cgi.eoss.ftep.api.security.FtepPermission;
import com.cgi.eoss.ftep.model.Job;
import com.cgi.eoss.ftep.model.JobStatus;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.rest.core.config.Projection;

import java.time.LocalDateTime;

/**
 * <p>Default JSON projection for embedded {@link Job}s. Embeds the owner as a ShortUser.</p>
 */
@Projection(name = "shortFtepService", types = {Job.class})
public interface ShortJob extends EmbeddedId {
    String getExtId();
    ShortUser getOwner();
    JobStatus getStatus();
    String getGuiUrl();
    String getStage();
    LocalDateTime getStartTime();
    LocalDateTime getEndTime();
    @Value("#{@ftepSecurityService.getCurrentPermission(target.class, target.id)}")
    FtepPermission getAccessLevel();
}

@@ -717,24 +717,97 @@
 tEndTime();%0A
+    @Value(%22#%7Btarget.config.service.name%7D%22)%0A    String getServiceName();%0A
     @Value(%22

Add service name to embedded Job representations