group BusinessOverdueStatus;

getOverdueStatusesForBundleByKey(external_key) ::= <<
select
  bundle_id
, external_key
, account_key
, status
, start_date
, end_date
from bos
where external_key = :external_key
order by start_date asc
;
>>

createOverdueStatus() ::= <<
insert into bos (
  bundle_id
, external_key
, account_key
, status
, start_date
, end_date
) values (
  :bundle_id
, :external_key
, :account_key
, :status
, :start_date
, :end_date
);
>>

deleteOverdueStatusesForBundle(bundle_id) ::= <<
delete from bos where bundle_id = :bundle_id;
>>

test() ::= <<
select 1 from bos;
>>
