main
alex 2024-03-06 19:32:08 +01:00
parent 553192f767
commit c3e06b005a
5 changed files with 19 additions and 0 deletions

BIN
main

Binary file not shown.

View File

@ -47,6 +47,8 @@ type CrmTableCustomerResponse struct {
type CrmTableCustomer struct {
Id string
Pipeline uint8
DealPhase uint8
FirstName string
LastName string
CreatedAt time.Time

View File

@ -85,6 +85,9 @@
"401": {
"description": "No permissions"
},
"409": {
"description": "Crm customer with the company name already exists"
},
"500": {
"description": "Failed to create crm customer"
}
@ -132,6 +135,9 @@
"404": {
"description": "Crm customer not found"
},
"409": {
"description": "Crm customer with the company name already exists"
},
"500": {
"description": "Failed to update crm customer"
}

View File

@ -16,6 +16,15 @@ import (
"gorm.io/gorm"
)
// testing
func GetAllCustomers(c *fiber.Ctx) error {
var customers []structs.CrmTableCustomer
database.DB.Find(&customers)
return c.JSON(customers)
}
func GetCrmTypeCustomers(c *fiber.Ctx) error {
// swagger:operation GET /crm/pipeline/{type}/{dealPhase} crm crmGetCrmCustomers
// ---

View File

@ -73,6 +73,8 @@ func SetupRoutes(app *fiber.App) {
c.Post("/customer/update/:id", requestAccessValidation, crm.UpdateCrmCustomer)
c.Post("/customer/create", requestAccessValidation, crm.CreateCrmCustomer)
c.Get("/customers", requestAccessValidation, crm.GetAllCustomers)
app.Static("/", config.Cfg.FolderPaths.PublicStatic)
}