package models

type Door struct {
	Code string `json:"code"`
	Name string `json:"name"`
	Show bool   `json:"show"`
}

func NewDoor(
	code string,
	name string,
	opts ...DoorOpt,
) *Door {
	door := &Door{
		Code: code,
		Name: name,
	}
	for _, opt := range opts {
		opt(door)
	}
	return door
}

type DoorOpt func(door *Door) error

func WithDoorShow(show bool) DoorOpt {
	return func(door *Door) error {
		door.Show = show
		return nil
	}
}
