From 3bc00069ff1c4b1ee36b8b3a5dbd1468d820b634 Mon Sep 17 00:00:00 2001 From: Akshat Date: Sun, 6 Oct 2024 03:08:54 +0530 Subject: [PATCH 1/2] Refactor proforma query to include additional fields - student --- application/db.proforma.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application/db.proforma.go b/application/db.proforma.go index 1706c70..ac1e965 100644 --- a/application/db.proforma.go +++ b/application/db.proforma.go @@ -180,6 +180,17 @@ func fetchProformaForStudent(ctx *gin.Context, pid uint, jp *Proforma) error { "perks", "package_details", "bond_details", + + "base", + "gross", + "joining_bonus", + "take_home", + "relocation_bonus", + "retention_bonus", + "package_details", + "bond_details", + "first_ctc", + "deductions", ). First(jp) return tx.Error From ed1e7220860aff35d4d4474d7cc599ee68848a9d Mon Sep 17 00:00:00 2001 From: Akshat Date: Sun, 6 Oct 2024 03:32:27 +0530 Subject: [PATCH 2/2] Refactor fetchAllRCs query to order by is_active field --- rc/db.rc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/db.rc.go b/rc/db.rc.go index 476b3c8..4eab15f 100644 --- a/rc/db.rc.go +++ b/rc/db.rc.go @@ -5,7 +5,7 @@ import ( ) func fetchAllRCs(ctx *gin.Context, rc *[]RecruitmentCycle) error { - tx := db.WithContext(ctx).Find(rc) + tx := db.WithContext(ctx).Order("is_active DESC").Find(rc) return tx.Error }