//
// 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 NotificationRoutes = newNotificationRoutesTable("backend", "notification_routes", "")

type notificationRoutesTable struct {
	postgres.Table

	// Columns
	RouteID        postgres.ColumnString
	NotificationID postgres.ColumnString
	Channel        postgres.ColumnString
	Status         postgres.ColumnString
	Attempts       postgres.ColumnInteger
	MaxAttempts    postgres.ColumnInteger
	NextAttemptAt  postgres.ColumnTimestampz
	LastAttemptAt  postgres.ColumnTimestampz
	LastError      postgres.ColumnString
	ResolvedEmail  postgres.ColumnString
	ResolvedLocale postgres.ColumnString
	CreatedAt      postgres.ColumnTimestampz
	UpdatedAt      postgres.ColumnTimestampz
	PublishedAt    postgres.ColumnTimestampz
	DeadLetteredAt postgres.ColumnTimestampz
	SkippedAt      postgres.ColumnTimestampz

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

type NotificationRoutesTable struct {
	notificationRoutesTable

	EXCLUDED notificationRoutesTable
}

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

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

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

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

func newNotificationRoutesTable(schemaName, tableName, alias string) *NotificationRoutesTable {
	return &NotificationRoutesTable{
		notificationRoutesTable: newNotificationRoutesTableImpl(schemaName, tableName, alias),
		EXCLUDED:                newNotificationRoutesTableImpl("", "excluded", ""),
	}
}

func newNotificationRoutesTableImpl(schemaName, tableName, alias string) notificationRoutesTable {
	var (
		RouteIDColumn        = postgres.StringColumn("route_id")
		NotificationIDColumn = postgres.StringColumn("notification_id")
		ChannelColumn        = postgres.StringColumn("channel")
		StatusColumn         = postgres.StringColumn("status")
		AttemptsColumn       = postgres.IntegerColumn("attempts")
		MaxAttemptsColumn    = postgres.IntegerColumn("max_attempts")
		NextAttemptAtColumn  = postgres.TimestampzColumn("next_attempt_at")
		LastAttemptAtColumn  = postgres.TimestampzColumn("last_attempt_at")
		LastErrorColumn      = postgres.StringColumn("last_error")
		ResolvedEmailColumn  = postgres.StringColumn("resolved_email")
		ResolvedLocaleColumn = postgres.StringColumn("resolved_locale")
		CreatedAtColumn      = postgres.TimestampzColumn("created_at")
		UpdatedAtColumn      = postgres.TimestampzColumn("updated_at")
		PublishedAtColumn    = postgres.TimestampzColumn("published_at")
		DeadLetteredAtColumn = postgres.TimestampzColumn("dead_lettered_at")
		SkippedAtColumn      = postgres.TimestampzColumn("skipped_at")
		allColumns           = postgres.ColumnList{RouteIDColumn, NotificationIDColumn, ChannelColumn, StatusColumn, AttemptsColumn, MaxAttemptsColumn, NextAttemptAtColumn, LastAttemptAtColumn, LastErrorColumn, ResolvedEmailColumn, ResolvedLocaleColumn, CreatedAtColumn, UpdatedAtColumn, PublishedAtColumn, DeadLetteredAtColumn, SkippedAtColumn}
		mutableColumns       = postgres.ColumnList{NotificationIDColumn, ChannelColumn, StatusColumn, AttemptsColumn, MaxAttemptsColumn, NextAttemptAtColumn, LastAttemptAtColumn, LastErrorColumn, ResolvedEmailColumn, ResolvedLocaleColumn, CreatedAtColumn, UpdatedAtColumn, PublishedAtColumn, DeadLetteredAtColumn, SkippedAtColumn}
		defaultColumns       = postgres.ColumnList{AttemptsColumn, LastErrorColumn, ResolvedEmailColumn, ResolvedLocaleColumn, CreatedAtColumn, UpdatedAtColumn}
	)

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

		//Columns
		RouteID:        RouteIDColumn,
		NotificationID: NotificationIDColumn,
		Channel:        ChannelColumn,
		Status:         StatusColumn,
		Attempts:       AttemptsColumn,
		MaxAttempts:    MaxAttemptsColumn,
		NextAttemptAt:  NextAttemptAtColumn,
		LastAttemptAt:  LastAttemptAtColumn,
		LastError:      LastErrorColumn,
		ResolvedEmail:  ResolvedEmailColumn,
		ResolvedLocale: ResolvedLocaleColumn,
		CreatedAt:      CreatedAtColumn,
		UpdatedAt:      UpdatedAtColumn,
		PublishedAt:    PublishedAtColumn,
		DeadLetteredAt: DeadLetteredAtColumn,
		SkippedAt:      SkippedAtColumn,

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