TransactionPartner.affiliateProgram constructor

  1. @Assert('type == TransactionPartnerType.affiliateProgram', 'type must be TransactionPartnerType.affiliateProgram')
const TransactionPartner.affiliateProgram({
  1. @JsonKey(name: 'type') @Default(TransactionPartnerType.affiliateProgram) TransactionPartnerType type,
  2. @JsonKey(name: 'sponsor_user') User? sponsorUser,
  3. @JsonKey(name: 'commission_per_mille') required int commissionPerMille,
})

Describes the affiliate program that issued the affiliate commission received via this transaction

Implementation

@Assert(
  'type == TransactionPartnerType.affiliateProgram',
  'type must be TransactionPartnerType.affiliateProgram',
)
const factory TransactionPartner.affiliateProgram({
  /// Type of the transaction partner, must be "affiliate_program"
  @JsonKey(name: 'type')
  @Default(TransactionPartnerType.affiliateProgram)
  TransactionPartnerType type,

  /// Information about the bot that sponsored the affiliate program.
  @JsonKey(name: 'sponsor_user') final User? sponsorUser,

  /// The number of Telegram Stars received by the bot for each 1000 Telegram
  /// Stars received by the affiliate program sponsor from referred users.
  @JsonKey(name: 'commission_per_mille')
  required final int commissionPerMille,
}) = TransactionPartnerAffiliateProgram;