package com.njcn.rdms.module.project.controller.admin.project.project.vo.workbench;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

@Schema(description = "Admin - workbench team worklog week response")
@Data
public class TeamWorklogWeekRespVO {

    @Schema(description = "Week monday", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026-06-08")
    private LocalDate weekStart;

    @Schema(description = "Team members", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<MemberVO> members;

    @Schema(description = "Single member week worklog")
    @Data
    public static class MemberVO {

        @Schema(description = "User id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
        @JsonSerialize(using = ToStringSerializer.class)
        private Long userId;

        @Schema(description = "User nickname", example = "zhangsan")
        private String userNickname;

        @Schema(description = "Weekly worklog distribution", requiredMode = Schema.RequiredMode.REQUIRED)
        private List<MyWorklogWeekRespVO.DistributionItemVO> items;

        @Schema(description = "Approved overtime hours in selected week",
                requiredMode = Schema.RequiredMode.REQUIRED, example = "9.00")
        private BigDecimal overtimeHours;
    }

}
