anchor.diff:  					TotalUnits = UnitsCharged + (PriceCharged div UnitPrice),
   					Rated3 = rated(#{Units => Amount, cents => PriceCharged}, Rated2),
   					Now = erlang:system_time(millisecond),
  -					NewReservation = {Now, UnitsCharged, 0,
  -							ServiceId, ChargingKey, SessionId},
  +					Reservation = #{ts => Now, debit => UnitsCharged, reserve => 0,
  +							service_id => ServiceId, charging_key => ChargingKey},
  +					Attributes = #{bucket_type => session,
  +							reservations => #{SessionId => Reservation}},
   					LM = make_lm(),
   					Buckets4 = [#bucket{id = make_id(LM), last_modified = LM,
   							start_date = Now,
   							remain_amount = PriceCharged - PriceCharge,
  -							reservations = [NewReservation],
  -							units = cents, product = [ProductId]} | Buckets3],
  +							attributes = Attributes, units = cents,
  +							product = [ProductId]} | Buckets3],
   					charge3(Service, ServiceId, Product, Buckets4, event, DebitAmount, {Units, TotalUnits},
   							ReserveAmount, ReserveAmount, SessionId, Rated3, ChargingKey, Buckets)
   			end
  
positive.code: 						{NewUnitsCharged, 0, Buckets4}
  								when NewUnitsCharged < NewChargeUnits->
  							Now = erlang:system_time(millisecond),
  							NewReservation = {Now, 0, NewUnitsCharged - NewChargeUnits,
  									ServiceId, ChargingKey, SessionId},
  							LM = make_lm(),
  							Buckets5 = [#bucket{id = make_id(LM), last_modified = LM,
  									start_date = Now, end_date = Now,
  									remain_amount = 0, reservations = [NewReservation],
  									units = Units, product = [ProductId]} | Buckets4],
  							charge3(Service, ServiceId, Product, Buckets5, interim,
  									DebitAmount, {Units, UnitsCharged + NewUnitsCharged},
  
negative.code: 	refund(ServiceId, ChargingKey, SessionId, Buckets, []).
  %% @hidden
  refund(ServiceId, ChargingKey, SessionId,
  		[#bucket{attributes = #{reservations := Reservations}} = H | T], Acc) ->
  	refund(ServiceId, ChargingKey, SessionId,
  			H, maps:to_list(Reservations), T, [], Acc);
  refund(_, _, _, [], Acc) ->
  	lists:reverse(Acc).
  %% @hidden
  refund(ServiceId, ChargingKey, SessionId,
  		#bucket{remain_amount = R, attributes = Attributes} = Bucket1,
  		[{SessionId, #{debit := 0, reserve := Amount, service_id := ServiceId,
  				charging_key := ChargingKey}} | T1],
  		T2, Acc1, Acc2) ->
  	NewReservations = maps:from_list(lists:reverse(Acc1) ++ T1),
  	Bucket2 = Bucket1#bucket{remain_amount = R + Amount,
  			attributes = Attributes#{reservations => NewReservations}},
  	refund(ServiceId, ChargingKey, SessionId, T2, [Bucket2 | Acc2]);
  refund(ServiceId, ChargingKey, SessionId,
  		#bucket{remain_amount = R, attributes = Attributes} = Bucket1,
  		[{SessionId, #{ts := TS, debit := Debit, reserve := Amount,
  				service_id := ServiceId, charging_key := ChargingKey}} | T1],
  		T2, Acc1, Acc2) ->
  	Refunded = {SessionId, #{ts => TS, debit => Debit, reserve => 0,
  			service_id => ServiceId, charging_key => ChargingKey}},
  	NewReservations = maps:from_list(lists:reverse(Acc1) ++ [Refunded | T1]),
  	Bucket2 = Bucket1#bucket{remain_amount = R + Amount,
  			attributes = Attributes#{reservations => NewReservations}},
  	refund(ServiceId, ChargingKey, SessionId, T2, [Bucket2 | Acc2]);
  refund(ServiceId, ChargingKey, SessionId, Bucket,
  		[H | T1], T2, Acc1, Acc2) ->
  	refund(ServiceId, ChargingKey, SessionId, Bucket,
  			T1, T2, [H | Acc1], Acc2);
  refund(ServiceId, ChargingKey, SessionId,
  		#bucket{attributes = Attributes} = Bucket1, [], T, Acc1, Acc2) ->
  	NewReservations = maps:from_list(lists:reverse(Acc1)),
  	Bucket2 = Bucket1#bucket{attributes =
  			Attributes#{reservations => NewReservations}},
  	refund(ServiceId, ChargingKey, SessionId, T, [Bucket2 | Acc2]).
  
  -spec filter_prices_tod(Timestamp, Prices) -> Prices
  