Skip to content

Bid Lifecycle

Ding YuChen edited this page Nov 4, 2020 · 4 revisions

Status Code

Prefer

type BidStatus = 'submitted' | 'confirmed' | 'reviewed' | 'closed'

Since this saves the trouble of converting the string to number and back. PostgreSQL also supports native enum type over a set of strings.

export enum BidStatus {
    submitted = 0,
    confirmed = 1,
    reviewed = 2,
    closed = 3,
}

For a full timer

submitted -> confirmed -> reviewed

For a part timer

Successful bid:

submitted -> confirmed -> reviewed

Cancled by the pet owner or rejected by caretaker:

submitted -> closed