nnew crm
parent
553192f767
commit
c3e06b005a
|
@ -47,6 +47,8 @@ type CrmTableCustomerResponse struct {
|
||||||
|
|
||||||
type CrmTableCustomer struct {
|
type CrmTableCustomer struct {
|
||||||
Id string
|
Id string
|
||||||
|
Pipeline uint8
|
||||||
|
DealPhase uint8
|
||||||
FirstName string
|
FirstName string
|
||||||
LastName string
|
LastName string
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
|
|
|
@ -85,6 +85,9 @@
|
||||||
"401": {
|
"401": {
|
||||||
"description": "No permissions"
|
"description": "No permissions"
|
||||||
},
|
},
|
||||||
|
"409": {
|
||||||
|
"description": "Crm customer with the company name already exists"
|
||||||
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Failed to create crm customer"
|
"description": "Failed to create crm customer"
|
||||||
}
|
}
|
||||||
|
@ -132,6 +135,9 @@
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Crm customer not found"
|
"description": "Crm customer not found"
|
||||||
},
|
},
|
||||||
|
"409": {
|
||||||
|
"description": "Crm customer with the company name already exists"
|
||||||
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Failed to update crm customer"
|
"description": "Failed to update crm customer"
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,15 @@ import (
|
||||||
"gorm.io/gorm"
|
"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 {
|
func GetCrmTypeCustomers(c *fiber.Ctx) error {
|
||||||
// swagger:operation GET /crm/pipeline/{type}/{dealPhase} crm crmGetCrmCustomers
|
// swagger:operation GET /crm/pipeline/{type}/{dealPhase} crm crmGetCrmCustomers
|
||||||
// ---
|
// ---
|
||||||
|
|
|
@ -73,6 +73,8 @@ func SetupRoutes(app *fiber.App) {
|
||||||
c.Post("/customer/update/:id", requestAccessValidation, crm.UpdateCrmCustomer)
|
c.Post("/customer/update/:id", requestAccessValidation, crm.UpdateCrmCustomer)
|
||||||
c.Post("/customer/create", requestAccessValidation, crm.CreateCrmCustomer)
|
c.Post("/customer/create", requestAccessValidation, crm.CreateCrmCustomer)
|
||||||
|
|
||||||
|
c.Get("/customers", requestAccessValidation, crm.GetAllCustomers)
|
||||||
|
|
||||||
app.Static("/", config.Cfg.FolderPaths.PublicStatic)
|
app.Static("/", config.Cfg.FolderPaths.PublicStatic)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue