//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package table

import (
	"github.com/go-jet/jet/v2/postgres"
)

var SuspensionReasons = newSuspensionReasonsTable("backend", "suspension_reasons", "")

type suspensionReasonsTable struct {
	postgres.Table

	// Columns
	ReasonID  postgres.ColumnString
	TextEn    postgres.ColumnString
	TextRu    postgres.ColumnString
	CreatedAt postgres.ColumnTimestampz
	UpdatedAt postgres.ColumnTimestampz

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
	DefaultColumns postgres.ColumnList
}

type SuspensionReasonsTable struct {
	suspensionReasonsTable

	EXCLUDED suspensionReasonsTable
}

// AS creates new SuspensionReasonsTable with assigned alias
func (a SuspensionReasonsTable) AS(alias string) *SuspensionReasonsTable {
	return newSuspensionReasonsTable(a.SchemaName(), a.TableName(), alias)
}

// Schema creates new SuspensionReasonsTable with assigned schema name
func (a SuspensionReasonsTable) FromSchema(schemaName string) *SuspensionReasonsTable {
	return newSuspensionReasonsTable(schemaName, a.TableName(), a.Alias())
}

// WithPrefix creates new SuspensionReasonsTable with assigned table prefix
func (a SuspensionReasonsTable) WithPrefix(prefix string) *SuspensionReasonsTable {
	return newSuspensionReasonsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}

// WithSuffix creates new SuspensionReasonsTable with assigned table suffix
func (a SuspensionReasonsTable) WithSuffix(suffix string) *SuspensionReasonsTable {
	return newSuspensionReasonsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}

func newSuspensionReasonsTable(schemaName, tableName, alias string) *SuspensionReasonsTable {
	return &SuspensionReasonsTable{
		suspensionReasonsTable: newSuspensionReasonsTableImpl(schemaName, tableName, alias),
		EXCLUDED:               newSuspensionReasonsTableImpl("", "excluded", ""),
	}
}

func newSuspensionReasonsTableImpl(schemaName, tableName, alias string) suspensionReasonsTable {
	var (
		ReasonIDColumn  = postgres.StringColumn("reason_id")
		TextEnColumn    = postgres.StringColumn("text_en")
		TextRuColumn    = postgres.StringColumn("text_ru")
		CreatedAtColumn = postgres.TimestampzColumn("created_at")
		UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
		allColumns      = postgres.ColumnList{ReasonIDColumn, TextEnColumn, TextRuColumn, CreatedAtColumn, UpdatedAtColumn}
		mutableColumns  = postgres.ColumnList{TextEnColumn, TextRuColumn, CreatedAtColumn, UpdatedAtColumn}
		defaultColumns  = postgres.ColumnList{CreatedAtColumn, UpdatedAtColumn}
	)

	return suspensionReasonsTable{
		Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),

		//Columns
		ReasonID:  ReasonIDColumn,
		TextEn:    TextEnColumn,
		TextRu:    TextRuColumn,
		CreatedAt: CreatedAtColumn,
		UpdatedAt: UpdatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
		DefaultColumns: defaultColumns,
	}
}
