Skip to content

Commit

Permalink
zopsmart#3 | Resolved merge conflicts in schema.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Pandey committed Feb 15, 2021
2 parents 2a1e923 + 0ae0747 commit 013f0b3
Show file tree
Hide file tree
Showing 16 changed files with 600 additions and 409 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# Test binary, built with `go test -c`
*.test

./.DS_Store
.DS_Store
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
.DS_Store
Expand Down
196 changes: 170 additions & 26 deletions db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ DROP TABLE IF EXISTS `companies`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `companies` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`description` varchar(45) DEFAULT NULL,
`domain` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`description` varchar(45) DEFAULT NULL,
`domain` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

Expand All @@ -49,16 +49,16 @@ DROP TABLE IF EXISTS `employees`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employees` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
`phone` bigint DEFAULT NULL,
`designation` varchar(45) NOT NULL,
`yoe` int NOT NULL DEFAULT '0',
`company_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `comapny_id_idx` (`company_id`),
CONSTRAINT `company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`)
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
`phone` bigint DEFAULT NULL,
`designation` varchar(45) NOT NULL,
`yoe` int NOT NULL DEFAULT '0',
`company_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `comapny_id_idx` (`company_id`),
CONSTRAINT `company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

Expand All @@ -79,9 +79,9 @@ DROP TABLE IF EXISTS `skills`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `skills` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

Expand All @@ -102,12 +102,12 @@ DROP TABLE IF EXISTS `skillsEmployees`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `skillsEmployees` (
`employee_id` int NOT NULL,
`skill_id` int NOT NULL,
PRIMARY KEY (`employee_id`,`skill_id`),
KEY `skill_id_idx` (`skill_id`),
CONSTRAINT `emp_skill_id` FOREIGN KEY (`skill_id`) REFERENCES `skills` (`id`),
CONSTRAINT `employee_id` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
`employee_id` int NOT NULL,
`skill_id` int NOT NULL,
PRIMARY KEY (`employee_id`,`skill_id`),
KEY `skill_id_idx` (`skill_id`),
CONSTRAINT `employee_id` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
CONSTRAINT `emp_skill_id` FOREIGN KEY (`skill_id`) REFERENCES `skills` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

Expand All @@ -129,4 +129,148 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2021-02-15 13:50:54
-- Dump completed on 2021-02-12 16:03:51

DROP TABLE IF EXISTS `positions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `positions` (
`id` int NOT NULL AUTO_INCREMENT,
`noOfOpenings` int NOT NULL,
`description` varchar(45) NOT NULL,
`location` varchar(45) NOT NULL,
`currentNoOfOpenings` int NOT NULL,
`startDate` datetime NOT NULL,
`endDate` datetime NOT NULL,
`status` tinyint NOT NULL,
`title` varchar(45) NOT NULL,
`postDate` datetime NOT NULL,
`experience` float NOT NULL,
`companyId` int NOT NULL,
`pid` varchar(45) NOT NULL,
`is_deleted` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `id_idx` (`companyId`),
CONSTRAINT `id` FOREIGN KEY (`companyId`) REFERENCES `companies` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `positions`
--

LOCK TABLES `positions` WRITE;
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;



/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `candidates`
--

DROP TABLE IF EXISTS `candidates`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `candidates` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
`phone` bigint NOT NULL,
`college_name` varchar(45) DEFAULT NULL,
`experience` float DEFAULT NULL,
`resume` varchar(60) NOT NULL,
`skills` int DEFAULT NULL,
`gender` varchar(10) NOT NULL,
`bio` varchar(45) DEFAULT NULL,
`dob` datetime NOT NULL,
`github` varchar(60) DEFAULT 'no Link',
`linkedin` varchar(60) DEFAULT 'no Link',
`others` varchar(100) DEFAULT 'no Links',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;



/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `candidates_skills`
--

DROP TABLE IF EXISTS `candidates_skills`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `candidates_skills` (
`candidate_id` int NOT NULL,
`skill_id` int NOT NULL,
PRIMARY KEY (`candidate_id`,`skill_id`),
KEY `skill_id_idx` (`skill_id`),
CONSTRAINT `candidate_id` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`),
CONSTRAINT `candidate_skill_id` FOREIGN KEY (`skill_id`) REFERENCES `skills` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2021-02-15 11:38:30

Binary file removed panel/.DS_Store
Binary file not shown.
48 changes: 26 additions & 22 deletions panel/http/coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,30 @@ github.com/zopsmart/hiring-portal-api/panel/http/http.go:24.16,26.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:29.16,31.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:33.16,35.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:39.73,41.16 2 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:45.2,46.16 2 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:50.2,50.17 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:45.2,48.16 4 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:51.2,52.16 2 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:55.2,66.16 4 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:70.2,70.17 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:41.16,43.3 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:46.16,48.3 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:53.74,55.16 2 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:58.2,59.16 2 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:62.2,64.16 3 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:67.2,67.17 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:55.16,57.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:59.16,61.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:64.16,66.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:70.71,72.16 2 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:75.2,76.16 2 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:79.2,82.16 4 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:85.2,85.17 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:72.16,74.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:76.16,78.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:82.16,84.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:88.73,90.16 2 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:93.2,94.16 2 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:97.2,97.64 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:90.16,92.3 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:94.16,96.3 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:48.16,50.3 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:52.16,54.3 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:66.16,68.3 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:73.74,75.16 2 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:78.2,79.16 2 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:82.2,84.16 3 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:87.2,87.17 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:75.16,77.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:79.16,81.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:84.16,86.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:90.71,92.16 2 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:95.2,96.16 2 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:99.2,102.16 4 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:105.2,105.17 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:92.16,94.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:96.16,98.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:102.16,104.3 1 1
github.com/zopsmart/hiring-portal-api/panel/http/http.go:108.73,110.16 2 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:113.2,114.16 2 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:117.2,117.64 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:110.16,112.3 1 0
github.com/zopsmart/hiring-portal-api/panel/http/http.go:114.16,116.3 1 0
42 changes: 31 additions & 11 deletions panel/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/zopsmart/hiring-portal-api/panel/models"

"github.com/vikash/gofr/pkg/gofr"
customError "github.com/zopsmart/hiring-portal-api/panel/error"
customerror "github.com/zopsmart/hiring-portal-api/panel/error"
"github.com/zopsmart/hiring-portal-api/panel/service"
)

Expand All @@ -22,12 +22,12 @@ func New(service service.PanelEmployee) PanelHTTP {
func (p PanelHTTP) CreateEmployee(c *gofr.Context) (interface{}, error) {
companyID, err := strconv.Atoi(c.Request.PathParam("companyID"))
if err != nil {
return models.Employee{}, customError.ErrInvalidCompanyID
return models.Employee{}, customerror.ErrInvalidCompanyID
}
var emp models.Employee
err = c.Request.Bind(&emp)
if err != nil {
return models.Employee{}, customError.ErrJSONFormat
return models.Employee{}, customerror.ErrJSONFormat
}
res, err := p.service.CreateEmployee(c, companyID, &emp)
if err != nil {
Expand All @@ -39,10 +39,30 @@ func (p PanelHTTP) CreateEmployee(c *gofr.Context) (interface{}, error) {
func (p PanelHTTP) GetAllEmployee(c *gofr.Context) (interface{}, error) {
companyID, err := strconv.Atoi(c.Request.PathParam("companyID"))
if err != nil {
return "Invalid CompanyID", customError.ErrInvalidCompanyID
return nil, customerror.ErrInvalidCompanyID
}

res, err := p.service.GetAllEmployee(c, companyID)
yoe, _ := strconv.Atoi(c.Param("yoe"))
designation := c.Param("designation")
page, err := strconv.Atoi(c.Param("page"))
if err != nil {
page = 1
}
limit, err := strconv.Atoi(c.Param("limit"))
if err != nil {
limit = 20
}
skills := []string{}

queryParams := map[string]interface{}{
"yoe": yoe,
"designation": designation,
"page": (page - 1) * limit,
"limit": limit,
"skills": skills,
}

res, err := p.service.GetAllEmployee(c, companyID, queryParams)
if err != nil {
return nil, err
}
Expand All @@ -53,11 +73,11 @@ func (p PanelHTTP) GetAllEmployee(c *gofr.Context) (interface{}, error) {
func (p PanelHTTP) GetEmployeeByID(c *gofr.Context) (interface{}, error) {
companyID, err := strconv.Atoi(c.Request.PathParam("companyID"))
if err != nil {
return models.Employee{}, customError.ErrInvalidCompanyID
return models.Employee{}, customerror.ErrInvalidCompanyID
}
employeeID, err := strconv.Atoi(c.Request.PathParam("employeeID"))
if err != nil {
return models.Employee{}, customError.ErrInvalidEmployeeID
return models.Employee{}, customerror.ErrInvalidEmployeeID
}
fmt.Println(companyID, employeeID)
res, err := p.service.GetEmployeeByID(c, companyID, employeeID)
Expand All @@ -70,11 +90,11 @@ func (p PanelHTTP) GetEmployeeByID(c *gofr.Context) (interface{}, error) {
func (p PanelHTTP) EditEmployee(c *gofr.Context) (interface{}, error) {
companyID, err := strconv.Atoi(c.Request.PathParam("companyID"))
if err != nil {
return models.Employee{}, customError.ErrInvalidCompanyID
return models.Employee{}, customerror.ErrInvalidCompanyID
}
employeeID, err := strconv.Atoi(c.Request.PathParam("employeeID"))
if err != nil {
return models.Employee{}, customError.ErrInvalidEmployeeID
return models.Employee{}, customerror.ErrInvalidEmployeeID
}
var data models.Employee
c.Request.Bind(&data)
Expand All @@ -88,11 +108,11 @@ func (p PanelHTTP) EditEmployee(c *gofr.Context) (interface{}, error) {
func (p PanelHTTP) DeleteEmployee(c *gofr.Context) (interface{}, error) {
companyID, err := strconv.Atoi(c.Request.PathParam("companyID"))
if err != nil {
return nil, customError.ErrInvalidCompanyID
return nil, customerror.ErrInvalidCompanyID
}
employeeID, err := strconv.Atoi(c.Request.PathParam("employeeID"))
if err != nil {
return nil, customError.ErrInvalidEmployeeID
return nil, customerror.ErrInvalidEmployeeID
}
return nil, p.service.DeleteEmployee(c, companyID, employeeID)

Expand Down
2 changes: 1 addition & 1 deletion panel/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (m mockService) GetEmployeeByID(c *gofr.Context, companyID int, employeeID
return models.Employee{}, customerror.ErrDBServer
}

func (m mockService) GetAllEmployee(c *gofr.Context, companyID int) ([]models.Employee, error) {
func (m mockService) GetAllEmployee(c *gofr.Context, companyID int, queryParams map[string]interface{}) ([]models.Employee, error) {
return []models.Employee(nil), customerror.ErrDBServer
}

Expand Down
Loading

0 comments on commit 013f0b3

Please sign in to comment.