anchor.diff:  %% @hidden
   convert1(Type, Size, ServiceId, ChargingKey, SessionId, Now, CentsBuckets,
   		[#bucket{units = Type, name = "session", remain_amount = R,
  -		attributes = #{reservations := Reservations}} = B | T], Acc) ->
  +		attributes = #{bucket_type := session,
  +				reservations := Reservations}} = B | T], Acc) ->
   	F = fun({SessionId1, #{service_id := ServiceId1,
   					charging_key := ChargingKey1}}) when ServiceId1 =:= ServiceId,
   					ChargingKey1 =:= ChargingKey, SessionId1 == SessionId ->
  
positive.code: 			ServiceId, ChargingKey, SessionId, T, Acc, Charged);
  charge_session1(Type, Charge, Now, ServiceId, ChargingKey, SessionId,
  		[#bucket{units = Type, remain_amount = R, end_date = Expires,
  		attributes = Attributes} = B | T], Acc, Charged)
  		when Charge > 0, R >= Charge,
  		((Expires == undefined) or (Now < Expires)) ->
  	#{reservations := Reservations} = Attributes,
  	NewReservations = Reservations#{SessionId => #{ts => Now, debit => Charge,
  			reserve => 0, service_id => ServiceId, charging_key => ChargingKey}},
  
negative.code: 			ServiceId, ChargingKey, SessionId, T, Acc, Charged, Reserved);
  update(Type, Charge, Reserve, Now, ServiceId, ChargingKey, SessionId,
  		[#bucket{units = Type, remain_amount = Remain, end_date = Expires,
  		attributes = #{bucket_type := session}} = B | T], Acc, Charged, Reserved)
  		when ((Expires == undefined) or (Now < Expires)),
  		Remain >= ((Charge - Charged) + (Reserve - Reserved)) ->
  	Attributes = B#bucket.attributes,
  	#{reservations := Reservations} = Attributes,
  	NewCharge = Charge - Charged,
  	NewReserve = Reserve - Reserved,
  