How to select records that meets specific criteria I want to get the result for a particular ID if only all the "Prospect" have after it "Qualify", if not all the calculation will be dropped

Below is example sample and output. How it can be done using sql query?

+----+----------+-----------+-------+
| id |  stage   | nextstage | value1 |
+----+----------+-----------+-------+
|  1 | prospect | qualify   |   200 |
|  1 | solution | develop   |   500 |
|  1 | prospect | null      |   400 |
|  2 | prospect | qualify   |   100 |
|  2 | develop  | solution  |   300 |
|  2 | prospect | qualify   |   100 |
+----+----------+-----------+-------+


Output:

+----+-------------+
| id | time in P2Q |
+----+-------------+
|  1 | NULL        |
|  2 | 200         |
+----+-------------+


I have tried the following, but didn't know how to drop the entire calculation if there is one prospect record that don't have qualify after it

SELECT

 SUM(CASE WHEN stage = 'Prospect' and nextstage='Qualify'  THEN value1 END) AS timeP2Q
 from table1
 group by ID
To solve this problem, I did the following:

Created table and data:

CREATE TABLE table1
(
  id INTEGER NOT NULL,
  stage VARCHAR (10),
  nextstage VARCHAR (10),
  value1 INTEGER
);

INSERT INTO table1 
VALUES
(1, 'prospect', 'qualify' , 200),
(1, 'solution', 'develop' , 200),
(1, 'prospect',  NULL     , 200),
(2, 'prospect', 'qualify' , 100),
(2, 'develop' , 'solution', 200),
(2, 'prospect', 'qualify' , 100);


Then ran the following query:

SELECT id, timeP2Q FROM
(
  SELECT
    id,
    SUM
    (
      CASE 
        WHEN stage = 'prospect' and nextstage = 'qualify'  THEN value1 END
    ) AS timeP2Q
  FROM table1
  WHERE id NOT IN
  (
    SELECT id 
    FROM table1
    WHERE stage = 'prospect' AND nextstage IS NULL
  )
  GROUP BY id
) AS stuff  -- subqueries require an alias, not used.
ORDER BY id;


Which gives the desired result:

 id | timep2q 
----+---------
  2 |     200
(1 row)


The main query simply does the sum by id, and then the WHERE id NOT IN removes the unwanted ones. I think that there should be a date or a timestamp in there somewhere to be able to better extract information from this data! I see this as a process with stages?