//
// 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 LimitRecords = newLimitRecordsTable("backend", "limit_records", "")

type limitRecordsTable struct {
	postgres.Table

	// Columns
	RecordID          postgres.ColumnString
	UserID            postgres.ColumnString
	LimitCode         postgres.ColumnString
	Value             postgres.ColumnInteger
	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 LimitRecordsTable struct {
	limitRecordsTable

	EXCLUDED limitRecordsTable
}

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

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

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

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

func newLimitRecordsTable(schemaName, tableName, alias string) *LimitRecordsTable {
	return &LimitRecordsTable{
		limitRecordsTable: newLimitRecordsTableImpl(schemaName, tableName, alias),
		EXCLUDED:          newLimitRecordsTableImpl("", "excluded", ""),
	}
}

func newLimitRecordsTableImpl(schemaName, tableName, alias string) limitRecordsTable {
	var (
		RecordIDColumn          = postgres.StringColumn("record_id")
		UserIDColumn            = postgres.StringColumn("user_id")
		LimitCodeColumn         = postgres.StringColumn("limit_code")
		ValueColumn             = postgres.IntegerColumn("value")
		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, LimitCodeColumn, ValueColumn, ReasonCodeColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByUserIDColumn, RemovedByUsernameColumn, RemovedReasonCodeColumn}
		mutableColumns          = postgres.ColumnList{UserIDColumn, LimitCodeColumn, ValueColumn, ReasonCodeColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByUserIDColumn, RemovedByUsernameColumn, RemovedReasonCodeColumn}
		defaultColumns          = postgres.ColumnList{AppliedAtColumn}
	)

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

		//Columns
		RecordID:          RecordIDColumn,
		UserID:            UserIDColumn,
		LimitCode:         LimitCodeColumn,
		Value:             ValueColumn,
		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,
	}
}
