<cfscript>

	taskGateway = new TaskGateway();

	// Create a new task as a pending (ie, not yet completed) task.
	taskID = taskGateway.createTask(
		description = "Clean up Xmas tree",
		isComplete = false,
		createdAt = now(),
		completedAt = taskGateway.NULL_DATE
	);

	// MARK AN EXISTING TASK AS COMPLETE - that's easy, we just pass-in the date at which
	// we want the task to be known as completed.
	taskGateway.updateTask(
		id = taskID,
		isComplete = true,
		completedAt = now()
	);

	// MARK AN EXISTING TASK AS INCOMPLETE! That's where things get tricky - how do we
	// differentiate between OMITTING the "completedAt" argument (ie, we don't want to
	// update it) vs. clearing the "completedAt" field (ie, setting it to NULL). The
	// "magic date" makes this simple!
	taskGateway.updateTask(
		id = taskID,
		isComplete = false,
		completedAt = taskGateway.NULL_DATE
	);

</cfscript>