package models

import (
	"time"

	"github.com/google/uuid"
)

type DeadlineRule struct {
	ID               uuid.UUID  `db:"id" json:"id"`
	ProceedingTypeID *int       `db:"proceeding_type_id" json:"proceeding_type_id,omitempty"`
	ParentID         *uuid.UUID `db:"parent_id" json:"parent_id,omitempty"`
	Code             *string    `db:"code" json:"code,omitempty"`
	Name             string     `db:"name" json:"name"`
	Description      *string    `db:"description" json:"description,omitempty"`
	PrimaryParty     *string    `db:"primary_party" json:"primary_party,omitempty"`
	EventType        *string    `db:"event_type" json:"event_type,omitempty"`
	IsMandatory      bool       `db:"is_mandatory" json:"is_mandatory"`
	DurationValue    int        `db:"duration_value" json:"duration_value"`
	DurationUnit     string     `db:"duration_unit" json:"duration_unit"`
	Timing           *string    `db:"timing" json:"timing,omitempty"`
	RuleCode         *string    `db:"rule_code" json:"rule_code,omitempty"`
	DeadlineNotes    *string    `db:"deadline_notes" json:"deadline_notes,omitempty"`
	SequenceOrder    int        `db:"sequence_order" json:"sequence_order"`
	ConditionRuleID  *uuid.UUID `db:"condition_rule_id" json:"condition_rule_id,omitempty"`
	AltDurationValue *int       `db:"alt_duration_value" json:"alt_duration_value,omitempty"`
	AltDurationUnit  *string    `db:"alt_duration_unit" json:"alt_duration_unit,omitempty"`
	AltRuleCode      *string    `db:"alt_rule_code" json:"alt_rule_code,omitempty"`
	IsSpawn          bool       `db:"is_spawn" json:"is_spawn"`
	SpawnLabel       *string    `db:"spawn_label" json:"spawn_label,omitempty"`
	IsActive         bool       `db:"is_active" json:"is_active"`
	CreatedAt        time.Time  `db:"created_at" json:"created_at"`
	UpdatedAt        time.Time  `db:"updated_at" json:"updated_at"`
}

type ProceedingType struct {
	ID           int     `db:"id" json:"id"`
	Code         string  `db:"code" json:"code"`
	Name         string  `db:"name" json:"name"`
	Description  *string `db:"description" json:"description,omitempty"`
	Jurisdiction *string `db:"jurisdiction" json:"jurisdiction,omitempty"`
	Category     *string `db:"category" json:"category,omitempty"`
	DefaultColor string  `db:"default_color" json:"default_color"`
	SortOrder    int     `db:"sort_order" json:"sort_order"`
	IsActive     bool    `db:"is_active" json:"is_active"`
}
