Documentation ¶
Index ¶
- Constants
- type Bulletin
- type BulletinAsSelectOption
- type BulletinListFilter
- type BulletinListResult
- type BulletinPaginationListFilter
- type BulletinPaginationListResult
- type BulletinStorer
- type BulletinStorerImpl
- func (impl BulletinStorerImpl) CheckIfExistsByEmail(ctx context.Context, email string) (bool, error)
- func (impl BulletinStorerImpl) Create(ctx context.Context, u *Bulletin) error
- func (impl BulletinStorerImpl) DeleteByID(ctx context.Context, id primitive.ObjectID) error
- func (impl BulletinStorerImpl) GetByEmail(ctx context.Context, email string) (*Bulletin, error)
- func (impl BulletinStorerImpl) GetByID(ctx context.Context, id primitive.ObjectID) (*Bulletin, error)
- func (impl BulletinStorerImpl) GetByPublicID(ctx context.Context, oldID uint64) (*Bulletin, error)
- func (impl BulletinStorerImpl) GetByVerificationCode(ctx context.Context, verificationCode string) (*Bulletin, error)
- func (impl BulletinStorerImpl) GetLatestByTenantID(ctx context.Context, tenantID primitive.ObjectID) (*Bulletin, error)
- func (impl BulletinStorerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *BulletinListFilter) ([]*BulletinAsSelectOption, error)
- func (impl BulletinStorerImpl) ListByFilter(ctx context.Context, f *BulletinPaginationListFilter) (*BulletinPaginationListResult, error)
- func (impl BulletinStorerImpl) UpdateByID(ctx context.Context, m *Bulletin) error
Constants ¶
View Source
const ( BulletinStatusActive = 1 BulletinStatusArchived = 2 )
View Source
const ( OrderAscending = 1 OrderDescending = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bulletin ¶
type Bulletin struct { ID primitive.ObjectID `bson:"_id" json:"id"` TenantID primitive.ObjectID `bson:"tenant_id" json:"tenant_id,omitempty"` CreatedAt time.Time `bson:"created_at" json:"created_at"` CreatedByUserID primitive.ObjectID `bson:"created_by_user_id" json:"created_by_user_id,omitempty"` CreatedByUserName string `bson:"created_by_user_name" json:"created_by_user_name"` CreatedFromIPAddress string `bson:"created_from_ip_address" json:"created_from_ip_address"` ModifiedAt time.Time `bson:"modified_at" json:"modified_at"` ModifiedByUserID primitive.ObjectID `bson:"modified_by_user_id" json:"modified_by_user_id,omitempty"` ModifiedByUserName string `bson:"modified_by_user_name" json:"modified_by_user_name"` ModifiedFromIPAddress string `bson:"modified_from_ip_address" json:"modified_from_ip_address"` Text string `bson:"text" json:"text"` Status int8 `bson:"status" json:"status"` PublicID uint64 `bson:"public_id" json:"public_id"` }
type BulletinAsSelectOption ¶
type BulletinListFilter ¶
type BulletinListResult ¶
type BulletinPaginationListResult ¶
type BulletinPaginationListResult struct { Results []*Bulletin `json:"results"` NextCursor string `json:"next_cursor"` HasNextPage bool `json:"has_next_page"` }
BulletinPaginationListResult represents the paginated list results for the associate records.
type BulletinStorer ¶
type BulletinStorer interface { Create(ctx context.Context, m *Bulletin) error GetByID(ctx context.Context, id primitive.ObjectID) (*Bulletin, error) GetByPublicID(ctx context.Context, oldID uint64) (*Bulletin, error) GetByEmail(ctx context.Context, email string) (*Bulletin, error) GetByVerificationCode(ctx context.Context, verificationCode string) (*Bulletin, error) GetLatestByTenantID(ctx context.Context, tenantID primitive.ObjectID) (*Bulletin, error) CheckIfExistsByEmail(ctx context.Context, email string) (bool, error) UpdateByID(ctx context.Context, m *Bulletin) error ListByFilter(ctx context.Context, f *BulletinPaginationListFilter) (*BulletinPaginationListResult, error) ListAsSelectOptionByFilter(ctx context.Context, f *BulletinListFilter) ([]*BulletinAsSelectOption, error) DeleteByID(ctx context.Context, id primitive.ObjectID) error }
BulletinStorer Interface for user.
func NewDatastore ¶
type BulletinStorerImpl ¶
type BulletinStorerImpl struct { Logger *slog.Logger DbClient *mongo.Client Collection *mongo.Collection }
func (BulletinStorerImpl) CheckIfExistsByEmail ¶
func (BulletinStorerImpl) Create ¶
func (impl BulletinStorerImpl) Create(ctx context.Context, u *Bulletin) error
func (BulletinStorerImpl) DeleteByID ¶
func (BulletinStorerImpl) GetByEmail ¶
func (BulletinStorerImpl) GetByPublicID ¶
func (BulletinStorerImpl) GetByVerificationCode ¶
func (BulletinStorerImpl) GetLatestByTenantID ¶
func (BulletinStorerImpl) ListAsSelectOptionByFilter ¶
func (impl BulletinStorerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *BulletinListFilter) ([]*BulletinAsSelectOption, error)
func (BulletinStorerImpl) ListByFilter ¶
func (impl BulletinStorerImpl) ListByFilter(ctx context.Context, f *BulletinPaginationListFilter) (*BulletinPaginationListResult, error)
func (BulletinStorerImpl) UpdateByID ¶
func (impl BulletinStorerImpl) UpdateByID(ctx context.Context, m *Bulletin) error
Click to show internal directories.
Click to hide internal directories.