diff --git a/main b/main index d79804f..7e3d7f4 100755 Binary files a/main and b/main differ diff --git a/public/swagger/swagger.json b/public/swagger/swagger.json index 317a564..b69594c 100644 --- a/public/swagger/swagger.json +++ b/public/swagger/swagger.json @@ -294,6 +294,150 @@ } } }, + "/crm/link/{id}": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "crm" + ], + "summary": "Use crm link", + "operationId": "crmUseLink", + "parameters": [ + { + "description": "Link id", + "name": "id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Crm link used" + }, + "400": { + "description": "Invalid request query" + }, + "401": { + "description": "No permissions" + }, + "404": { + "description": "Crm link not found" + }, + "500": { + "description": "Failed to use crm link" + } + } + } + }, + "/crm/links/create": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "crm" + ], + "summary": "Create crm link", + "operationId": "crmCreateCrmLink", + "parameters": [ + { + "description": "Crm link", + "name": "crmLink", + "in": "body", + "schema": { + "$ref": "#/definitions/CrmLink" + } + } + ], + "responses": { + "200": { + "description": "Crm link created" + }, + "400": { + "description": "Invalid request query" + }, + "401": { + "description": "No permissions" + }, + "500": { + "description": "Failed to create crm link" + } + } + } + }, + "/crm/links/{customerId}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "crm" + ], + "summary": "Get crm links", + "operationId": "crmGetCrmLinks", + "parameters": [ + { + "description": "Customer id", + "name": "customerId", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Crm links", + "schema": { + "$ref": "#/definitions/CrmLink" + } + }, + "400": { + "description": "Invalid request query" + }, + "401": { + "description": "No permissions" + }, + "500": { + "description": "Failed to get crm links" + } + } + } + }, + "/crm/links/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "crm" + ], + "summary": "Delete crm link", + "operationId": "crmDeleteCrmLink", + "parameters": [ + { + "description": "Link id", + "name": "id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Crm link deleted" + }, + "400": { + "description": "Invalid request query" + }, + "401": { + "description": "No permissions" + }, + "404": { + "description": "Crm link not found" + }, + "500": { + "description": "Failed to delete crm link" + } + } + } + }, "/crm/pipeline/{type}/{dealPhase}": { "get": { "produces": [ @@ -1411,6 +1555,59 @@ }, "Customer": { "$ref": "#/definitions/CrmCustomer" + }, + "LinkHistory": { + "type": "array", + "items": { + "$ref": "#/definitions/CrmLinkHistory" + } + }, + "Links": { + "type": "array", + "items": { + "$ref": "#/definitions/CrmLink" + } + } + }, + "x-go-package": "jannex/admin-dashboard-backend/modules/structs" + }, + "CrmLink": { + "type": "object", + "properties": { + "CreatedAt": { + "type": "string", + "format": "date-time" + }, + "CreatedBy": { + "type": "string" + }, + "CustomerId": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Url": { + "type": "string" + } + }, + "x-go-package": "jannex/admin-dashboard-backend/modules/structs" + }, + "CrmLinkHistory": { + "type": "object", + "properties": { + "LinkId": { + "type": "string" + }, + "UsedAt": { + "type": "string", + "format": "date-time" + }, + "UserAgent": { + "type": "string" } }, "x-go-package": "jannex/admin-dashboard-backend/modules/structs" diff --git a/routers/router/api/v1/crm/crm.go b/routers/router/api/v1/crm/crm.go index dfda24d..8e71160 100644 --- a/routers/router/api/v1/crm/crm.go +++ b/routers/router/api/v1/crm/crm.go @@ -566,7 +566,7 @@ func DeleteCrmCallProtocol(c *fiber.Ctx) error { } func CreateCrmLink(c *fiber.Ctx) error { - // swagger:operation POST /crm/links/create crm crmCreateCrmLink + // swagger:operation POST /crm/links crm crmCreateCrmLink // --- // summary: Create crm link // produces: