Skip to content

Instantly share code, notes, and snippets.

@pyoner
Last active December 8, 2019 10:06
Show Gist options
  • Save pyoner/875793424ec5143e45847b34708e6687 to your computer and use it in GitHub Desktop.
Save pyoner/875793424ec5143e45847b34708e6687 to your computer and use it in GitHub Desktop.
Job State Sketch
Job State Sketch
init
client draft -> draft
client publish -> acceptingOffers
# Draft
draft
client publish -> acceptingOffers
client close -> closed
# Accepting Offers
acceptingOffers
client createOffer -> offer
client close -> closed
# Public job closed
closed
# Offer pending
# A client has offered a job to a provider and is awaiting the provider's acceptance
offer
client cancelJob -> cancelled
provider acceptTerms -> termsAcceptedAwaitingEscrow
provider counterOffer -> providerCounterOffer
provider decline -> declined
# Cancelled
# This job has been cancelled by the client
cancelled
# Declined
# This job offer was turned down by the provider
declined
# Provider counter
# The provider has countered the client's offer
providerCounterOffer
client acceptTerms -> termsAcceptedAwaitingEscrow
client counterOffer -> clientCounterOffer
client declineTerms -> declined
provider cancelJob -> cancelled
# Client counter
# The client has countered the provider's offer
clientCounterOffer
client cancelJob -> cancelled
provider acceptTerms -> termsAcceptedAwaitingEscrow
provider declineTerms -> declined
provider counterOffer -> providerCounterOffer
# Awaiting Escrow
# The job's terms has been accepted. You can now send the agreed amount of money to the escrow to commence the job.
# You have agreed to the terms and conditions of this job, you will need to wait for the client to send the funds to escrow.
termsAcceptedAwaitingEscrow
# send the funds to escrow
client authoriseEscrow -> authorisedEscrow
client cancelJob -> cancelled
provider cancelJob -> cancelled
authorisedEscrow
# if the funds in the escrow go to the next state 'inEscrow' else 'authorisedEscrow'
check escrow -> inEscrow
# Job started
# The funds has been deposited in the escrow! you can now commence the job.
inEscrow
client dispute -> inDispute
provider finishedJob -> workPendingCompletion
#provider cancelJobEarly
# Pending completion
# The provider has marked the job as complete and is awaiting the client's acceptance
workPendingCompletion
#client acceptFinish -> nothing
client dispute -> inDispute
provider dispute -> inDispute
# Disputed
# The provider or the client has raised a dispute. This is being resolved by the CanYa DAO
inDispute
#acceptFinish
# Complete
# This job has been marked as complete by the client.
complete
review -> reviewed
# Processing Escrow
processingEscrow
# Finishing Job
finishingJob
# Review added
# Both parties have completed the job, and a review has been left for the provider!
reviewed
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment