//
// 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/Gleipnir-Technology/jet/postgres"
)

var Communication = newCommunicationTable("public", "communication", "")

type communicationTable struct {
	postgres.Table

	// Columns
	Created            postgres.ColumnTimestamp
	ID                 postgres.ColumnInteger
	OrganizationID     postgres.ColumnInteger
	ResponseEmailLogID postgres.ColumnInteger
	ResponseTextLogID  postgres.ColumnInteger
	SourceEmailLogID   postgres.ColumnInteger
	SourceReportID     postgres.ColumnInteger
	SourceTextLogID    postgres.ColumnInteger
	Status             postgres.ColumnString

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

type CommunicationTable struct {
	communicationTable

	EXCLUDED communicationTable
}

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

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

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

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

func newCommunicationTable(schemaName, tableName, alias string) *CommunicationTable {
	return &CommunicationTable{
		communicationTable: newCommunicationTableImpl(schemaName, tableName, alias),
		EXCLUDED:           newCommunicationTableImpl("", "excluded", ""),
	}
}

func newCommunicationTableImpl(schemaName, tableName, alias string) communicationTable {
	var (
		CreatedColumn            = postgres.TimestampColumn("created")
		IDColumn                 = postgres.IntegerColumn("id")
		OrganizationIDColumn     = postgres.IntegerColumn("organization_id")
		ResponseEmailLogIDColumn = postgres.IntegerColumn("response_email_log_id")
		ResponseTextLogIDColumn  = postgres.IntegerColumn("response_text_log_id")
		SourceEmailLogIDColumn   = postgres.IntegerColumn("source_email_log_id")
		SourceReportIDColumn     = postgres.IntegerColumn("source_report_id")
		SourceTextLogIDColumn    = postgres.IntegerColumn("source_text_log_id")
		StatusColumn             = postgres.StringColumn("status")
		allColumns               = postgres.ColumnList{CreatedColumn, IDColumn, OrganizationIDColumn, ResponseEmailLogIDColumn, ResponseTextLogIDColumn, SourceEmailLogIDColumn, SourceReportIDColumn, SourceTextLogIDColumn, StatusColumn}
		mutableColumns           = postgres.ColumnList{CreatedColumn, OrganizationIDColumn, ResponseEmailLogIDColumn, ResponseTextLogIDColumn, SourceEmailLogIDColumn, SourceReportIDColumn, SourceTextLogIDColumn, StatusColumn}
		defaultColumns           = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		Created:            CreatedColumn,
		ID:                 IDColumn,
		OrganizationID:     OrganizationIDColumn,
		ResponseEmailLogID: ResponseEmailLogIDColumn,
		ResponseTextLogID:  ResponseTextLogIDColumn,
		SourceEmailLogID:   SourceEmailLogIDColumn,
		SourceReportID:     SourceReportIDColumn,
		SourceTextLogID:    SourceTextLogIDColumn,
		Status:             StatusColumn,

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