models

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

models/mailbox.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DMARCMonitoring added in v0.0.3

type DMARCMonitoring struct {
	ID            string    `gorm:"primary_key;type:uuid;default:gen_random_uuid()" json:"id"`
	Tenant        string    `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
	CreatedAt     time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
	EmailProvider string    `gorm:"column:email_provider;type:varchar(255)" json:"emailProvider"`
	Domain        string    `gorm:"column:domain;type:varchar(255)" json:"domain"`
	ReportStart   time.Time `gorm:"column:report_start;type:timestamp" json:"reportStart"`
	ReportEnd     time.Time `gorm:"column:report_end;type:timestamp" json:"reportEnd"`
	MessageCount  int       `gorm:"column:message_count;type:integer" json:"messageCount"`
	SPFPass       int       `gorm:"column:spf_pass;type:integer" json:"spfPass"`
	DKIMPass      int       `gorm:"column:dkim_pass;type:integer" json:"dkimPass"`
	DMARCPass     int       `gorm:"column:dmarc_pass;type:integer" json:"dmarcPass"`
	Data          string    `gorm:"type:text"`
}

func (DMARCMonitoring) TableName added in v0.0.3

func (DMARCMonitoring) TableName() string

type Domain added in v0.0.3

type Domain struct {
	ID          uint64    `gorm:"primary_key;autoIncrement" json:"id"`
	Tenant      string    `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
	Domain      string    `gorm:"column:domain;type:varchar(255);NOT NULL;uniqueIndex" json:"domain"`
	Configured  bool      `gorm:"column:configured;type:boolean;NOT NULL;DEFAULT:false" json:"configured"`
	CreatedAt   time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
	UpdatedAt   time.Time `gorm:"column:updated_at;type:timestamp;DEFAULT:current_timestamp" json:"updatedAt"`
	Active      bool      `gorm:"column:active;type:boolean;NOT NULL;DEFAULT:true" json:"active"`
	DkimPublic  string    `gorm:"column:dkim_public;type:text" json:"dkimPublic"`
	DkimPrivate string    `gorm:"column:dkim_private;type:text" json:"dkimPrivate"`
}

func (Domain) TableName added in v0.0.3

func (Domain) TableName() string

type Email

type Email struct {
	ID         string              `gorm:"column:id;type:varchar(50);primaryKey" json:"id"`
	MailboxID  string              `gorm:"column:mailbox_id;type:varchar(50);index;not null" json:"mailboxId"`
	Direction  enum.EmailDirection `gorm:"column:direction;type:varchar(20);index;not null" json:"direction"`
	Status     enum.EmailStatus    `gorm:"column:status;type:varchar(20);index" json:"status"`
	Folder     string              `gorm:"column:folder;type:varchar(100);index;not null" json:"folder"`
	ImapUID    uint32              `gorm:"column:imap_uid;index" json:"imapUid"`
	MessageID  string              `gorm:"column:message_id;uniqueIndex;type:varchar(255);not null" json:"messageId"`
	ThreadID   string              `gorm:"column:thread_id;type:varchar(255);index" json:"threadId"`
	InReplyTo  string              `gorm:"column:in_reply_to;type:varchar(255);index" json:"inReplyTo"`
	References pq.StringArray      `gorm:"column:references;type:text[]" json:"references"`

	// Core email metadata
	Subject      string         `gorm:"column:subject;type:varchar(1000)" json:"subject"`
	CleanSubject string         `gorm:"column:clean_subject;type:varchar(1000)" json:"cleanSubject"`
	FromAddress  string         `gorm:"column:from_address;type:varchar(255);index" json:"fromAddress"`
	FromName     string         `gorm:"column:from_name;type:varchar(255)" json:"fromName"`
	FromUser     string         `gorm:"column:from_user;type:varchar(255)" json:"fromUser"`
	FromDomain   string         `gorm:"column:from_domain;type:varchar(255)" json:"fromDomain"`
	ReplyTo      string         `gorm:"column:reply_to;type:varchar(255);index" json:"replyTo"`
	ToAddresses  pq.StringArray `gorm:"column:to_addresses;type:text[]" json:"toAddresses"`
	CcAddresses  pq.StringArray `gorm:"column:cc_addresses;type:text[]" json:"ccAddresses"`
	BccAddresses pq.StringArray `gorm:"column:bcc_addresses;type:text[]" json:"bccAddresses"`
	TrackClicks  bool           `gorm:"column:track_clicks;default:false" json:"trackClicks"`

	// Content
	BodyText      string `gorm:"column:body_text;type:text" json:"bodyText"`
	BodyHTML      string `gorm:"column:body_html;type:text" json:"bodyHtml"`
	BodyMarkdown  string `gorm:"column:body_markdown;type:text" json:"bodyMarkdown"`
	HasAttachment bool   `gorm:"column:has_attachment;default:false" json:"hasAttachment"`
	HasSignature  bool   `gorm:"column:has_signature;default:false" json:"hasSignature"`

	// Send Details
	StatusDetail string `gorm:"column:status_detail;type:text" json:"statusDetail"` // Error message or delivery info
	SendAttempts int    `gorm:"column:send_attempts;default:0" json:"sendAttempts"` // Number of send attempts

	// Time information
	SentAt        *time.Time `gorm:"column:sent_at;type:timestamp;index" json:"sentAt"`
	ReceivedAt    *time.Time `gorm:"column:received_at;type:timestamp;index" json:"receivedAt"`
	LastAttemptAt *time.Time `gorm:"column:last_attempt_at;type:timestamp" json:"lastAttemptAt"`    // When last send attempt occurred
	ScheduledFor  *time.Time `gorm:"column:scheduled_for;type:timestamp;index" json:"scheduledFor"` // For scheduled sends

	// Extensions and provider-specific data
	GmailLabels       pq.StringArray `gorm:"column:gmail_labels;type:text[]" json:"gmailLabels"`
	OutlookCategories pq.StringArray `gorm:"column:outlook_categories;type:text[]" json:"outlookCategories"`
	MailstackFlags    pq.StringArray `gorm:"column:mailstack_flags;type:text[]" json:"mailstackFlags"`

	// Raw data
	RawHeaders    JSONMap `gorm:"column:raw_headers;type:jsonb" json:"rawHeaders"`
	Envelope      JSONMap `gorm:"column:envelope;type:jsonb" json:"envelope"`
	BodyStructure JSONMap `gorm:"column:body_structure;type:jsonb" json:"bodyStructure"`

	// Classification
	Classification       enum.EmailClassification `gorm:"column:classification;type:varchar(50);index" json:"classification"`
	ClassificationReason string                   `gorm:"column:classification_reason;type:text" json:"classificationReason"`

	// Standard timestamps
	CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
}

Email represents a raw email message stored in the database

func (*Email) AllParticipants added in v0.0.3

func (e *Email) AllParticipants() []string

AllParticipants returns all email participants including sender and recipients

func (*Email) AllRecipients added in v0.0.3

func (e *Email) AllRecipients() []string

func (*Email) BeforeCreate

func (e *Email) BeforeCreate(tx *gorm.DB) error

func (*Email) BuildHeaders

func (e *Email) BuildHeaders() map[string]string

BuildHeaders creates a map of headers for an outgoing email

func (*Email) HasRichContent

func (e *Email) HasRichContent() bool

func (*Email) Headers

func (e *Email) Headers() (*EmailHeaders, error)

func (Email) TableName

func (Email) TableName() string

type EmailAttachment

type EmailAttachment struct {
	ID          string         `gorm:"type:varchar(50);primaryKey"`
	Emails      pq.StringArray `gorm:"type:varchar(50)[];index;not null"`
	Threads     pq.StringArray `gorm:"type:varchar(50)[];index;not null"`
	Filename    string         `gorm:"type:varchar(500)"`
	ContentType string         `gorm:"type:varchar(255)"`
	ContentID   string         `gorm:"type:varchar(255)"` // For inline attachments
	Size        int            `gorm:"default:0"`
	IsInline    bool           `gorm:"default:false"`

	// Storage options
	StorageService string `gorm:"type:varchar(50)"`   // "s3", "azure", "local", etc.
	StorageBucket  string `gorm:"type:varchar(255)"`  // For cloud storage
	StorageKey     string `gorm:"type:varchar(1000)"` // If stored in S3/blob storage

	// Security and verification
	ContentHash string `gorm:"type:varchar(64);index"` // SHA-256 hash of content

	// Standard timestamps
	CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
}

EmailAttachment represents an attachment to an email

func (*EmailAttachment) BeforeCreate

func (e *EmailAttachment) BeforeCreate(tx *gorm.DB) error

func (EmailAttachment) TableName

func (EmailAttachment) TableName() string

TableName overrides the table name for EmailAttachment

type EmailHeaders

type EmailHeaders struct {
	AutoSubmitted      bool
	ContentDescription string
	DeliveryStatus     bool
	ListUnsubscribe    bool
	Precedence         string
	ReturnPath         string
	ReturnPathExists   bool
	XAutoreply         string
	XAutoresponse      string
	XLoop              bool
	XFailedRecipients  []string
	ReplyTo            string
	ReplyToExists      bool
	Sender             string
	ForwardedFor       string
	DKIM               []string
	SPF                string
	DMARC              string
}

EmailHeaders represents specific email header information needed for processing

type EmailMessage added in v0.0.3

type EmailMessage struct {
	ID        uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey"`
	CreatedAt time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp"`

	Status EmailMessageStatus `gorm:"size:50;not null;"`

	SentAt *time.Time `gorm:"column:sent_at;type:timestamp;"`
	Error  *string    `gorm:"column:error;type:text"`

	UniqueInternalIdentifier *string `gorm:"size:255;index:unique_internal_identifier"`

	Tenant       string `gorm:"size:255;not null;index:idx_raw_email_external_system"`
	ProducerId   string `gorm:"size:255;not null;"`
	ProducerType string `gorm:"size:255;not null;"`

	//Email message data
	FromName     string   `gorm:"size:255;"`
	From         string   `gorm:"size:255;"`
	FromProvider string   `gorm:"size:255;"`
	To           []string `gorm:"-"`
	ToString     string   `gorm:"type:text;column:to"`
	Cc           []string `gorm:"-"`
	CcString     string   `gorm:"type:text;column:cc"`
	Bcc          []string `gorm:"-"`
	BccString    string   `gorm:"type:text;column:bcc"`
	Subject      string
	Content      string

	//COS interaction event id
	//deprecated
	ReplyTo *string

	//Values taken from providers
	ProviderMessageId  string `gorm:"size:255;not null;"`
	ProviderThreadId   string `gorm:"size:255;not null;"`
	ProviderInReplyTo  string `gorm:"size:255;not null;"`
	ProviderReferences string `gorm:"size:255;not null;"`
}

func (*EmailMessage) AfterFind added in v0.0.3

func (e *EmailMessage) AfterFind(tx *gorm.DB) (err error)

AfterFind hook for converting strings to slices

func (*EmailMessage) BeforeSave added in v0.0.3

func (e *EmailMessage) BeforeSave(tx *gorm.DB) (err error)

BeforeSave hook for converting slices to strings

func (EmailMessage) TableName added in v0.0.3

func (EmailMessage) TableName() string

type EmailMessageStatus added in v0.0.3

type EmailMessageStatus string
const (
	EmailMessageStatusScheduled EmailMessageStatus = "SCHEDULED"
	EmailMessageStatusSent      EmailMessageStatus = "SENT"
	EmailMessageStatusProcessed EmailMessageStatus = "PROCESSED"
	EmailMessageStatusError     EmailMessageStatus = "ERROR"
)

type EmailThread

type EmailThread struct {
	ID             string         `gorm:"column:id;type:varchar(50);primaryKey" json:"id"`
	MailboxID      string         `gorm:"column:mailbox_id;type:varchar(50);index" json:"mailboxId"`
	Subject        string         `gorm:"column:subject;type:varchar(1000)" json:"subject"`
	Participants   pq.StringArray `gorm:"column:participants;type:text[]" json:"participants"`
	LastMessageID  string         `gorm:"column:last_message_id;type:varchar(255)" json:"lastMessageId"`
	HasAttachments bool           `gorm:"column:has_attachments;default:false" json:"hasAttachments"`
	LastMessageAt  *time.Time     `gorm:"column:last_message_at;type:timestamp" json:"lastMessageAt"`
	FirstMessageAt *time.Time     `gorm:"column:first_message_at;type:timestamp" json:"firstMessageAt"`
	CreatedAt      time.Time      `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
	UpdatedAt      time.Time      `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
}

func (*EmailThread) BeforeCreate

func (e *EmailThread) BeforeCreate(tx *gorm.DB) error

func (EmailThread) TableName

func (EmailThread) TableName() string

type JSONMap

type JSONMap map[string]interface{}

JSONMap represents a JSON object that can be stored in PostgreSQL

func (*JSONMap) Scan

func (j *JSONMap) Scan(value interface{}) error

Scan implements the sql.Scanner interface for JSONMap

func (JSONMap) Value

func (j JSONMap) Value() (driver.Value, error)

Value implements the driver.Valuer interface for JSONMap

type MailStackDomain added in v0.0.3

type MailStackDomain struct {
	ID          uint64    `gorm:"primary_key;autoIncrement" json:"id"`
	Tenant      string    `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
	Domain      string    `gorm:"column:domain;type:varchar(255);NOT NULL;uniqueIndex" json:"domain"`
	Configured  bool      `gorm:"column:configured;type:boolean;NOT NULL;DEFAULT:false" json:"configured"`
	CreatedAt   time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
	UpdatedAt   time.Time `gorm:"column:updated_at;type:timestamp" json:"updatedAt"`
	Active      bool      `gorm:"column:active;type:boolean;NOT NULL;DEFAULT:true" json:"active"`
	DkimPublic  string    `gorm:"column:dkim_public;type:text" json:"dkimPublic"`
	DkimPrivate string    `gorm:"column:dkim_private;type:text" json:"dkimPrivate"`
}

TODO: Deprecated, drop in favor of Domain model

func (MailStackDomain) TableName added in v0.0.3

func (MailStackDomain) TableName() string

type MailStackDomainConfiguration added in v0.0.3

type MailStackDomainConfiguration struct {
}

type Mailbox

type Mailbox struct {
	ID            string             `gorm:"column:id;type:varchar(50);primaryKey" json:"id"`
	Tenant        string             `gorm:"column:tenant;type:varchar(255)" json:"tenant"`
	UserID        string             `gorm:"column:user_id;type:varchar(255);index" json:"userId"`
	Provider      enum.EmailProvider `gorm:"column:provider;type:varchar(50);index;not null" json:"provider"`
	EmailAddress  string             `gorm:"column:email_address;type:varchar(255);index" json:"emailAddress"`
	MailboxUser   string             `gorm:"column:mailbox_user;type:varchar(255);index" json:"mailboxUser"`
	MailboxDomain string             `gorm:"column:mailbox_domain;type:varchar(255);index" json:"mailboxDomain"`
	SenderID      string             `gorm:"column:sender_id;type:varchar(255);index" json:"senderId"`

	// Common connection properties
	InboundEnabled  bool `gorm:"column:inbound_enabled;default:true" json:"inboundEnabled"`
	OutboundEnabled bool `gorm:"column:outbound_enabled;default:true" json:"outboundEnabled"`

	// Protocol-specific configurations (null for API-based providers)
	ImapServer   string             `gorm:"column:imap_server;type:varchar(255)" json:"imapServer"`
	ImapPort     int                `gorm:"column:imap_port" json:"imapPort"`
	ImapUsername string             `gorm:"column:imap_username;type:varchar(255)" json:"imapUsername"`
	ImapPassword string             `gorm:"column:imap_password;type:varchar(255)" json:"imapPassword"`
	ImapSecurity enum.EmailSecurity `gorm:"column:imap_security;type:varchar(50)" json:"imapSecurity"`

	SmtpServer   string             `gorm:"column:smtp_server;type:varchar(255)" json:"smtpServer"`
	SmtpPort     int                `gorm:"column:smtp_port" json:"smtpPort"`
	SmtpUsername string             `gorm:"column:smtp_username;type:varchar(255)" json:"smtpUsername"`
	SmtpPassword string             `gorm:"column:smtp_password;type:varchar(255)" json:"smtpPassword"`
	SmtpSecurity enum.EmailSecurity `gorm:"column:smtp_security;type:varchar(50)" json:"smtpSecurity"`

	// OAuth specific fields (for Google, Microsoft, etc.)
	OAuthClientID     string     `gorm:"column:oauth_client_id;type:varchar(255)" json:"oauthClientId"`
	OAuthClientSecret string     `gorm:"column:oauth_client_secret;type:varchar(255)" json:"oauthClientSecret"`
	OAuthRefreshToken string     `gorm:"column:oauth_refresh_token;type:varchar(1000)" json:"oauthRefreshToken"`
	OAuthAccessToken  string     `gorm:"column:oauth_access_token;type:varchar(1000)" json:"oauthAccessToken"`
	OAuthTokenExpiry  *time.Time `gorm:"column:oauth_token_expiry;type:timestamp" json:"oauthTokenExpiry"`
	OAuthScope        string     `gorm:"column:oauth_scope;type:varchar(500)" json:"oauthScope"`

	// Email sending configuration
	ReplyToAddress string `gorm:"column:reply_to_address;type:varchar(255)" json:"replyToAddress"`

	// Sync configuration
	SyncFolders pq.StringArray `gorm:"column:sync_folders;type:text[]" json:"syncFolders"`

	// Status tracking
	ConnectionStatus    enum.ConnectionStatus `gorm:"column:connection_status;type:varchar(50)" json:"connectionStatus"`
	LastConnectionCheck *time.Time            `gorm:"column:last_connection_check;type:timestamp" json:"lastConnectionCheck"`
	ErrorMessage        string                `gorm:"column:error_message;type:text" json:"errorMessage"`

	// Send rate limits
	DailySendQuota int        `gorm:"column:daily_quota;default:2000" json:"dailyQuota"`
	DailySendCount int        `gorm:"column:daily_send_count;default:0" json:"dailySendCount"`
	QuotaResetAt   *time.Time `gorm:"column:quota_reset_at;type:timestamp" json:"quotaResetAt"`

	// Standard timestamps
	CreatedAt time.Time      `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"`
}

Mailbox represents an email account configuration with provider-specific settings

func (*Mailbox) BeforeCreate

func (m *Mailbox) BeforeCreate(tx *gorm.DB) error

func (Mailbox) TableName

func (Mailbox) TableName() string

TableName sets the table name for the Mailbox model

type MailboxStatus added in v0.0.3

type MailboxStatus string
const (
	MailboxStatusPendingProvisioning MailboxStatus = "PENDING_PROVISIONING"
	MailboxStatusProvisioned         MailboxStatus = "PROVISIONED"
)

type MailboxSyncState

type MailboxSyncState struct {
	ID         string    `gorm:"column:id;type:varchar(50);primaryKey"`
	MailboxID  string    `gorm:"column:mailbox_id;type:varchar(50);index;not null"`
	FolderName string    `gorm:"column:folder_name;type:varchar(100);index;not null"`
	LastUID    uint32    `gorm:"column:last_uid;not null"`
	LastSync   time.Time `gorm:"column:last_sync;type:timestamp"`
	CreatedAt  time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp"`
	UpdatedAt  time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp"`
}

MailboxSyncState represents the synchronization state for a mailbox folder

func (*MailboxSyncState) BeforeCreate added in v0.0.3

func (m *MailboxSyncState) BeforeCreate(tx *gorm.DB) error

func (MailboxSyncState) TableName

func (MailboxSyncState) TableName() string

type MailstackReputation added in v0.0.3

type MailstackReputation struct {
	ID                  string    `gorm:"primary_key;type:uuid;default:gen_random_uuid()" json:"id"`
	Tenant              string    `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
	CreatedAt           time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
	Domain              string    `gorm:"column:domain;type:varchar(255)" json:"domain"`
	DomainAgePenalty    int       `gorm:"column:domain_age_penalty;type:integer" json:"domainAgePenalty"`
	BlacklistPenaltyPct int       `gorm:"column:blacklist_penalty_pct;type:integer" json:"blacklistPenaltyPct"`
	BouncePenaltyPct    int       `gorm:"column:bounce_penalty_pct;type:integer" json:"bouncePenaltyPct"`
	DMARCPenaltyPct     int       `gorm:"column:dmarc_penalty_pct;type:integer" json:"dmarcPenaltyPct"`
	SPFPenaltyPct       int       `gorm:"column:spf_penalty_pct;type:integer" json:"spfPenaltyPct"`
}

func (MailstackReputation) TableName added in v0.0.3

func (MailstackReputation) TableName() string

type OrphanEmail added in v0.0.3

type OrphanEmail struct {
	ID           string    `gorm:"column:id;type:varchar(50);primaryKey"`
	MessageID    string    `gorm:"column:message_id;type:varchar(255);uniqueIndex"`
	ReferencedBy string    `gorm:"column:referenced_by;type:varchar(255)"` // Email ID that referenced this
	ThreadID     string    `gorm:"column:thread_id;type:varchar(50);index"`
	MailboxID    string    `gorm:"column:mailbox_id;type:varchar(50);index"`
	CreatedAt    time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp"`
}

func (*OrphanEmail) BeforeCreate added in v0.0.3

func (m *OrphanEmail) BeforeCreate(tx *gorm.DB) error

func (OrphanEmail) TableName added in v0.0.3

func (OrphanEmail) TableName() string

type Sender added in v0.0.22

type Sender struct {
	ID             string    `gorm:"column:id;type:varchar(50);primaryKey" json:"id"`
	Tenant         string    `gorm:"column:tenant;type:varchar(255)" json:"tenant"`
	UserID         string    `gorm:"column:user_id;type:varchar(255);index" json:"userId"`
	DisplayName    string    `gorm:"column:display_name;type:varchar(255)" json:"displayName"`
	SignatureHTML  string    `gorm:"column:signature_html;type:text" json:"signatureHtml"`
	SignaturePlain string    `gorm:"column:signature_plain;type:text" json:"signaturePlain"`
	IsDefault      bool      `gorm:"column:is_default;type:boolean" json:"isDefault"`
	IsActive       bool      `gorm:"column:is_active;type:boolean" json:"isActive"`
	CreatedAt      time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
	UpdatedAt      time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
}

func (*Sender) BeforeCreate added in v0.0.22

func (m *Sender) BeforeCreate(tx *gorm.DB) error

func (Sender) TableName added in v0.0.22

func (Sender) TableName() string

type TenantSettingsMailbox added in v0.0.3

type TenantSettingsMailbox struct {
	ID        string    `gorm:"primary_key;type:uuid;default:gen_random_uuid()" json:"id"`
	Tenant    string    `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
	CreatedAt time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp" json:"updatedAt"`

	MailboxUsername string `gorm:"column:mailbox_username;type:varchar(255)" json:"mailboxUsername"`
	MailboxPassword string `gorm:"column:mailbox_password;type:varchar(255)" json:"mailboxPassword"`

	Domain   string `gorm:"column:domain;type:varchar(255)" json:"domain"`
	Username string `gorm:"column:user_name;type:varchar(255)" json:"userName"`

	UserId string `gorm:"column:user_id;type:varchar(255)" json:"userId"` // linked user in neo4j

	ForwardingTo   string `gorm:"column:forwarding_to;type:text" json:"forwardingTo"`
	WebmailEnabled bool   `gorm:"column:webmail_enabled;type:boolean" json:"webmailEnabled"`

	LastRampUpAt  time.Time `gorm:"column:last_ramp_up_at;type:timestamp" json:"lastRampUpAt"`
	RampUpRate    int       `gorm:"type:integer" json:"rampUpRate"`
	RampUpMax     int       `gorm:"type:integer" json:"rampUpMax"`
	RampUpCurrent int       `gorm:"type:integer" json:"rampUpCurrent"`

	MinMinutesBetweenEmails int `gorm:"type:integer" json:"minMinutesBetweenEmails"`
	MaxMinutesBetweenEmails int `gorm:"type:integer" json:"maxMinutesBetweenEmails"`

	ConfigureAttemptAt *time.Time    `gorm:"column:configure_attempt_at;type:timestamp" json:"configureAttemptAt"`
	Status             MailboxStatus `gorm:"column:status;type:varchar(255)" json:"status"`
}

func (TenantSettingsMailbox) TableName added in v0.0.3

func (TenantSettingsMailbox) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL