module FakeBsmobil::Generator::Movements

Public Instance Methods

commission() click to toggle source
# File lib/fake_bsmobil/generator/movements.rb, line 25
def commission
  Util.card(amount: Util.negative(10)).merge(
      concept: "NON-EURO CURRENCY COMMISSION ",
      canSplit: false,
      conceptCode: "06",
      conceptDetail: "REMITTANCE OF BILLS"
  )
end
purchase() click to toggle source
# File lib/fake_bsmobil/generator/movements.rb, line 17
def purchase
  Util.card(amount: Util.negative(100)).merge(
      concept: "PURCHASE WITH CARD #{Util.card_number} #{Util.company_name}",
      conceptCode: "12",
      conceptDetail: "CREDIT CARDS - DEBITS CARDS"
  )
end
random() click to toggle source
# File lib/fake_bsmobil/generator/movements.rb, line 55
def random
  (self.methods - self.class.methods - [__method__]).sample
end
salary() click to toggle source
# File lib/fake_bsmobil/generator/movements.rb, line 45
def salary
  Util.basic(amount: Util.positive(5000)).merge(
      concept: "SALARY PAYMENT #{Util.company_name}",
      existDocument: true,
      conceptCode: "15",
      conceptDetail: "SALARIES - SOCIAL SECURITY",
      referencor: "#{Generator.number(6)} #{Generator.number(15)} 01 P EUR                  #{Generator.number(20)}CAIX#{Generator.number(25)}",
  )
end
transfer(timestamp: Util.timestamp) click to toggle source
# File lib/fake_bsmobil/generator/movements.rb, line 34
def transfer(timestamp: Util.timestamp)
  Util.basic(amount: Util.negative(1000), timestamp: timestamp).merge(
      concept: "TRANSFER A #{Util.full_name}",
      canSplit: false,
      existDocument: true,
      conceptCode: "04",
      conceptDetail: "DRAFTS - INTERBANK TRANSFERS - INTRABANK TRANSFERS - CHECKS",
      referencor: "#{Generator.number(4)}#{timestamp.strftime('%Y-%m-%d %H:%M:%S')} 01 EUR                   #{Generator.number(6)}DV #{Generator.number(29)}",
  )
end
withdrawal(timestamp: Util.timestamp) click to toggle source
# File lib/fake_bsmobil/generator/movements.rb, line 6
def withdrawal(timestamp: Util.timestamp)
  movement = Util.card(timestamp: timestamp, amount: Util.negative(1000))

  movement.merge(
      concept: "WITHDRAWAL ATM #{Util.card_number} #{timestamp.strftime('%d.%m')}",
      conceptCode: "01",
      conceptDetail: "CHECKS - WITHDRAWALS",
      referencor: "#{movement[:referencor]} #{Generator.number(12)}",
  )
end