Skip to content

Instantly share code, notes, and snippets.

@sfletche
Last active November 7, 2016 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sfletche/0996ea207272547a5deb0a5148626752 to your computer and use it in GitHub Desktop.
Save sfletche/0996ea207272547a5deb0a5148626752 to your computer and use it in GitHub Desktop.
JSON response to a specific lead
{
"id": { "type": "string" },
"status": { "enum": ["offered", "accepted", "applied", "declined", "disqualified", "expired", "unavailable"] },
"archived": { "type": "boolean" },
"expire_at": { "type": "datetime" },
"critical_at": { "type": "datetime" },
"contractor_location": { "type": "location" },
"lead_contact": {
"type": "object",
"properties": {
"name": { "type": "string" },
"phone": { "type": "string" },
"email": { "type": "string" }
}
},
"availability": { "type": "availability" },
"project_categories": {
"type": "array",
"items": { "type": "string" }
},
"accepted_by": {
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "datetime" }
}
},
"application": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"program": { "type": "string" },
"sales_rep_id": { "type": "string" },
"sales_rep_name": { "type": "string" },
"created_at": { "type": "datetime" }
}
},
"declined_by": {
"type": "object",
"properties": {
"name": { "type": "string" },
"reason": { "type": "string" },
"date": { "type": "datetime"}
}
},
"disqualified_by": {
"type": "object",
"properties": {
"name": { "type": "string" },
"reason": { "type": "string" },
"date": { "type": "datetime"}
}
},
"unavailable_at": { "type": "datetime" },
"decline_reasons": {
"type": "object",
"patternProperties": {
"\d+": { "type": "string" }
},
"additionalProperties": false
},
"disqualify_reasons": {
"type": "object",
"patternProperties": {
"\d+": { "type": "string" }
},
"additionalProperties": false
}
}
@davidstocker
Copy link

I suggest changing property_owners to lead_contact and make the value a {} instead of a [] ... as it stands, these leads have not been verified to be the property owners, and AFAIK there is only one contact per lead.

@davidstocker
Copy link

davidstocker commented Sep 12, 2016

I suggest calling expiration_date to expire_at .. a little more consistent with datetime conventions in our apis.
👍

@davidstocker
Copy link

davidstocker commented Sep 12, 2016

i suggest the status by snake_cased ('expired', 'accepted' ... ) not sure how application differs from applied
👍

@davidstocker
Copy link

davidstocker commented Sep 12, 2016

I suggest potential_programs become availability or eligibility ... whatever is more consistent with the rest of our apis.
👍

@davidstocker
Copy link

davidstocker commented Sep 12, 2016

application_data should probably become application.

application_data.start_date should probably become application.created_at (for consistency)

👍

@DTwigs
Copy link

DTwigs commented Sep 12, 2016

An "Open" state is probably needed too, this indicates that the lead hasn't been accepted yet. Should "Open" be past tense though?

👍

@sfletche
Copy link
Author

@davidstocker: property_owners was meant to represent the property owners that will be listed on the application (could be 1 applicant, could be 2, could be more). is that the same as lead_contact?

@sfletche
Copy link
Author

added lead_contact object

@sfletche
Copy link
Author

added "unavailable_at"

@sfletche
Copy link
Author

splitting declined into rejected and disqualified

@sfletche
Copy link
Author

because the "declined" status naming is still in flux, i'm reverting "rejected" back to "declined" and simply adding "disqualified" (minimizing the changes until the language has been settled)

@sfletche
Copy link
Author

added decline_reasons

@sfletche
Copy link
Author

sfletche commented Oct 4, 2016

changed availability to single object (from array of objects)

@manjumuthaiya
Copy link

disqualify_reasons is now disqualified_reasons

@sfletche
Copy link
Author

sfletche commented Nov 4, 2016

updating adding critical flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment