Description

Below are an example stories for populating a set of database tables.  Each story gives information that allows GenRocket to populate the attributes of the given table, knowledge of datatypes or enumerations, and knowledge of parent/child relationships.  


Plot: GenRocket needs to populate a set of tables via JDBC

Actors: 

  • GenRocket
  • ComputeReward Stored Procedure


Story 1: GenRocket populates the reward_type table

  • The following reward_type attributes are populated
    • id (unique)
    • name (must consist the following enumerations)
      • Platinum
      • Gold
      • Silver
    • percent_reward
      • 2.0% --> Platinum
      • 1.5% --> Gold
      • 1.0% --> Silver 


Story 2: GenRocket populates the customer table

  • The following customer attributes are populated
    • id (unique)
    • external_id (unique string, limit 10) 
    • first_name (random)
    • last_name (random)
    • ssn (unique)
    • username (unique)
    • email_address (unique)
    • phone_number (random)


Story 3: GenRocket populates the account table

  • The following account attributes are populated
    • id (unique)
    • external_id (unique string, limit 10)
    • account_number (unique string, limit 8)
    • card_number (credit card)
    • balance (float default = 0)
    • reward (float, default = 0)
    • customer_id (references customer)
    • reward_type_id (references reward_type)
  • GenRocket will generate one account for each customer
  • 60% of the accounts will have a Silver reward type
  • 30% of the accounts will have a Gold reward type
  • 10% of the accounts will have a Platinum reward type


Story 4: GenRocket populates the transaction table

  • The following transaction attributes are populated
    • id (unique)
    • external_id
      • concatenation of 
        • customer.external_id 
        • account.external_id
        • transaction.id
    • date_created (DateTime)
    • amount (float, random (5,15,25,50,75,100,125,150,175, 200))
    • reward_amount (float)
    • account_id (references account)
  • GenRocket will generate 1000 transactions for each account
  • GenRocket will call the Stored Procedure, ComputeReward(), after each row insertion
  • ComputeReward we perform the following computations: 
    • compute the transaction.reward_amount for the given transaction.amount and transaction.reward_type
    • update the account.reward with the transaction.reward_amount


ER Diagram of the tables that may be populated for the above story