//
// 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 EntitlementSnapshots = newEntitlementSnapshotsTable("backend", "entitlement_snapshots", "")

type entitlementSnapshotsTable struct {
	postgres.Table

	// Columns
	UserID                 postgres.ColumnString
	Tier                   postgres.ColumnString
	IsPaid                 postgres.ColumnBool
	Source                 postgres.ColumnString
	ActorType              postgres.ColumnString
	ActorUserID            postgres.ColumnString
	ActorUsername          postgres.ColumnString
	ReasonCode             postgres.ColumnString
	StartsAt               postgres.ColumnTimestampz
	EndsAt                 postgres.ColumnTimestampz
	MaxRegisteredRaceNames postgres.ColumnInteger
	UpdatedAt              postgres.ColumnTimestampz

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

type EntitlementSnapshotsTable struct {
	entitlementSnapshotsTable

	EXCLUDED entitlementSnapshotsTable
}

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

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

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

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

func newEntitlementSnapshotsTable(schemaName, tableName, alias string) *EntitlementSnapshotsTable {
	return &EntitlementSnapshotsTable{
		entitlementSnapshotsTable: newEntitlementSnapshotsTableImpl(schemaName, tableName, alias),
		EXCLUDED:                  newEntitlementSnapshotsTableImpl("", "excluded", ""),
	}
}

func newEntitlementSnapshotsTableImpl(schemaName, tableName, alias string) entitlementSnapshotsTable {
	var (
		UserIDColumn                 = postgres.StringColumn("user_id")
		TierColumn                   = postgres.StringColumn("tier")
		IsPaidColumn                 = postgres.BoolColumn("is_paid")
		SourceColumn                 = postgres.StringColumn("source")
		ActorTypeColumn              = postgres.StringColumn("actor_type")
		ActorUserIDColumn            = postgres.StringColumn("actor_user_id")
		ActorUsernameColumn          = postgres.StringColumn("actor_username")
		ReasonCodeColumn             = postgres.StringColumn("reason_code")
		StartsAtColumn               = postgres.TimestampzColumn("starts_at")
		EndsAtColumn                 = postgres.TimestampzColumn("ends_at")
		MaxRegisteredRaceNamesColumn = postgres.IntegerColumn("max_registered_race_names")
		UpdatedAtColumn              = postgres.TimestampzColumn("updated_at")
		allColumns                   = postgres.ColumnList{UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, MaxRegisteredRaceNamesColumn, UpdatedAtColumn}
		mutableColumns               = postgres.ColumnList{TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, MaxRegisteredRaceNamesColumn, UpdatedAtColumn}
		defaultColumns               = postgres.ColumnList{ReasonCodeColumn, UpdatedAtColumn}
	)

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

		//Columns
		UserID:                 UserIDColumn,
		Tier:                   TierColumn,
		IsPaid:                 IsPaidColumn,
		Source:                 SourceColumn,
		ActorType:              ActorTypeColumn,
		ActorUserID:            ActorUserIDColumn,
		ActorUsername:          ActorUsernameColumn,
		ReasonCode:             ReasonCodeColumn,
		StartsAt:               StartsAtColumn,
		EndsAt:                 EndsAtColumn,
		MaxRegisteredRaceNames: MaxRegisteredRaceNamesColumn,
		UpdatedAt:              UpdatedAtColumn,

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