package domain

import (
	"encoding/xml"

	"go.mongodb.org/mongo-driver/bson/primitive"
)

type WorkInfo struct {
	EmployeeNumber int     `xml:"EmployeeNumber" json:"employee_number" bson:"employee_number"`
	Date           string  `xml:"Date" json:"date" bson:"date"`
	Shifts         []Shift `xml:"Shifts>Shift" json:"shifts" bson:"shifts"`
}

type Shift struct {
	Start             string        `xml:"Start" json:"start" bson:"start"`
	End               string        `xml:"End" json:"end" bson:"end"`
	ShiftCode         string        `xml:"ShiftCode" json:"shift_code" bson:"shift_code"`
	ActualStart       string        `xml:"ActualStart" json:"actual_start" bson:"actual_start"`
	ActualEnd         string        `xml:"ActualEnd" json:"actual_end" bson:"actual_end"`
	RoleCode          string        `xml:"RoleCode" json:"role_code" bson:"role_code"`
	ShiftCategoryCode string        `xml:"ShiftCategoryCode" json:"shift_category_code" bson:"shift_category_code"`
	CustomFields      []CustomField `xml:"CustomFields>CustomField" json:"custom_fields" bson:"custom_fields"`
}

type Baseline struct {
	BaselineType string  `xml:"BaselineType,attr" json:"baseline_type" bson:"baseline_type"`
	Shifts       []Shift `xml:"Shifts>Shift" json:"shifts" bson:"shifts"`
}

type CustomField struct {
	Name  string `xml:"Name" json:"name" bson:"name"`
	Value string `xml:"Value" json:"value" bson:"value"`
}

type EmployeeWorkInformation struct {
	ID              primitive.ObjectID `json:"id" bson:"_id"`
	EmployeeNumber  int                `xml:"EmployeeNumber" json:"employee_number" bson:"employee_number"`
	Date            string             `xml:"Date" json:"date"`
	WorkInformation WorkInfo           `xml:"WorkInformation" json:"work_information" bson:"work_information"`
	Baselines       []Baseline         `xml:"Baselines>Baseline" json:"baselines" bson:"baselines"`
	CustomFields    []CustomField      `xml:"CustomFields>CustomField" json:"custom_fields" bson:"custom_fields"`
}

type ArrayOfEmployeeWorkInformation struct {
	XMLName           xml.Name                  `xml:"ArrayOfEmployeeWorkInformation"`
	EmployeeWorkInfos []EmployeeWorkInformation `xml:"EmployeeWorkInformation"`
}