Adding missing field in S&P models

This commit is contained in:
Joaquin Ossa 2024-12-11 16:35:40 +01:00
parent a564afea3c
commit 34a5b0d86e
6 changed files with 17 additions and 8 deletions

View file

@ -1,4 +1,4 @@
{% set api_name = "CHECKINHEROAPI" %}
{% set api_name = "SCREENANDPROTECTAPI" %}
with
stg_screen_and_protect__verification_requests as (
@ -13,8 +13,11 @@ select
vr.id_booking,
vr.id_user_partner,
vr.id_accommodation,
({{ adapter.quote("json_document_user_data") }} ->> 'FlaggedNotProtected')::boolean
as not_protected,
case
when (au.json_document_user_data ->> 'FlaggedNotProtected') = 'false'
then true
else false
end as is_protected,
vr.protection_type,
vr.protection_starting_level,
vr.protection_basic_amount,

View file

@ -30,12 +30,10 @@ models:
data_type: text
description: Identifier for the accommodation related to the booking.
- name: not_protected
- name: is_protected
data_type: boolean
description: |
Indicates if the booking is protected or not.
It is kind of weird for being a negative statement,
so when false it means the booking is protected.
tests:
- not_null