Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserBaseRecordMapper ¶
type UserBaseRecordMapper interface {
// ToUserRecord maps a User database row to a UserRecord domain model.
//
// Parameters:
// - user: A pointer to a User representing the database row.
//
// Returns:
// - A pointer to a UserRecord containing the mapped data, including
// ID, FirstName, LastName, VerifiedCode, IsVerified, Email, Password, CreatedAt, UpdatedAt, and DeletedAt.
ToUserRecord(user *db.User) *record.UserRecord
}
type UserCommandRecordMapper ¶
type UserCommandRecordMapper interface {
UserBaseRecordMapper
}
UserCommandRecordMapper maps user table rows to domain models for command operations.
func NewUserCommandRecordMapper ¶
func NewUserCommandRecordMapper() UserCommandRecordMapper
type UserQueryRecordMapper ¶
type UserQueryRecordMapper interface {
UserBaseRecordMapper
// ToUserRecordPagination maps a GetUsersWithPaginationRow database row to a UserRecord domain model.
//
// Parameters:
// - user: A pointer to a GetUsersWithPaginationRow representing the database row.
//
// Returns:
// - A pointer to a UserRecord containing the mapped data, including
// ID, FirstName, LastName, Email, Password, IsVerified, CreatedAt, UpdatedAt, and DeletedAt.
ToUserRecordPagination(user *db.GetUsersWithPaginationRow) *record.UserRecord
// ToUsersRecordPagination maps a slice of GetUsersWithPaginationRow database rows to a slice of UserRecord domain models.
//
// Parameters:
// - users: A slice of pointers to GetUsersWithPaginationRow representing the database rows.
//
// Returns:
// - A slice of pointers to UserRecord containing the mapped data for each user, including
// ID, FirstName, LastName, Email, Password, IsVerified, CreatedAt, UpdatedAt, and DeletedAt.
ToUsersRecordPagination(users []*db.GetUsersWithPaginationRow) []*record.UserRecord
// ToUserRecordActivePagination maps a GetActiveUsersWithPaginationRow database row to a UserRecord domain model.
//
// Parameters:
// - user: A pointer to a GetActiveUsersWithPaginationRow representing the database row.
//
// Returns:
// - A pointer to a UserRecord containing the mapped data, including
// ID, FirstName, LastName, Email, Password, IsVerified, CreatedAt, UpdatedAt, and DeletedAt.
ToUserRecordActivePagination(user *db.GetActiveUsersWithPaginationRow) *record.UserRecord
// ToUsersRecordActivePagination maps a slice of GetActiveUsersWithPaginationRow database rows to a slice of UserRecord domain models.
//
// Parameters:
// - users: A slice of pointers to GetActiveUsersWithPaginationRow representing the database rows.
//
// Returns:
// - A slice of pointers to UserRecord containing the mapped data for each user, including
// ID, FirstName, LastName, Email, Password, IsVerified, CreatedAt, UpdatedAt, and DeletedAt.
ToUsersRecordActivePagination(users []*db.GetActiveUsersWithPaginationRow) []*record.UserRecord
// ToUserRecordTrashedPagination maps a GetTrashedUsersWithPaginationRow database row to a UserRecord domain model.
//
// Parameters:
// - user: A pointer to a GetTrashedUsersWithPaginationRow representing the database row.
//
// Returns:
// - A pointer to a UserRecord containing the mapped data, including
// ID, FirstName, LastName, Email, Password, CreatedAt, UpdatedAt, and DeletedAt.
ToUserRecordTrashedPagination(user *db.GetTrashedUsersWithPaginationRow) *record.UserRecord
// ToUsersRecordTrashedPagination maps a slice of GetTrashedUsersWithPaginationRow database rows
// to a slice of UserRecord domain models.
//
// Parameters:
// - users: A slice of pointers to GetTrashedUsersWithPaginationRow representing the database rows.
//
// Returns:
// - A slice of pointers to UserRecord containing the mapped data for each user, including
// ID, FirstName, LastName, Email, Password, CreatedAt, UpdatedAt, and DeletedAt. domain models.
ToUsersRecordTrashedPagination(users []*db.GetTrashedUsersWithPaginationRow) []*record.UserRecord
}
UserQueryRecordMapper maps user query results to domain models.
func NewUserQueryRecordMapper ¶
func NewUserQueryRecordMapper() UserQueryRecordMapper
NewUserQueryRecordMapper creates a new instance of userQueryRecordMapper, which implements the UserQueryRecordMapper interface. This mapper is responsible for mapping user query results from the database to domain models, facilitating data transformation and access in the application.
type UserRecordMapper ¶ added in v1.0.13
type UserRecordMapper interface {
QueryMapper() UserQueryRecordMapper
CommandMapper() UserCommandRecordMapper
}
func NewUserRecordMapper ¶
func NewUserRecordMapper() UserRecordMapper
Click to show internal directories.
Click to hide internal directories.