finish pgc impl
This commit is contained in:
		@ -199,3 +199,36 @@ FROM
 | 
			
		||||
  rooms
 | 
			
		||||
ORDER BY
 | 
			
		||||
  room_name;
 | 
			
		||||
 | 
			
		||||
-- name: GetRestrictionsForRoomByDate :many
 | 
			
		||||
SELECT
 | 
			
		||||
  id,
 | 
			
		||||
  coalesce(reservation_id, 0),
 | 
			
		||||
  restriction_id,
 | 
			
		||||
  room_id,
 | 
			
		||||
  start_date,
 | 
			
		||||
  end_date
 | 
			
		||||
FROM
 | 
			
		||||
  room_restrictions
 | 
			
		||||
WHERE
 | 
			
		||||
  $1 < end_date
 | 
			
		||||
  AND $2 >= start_date
 | 
			
		||||
  AND room_id = $3;
 | 
			
		||||
 | 
			
		||||
-- name: InsertBlockForRoom :exec
 | 
			
		||||
INSERT INTO
 | 
			
		||||
  room_restrictions (
 | 
			
		||||
    start_date,
 | 
			
		||||
    end_date,
 | 
			
		||||
    room_id,
 | 
			
		||||
    restriction_id,
 | 
			
		||||
    created_at,
 | 
			
		||||
    updated_at
 | 
			
		||||
  )
 | 
			
		||||
VALUES
 | 
			
		||||
  ($1, $2, $3, $4, $5, $6);
 | 
			
		||||
 | 
			
		||||
-- name: DeleteBlockByID :exec
 | 
			
		||||
DELETE FROM room_restrictions
 | 
			
		||||
WHERE
 | 
			
		||||
  id = $1;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user