2022-08-30 18:04:50 +00:00
|
|
|
// Code generated by ent, DO NOT EDIT.
|
|
|
|
|
|
|
|
package group
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/google/uuid"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Label holds the string label denoting the group type in the database.
|
|
|
|
Label = "group"
|
|
|
|
// FieldID holds the string denoting the id field in the database.
|
|
|
|
FieldID = "id"
|
|
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
|
|
FieldCreatedAt = "created_at"
|
|
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
|
|
FieldUpdatedAt = "updated_at"
|
|
|
|
// FieldName holds the string denoting the name field in the database.
|
|
|
|
FieldName = "name"
|
|
|
|
// FieldCurrency holds the string denoting the currency field in the database.
|
|
|
|
FieldCurrency = "currency"
|
|
|
|
// EdgeUsers holds the string denoting the users edge name in mutations.
|
|
|
|
EdgeUsers = "users"
|
|
|
|
// EdgeLocations holds the string denoting the locations edge name in mutations.
|
|
|
|
EdgeLocations = "locations"
|
|
|
|
// EdgeItems holds the string denoting the items edge name in mutations.
|
|
|
|
EdgeItems = "items"
|
|
|
|
// EdgeLabels holds the string denoting the labels edge name in mutations.
|
|
|
|
EdgeLabels = "labels"
|
2022-09-12 22:47:27 +00:00
|
|
|
// EdgeDocuments holds the string denoting the documents edge name in mutations.
|
|
|
|
EdgeDocuments = "documents"
|
2022-10-07 02:54:09 +00:00
|
|
|
// EdgeInvitationTokens holds the string denoting the invitation_tokens edge name in mutations.
|
|
|
|
EdgeInvitationTokens = "invitation_tokens"
|
2023-03-07 06:18:58 +00:00
|
|
|
// EdgeNotifiers holds the string denoting the notifiers edge name in mutations.
|
|
|
|
EdgeNotifiers = "notifiers"
|
2022-08-30 18:04:50 +00:00
|
|
|
// Table holds the table name of the group in the database.
|
|
|
|
Table = "groups"
|
|
|
|
// UsersTable is the table that holds the users relation/edge.
|
|
|
|
UsersTable = "users"
|
|
|
|
// UsersInverseTable is the table name for the User entity.
|
|
|
|
// It exists in this package in order to avoid circular dependency with the "user" package.
|
|
|
|
UsersInverseTable = "users"
|
|
|
|
// UsersColumn is the table column denoting the users relation/edge.
|
|
|
|
UsersColumn = "group_users"
|
|
|
|
// LocationsTable is the table that holds the locations relation/edge.
|
|
|
|
LocationsTable = "locations"
|
|
|
|
// LocationsInverseTable is the table name for the Location entity.
|
|
|
|
// It exists in this package in order to avoid circular dependency with the "location" package.
|
|
|
|
LocationsInverseTable = "locations"
|
|
|
|
// LocationsColumn is the table column denoting the locations relation/edge.
|
|
|
|
LocationsColumn = "group_locations"
|
|
|
|
// ItemsTable is the table that holds the items relation/edge.
|
|
|
|
ItemsTable = "items"
|
|
|
|
// ItemsInverseTable is the table name for the Item entity.
|
|
|
|
// It exists in this package in order to avoid circular dependency with the "item" package.
|
|
|
|
ItemsInverseTable = "items"
|
|
|
|
// ItemsColumn is the table column denoting the items relation/edge.
|
|
|
|
ItemsColumn = "group_items"
|
|
|
|
// LabelsTable is the table that holds the labels relation/edge.
|
|
|
|
LabelsTable = "labels"
|
|
|
|
// LabelsInverseTable is the table name for the Label entity.
|
|
|
|
// It exists in this package in order to avoid circular dependency with the "label" package.
|
|
|
|
LabelsInverseTable = "labels"
|
|
|
|
// LabelsColumn is the table column denoting the labels relation/edge.
|
|
|
|
LabelsColumn = "group_labels"
|
2022-09-12 22:47:27 +00:00
|
|
|
// DocumentsTable is the table that holds the documents relation/edge.
|
|
|
|
DocumentsTable = "documents"
|
|
|
|
// DocumentsInverseTable is the table name for the Document entity.
|
|
|
|
// It exists in this package in order to avoid circular dependency with the "document" package.
|
|
|
|
DocumentsInverseTable = "documents"
|
|
|
|
// DocumentsColumn is the table column denoting the documents relation/edge.
|
|
|
|
DocumentsColumn = "group_documents"
|
2022-10-07 02:54:09 +00:00
|
|
|
// InvitationTokensTable is the table that holds the invitation_tokens relation/edge.
|
|
|
|
InvitationTokensTable = "group_invitation_tokens"
|
|
|
|
// InvitationTokensInverseTable is the table name for the GroupInvitationToken entity.
|
|
|
|
// It exists in this package in order to avoid circular dependency with the "groupinvitationtoken" package.
|
|
|
|
InvitationTokensInverseTable = "group_invitation_tokens"
|
|
|
|
// InvitationTokensColumn is the table column denoting the invitation_tokens relation/edge.
|
|
|
|
InvitationTokensColumn = "group_invitation_tokens"
|
2023-03-07 06:18:58 +00:00
|
|
|
// NotifiersTable is the table that holds the notifiers relation/edge.
|
|
|
|
NotifiersTable = "notifiers"
|
|
|
|
// NotifiersInverseTable is the table name for the Notifier entity.
|
|
|
|
// It exists in this package in order to avoid circular dependency with the "notifier" package.
|
|
|
|
NotifiersInverseTable = "notifiers"
|
|
|
|
// NotifiersColumn is the table column denoting the notifiers relation/edge.
|
|
|
|
NotifiersColumn = "group_id"
|
2022-08-30 18:04:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Columns holds all SQL columns for group fields.
|
|
|
|
var Columns = []string{
|
|
|
|
FieldID,
|
|
|
|
FieldCreatedAt,
|
|
|
|
FieldUpdatedAt,
|
|
|
|
FieldName,
|
|
|
|
FieldCurrency,
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
|
|
func ValidColumn(column string) bool {
|
|
|
|
for i := range Columns {
|
|
|
|
if column == Columns[i] {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
|
|
DefaultCreatedAt func() time.Time
|
|
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
|
|
DefaultUpdatedAt func() time.Time
|
|
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
|
|
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
|
|
NameValidator func(string) error
|
|
|
|
// DefaultID holds the default value on creation for the "id" field.
|
|
|
|
DefaultID func() uuid.UUID
|
|
|
|
)
|
|
|
|
|
|
|
|
// Currency defines the type for the "currency" enum field.
|
|
|
|
type Currency string
|
|
|
|
|
|
|
|
// CurrencyUsd is the default value of the Currency enum.
|
|
|
|
const DefaultCurrency = CurrencyUsd
|
|
|
|
|
|
|
|
// Currency values.
|
|
|
|
const (
|
|
|
|
CurrencyUsd Currency = "usd"
|
2022-10-15 20:15:55 +00:00
|
|
|
CurrencyEur Currency = "eur"
|
|
|
|
CurrencyGbp Currency = "gbp"
|
|
|
|
CurrencyJpy Currency = "jpy"
|
2022-11-01 22:16:22 +00:00
|
|
|
CurrencyZar Currency = "zar"
|
|
|
|
CurrencyAud Currency = "aud"
|
2022-11-01 23:10:48 +00:00
|
|
|
CurrencyNok Currency = "nok"
|
|
|
|
CurrencySek Currency = "sek"
|
|
|
|
CurrencyDkk Currency = "dkk"
|
2022-11-12 23:54:24 +00:00
|
|
|
CurrencyInr Currency = "inr"
|
2022-12-02 01:45:28 +00:00
|
|
|
CurrencyRmb Currency = "rmb"
|
2023-01-28 20:53:00 +00:00
|
|
|
CurrencyBgn Currency = "bgn"
|
2023-02-25 19:46:27 +00:00
|
|
|
CurrencyChf Currency = "chf"
|
2023-02-26 03:13:52 +00:00
|
|
|
CurrencyPln Currency = "pln"
|
|
|
|
CurrencyTry Currency = "try"
|
|
|
|
CurrencyRon Currency = "ron"
|
2022-08-30 18:04:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (c Currency) String() string {
|
|
|
|
return string(c)
|
|
|
|
}
|
|
|
|
|
|
|
|
// CurrencyValidator is a validator for the "currency" field enum values. It is called by the builders before save.
|
|
|
|
func CurrencyValidator(c Currency) error {
|
|
|
|
switch c {
|
2023-02-26 03:13:52 +00:00
|
|
|
case CurrencyUsd, CurrencyEur, CurrencyGbp, CurrencyJpy, CurrencyZar, CurrencyAud, CurrencyNok, CurrencySek, CurrencyDkk, CurrencyInr, CurrencyRmb, CurrencyBgn, CurrencyChf, CurrencyPln, CurrencyTry, CurrencyRon:
|
2022-08-30 18:04:50 +00:00
|
|
|
return nil
|
|
|
|
default:
|
|
|
|
return fmt.Errorf("group: invalid enum value for currency field: %q", c)
|
|
|
|
}
|
|
|
|
}
|