| 1926 | } |
| 1927 | |
| 1928 | func ClaimPrebuild( |
| 1929 | t testing.TB, |
| 1930 | db database.Store, |
| 1931 | now time.Time, |
| 1932 | newUserID uuid.UUID, |
| 1933 | newName string, |
| 1934 | presetID uuid.UUID, |
| 1935 | autostartSchedule sql.NullString, |
| 1936 | nextStartAt sql.NullTime, |
| 1937 | ttl sql.NullInt64, |
| 1938 | ) database.ClaimPrebuiltWorkspaceRow { |
| 1939 | claimedWorkspace, err := db.ClaimPrebuiltWorkspace(genCtx, database.ClaimPrebuiltWorkspaceParams{ |
| 1940 | NewUserID: newUserID, |
| 1941 | NewName: newName, |
| 1942 | Now: now, |
| 1943 | PresetID: presetID, |
| 1944 | AutostartSchedule: autostartSchedule, |
| 1945 | NextStartAt: nextStartAt, |
| 1946 | WorkspaceTtl: ttl, |
| 1947 | }) |
| 1948 | require.NoError(t, err, "claim prebuilt workspace") |
| 1949 | |
| 1950 | return claimedWorkspace |
| 1951 | } |
| 1952 | |
| 1953 | func AIBridgeInterception(t testing.TB, db database.Store, seed database.InsertAIBridgeInterceptionParams, endedAt *time.Time) database.AIBridgeInterception { |
| 1954 | interception, err := db.InsertAIBridgeInterception(genCtx, database.InsertAIBridgeInterceptionParams{ |