package models

import (
	"github.com/jinzhu/gorm"
)

// RequestStatusType is a request status on timeline
type RequestStatusType int8

const (
	// RequestOpenedStatus when request is open
	RequestOpenedStatus RequestStatusType = iota + 1
	// RequestRejectedStatus when request is rejected
	RequestRejectedStatus
	// RequestProcessingStatus when request is processing
	RequestProcessingStatus
	// RequestDoneStatus when request is done
	RequestDoneStatus
	// RequestErrorStatus when request is error
	RequestErrorStatus
)

// Request represent a automation request
type Request struct {
	gorm.Model
	Name   string `gorm:"varchar(50)"`
	User   User   `gorm:"association_foreignkey:ID"`
	UserID int
	Issues []Issue `gorm:"foreignkey:RequestID`
}
