diff --git a/db/gen/accomodation-for-hospitality-panel.sql.go b/db/gen/accomodation-for-hospitality-panel.sql.go index 80e78d99..6cd68a07 100644 --- a/db/gen/accomodation-for-hospitality-panel.sql.go +++ b/db/gen/accomodation-for-hospitality-panel.sql.go @@ -251,7 +251,10 @@ SELECT ad.college_roll_number, ad.is_male, ad.room_preference, - ad.payment_status, + CASE + WHEN ad.payment_status = 'COMPLETED' THEN true + ELSE false + END AS is_paid, CASE WHEN hci.checked_out_at IS NOT NULL THEN 'OUT' WHEN hci.checked_in_at IS NOT NULL THEN 'IN' @@ -277,7 +280,7 @@ type GetAllAccommodationRequestsQueryRow struct { CollegeRollNumber string `json:"college_roll_number"` IsMale bool `json:"is_male"` RoomPreference string `json:"room_preference"` - PaymentStatus string `json:"payment_status"` + IsPaid bool `json:"is_paid"` CheckInStatus string `json:"check_in_status"` HostelName string `json:"hostel_name"` CheckInDate pgtype.Date `json:"check_in_date"` @@ -304,7 +307,7 @@ func (q *Queries) GetAllAccommodationRequestsQuery(ctx context.Context, db DBTX) &i.CollegeRollNumber, &i.IsMale, &i.RoomPreference, - &i.PaymentStatus, + &i.IsPaid, &i.CheckInStatus, &i.HostelName, &i.CheckInDate, diff --git a/db/queries/accomodation-for-hospitality-panel.sql b/db/queries/accomodation-for-hospitality-panel.sql index 180499bb..c5a42f9c 100644 --- a/db/queries/accomodation-for-hospitality-panel.sql +++ b/db/queries/accomodation-for-hospitality-panel.sql @@ -8,7 +8,10 @@ SELECT ad.college_roll_number, ad.is_male, ad.room_preference, - ad.payment_status, + CASE + WHEN ad.payment_status = 'COMPLETED' THEN true + ELSE false + END AS is_paid, CASE WHEN hci.checked_out_at IS NOT NULL THEN 'OUT' WHEN hci.checked_in_at IS NOT NULL THEN 'IN'