All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.killbill.billing.subscription.engine.dao.SubscriptionEventSqlDao.sql.stg Maven / Gradle / Ivy

The newest version!
group EventSqlDao: EntitySqlDao;

tableName() ::= "subscription_events"

andCheckSoftDeletionWithComma(prefix) ::= "and is_active"

extraTableFieldsWithComma(prefix) ::= <<
, record_id as total_ordering
>>

defaultOrderBy(prefix) ::= <<
order by effective_date ASC,  ASC
>>


tableFields(prefix) ::= <<
   event_type
,  user_type
,  effective_date
,  subscription_id
,  plan_name
,  phase_name
,  price_list_name
,  billing_cycle_day_local
,  is_active
,  created_by
,  created_date
,  updated_by
,  updated_date
>>

tableValues() ::= <<
  :eventType
, :userType
, :effectiveDate
, :subscriptionId
, :planName
, :phaseName
, :priceListName
, :billingCycleDayLocal
, :isActive
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>

unactiveEvent() ::= <<
update 
set
is_active = false
, updated_by = :createdBy
, updated_date = :updatedDate
where
id = :id

;
>>

getFutureActiveEventForSubscription() ::= <<
select 
, record_id as total_ordering
from 
where
subscription_id = :subscriptionId
and is_active = true
and effective_date > :now


;
>>


getFutureOrPresentActiveEventForSubscription() ::= <<
select 
, record_id as total_ordering
from 
where
subscription_id = :subscriptionId
and is_active = true
and effective_date >= :now


;
>>

getEventsForSubscription() ::= <<
select 
, record_id as total_ordering
from 
where
subscription_id = :subscriptionId
and is_active = true


;
>>

getFutureActiveEventsForAccount() ::= <<
select 
, record_id as total_ordering
from 
where
account_record_id = :accountRecordId
and is_active = true
and effective_date > :now


;
>>






© 2015 - 2025 Weber Informatics LLC | Privacy Policy