//
// 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 SanctionRecords = newSanctionRecordsTable("backend", "sanction_records", "")

type sanctionRecordsTable struct {
	postgres.Table

	// Columns
	RecordID          postgres.ColumnString
	UserID            postgres.ColumnString
	SanctionCode      postgres.ColumnString
	Scope             postgres.ColumnString
	ReasonCode        postgres.ColumnString
	ActorType         postgres.ColumnString
	ActorUserID       postgres.ColumnString
	ActorUsername     postgres.ColumnString
	AppliedAt         postgres.ColumnTimestampz
	ExpiresAt         postgres.ColumnTimestampz
	RemovedAt         postgres.ColumnTimestampz
	RemovedByType     postgres.ColumnString
	RemovedByUserID   postgres.ColumnString
	RemovedByUsername postgres.ColumnString
	RemovedReasonCode postgres.ColumnString

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

type SanctionRecordsTable struct {
	sanctionRecordsTable

	EXCLUDED sanctionRecordsTable
}

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

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

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

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

func newSanctionRecordsTable(schemaName, tableName, alias string) *SanctionRecordsTable {
	return &SanctionRecordsTable{
		sanctionRecordsTable: newSanctionRecordsTableImpl(schemaName, tableName, alias),
		EXCLUDED:             newSanctionRecordsTableImpl("", "excluded", ""),
	}
}

func newSanctionRecordsTableImpl(schemaName, tableName, alias string) sanctionRecordsTable {
	var (
		RecordIDColumn          = postgres.StringColumn("record_id")
		UserIDColumn            = postgres.StringColumn("user_id")
		SanctionCodeColumn      = postgres.StringColumn("sanction_code")
		ScopeColumn             = postgres.StringColumn("scope")
		ReasonCodeColumn        = postgres.StringColumn("reason_code")
		ActorTypeColumn         = postgres.StringColumn("actor_type")
		ActorUserIDColumn       = postgres.StringColumn("actor_user_id")
		ActorUsernameColumn     = postgres.StringColumn("actor_username")
		AppliedAtColumn         = postgres.TimestampzColumn("applied_at")
		ExpiresAtColumn         = postgres.TimestampzColumn("expires_at")
		RemovedAtColumn         = postgres.TimestampzColumn("removed_at")
		RemovedByTypeColumn     = postgres.StringColumn("removed_by_type")
		RemovedByUserIDColumn   = postgres.StringColumn("removed_by_user_id")
		RemovedByUsernameColumn = postgres.StringColumn("removed_by_username")
		RemovedReasonCodeColumn = postgres.StringColumn("removed_reason_code")
		allColumns              = postgres.ColumnList{RecordIDColumn, UserIDColumn, SanctionCodeColumn, ScopeColumn, ReasonCodeColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByUserIDColumn, RemovedByUsernameColumn, RemovedReasonCodeColumn}
		mutableColumns          = postgres.ColumnList{UserIDColumn, SanctionCodeColumn, ScopeColumn, ReasonCodeColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByUserIDColumn, RemovedByUsernameColumn, RemovedReasonCodeColumn}
		defaultColumns          = postgres.ColumnList{AppliedAtColumn}
	)

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

		//Columns
		RecordID:          RecordIDColumn,
		UserID:            UserIDColumn,
		SanctionCode:      SanctionCodeColumn,
		Scope:             ScopeColumn,
		ReasonCode:        ReasonCodeColumn,
		ActorType:         ActorTypeColumn,
		ActorUserID:       ActorUserIDColumn,
		ActorUsername:     ActorUsernameColumn,
		AppliedAt:         AppliedAtColumn,
		ExpiresAt:         ExpiresAtColumn,
		RemovedAt:         RemovedAtColumn,
		RemovedByType:     RemovedByTypeColumn,
		RemovedByUserID:   RemovedByUserIDColumn,
		RemovedByUsername: RemovedByUsernameColumn,
		RemovedReasonCode: RemovedReasonCodeColumn,

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