package com.iqser.red.service.persistence.management.v1.processor.migration.migrations.model.reducetext;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TextPositionSequence {

    private int page;
    @Builder.Default
    private List<RedTextPosition> textPositions = new ArrayList<>();

    // Removed
    @JsonIgnore
    private float x1;
    @JsonIgnore
    private float x2;

    // Added
    private float dir;
    private int rotation;
    private float pageHeight;
    private float pageWidth;


    @JsonProperty
    public float getDir() {

        return textPositions.get(0).getDir();
    }


    @JsonProperty
    public int getRotation() {return textPositions.get(0).getRotation();}


    @JsonProperty
    public float getPageHeight() {return textPositions.get(0).getPageHeight();}


    @JsonProperty
    public float getPageWidth() {return textPositions.get(0).getPageWidth();}

}
