namespace org.accordproject.ippayment

import org.accordproject.contract.* from https://models.accordproject.org/accordproject/contract.cto
import org.accordproject.runtime.* from https://models.accordproject.org/accordproject/runtime.cto
import org.accordproject.time.* from https://models.accordproject.org/v2.0/time.cto

/**
 * Requesting a payment
 */
transaction PaymentRequest extends Request {
  o Double netSaleRevenue
  o Double sublicensingRevenue
  o DateTime permissionGrantedBy optional
}

/**
 * PayOut response
 */
transaction PayOut extends Response {
  o Double totalAmount
  o DateTime dueBy
}

/**
 * The template model
 */
asset IntellectualPropertyPaymentClause extends Clause {
  /* royalty */
  o String royaltyText
  o Double royaltyRate

  /* sub-licensing */
  o String sublicensingRoyaltyText
  o Double sublicensingRoyaltyRate

  /* payment */
  o Duration paymentPeriod
  o Duration paymentPeriodWithPermission
}
