anchor.diff:  product_size(octets, mb, Size) -> Size div 1000000;
   product_size(_, _, Size) -> Size.
   
  --spec rc_period(RCPeriod) -> Result
  -	when
  -		RCPeriod	:: string() | valid_period(),
  -		Result	:: valid_period() | string().
  -%% @doc return valid period
  -%% @private
  -rc_period("") -> undefined;
  -rc_period("yearly") -> yearly;
  -rc_period("monthly") -> monthly;
  -rc_period("weekly") -> weekly;
  -rc_period("daily") -> daily;
  -rc_period(undefined) -> "";
  -rc_period(yearly) -> "yearly";
  -rc_period(monthly) -> "monthly";
  -rc_period(weekly) -> "weekly";
  -rc_period(daily) -> "daily".
  -
  --spec product_offering_status(Status) -> Status
  -	when
  -		Status :: product_offering_status() | string().
  +-spec offer_status(Status) -> Status
  +	when
  +		Status :: offer_status() | string().
   %% @doc CODEC for life cycle status of Product instance.
   %% @private
  -product_offering_status("In Study") -> in_study;
  -product_offering_status("In Design") -> in_design;
  -product_offering_status("In Test") -> in_test;
  -product_offering_status("Active") -> active;
  -product_offering_status("Rejected") -> rejected;
  -product_offering_status("Launched") -> launched;
  -product_offering_status("Retired") -> retired;
  -product_offering_status("Obsolete") -> obsolete;
  -product_offering_status(in_study) -> "In Study";
  -product_offering_status(in_design) -> "In Design";
  -product_offering_status(in_test) -> "In Test";
  -product_offering_status(active) -> "Active";
  -product_offering_status(rejected) -> "Rejected";
  -product_offering_status(launched) -> "Launched";
  -product_offering_status(retired) -> "Retired";
  -product_offering_status("Obsolete") -> obsolete.
  +offer_status("In Study") -> in_study;
  +offer_status("In Design") -> in_design;
  +offer_status("In Test") -> in_test;
  +offer_status("Active") -> active;
  +offer_status("Rejected") -> rejected;
  +offer_status("Launched") -> launched;
  +offer_status("Retired") -> retired;
  +offer_status("Obsolete") -> obsolete;
  +offer_status(in_study) -> "In Study";
  +offer_status(in_design) -> "In Design";
  +offer_status(in_test) -> "In Test";
  +offer_status(active) -> "Active";
  +offer_status(rejected) -> "Rejected";
  +offer_status(launched) -> "Launched";
  +offer_status(retired) -> "Retired";
  +offer_status("Obsolete") -> obsolete.
   
   -spec product_status(Status) -> Status
   	when
  
positive.code: patch_replace4(_, _) ->
  	{error, unprocessable}.
  
  -spec product_offering(Product) -> Product
  	when
  		Product :: #product{} | {struct, ObjectMembers} | ObjectMembers,
  		ObjectMembers :: [tuple()].
  %% @doc CODEC for Product Offering.
  %% @private
  product_offering(#product{} = P) ->
  	product_offering(record_info(fields, product), P, []);
  product_offering({struct, ObjectMembers}) ->
  	product_offering(ObjectMembers, #product{});
  product_offering(ObjectMembers) when is_list(ObjectMembers) ->
  	product_offering(ObjectMembers, #product{}).
  %% @hidden
  product_offering([{"id", ID} | T], Acc) ->
  	product_offering(T, Acc#product{id = ID});
  product_offering([{"href", URI} | T], Acc) ->
  	product_offering(T, Acc#product{href = URI});
  product_offering([{"name", Name} | T], Acc) ->
  	product_offering(T, Acc#product{name = Name});
  product_offering([{"description", Description} | T], Acc) ->
  	product_offering(T, Acc#product{description = Description});
  product_offering([{"validFor", {struct, L}} | T], Acc) ->
  	Acc1 = case lists:keyfind("startDateTime", 1, L) of
  		{_, Start} ->
  			Acc#product{start_date = ocs_rest:iso8601(Start)};
  		undefined ->
  			Acc
  	end;
  	Acc2 = case lists:keyfind("endDateTime", 1, L) of
  		{_, End} ->
  			Acc1#product{end_date = ocs_rest:iso8601(End)};
  		undefined ->
  			Acc
  	end,
  	product_offering(T, Acc2);
  product_offering([{"is_bundle", Bundle} | T], Acc) ->
  	product_offering(T, Acc#product{is_bundle = Bundle});
  product_offering([{"lifecycleStatus", Status} | T], Acc) ->
  	product_offering(T, Acc#product{status = product_offering_status(Status)});
  product_offering([{"price", Price} | T], Acc) ->
  	product_offering(T, Acc#product{price = product_price(Price)});
  product_offering([{"characteristic", Chars} | T], Acc) ->
  	product_offering(T, Acc#product{characteristics = characterics(Chars)});
  product_offering([{"lastUpdate", Last} | T], Acc) ->
  	product_offering(T, Acc#product{last_modified = ocs_rest:iso8601(Last)}).
  %% @hidden
  product_offering([id | T], #product{id = ID} = P, Acc) ->
  	product_offering(T, P, [{"id", ID} | Acc]);
  product_offering([href | T], #product{href = URI} = P, Acc) ->
  	product_offering(T, P, [{"href", URI} | Acc]);
  product_offering([name | T], #product{name = Name} = P, Acc) ->
  	product_offering(T, P, [{"name", Name} | Acc]);
  product_offering([description | T], #product{description = D} = P, Acc)
  		when D /= undefined ->
  	product_offering(P, [{"description", Description} | Acc]);
  product_offering([start_date | T], #product{start_date = Start,
  		end_date = undefined} = P, Acc) when Start /= undefined ->
  	ValidFor = {struct, [{"startDateTime", ocs_rest:iso8601(Start)}]},
  	product_offering(T, P, [{"validFor", ValidFor} | Acc]);
  product_offering([start_date | T], #product{start_date = undefined,
  		end_date = End} = P, Acc) End /= undefined ->
  	ValidFor = {struct, [{"endDateTime", ocs_rest:iso8601(End)}]},
  	product_offering(T, P, [{"validFor", ValidFor} | Acc]);
  product_offering([start_date | T], #product{start_date = Start,
  		end_date = End} = P, Acc) ->
  	ValidFor = {struct, [{"startDateTime", ocs_rest:iso8601(Start)},
  			{"endDateTime", ocs_rest:iso8601(End)}]},
  	product_offering(T, P, [{"validFor", ValidFor} | Acc]);
  product_offering([end_date | T], P, Acc) ->
  	product_offering(T, P, Acc);
  product_offering([is_bundle | T], (#product{is_bundle = IsBundle} = P, Acc)
  		when IsBundle /= undeined ->
  	product_offering(T, P, [{"isBunde", IsBundle} | Acc]);
  product_offering([status | T], #product{status = Status} = P, Acc)
  		when Status /= undefined ->
  	StatusString = product_offering_status(Status),
  	product_offering(T, P, [{"lifecycleStatus", StatusString} | Acc]);
  product_offering([price | T], #product{price = Price, Acc)
  		when Price /= undefined ->
  	product_offering(T, P, [{"price", product_price(Price)} | Acc]);
  product_offering([characteristics | T],
  		#product{characteristics = Chars} = P, Acc) when Chars /= undefined ->
  	product_offering(T, P, [{"characteristic", characterics(Chars)} | Acc]);
  product_offering([last_modified | T], #product{last_modified = Last} = P, Acc)
  		when Last /= undefined ->
  product_offering([], P, Acc) ->
  	lists:reverse([{"lastUpdate", ocs_rest:iso8601(Last)} | Acc]).
  
  %% @hidden
  query_start(Query, Filters, RangeStart, RangeEnd) ->
  
negative.code: price_type(usage) -> "usage";
  price_type(recurring) -> "recurring";
  price_type(one_time) -> "one_time".
  
  -spec price_period(Period) -> Period
  	when
  		Period :: string() | atom().
  %% @doc CODEC for Recurring Charge Period.
  %% @private
  price_period(daily) -> "Daily";
  price_period(weekly) -> "Weekly";
  price_period(monthly) -> "Monthly";
  price_period(yearly) -> "Yearly";
  price_period("Daily") -> daily;
  price_period("Weekly") -> weekly;
  price_period("Monthly") -> monthly;
  price_period("Yearly") -> yearly.
  
  -spec exe_jsonpatch_ON(ProductID, Etag, OperationList) -> Result
  	when
  