Documentation ¶
Index ¶
- func AdminRegisterHandler(c *gin.Context, h *database.Handler, storage *storage.Handler)
- func ApproveSeller(c *gin.Context, h *database.Handler)
- func LoginHandler(c *gin.Context, h *database.Handler)
- func LoginHandlerForAdmin(c *gin.Context, h *database.Handler)
- func RegisterHandler(c *gin.Context, h *database.Handler, storage *storage.Handler)
- type PaymentHandler
- func (h *PaymentHandler) ConfirmPayment(c *gin.Context)
- func (h *PaymentHandler) ConfirmPaymentIntent(transaction *models.Transaction, payment *models.PaymentIntent) error
- func (h *PaymentHandler) CreatePayment(c *gin.Context)
- func (h *PaymentHandler) CreatePaymentIntent(transaction models.Transaction) (*stripe.PaymentIntent, error)
- type PetHandler
- func (h *PetHandler) CreatePet(c *gin.Context)
- func (h *PetHandler) DeletePet(c *gin.Context)
- func (h *PetHandler) GetCategories(c *gin.Context)
- func (h *PetHandler) GetFilteredPets(c *gin.Context)
- func (h *PetHandler) GetMasterData(c *gin.Context)
- func (h *PetHandler) GetMasterDataByCategory(c *gin.Context)
- func (h *PetHandler) GetPetByPetID(c *gin.Context)
- func (h *PetHandler) GetPetBySeller(c *gin.Context)
- func (h *PetHandler) UpdatePet(c *gin.Context)
- type ReportHandler
- type ReviewHandler
- type SellerHandler
- type TransactionHandler
- type UserHandler
- func (h *UserHandler) CheckMail(c *gin.Context)
- func (h *UserHandler) DeleteUser(c *gin.Context)
- func (h *UserHandler) GetUserByUserID(c *gin.Context)
- func (h *UserHandler) RecoveryUsername(c *gin.Context)
- func (h *UserHandler) SentOTP(c *gin.Context)
- func (h *UserHandler) UpdateForgotPassword(c *gin.Context)
- func (h *UserHandler) UpdateUser(c *gin.Context)
- func (h *UserHandler) UpdateUserPasswd(c *gin.Context)
- func (h *UserHandler) ValidateOTP(c *gin.Context)
- func (h *UserHandler) ValidatePassword(c *gin.Context)
- func (h *UserHandler) WhoAmI(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminRegisterHandler ¶
Types ¶
type PaymentHandler ¶
type PaymentHandler struct {
// contains filtered or unexported fields
}
func NewPaymentHandler ¶
func NewPaymentHandler(handler *database.Handler, env configs.EnvVars) *PaymentHandler
func (*PaymentHandler) ConfirmPayment ¶
func (h *PaymentHandler) ConfirmPayment(c *gin.Context)
ConfirmPayment godoc @Summary Confirm a payment @Description Confirm a payment for a transaction @Security ApiKeyAuth @Tags Payments @Accept json @Produce json @Param Payment body models.PaymentIntent true "Payment object" @Router /payment/confirm [post] @Success 200 {object} models.ConfirmPaymentResponse @Failure 400 {object} models.ErrorResponse @Failure 401 {object} models.ErrorResponse "Unauthorized"
func (*PaymentHandler) ConfirmPaymentIntent ¶
func (h *PaymentHandler) ConfirmPaymentIntent(transaction *models.Transaction, payment *models.PaymentIntent) error
func (*PaymentHandler) CreatePayment ¶
func (h *PaymentHandler) CreatePayment(c *gin.Context)
CreatePayment godoc @Summary Create a new payment @Description Create a new payment for a transaction @Security ApiKeyAuth @Tags Payments @Accept json @Produce json @Router /payment/create [post] @Param payment body models.CreatePaymentBody true "Payment object" @Success 201 {object} models.CreatePaymentResponse @Failure 400 {object} models.ErrorResponse "Bad Request" @Failure 401 {object} models.ErrorResponse "Unauthorized"
func (*PaymentHandler) CreatePaymentIntent ¶
func (h *PaymentHandler) CreatePaymentIntent(transaction models.Transaction) (*stripe.PaymentIntent, error)
type PetHandler ¶
type PetHandler struct {
// contains filtered or unexported fields
}
func NewPetHandler ¶
func NewPetHandler(db *database.Handler, stg *storage.Handler) *PetHandler
func (*PetHandler) CreatePet ¶
func (h *PetHandler) CreatePet(c *gin.Context)
CreatePet godoc @Summary Create a new pet @Description Creat a new pet @Tags Pets @Accept json @Security ApiKeyAuth @Param sellerID path string true "ID of the seller to perform the operation on" @Param Pet body models.PetRequest true "Pet object that needs to be created" @Router /api/v1/pets/seller/{sellerID} [post] @Success 200 {object} models.PetResponse "return created pet" @Failure 400 {object} models.ErrorResponse "bad request" @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
func (*PetHandler) DeletePet ¶
func (h *PetHandler) DeletePet(c *gin.Context)
DeletePet godoc @Summary Delete pet @Description Delete pet by pet ID and delete pet from user's pets @Security ApiKeyAuth @Tags Pets @Accept json @Produce json @Param petID path string true "ID of the pet to delete" @Router /api/v1/pets/pet/{petID} [delete] @Success 200 {object} models.DeletePetResponse "return deleted count" @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
func (*PetHandler) GetCategories ¶
func (h *PetHandler) GetCategories(c *gin.Context)
GetCategories godoc @Summary Get all categories that system have @tags Master Data @Description Get all categories that system have @Security ApiKeyAuth @id GetCategories @produce json @Router /api/v1/pets/categories [get] @Success 200 {object} models.MasterDataCategoryResponse @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
func (*PetHandler) GetFilteredPets ¶
func (h *PetHandler) GetFilteredPets(c *gin.Context)
GetPetFilteredPets godoc @Summary Get filtered pets @tags Pets @Description Get filtered pets by filter params @id GetFilteredPets @Security ApiKeyAuth @produce json @Router /api/v1/pets/ [get] @Param category query string false "Category of pet" @Param species query string false "Species of pet" @Param sex query string false "Sex of pet" @Param behavior query string false "Behavior of pet" @Param minAge query int false "Minimum age of pet" @Param maxAge query int false "Maximum age of pet" @Param minWeight query int false "Minimum weight of pet" @Param maxWeight query int false "Maximum weight of pet" @Param minPrice query int false "Minimum price of pet" @Param maxPrice query int false "Maximum price of pet" @Success 200 {object} models.PetCardResponse @Failure 400 {object} models.ErrorResponse "bad request" @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
func (*PetHandler) GetMasterData ¶
func (h *PetHandler) GetMasterData(c *gin.Context)
GetMasterData godoc @Summary Get all master data @tags Master Data @Description Get all master data @Security ApiKeyAuth @id GetMasterData @produce json @Router /api/v1/pets/master [get] @Success 200 {object} models.AllMasterDataResponse @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
func (*PetHandler) GetMasterDataByCategory ¶
func (h *PetHandler) GetMasterDataByCategory(c *gin.Context)
GetMasterDataByCategory godoc @Summary Get master data by category @tags Master Data @Description Get master data by category @Security ApiKeyAuth @id GetMasterDataByCategory @produce json @Param category path string true "Category of master data" @Router /api/v1/pets/master/{category} [get] @Success 200 {object} models.MasterDataResponse @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
func (*PetHandler) GetPetByPetID ¶
func (h *PetHandler) GetPetByPetID(c *gin.Context)
GetPetByPetID godoc @Summary Get single pet by petID @tags Pets @Description Get single pet by petID @Security ApiKeyAuth @id GetPetByPetID @produce json @Param petID path string true "ID of the pet to perform the operation on" @Router /api/v1/pets/pet/{petID} [get] @Success 200 {object} models.PetResponse @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
func (*PetHandler) GetPetBySeller ¶
func (h *PetHandler) GetPetBySeller(c *gin.Context)
GetPetBySellerID godoc @Summary Get pets by sellerID @tags Pets @Description Get pets by sellerID @Security ApiKeyAuth @id GetPetBySeller @produce json @Param sellerID path string true "ID of the seller to perform the operation on" @Router /api/v1/pets/seller/{sellerID} [get] @Success 200 {object} models.PetCardResponse @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
func (*PetHandler) UpdatePet ¶
func (h *PetHandler) UpdatePet(c *gin.Context)
UpdatePet godoc @Summary Update pet @Description Update pet by pet ID @Tags Pets @Security ApiKeyAuth @Accept json @Produce json @Param petID path string true "ID of the pet to perform the operation on" @Param Pet body models.PetRequest true "Pet object that needs to be updated" @Router /api/v1/pets/pet/{petID} [put] @Success 200 {object} models.PetResponse "return updated pet" @Failure 400 {object} models.ErrorResponse "bad request" @Failure 401 {object} models.ErrorResponse "Unauthorized" @Failure 500 {object} models.ErrorResponse "internal server error"
type ReportHandler ¶
type ReportHandler struct {
// contains filtered or unexported fields
}
func NewReportHandler ¶
func NewReportHandler(handler *database.Handler) *ReportHandler
func (*ReportHandler) CreatePartyReport ¶
func (h *ReportHandler) CreatePartyReport(c *gin.Context)
func (*ReportHandler) CreateSystemReport ¶
func (h *ReportHandler) CreateSystemReport(c *gin.Context)
func (*ReportHandler) GetReport ¶
func (h *ReportHandler) GetReport(c *gin.Context)
type ReviewHandler ¶
type ReviewHandler struct {
// contains filtered or unexported fields
}
func NewReviewHandler ¶
func NewReviewHandler(handler *database.Handler) *ReviewHandler
func (*ReviewHandler) AddComment ¶
func (h *ReviewHandler) AddComment(c *gin.Context)
func (*ReviewHandler) CreateReview ¶
func (h *ReviewHandler) CreateReview(c *gin.Context)
func (*ReviewHandler) DeleteReview ¶
func (h *ReviewHandler) DeleteReview(c *gin.Context)
func (*ReviewHandler) GetReviewByID ¶
func (h *ReviewHandler) GetReviewByID(c *gin.Context)
func (*ReviewHandler) GetReviewBySeller ¶
func (h *ReviewHandler) GetReviewBySeller(c *gin.Context)
type SellerHandler ¶
type SellerHandler struct {
// contains filtered or unexported fields
}
func NewSellerHandler ¶
func NewSellerHandler(handler *database.Handler) *SellerHandler
func (*SellerHandler) AddBankAccount ¶
func (h *SellerHandler) AddBankAccount(c *gin.Context)
func (*SellerHandler) DeleteBankAccount ¶
func (h *SellerHandler) DeleteBankAccount(c *gin.Context)
func (*SellerHandler) GetAllSellers ¶
func (h *SellerHandler) GetAllSellers(c *gin.Context)
func (*SellerHandler) GetBankAccount ¶
func (h *SellerHandler) GetBankAccount(c *gin.Context)
func (*SellerHandler) GetSeller ¶
func (h *SellerHandler) GetSeller(c *gin.Context)
type TransactionHandler ¶
type TransactionHandler struct {
// contains filtered or unexported fields
}
func NewTransactionHandler ¶
func NewTransactionHandler(handler *database.Handler) *TransactionHandler
func (*TransactionHandler) GetTransactionByTransactionID ¶
func (h *TransactionHandler) GetTransactionByTransactionID(c *gin.Context)
func (*TransactionHandler) GetTransactions ¶
func (h *TransactionHandler) GetTransactions(c *gin.Context)
type UserHandler ¶
type UserHandler struct {
// contains filtered or unexported fields
}
func NewUserHandler ¶
func NewUserHandler(db *database.Handler, stg *storage.Handler) *UserHandler
func (*UserHandler) CheckMail ¶
func (h *UserHandler) CheckMail(c *gin.Context)
func (*UserHandler) DeleteUser ¶
func (h *UserHandler) DeleteUser(c *gin.Context)
func (*UserHandler) GetUserByUserID ¶
func (h *UserHandler) GetUserByUserID(c *gin.Context)
func (*UserHandler) RecoveryUsername ¶
func (h *UserHandler) RecoveryUsername(c *gin.Context)
func (*UserHandler) SentOTP ¶
func (h *UserHandler) SentOTP(c *gin.Context)
func (*UserHandler) UpdateForgotPassword ¶
func (h *UserHandler) UpdateForgotPassword(c *gin.Context)
func (*UserHandler) UpdateUser ¶
func (h *UserHandler) UpdateUser(c *gin.Context)
func (*UserHandler) UpdateUserPasswd ¶
func (h *UserHandler) UpdateUserPasswd(c *gin.Context)
func (*UserHandler) ValidateOTP ¶
func (h *UserHandler) ValidateOTP(c *gin.Context)
func (*UserHandler) ValidatePassword ¶
func (h *UserHandler) ValidatePassword(c *gin.Context)
func (*UserHandler) WhoAmI ¶
func (h *UserHandler) WhoAmI(c *gin.Context)