Documentation
¶
Index ¶
- func SetupRoutes(app *fiber.App, db *gorm.DB)
- type AddressRepository
- func (r *AddressRepository) CreateAddress(c *fiber.Ctx) error
- func (r *AddressRepository) GetAddressByID(c *fiber.Ctx) error
- func (r *AddressRepository) GetAddresses(c *fiber.Ctx) error
- func (r *AddressRepository) SetupAddressRoutes(app *fiber.App)
- func (r *AddressRepository) UpdateAddress(c *fiber.Ctx) error
- type ClassRepository
- func (r *ClassRepository) CreateClass(c *fiber.Ctx) error
- func (r *ClassRepository) GetClassByID(c *fiber.Ctx) error
- func (r *ClassRepository) GetClasses(c *fiber.Ctx) error
- func (r *ClassRepository) GetClassesByName(c *fiber.Ctx) error
- func (r *ClassRepository) SetupClassRoutes(app *fiber.App)
- func (r *ClassRepository) UpdateClass(c *fiber.Ctx) error
- type ClientRepository
- func (r *ClientRepository) CreateClient(c *fiber.Ctx) error
- func (r *ClientRepository) DeleteClient(c *fiber.Ctx) error
- func (r *ClientRepository) GetClientByID(c *fiber.Ctx) error
- func (r *ClientRepository) GetClients(c *fiber.Ctx) error
- func (r *ClientRepository) GetClientsByCPF(c *fiber.Ctx) error
- func (r *ClientRepository) GetClientsByName(c *fiber.Ctx) error
- func (r *ClientRepository) SetupClientRoutes(app *fiber.App)
- func (r *ClientRepository) UpdateClient(c *fiber.Ctx) error
- type CompanyRepository
- func (r *CompanyRepository) AuthenticateCompany(c *fiber.Ctx) error
- func (r *CompanyRepository) CreateCompany(c *fiber.Ctx) error
- func (r *CompanyRepository) GetCompanies(c *fiber.Ctx) error
- func (r *CompanyRepository) GetCompanyByID(c *fiber.Ctx) error
- func (r *CompanyRepository) SetupCompanyRoutes(app *fiber.App)
- func (r *CompanyRepository) UpdateCompany(c *fiber.Ctx) error
- type InvoiceItemRepository
- func (r *InvoiceItemRepository) CreateInvoiceItem(c *fiber.Ctx) error
- func (r *InvoiceItemRepository) DeleteInvoiceItem(c *fiber.Ctx) error
- func (r *InvoiceItemRepository) GetInvoiceItemByID(c *fiber.Ctx) error
- func (r *InvoiceItemRepository) GetInvoiceItems(c *fiber.Ctx) error
- func (r *InvoiceItemRepository) SetupInvoiceItemRoutes(app *fiber.App)
- func (r *InvoiceItemRepository) UpdateInvoiceItem(c *fiber.Ctx) error
- type InvoiceRepository
- type PaymentMethodRepository
- type ProductRepository
- func (r *ProductRepository) CreateProduct(c *fiber.Ctx) error
- func (r *ProductRepository) DeleteProduct(c *fiber.Ctx) error
- func (r *ProductRepository) GetProductByID(c *fiber.Ctx) error
- func (r *ProductRepository) GetProducts(c *fiber.Ctx) error
- func (r *ProductRepository) GetProductsByClass(c *fiber.Ctx) error
- func (r *ProductRepository) GetProductsByName(c *fiber.Ctx) error
- func (r *ProductRepository) SetupProductRoutes(app *fiber.App)
- func (r *ProductRepository) UpdateProduct(c *fiber.Ctx) error
- type Repository
- type SaleRepository
- func (r *SaleRepository) AddItemToInvoice(c *fiber.Ctx) error
- func (r *SaleRepository) CreateDraftInvoice(c *fiber.Ctx) error
- func (r *SaleRepository) FinalizeInvoice(c *fiber.Ctx) error
- func (r *SaleRepository) GetInvoiceItems(c *fiber.Ctx) error
- func (r *SaleRepository) SetupSaleRoutes(app *fiber.App)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupRoutes ¶
Types ¶
type AddressRepository ¶
func (*AddressRepository) CreateAddress ¶
func (r *AddressRepository) CreateAddress(c *fiber.Ctx) error
CreateAddress godoc @Summary Cria um novo endereço @Description Adiciona um novo endereço ao banco de dados @Tags address @Accept json @Produce json @Param address body models.Address true "Dados do endereço" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/addresses [post]
func (*AddressRepository) GetAddressByID ¶
func (r *AddressRepository) GetAddressByID(c *fiber.Ctx) error
GetAddressByID godoc @Summary Busca endereço por ID @Description Retorna um endereço pelo seu ID @Tags address @Accept json @Produce json @Param id path int true "ID do endereço" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/addresses/{id} [get]
func (*AddressRepository) GetAddresses ¶
func (r *AddressRepository) GetAddresses(c *fiber.Ctx) error
GetAddresses godoc @Summary Lista todos os endereços @Description Retorna todos os endereços cadastrados @Tags address @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/addresses [get]
func (*AddressRepository) SetupAddressRoutes ¶
func (r *AddressRepository) SetupAddressRoutes(app *fiber.App)
func (*AddressRepository) UpdateAddress ¶
func (r *AddressRepository) UpdateAddress(c *fiber.Ctx) error
UpdateAddress godoc @Summary Atualiza um endereço @Description Atualiza os dados de um endereço existente @Tags address @Accept json @Produce json @Param id path int true "ID do endereço" @Param address body models.Address true "Dados do endereço" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/addresses/{id} [put]
type ClassRepository ¶
func (*ClassRepository) CreateClass ¶
func (r *ClassRepository) CreateClass(c *fiber.Ctx) error
CreateClass godoc @Summary Cria uma nova classe @Description Adiciona uma nova classe ao banco de dados @Tags class @Accept json @Produce json @Param class body models.Class true "Dados da classe" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/classes [post]
func (*ClassRepository) GetClassByID ¶
func (r *ClassRepository) GetClassByID(c *fiber.Ctx) error
GetClassByID godoc @Summary Busca classe por ID @Description Retorna uma classe pelo seu ID @Tags class @Accept json @Produce json @Param id path int true "ID da classe" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/classes/{id} [get]
func (*ClassRepository) GetClasses ¶
func (r *ClassRepository) GetClasses(c *fiber.Ctx) error
GetClasses godoc @Summary Lista todas as classes @Description Retorna todas as classes cadastradas @Tags class @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/classes [get]
func (*ClassRepository) GetClassesByName ¶
func (r *ClassRepository) GetClassesByName(c *fiber.Ctx) error
GetClassesByName godoc @Summary Busca classes por nome @Description Retorna classes que contenham o nome informado @Tags class @Accept json @Produce json @Param name path string true "Nome da classe" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/classes/name/{name} [get]
func (*ClassRepository) SetupClassRoutes ¶
func (r *ClassRepository) SetupClassRoutes(app *fiber.App)
func (*ClassRepository) UpdateClass ¶
func (r *ClassRepository) UpdateClass(c *fiber.Ctx) error
UpdateClass godoc @Summary Atualiza uma classe @Description Atualiza os dados de uma classe existente @Tags class @Accept json @Produce json @Param id path int true "ID da classe" @Param class body models.Class true "Dados da classe" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/classes/{id} [put]
type ClientRepository ¶
func (*ClientRepository) CreateClient ¶
func (r *ClientRepository) CreateClient(c *fiber.Ctx) error
CreateClient godoc @Summary Cria um novo cliente @Description Adiciona um novo cliente ao banco de dados @Tags client @Accept json @Produce json @Param client body models.Client true "Dados do cliente" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/clients [post]
func (*ClientRepository) DeleteClient ¶
func (r *ClientRepository) DeleteClient(c *fiber.Ctx) error
DeleteClient godoc @Summary Remove um cliente @Description Deleta um cliente pelo ID @Tags client @Accept json @Produce json @Param id path int true "ID do cliente" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/clients/{id} [delete]
func (*ClientRepository) GetClientByID ¶
func (r *ClientRepository) GetClientByID(c *fiber.Ctx) error
GetClientByID godoc @Summary Busca cliente por ID @Description Retorna um cliente pelo seu ID @Tags client @Accept json @Produce json @Param id path int true "ID do cliente" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/clients/{id} [get]
func (*ClientRepository) GetClients ¶
func (r *ClientRepository) GetClients(c *fiber.Ctx) error
GetClients godoc @Summary Lista todos os clientes @Description Retorna todos os clientes cadastrados @Tags client @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/clients [get]
func (*ClientRepository) GetClientsByCPF ¶
func (r *ClientRepository) GetClientsByCPF(c *fiber.Ctx) error
GetClientsByCPF godoc @Summary Busca cliente por CPF @Description Retorna um cliente pelo CPF informado @Tags client @Accept json @Produce json @Param cpf path string true "CPF do cliente" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/clients/cpf/{cpf} [get]
func (*ClientRepository) GetClientsByName ¶
func (r *ClientRepository) GetClientsByName(c *fiber.Ctx) error
GetClientsByName godoc @Summary Busca clientes por nome @Description Retorna clientes que contenham o nome informado @Tags client @Accept json @Produce json @Param name path string true "Nome do cliente" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/clients/name/{name} [get]
func (*ClientRepository) SetupClientRoutes ¶
func (r *ClientRepository) SetupClientRoutes(app *fiber.App)
func (*ClientRepository) UpdateClient ¶
func (r *ClientRepository) UpdateClient(c *fiber.Ctx) error
UpdateClient godoc @Summary Atualiza um cliente @Description Atualiza os dados de um cliente existente @Tags client @Accept json @Produce json @Param id path int true "ID do cliente" @Param client body models.Client true "Dados do cliente" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/clients/{id} [put]
type CompanyRepository ¶
func (*CompanyRepository) AuthenticateCompany ¶
func (r *CompanyRepository) AuthenticateCompany(c *fiber.Ctx) error
AuthenticateCompany godoc @Summary Autentica uma empresa @Description Autentica uma empresa pelo CNPJ e senha, retornando um token JWT @Tags company @Accept json @Produce json @Param credentials body object true "CNPJ e senha" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 401 {object} map[string]string @Router /api/entrar [post]
func (*CompanyRepository) CreateCompany ¶
func (r *CompanyRepository) CreateCompany(c *fiber.Ctx) error
CreateCompany godoc @Summary Cria uma nova empresa @Description Adiciona uma nova empresa ao banco de dados @Tags company @Accept json @Produce json @Param company body models.Company true "Dados da empresa" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/company [post]
func (*CompanyRepository) GetCompanies ¶
func (r *CompanyRepository) GetCompanies(c *fiber.Ctx) error
GetCompanies godoc @Summary Lista todas as empresas @Description Retorna todas as empresas cadastradas @Tags company @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/company [get]
func (*CompanyRepository) GetCompanyByID ¶
func (r *CompanyRepository) GetCompanyByID(c *fiber.Ctx) error
GetCompanyByID godoc @Summary Busca empresa por ID @Description Retorna uma empresa pelo seu ID @Tags company @Accept json @Produce json @Param id path int true "ID da empresa" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/company/{id} [get]
func (*CompanyRepository) SetupCompanyRoutes ¶
func (r *CompanyRepository) SetupCompanyRoutes(app *fiber.App)
func (*CompanyRepository) UpdateCompany ¶
func (r *CompanyRepository) UpdateCompany(c *fiber.Ctx) error
UpdateCompany godoc @Summary Atualiza uma empresa @Description Atualiza os dados de uma empresa existente @Tags company @Accept json @Produce json @Param id path int true "ID da empresa" @Param company body models.Company true "Dados da empresa" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/company/{id} [put]
type InvoiceItemRepository ¶
func (*InvoiceItemRepository) CreateInvoiceItem ¶
func (r *InvoiceItemRepository) CreateInvoiceItem(c *fiber.Ctx) error
CreateInvoiceItem godoc @Summary Cria um novo item de nota fiscal @Description Adiciona um novo item à nota fiscal @Tags invoice_item @Accept json @Produce json @Param invoice_item body models.InvoiceItem true "Dados do item da nota" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/invoice_items [post]
func (*InvoiceItemRepository) DeleteInvoiceItem ¶
func (r *InvoiceItemRepository) DeleteInvoiceItem(c *fiber.Ctx) error
DeleteInvoiceItem godoc @Summary Remove um item de nota fiscal @Description Deleta um item de nota fiscal pelo ID @Tags invoice_item @Accept json @Produce json @Param id path int true "ID do item da nota" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/invoice_items/{id} [delete]
func (*InvoiceItemRepository) GetInvoiceItemByID ¶
func (r *InvoiceItemRepository) GetInvoiceItemByID(c *fiber.Ctx) error
GetInvoiceItemByID godoc @Summary Busca item de nota fiscal por ID @Description Retorna um item de nota fiscal pelo seu ID @Tags invoice_item @Accept json @Produce json @Param id path int true "ID do item da nota" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/invoice_items/{id} [get]
func (*InvoiceItemRepository) GetInvoiceItems ¶
func (r *InvoiceItemRepository) GetInvoiceItems(c *fiber.Ctx) error
GetInvoiceItems godoc @Summary Lista todos os itens de nota fiscal @Description Retorna todos os itens de nota fiscal cadastrados @Tags invoice_item @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/invoice_items [get]
func (*InvoiceItemRepository) SetupInvoiceItemRoutes ¶
func (r *InvoiceItemRepository) SetupInvoiceItemRoutes(app *fiber.App)
func (*InvoiceItemRepository) UpdateInvoiceItem ¶
func (r *InvoiceItemRepository) UpdateInvoiceItem(c *fiber.Ctx) error
UpdateInvoiceItem godoc @Summary Atualiza um item de nota fiscal @Description Atualiza os dados de um item de nota fiscal existente @Tags invoice_item @Accept json @Produce json @Param id path int true "ID do item da nota" @Param invoice_item body models.InvoiceItem true "Dados do item da nota" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/invoice_items/{id} [put]
type InvoiceRepository ¶
func (*InvoiceRepository) CreateInvoice ¶
func (r *InvoiceRepository) CreateInvoice(c *fiber.Ctx) error
CreateInvoice godoc @Summary Cria uma nova nota fiscal @Description Adiciona uma nova nota fiscal ao banco de dados @Tags invoice @Accept json @Produce json @Param invoice body models.Invoice true "Dados da nota fiscal" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/invoices [post]
func (*InvoiceRepository) GetInvoiceByID ¶
func (r *InvoiceRepository) GetInvoiceByID(c *fiber.Ctx) error
GetInvoiceByID godoc @Summary Busca nota fiscal por ID @Description Retorna uma nota fiscal pelo seu ID @Tags invoice @Accept json @Produce json @Param id path int true "ID da nota fiscal" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/invoices/{id} [get]
func (*InvoiceRepository) GetInvoices ¶
func (r *InvoiceRepository) GetInvoices(c *fiber.Ctx) error
GetInvoices godoc @Summary Lista todas as notas fiscais @Description Retorna todas as notas fiscais cadastradas @Tags invoice @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/invoices [get]
func (*InvoiceRepository) SetupInvoiceRoutes ¶
func (r *InvoiceRepository) SetupInvoiceRoutes(app *fiber.App)
type PaymentMethodRepository ¶
func (*PaymentMethodRepository) GetPaymentMethods ¶
func (r *PaymentMethodRepository) GetPaymentMethods(c *fiber.Ctx) error
GetPaymentMethods godoc @Summary Lista todos os métodos de pagamento @Description Retorna todos os métodos de pagamento cadastrados @Tags payment_method @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/payment_methods [get]
func (*PaymentMethodRepository) SetupPaymentMethodRoutes ¶
func (r *PaymentMethodRepository) SetupPaymentMethodRoutes(app *fiber.App)
type ProductRepository ¶
func (*ProductRepository) CreateProduct ¶
func (r *ProductRepository) CreateProduct(c *fiber.Ctx) error
CreateProduct godoc @Summary Cria um novo produto @Description Adiciona um novo produto ao banco de dados @Tags product @Accept json @Produce json @Param product body models.Product true "Dados do produto" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/products [post]
func (*ProductRepository) DeleteProduct ¶
func (r *ProductRepository) DeleteProduct(c *fiber.Ctx) error
DeleteProduct godoc @Summary Remove um produto @Description Deleta um produto pelo ID @Tags product @Accept json @Produce json @Param id path int true "ID do produto" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/products/{id} [delete]
func (*ProductRepository) GetProductByID ¶
func (r *ProductRepository) GetProductByID(c *fiber.Ctx) error
GetProductByID godoc @Summary Busca produto por ID @Description Retorna um produto pelo seu ID @Tags product @Accept json @Produce json @Param id path int true "ID do produto" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/products/{id} [get]
func (*ProductRepository) GetProducts ¶
func (r *ProductRepository) GetProducts(c *fiber.Ctx) error
GetProducts godoc @Summary Lista todos os produtos @Description Retorna todos os produtos cadastrados @Tags product @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/products [get]
func (*ProductRepository) GetProductsByClass ¶
func (r *ProductRepository) GetProductsByClass(c *fiber.Ctx) error
GetProductsByClass godoc @Summary Busca produtos por classe @Description Retorna produtos de uma determinada classe @Tags product @Accept json @Produce json @Param class_id path int true "ID da classe" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/products/class/{class_id} [get]
func (*ProductRepository) GetProductsByName ¶
func (r *ProductRepository) GetProductsByName(c *fiber.Ctx) error
GetProductsByName godoc @Summary Busca produtos por nome @Description Retorna produtos que contenham o nome informado @Tags product @Accept json @Produce json @Param name path string true "Nome do produto" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/products/name/{name} [get]
func (*ProductRepository) SetupProductRoutes ¶
func (r *ProductRepository) SetupProductRoutes(app *fiber.App)
func (*ProductRepository) UpdateProduct ¶
func (r *ProductRepository) UpdateProduct(c *fiber.Ctx) error
UpdateProduct godoc @Summary Atualiza um produto @Description Atualiza os dados de um produto existente @Tags product @Accept json @Produce json @Param id path int true "ID do produto" @Param product body models.Product true "Dados do produto" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/products/{id} [put]
type Repository ¶
type SaleRepository ¶
func (*SaleRepository) AddItemToInvoice ¶
func (r *SaleRepository) AddItemToInvoice(c *fiber.Ctx) error
AddItemToInvoice godoc @Summary Adiciona um item à nota fiscal @Description Adiciona um produto à nota fiscal informando quantidade @Tags sale @Accept json @Produce json @Param data body object true "Dados do item" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/sale/add_item [post]
func (*SaleRepository) CreateDraftInvoice ¶
func (r *SaleRepository) CreateDraftInvoice(c *fiber.Ctx) error
CreateDraftInvoice godoc @Summary Cria uma nota fiscal rascunho @Description Cria uma nota fiscal sem cliente e método de pagamento @Tags sale @Accept json @Produce json @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Router /api/sale/draft [post]
func (*SaleRepository) FinalizeInvoice ¶
func (r *SaleRepository) FinalizeInvoice(c *fiber.Ctx) error
FinalizeInvoice godoc @Summary Finaliza a nota fiscal @Description Finaliza a nota fiscal informando cliente e método de pagamento @Tags sale @Accept json @Produce json @Param data body object true "Dados para finalizar nota" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 404 {object} map[string]string @Failure 422 {object} map[string]string @Router /api/sale/finalize [post]
func (*SaleRepository) GetInvoiceItems ¶
func (r *SaleRepository) GetInvoiceItems(c *fiber.Ctx) error
GetInvoiceItems godoc @Summary Consulta itens de uma nota fiscal @Description Retorna todos os itens de uma nota fiscal pelo ID @Tags sale @Accept json @Produce json @Param invoice_id path string true "ID da nota fiscal" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string @Router /api/sale/items/{invoice_id} [get]
func (*SaleRepository) SetupSaleRoutes ¶
func (r *SaleRepository) SetupSaleRoutes(app *fiber.App)