controllers

package
v0.0.0-...-76732a0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAnalytics

func CreateAnalytics(c *gin.Context)

CreateAnalytics godoc @Summary Create and return MRR analytics data @Description Creating MRR analytics data with all components for given period and returning it @Tags analytics @Accept json @Produce json @Success 200 {object} models.ResponseSuccessAnalytics @Failure 400 {object} models.Response @Failure 401 {object} models.Response @Failure 500 {object} models.Response @Security ApiKeyAuth @Param request body models.Period true "Parameters for MRR analytics" @Router /analytics/mrr [post]

func DeleteFileContent

func DeleteFileContent(c *gin.Context)

DeleteFileContent godoc @Summary Deleting user's invoices file's content @Description Deleting invoices linked to file from database @Tags files @Accept json @Produce json @Success 200 {object} models.Response @Failure 400 {object} models.Response @Failure 401 {object} models.Response @Failure 500 {object} models.Response @Security ApiKeyAuth @Param filename path string true "Invoice file to delete" @Router /files/{filename} [delete]

func LoadFiles

func LoadFiles(c *gin.Context)

LoadFiles godoc @Summary Loading user's invoices files list @Description Loading invoices files' names, uploaded by user @Tags files @Accept json @Produce json @Success 200 {object} models.ResponseSuccessLoadFiles @Failure 401 {object} models.Response @Failure 500 {object} models.Response @Security ApiKeyAuth @Router /files [get]

func Login

func Login(c *gin.Context)

Login godoc @Summary Logging user in @Description Logging user in by retrieving his data from the database @Tags login @Accept json @Produce json @Success 200 {object} models.ResponseSuccessAuth @Failure 400 {object} models.Response @Failure 500 {object} models.Response @Param request body models.User true "User's email and password" @Router /login [post]

func SaveFileContent

func SaveFileContent(c *gin.Context)

SaveFileContent godoc @Summary Saving user's file's content @Description Saving file locally, parsing its content to database and deleting it from the server @Tags files @Accept json @Produce json @Success 200 {object} models.ResponseSuccessSaveFileContent @Failure 400 {object} models.Response @Failure 401 {object} models.Response @Failure 500 {object} models.Response @Security ApiKeyAuth @Param file formData file true "File to upload" @Router /files [post]

func SignUp

func SignUp(c *gin.Context)

SignUp godoc @Summary Signing user up @Description Signing user up by adding him to the database @Tags signup @Accept json @Produce json @Success 200 {object} models.ResponseSuccessAuth @Failure 400 {object} models.Response @Failure 500 {object} models.Response @Param request body models.User true "User's email and password" @Router /signup [post]

Types

type Invoice

type Invoice struct {
	CustomerID  uint32  `csv:"customer_id"`
	PeriodStart string  `csv:"period_start"`
	PaidPlan    string  `csv:"paid_plan"`
	PaidAmount  float32 `csv:"paid_amount"`
	PeriodEnd   string  `csv:"period_end"`
}

Jump to

Keyboard shortcuts

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