feat(caprover): allow human to mark an app as successfully updated

This commit is contained in:
Pierre Martin
2024-03-10 12:22:38 +01:00
parent 5c599842f6
commit 204efe8a8b
9 changed files with 215 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ import EventStore from "../domain/EventStore";
import { ApplicationUpdateStarted } from "../domain/events/ApplicationUpdateStarted";
import DomainEvent from "../domain/DomainEvent";
import DomainProjection from "../domain/DomainProjection";
import { ApplicationUpdateFinished } from "../domain/events/ApplicationUpdateFinished";
export default class FileEventStore implements EventStore {
private handlers: DomainProjection[] = [];
@@ -55,8 +56,15 @@ export default class FileEventStore implements EventStore {
},
new Date(event.createdAt)
);
case "ApplicationUpdateFinished":
return new ApplicationUpdateFinished(
{
id: event.payload.id,
},
new Date(event.createdAt)
);
default:
throw new Error("Unknown event type" + event.type);
throw new Error("Unknown event type: " + event.type);
}
}
}