dto

package
v0.0.0-...-7831d8d Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE_FAILED_CREATE_REGISTRATION  = "failed registered for IoI Competition"
	MESSAGE_SUCCESS_CREATE_REGISTRATION = "successfully registered for IoI Competition"
	MESSAGE_FAILED_UPDATE_REGISTRATION  = "failed updated for IoI Competition"
	MESSAGE_SUCCESS_UPDATE_REGISTRATION = "successfully updated for IoI Competition"
)

Error messages

View Source
const (
	// Failed
	MESSAGE_FAILED_GET_DATA_FROM_BODY      = "failed get data from body"
	MESSAGE_FAILED_REGISTER_USER           = "failed create user"
	MESSAGE_FAILED_GET_LIST_USER           = "failed get list user"
	MESSAGE_FAILED_GET_USER_TOKEN          = "failed get user token"
	MESSAGE_FAILED_TOKEN_NOT_VALID         = "token not valid"
	MESSAGE_FAILED_TOKEN_NOT_FOUND         = "token not found"
	MESSAGE_FAILED_GET_USER                = "failed get user"
	MESSAGE_FAILED_LOGIN                   = "failed login"
	MESSAGE_FAILED_WRONG_EMAIL_OR_PASSWORD = "wrong email or password"
	MESSAGE_FAILED_UPDATE_USER             = "failed update user"
	MESSAGE_FAILED_DELETE_USER             = "failed delete user"
	MESSAGE_FAILED_PROSES_REQUEST          = "failed proses request"
	MESSAGE_FAILED_DENIED_ACCESS           = "denied access"
	MESSAGE_FAILED_VERIFY_EMAIL            = "failed verify email"

	// Success
	MESSAGE_SUCCESS_REGISTER_USER           = "success create user"
	MESSAGE_SUCCESS_GET_LIST_USER           = "success get list user"
	MESSAGE_SUCCESS_GET_USER                = "success get user"
	MESSAGE_SUCCESS_LOGIN                   = "success login"
	MESSAGE_SUCCESS_UPDATE_USER             = "success update user"
	MESSAGE_SUCCESS_DELETE_USER             = "success delete user"
	MESSAGE_SEND_VERIFICATION_EMAIL_SUCCESS = "success send verification email"
	MESSAGE_SUCCESS_VERIFY_EMAIL            = "success verify email"
	MESSAGE_SUCCESS_REGISTER_USER_DETAIL    = "success register user detail"
)

Variables

View Source
var (
	ErrCreateregistrant             = errors.New("failed to create registrant")
	ErrGetAllregistrant             = errors.New("failed to get all registrant")
	ErrGetregistrantById            = errors.New("failed to get registrant by id")
	ErrGetregistrantByEmail         = errors.New("failed to get registrant by email")
	ErrUpdateregistrant             = errors.New("failed to update registrant")
	ErrregistrantNotFound           = errors.New("registrant not found")
	ErrRegistrantEmailAlreadyExists = errors.New("email already exist")
)

Error variables

View Source
var (
	ErrCreateUser             = errors.New("failed to create user")
	ErrGetAllUser             = errors.New("failed to get all user")
	ErrGetUserById            = errors.New("failed to get user by id")
	ErrGetUserByEmail         = errors.New("failed to get user by email")
	ErrEmailAlreadyExists     = errors.New("email already exist")
	ErrUpdateUser             = errors.New("failed to update user")
	ErrUserNotAdmin           = errors.New("user not admin")
	ErrUserNotFound           = errors.New("user not found")
	ErrEmailNotFound          = errors.New("email not found")
	ErrDeleteUser             = errors.New("failed to delete user")
	ErrPasswordNotMatch       = errors.New("password not match")
	ErrEmailOrPassword        = errors.New("wrong email or password")
	ErrAccountNotVerified     = errors.New("account not verified")
	ErrTokenInvalid           = errors.New("token invalid")
	ErrTokenExpired           = errors.New("token expired")
	ErrAccountAlreadyVerified = errors.New("account already verified")
	ErrAccountDetailsNotFound = errors.New("account details not found")
)

Functions

This section is empty.

Types

type GetAllPaymentResponse

type GetAllPaymentResponse struct {
	Payments []entity.Payments
	PaginationResponse
}

type GetAllRegistrantRepositoryResponse

type GetAllRegistrantRepositoryResponse struct {
	Registrants []entity.EventRegistrants
	PaginationResponse
}

type GetAllShortenLinkRepositoryResponse

type GetAllShortenLinkRepositoryResponse struct {
	ShortenLink []entity.ShortenLink
	PaginationResponse
}

type GetAllUserRepositoryResponse

type GetAllUserRepositoryResponse struct {
	Users []entity.Account
	PaginationResponse
}

type IdentitasPersonRequest

type IdentitasPersonRequest struct {
	Name               string `json:"name" form:"name" binding:"required"`
	Email              string `json:"email" form:"email" binding:"required"`
	PhoneNumber        string `json:"phone_number" form:"phone_number" binding:"required"`
	ImgIdentity        string `json:"img_identity" form:"img_identity" binding:"required"`
	ImgFollowInstagram string `json:"img_follow_instagram" form:"img_follow_instagram" binding:"required"`
	LinkTwibbon        string `json:"link_twibbon" form:"link_twibbon" binding:"required"`
	Role               string `json:"role" form:"role" binding:"required"`
	Registrant_ID      string `json:"registrant_id" form:"registrant_id" binding:"required"`
}

type IdentitasPersonResponse

type IdentitasPersonResponse struct {
	Name               string `json:"name"`
	Email              string `json:"email"`
	PhoneNumber        string `json:"phone_number"`
	ImgIdentity        string `json:"img_identity"`
	ImgFollowInstagram string `json:"img_follow_instagram"`
	LinkTwibbon        string `json:"link_twibbon"`
}

type IdentitasTimRequest

type IdentitasTimRequest struct {
	TeamName string `json:"team_name" form:"team_name" binding:"required"`
	School   string `json:"school" form:"school" binding:"required"`
}

type IdentitasTimResponse

type IdentitasTimResponse struct {
	AccountID string `json:"account_id"`
	Event     string `json:"event"`
	TeamName  string `json:"team_name"`
	School    string `json:"school"`
	Status    string `json:"status"`
	Phase     string `json:"phase"`
}

type PaginationRequest

type PaginationRequest struct {
	Search  string `form:"search"`
	Page    int    `form:"page"`
	PerPage int    `form:"per_page"`
}

func (*PaginationRequest) GetOffset

func (p *PaginationRequest) GetOffset() int

type PaginationResponse

type PaginationResponse struct {
	Page    int   `json:"page"`
	PerPage int   `json:"per_page"`
	MaxPage int64 `json:"max_page"`
	Count   int64 `json:"count"`
}

func (*PaginationResponse) GetLimit

func (p *PaginationResponse) GetLimit() int

func (*PaginationResponse) GetPage

func (p *PaginationResponse) GetPage() int

type PaymentPaginationResponse

type PaymentPaginationResponse struct {
	Data []PaymentResponse `json:"data"`
	PaginationResponse
}

type PaymentRequest

type PaymentRequest struct {
	Bank_ID            string                  `json:"bank_list"`
	Bank_Transfer_From string                  `json:"bank_transfer_from"`
	Name_Transfer_From string                  `json:"name_transfer_from"`
	Amount             int64                   `json:"amount"`
	Payment_Method     constants.PaymentMethod `json:"payment_method"`
	Payment_Proof      string                  `json:"payment_proof"`
}

Payment Structures

type PaymentResponse

type PaymentResponse struct {
	Payment_ID         string  `json:"payment_id"`
	Registrant_ID      string  `json:"registrant_id"`
	Bank_Transfer_From string  `json:"bank_transfer_from"`
	Name_Transfer_From string  `json:"name_transfer_from"`
	Amount             float64 `json:"amount"`
	Payment_Method     string  `json:"payment_method"`
	Payment_Proof      string  `json:"payment_proof"`
	Status             string  `json:"status"`
}

type RegistrantCreateRequest

type RegistrantCreateRequest struct {
	RegistrantDetails []RegistrantDetailRequest `json:"registrant_details" form:"registrant_details"`
	PaymentDetails    PaymentRequest            `json:"payment_details" form:"payment_details"`
}

type RegistrantCreateResponse

type RegistrantCreateResponse struct {
	RegistrantDetails []RegistrantDetailResponse `json:"registrant_details"`
	PaymentDetails    PaymentResponse            `json:"payment_details"`
}

Response DTOs

type RegistrantDetailRequest

type RegistrantDetailRequest struct {
	IdentitasTim     IdentitasTimRequest    `json:"identitas_tim" form:"identitas_tim"`
	IdentitasKetua   IdentitasPersonRequest `json:"identitas_ketua" form:"identitas_ketua"`
	IdentitasAnggota IdentitasPersonRequest `json:"identitas_anggota" form:"identitas_anggota"`
}

Detail Structure for Registrant

type RegistrantDetailResponse

type RegistrantDetailResponse struct {
	IdentitasTim     IdentitasTimResponse    `json:"identitas_tim"`
	IdentitasKetua   IdentitasPersonResponse `json:"identitas_ketua"`
	IdentitasAnggota IdentitasPersonResponse `json:"identitas_anggota"`
}

type RegistrantPaginationResponse

type RegistrantPaginationResponse struct {
	Data []RegistrantCreateResponse `json:"data"`
	PaginationResponse
}

type RegistrantUpdateRequest

type RegistrantUpdateRequest struct {
	RegistrantDetails []RegistrantDetailRequest `json:"registrant_details" form:"registrant_details"`
	PaymentDetails    PaymentRequest            `json:"payment_details" form:"payment_details"`
}

type RegistrantUpdateResponse

type RegistrantUpdateResponse struct {
	Status            constants.CompStatus       `json:"status"`
	RegistrantDetails []RegistrantDetailResponse `json:"registrant_details"`
	PaymentDetails    PaymentResponse            `json:"payment_details"`
}

type SendVerificationEmailRequest

type SendVerificationEmailRequest struct {
	Email string `json:"email" form:"email" binding:"required"`
}

type ShortenLinkCreateRequest

type ShortenLinkCreateRequest struct {
	Custom_Link   string `json:"custom_link" form:"custom_link" binding:"required" `
	Original_link string `json:"original_link" form:"original_link" binding:"required" `
}

type ShortenLinkCreateResponse

type ShortenLinkCreateResponse struct {
	Link string `json:"link" `
}

type ShortenLinkPaginationResponse

type ShortenLinkPaginationResponse struct {
	Data []ShortenLinkCreateResponse `json:"data"`
	PaginationResponse
}

type ShortenLinkUpdateRequest

type ShortenLinkUpdateRequest struct {
	Custom_Link   string `json:"custom_link" form:"custom_link" binding:"required" `
	Original_link string `json:"original_link" form:"original_link" binding:"required" `
}

type ShortenLinkUpdateResponse

type ShortenLinkUpdateResponse struct {
	Link string `json:"link" `
}

type UpdateStatusIsVerifiedRequest

type UpdateStatusIsVerifiedRequest struct {
	UserId     string `json:"user_id" form:"user_id" binding:"required"`
	IsVerified bool   `json:"is_verified" form:"is_verified"`
}

type UserCreateRequest

type UserCreateRequest struct {
	Email        string            `json:"email" form:"email"`
	Password     string            `json:"password" form:"password"`
	Name         string            `json:"name" form:"name"`
	Phone_Number string            `json:"phone_number" form:"phone_number"`
	Jenjang      constants.Jenjang `json:"jenjang" form:"jenjang"`
}

type UserLoginRequest

type UserLoginRequest struct {
	Email    string `json:"email" form:"email" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

type UserLoginResponse

type UserLoginResponse struct {
	ID    uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"id"`
	Role  string    `json:"role"`
	Token string    `json:"token"`
}

type UserPaginationResponse

type UserPaginationResponse struct {
	Data []UserResponse `json:"data"`
	PaginationResponse
}

type UserResponse

type UserResponse struct {
	ID              string            `json:"id"`
	Email           string            `json:"email"`
	IsEmailVerified bool              `json:"is_verified"`
	Role            string            `json:"role"`
	Name            string            `json:"name" form:"name"`
	Phone_Number    string            `json:"phone_number" form:"phone_number"`
	Jenjang         constants.Jenjang `json:"jenjang" form:"jenjang"`
}

type UserUpdateRequest

type UserUpdateRequest struct {
	Name         string `json:"name" form:"name"`
	Phone_Number string `json:"telp_number" form:"telp_number"`
	Email        string `json:"email" form:"email"`
}

type UserUpdateResponse

type UserUpdateResponse struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Phone_Number    string `json:"telp_number"`
	Role            string `json:"role"`
	Email           string `json:"email"`
	IsEmailVerified bool   `json:"is_verified"`
}

type VerifyEmailRequest

type VerifyEmailRequest struct {
	Token string `json:"token" form:"token" binding:"required"`
}

type VerifyEmailResponse

type VerifyEmailResponse struct {
	Email      string `json:"email"`
	IsVerified bool   `json:"is_verified"`
}

Jump to

Keyboard shortcuts

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