note
	description: "Summary description for {TASK_DATA}."
	author: ""
	date: "$Date$"
	revision: "$Revision$"

class
	TASK_DATA

inherit
	JSON_DESERIALIZABLE

create
	 make_from_json,
	 make_for_test

feature

	UID : STRING
	summary : STRING
	startdate : STRING
	enddate : STRING
	notes : STRING

convertible_features (a_object: ANY): ARRAY [STRING]
		-- <Precursor>
	once
		Result := <<"UID", "summary", "startdate", "enddate", "notes">>
	end

make_from_json (a_json: STRING)
		-- <Precursor>
	require else											-- This must be here because the ancestor is False.
		True												    --	Leaving it False, will cause this to fail.
	local
		l_object: detachable JSON_OBJECT					        -- You must have one of these because ...
		l_any: detachable ANY
	do
		l_object := json_string_to_json_object (a_json)		-- ... the `a_json' STRING is parsed to a JSON_OBJECT.
		check attached_object: attached l_object end		  -- This proves that our JSON parsing was okay.

		UID := json_object_to_json_string_representation_attached ("UID", l_object)
		summary := json_object_to_json_string_representation_attached ("summary", l_object)
		startdate := json_object_to_json_string_representation_attached ("startdate", l_object)
		enddate := json_object_to_json_string_representation_attached ("enddate", l_object)
		notes := json_object_to_json_string_representation_attached ("notes", l_object)
	end

	metadata_refreshed( a_current: ANY): ARRAY [JSON_METADATA]

	do
		Result := <<
					>>
	end

	make_for_test(p_UID : STRING; p_summary : STRING; p_startdate : STRING; p_enddate : STRING;	p_notes : STRING)
	do
		uid := p_uid
		summary := p_summary
		startdate := p_startdate
		enddate := p_enddate
		notes := p_notes
	end

end
