Rename event fulfill to resolve

This commit is contained in:
Dominic Ferrando
2026-07-17 10:41:21 -04:00
parent 5829021658
commit 29c55a1bf1
4 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ export const EventStatusSchema = t.Union([
t.Literal("available"),
t.Literal("processing"),
t.Literal("failed"),
t.Literal("fulfilled"),
t.Literal("resolved"),
]);
export type EventStatus = Static<typeof EventStatusSchema>;
@@ -37,7 +37,7 @@ export class EventsService {
return "available";
};
if (!event.ended_at) return "processing";
return event.has_failed ? "failed" : "fulfilled";
return event.has_failed ? "failed" : "resolved";
}
async get(id: string, trx?: Transaction<DB>) {
@@ -76,7 +76,7 @@ export class EventsService {
.where("ended_at", "is not", null)
.where("has_failed", "is", true)
)
.$if(opt.filter?.status === "fulfilled", (qb) => qb
.$if(opt.filter?.status === "resolved", (qb) => qb
.where("started_at", "is not", null)
.where("ended_at", "is not", null)
.where("has_failed", "is", false)
@@ -115,7 +115,7 @@ export class EventsService {
.execute();
}
async fulfill(id: string, trx?: Transaction<DB>): Promise<void> {
async resolve(id: string, trx?: Transaction<DB>): Promise<void> {
await (trx ?? db).updateTable("events")
.set({ state: null, ended_at: new Date(), last_error: null })
.where("id", "=", id)