
You can do this as a simple subtraction of DENSE_RANK() operations:
WITH IdTypes AS (
SELECT
date,
id_type,
Dense_Rank() OVER (ORDER BY date)
- Dense_Rank() OVER (PARTITION BY id_type ORDER BY date)
AS Seq
FROM
tmp
)
SELECT
Min(date) AS begin,
...