CREATE OR REPLACE VIEW `ifood-prev-fraude-case.fraude_biometria.drivers_typed` AS
SELECT CAST(Driver_ID AS STRING) AS Driver_ID,
    Category,
    Modal,
    Register_Dt,
    Device_ID
FROM `ifood-prev-fraude-case.fraude_biometria.drivers`;

CREATE OR REPLACE VIEW `ifood-prev-fraude-case.fraude_biometria.biometry_typed` AS
SELECT CAST(Driver_ID AS STRING) AS Driver_ID,
    CAST(Session_ID AS STRING) AS Session_ID,
    Status,
    Action,
    Event_Dt
FROM `ifood-prev-fraude-case.fraude_biometria.biometry`;

CREATE OR REPLACE VIEW `ifood-prev-fraude-case.fraude_biometria.biometry_execution_typed` AS
SELECT CAST(Session_ID AS STRING) AS Session_ID,
    Provider,
    Status,
    Similarity,
    Event_Dt
FROM `ifood-prev-fraude-case.fraude_biometria.biometry_execution`;

CREATE OR REPLACE VIEW `ifood-prev-fraude-case.fraude_biometria.orders_typed` AS
SELECT CAST(Order_ID AS STRING) AS Order_ID,
    NULLIF(Driver_ID, '#N/D') AS Driver_ID,
    Order_Dt,
    Order_Status,
    Order_Value
FROM `ifood-prev-fraude-case.fraude_biometria.orders`;