From dc7b6cfe4a5c686933685e9634c92004c0cfb914 Mon Sep 17 00:00:00 2001 From: Sumita Canopas <69897605+cp-sumi-k@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:32:43 +0530 Subject: [PATCH] Revert "Revert "Revert "Fix: base_salary type in jobs""" --- jobs/jobs.go | 2 +- jobs/jobs_test.go | 2 +- nuxt-frontend/pages/jobs/[id].vue | 2 +- utils/test.go | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/jobs/jobs.go b/jobs/jobs.go index f8c1327a6..21925bf5c 100644 --- a/jobs/jobs.go +++ b/jobs/jobs.go @@ -38,7 +38,7 @@ type Career struct { ButtonName string `json:"button_name"` Qualification string `json:"qualification"` EmploymentType string `json:"employment_type"` - BaseSalary string `json:"base_salary"` + BaseSalary int `json:"base_salary"` Experience string `json:"experience"` IsActive bool `json:"is_active"` Skills null.String `json:"skills"` diff --git a/jobs/jobs_test.go b/jobs/jobs_test.go index 40269b465..9ed720eda 100644 --- a/jobs/jobs_test.go +++ b/jobs/jobs_test.go @@ -110,7 +110,7 @@ func expectedJobsData() map[string]interface{} { jobs["button_name"] = "Apply" jobs["qualification"] = "B.E/B.Tech/BCA/MCA/MSc IT degree in Computer Science, Engineering, or a related subject " jobs["employment_type"] = "full_time" - jobs["base_salary"] = "15000" + jobs["base_salary"] = 15000.0 jobs["experience"] = "0-3 years" jobs["is_active"] = true jobs["skills"] = "" diff --git a/nuxt-frontend/pages/jobs/[id].vue b/nuxt-frontend/pages/jobs/[id].vue index a087c7c46..1258378b0 100644 --- a/nuxt-frontend/pages/jobs/[id].vue +++ b/nuxt-frontend/pages/jobs/[id].vue @@ -181,7 +181,7 @@ function getJsonLdSchema() { currency: "INR", value: { "@type": "QuantitativeValue", - minValue: career?.base_salary || "10000", + minValue: parseInt(career?.base_salary || "10000"), maxValue: 50000, unitText: "MONTH", }, diff --git a/utils/test.go b/utils/test.go index 4ca1a6540..46bb14d6c 100644 --- a/utils/test.go +++ b/utils/test.go @@ -80,7 +80,7 @@ func TestDB() (*sqlx.DB, error) { func CreateTables(db *sqlx.DB) error { - jobs := "CREATE TABLE IF NOT EXISTS jobs (id SERIAL PRIMARY KEY, title varchar, summary text, description text, button_name varchar, qualification varchar, employment_type varchar, base_salary varchar, experience varchar, is_active bool DEFAULT false, created_at timestamptz DEFAULT CURRENT_TIMESTAMP, updated_at timestamptz DEFAULT CURRENT_TIMESTAMP, skills text, total_openings int4 DEFAULT 1, responsibilities text, icon_name int4, unique_id varchar NOT NULL, seo_title varchar, seo_description text, apply_seo_title varchar, apply_seo_description text, index int4 NOT NULL DEFAULT 0)" + jobs := "CREATE TABLE IF NOT EXISTS jobs (id SERIAL PRIMARY KEY, title varchar, summary text, description text, button_name varchar, qualification varchar, employment_type varchar, base_salary int4, experience varchar, is_active bool DEFAULT false, created_at timestamptz DEFAULT CURRENT_TIMESTAMP, updated_at timestamptz DEFAULT CURRENT_TIMESTAMP, skills text, total_openings int4 DEFAULT 1, responsibilities text, icon_name int4, unique_id varchar NOT NULL, seo_title varchar, seo_description text, apply_seo_title varchar, apply_seo_description text, index int4 NOT NULL DEFAULT 0)" _, err := db.Exec(jobs) @@ -108,6 +108,7 @@ func CreateTables(db *sqlx.DB) error { _, err = db.Exec(jobsIcons) + lifeatCanopas := "CREATE TABLE lifeatcanopas (id SERIAL PRIMARY KEY, image_urls varchar, index int4 NOT NULL DEFAULT 0, created_at timestamptz DEFAULT CURRENT_TIMESTAMP,updated_at timestamptz DEFAULT CURRENT_TIMESTAMP)" _, err = db.Exec(lifeatCanopas) @@ -141,7 +142,7 @@ func PrepareTablesData(db *sqlx.DB) { db.MustExec("INSERT INTO job_applications(id, name, email, phone, place,reference, resumeURL, position, message, status, created_at, updated_at) VALUES(1, 'New Web Developer', 'developer@gmail.com', '1234567890', 'surat', 'From canopas', '', 'Web Developer from testing', 'I m a very good programer', '1',current_timestamp, current_timestamp)") db.MustExec("INSERT INTO job_applicant_statuses(id, applicant_id, status, index, rejection_with_mail, created_at, updated_at) VALUES(1, 1, 1, 0, false, current_timestamp,current_timestamp )") db.MustExec("INSERT INTO job_icons (id,name,value,createdAt,updatedAt) VALUES ('1','iOS','fab fa-apple',NULL,NULL);") - db.MustExec("INSERT INTO lifeatcanopas (id,image_urls,created_at,updated_at) VALUES(1,'https://canopas-website.s3.ap-south-1.amazonaws.com/lifeCanopas/1-400.webp,https://canopas-website.s3.ap-south-1.amazonaws.com/lifeCanopas/1-800.webp,https://canopas-website.s3.ap-south-1.amazonaws.com/lifeCanopas/1-1600.webp',current_timestamp, current_timestamp)") + db.MustExec("INSERT INTO lifeatcanopas (id,image_urls,created_at,updated_at) VALUES(1,'https://canopas-website.s3.ap-south-1.amazonaws.com/lifeCanopas/1-400.webp,https://canopas-website.s3.ap-south-1.amazonaws.com/lifeCanopas/1-800.webp,https://canopas-website.s3.ap-south-1.amazonaws.com/lifeCanopas/1-1600.webp',current_timestamp, current_timestamp)") db.MustExec("INSERT INTO perks (id,image_urls,created_at,updated_at) VALUES(1,'https://canopas-website.s3.ap-south-1.amazonaws.com/lifeCanopas/1-400.webp,https://canopas-website.s3.ap-south-1.amazonaws.com/lifeCanopas/1-800.webp',current_timestamp, current_timestamp)") }