package com.bankaudit.dto;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.bankaudit.model.AppIssueFile;

import lombok.Data;

@Data
public class IssueDto {
    private Long id;
    private String entityName;
    private String legalEntityCode;
    private String userId;
    private String userName; // from users table
    private String userEmail;
    private String userRole;
    private String process;
    private String issueDescription;
    private String fileName;
    private String filePath;
    private String fileType;
    private String status;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    private String unitId;
    private String financialYear;
    private String issueType;
    private Date actedOnByTeam;
    private String firstName;
    private String lastName;
    private List<AppIssueFile> issueFiles;
 
    // Constructor for projection
public IssueDto(Long id, String entityName, String legalEntityCode, String userId, String userEmail,
                String userRole, String process, String issueDescription, String fileName,
                String filePath, String fileType, String status, LocalDateTime createdAt,
                LocalDateTime updatedAt, String unitId, String financialYear, String issueType,
                Date actedOnByTeam, String firstName,String lastName) {
    this.id = id;
    this.entityName = entityName;
    this.legalEntityCode = legalEntityCode;
    this.userId = userId;
    this.userEmail = userEmail; // corrected
    this.userRole = userRole;
    this.process = process;
    this.issueDescription = issueDescription;
    this.fileName = fileName;
    this.filePath = filePath;
    this.fileType = fileType;
    this.status = status;
    this.createdAt = createdAt;
    this.updatedAt = updatedAt;
    this.unitId = unitId;
    this.financialYear = financialYear;
    this.issueType = issueType;
    this.actedOnByTeam = actedOnByTeam;
    this.firstName = firstName;
    this.lastName = lastName;
}


    // Getters (or use Lombok @Getter)
}
