Snowfakery icon indicating copy to clipboard operation
Snowfakery copied to clipboard

Macro library

Open prescod opened this issue 4 years ago • 0 comments

A vast namespaced library could provide pre-defined macros for all common Salesforce objects. In the first iteration there might be just one profile for every SObject

You might use it like this:

   - object: Account
      include: Salesforce.Account
      friends:
           Contact:
           include: Salesforce.Contact
           fields:
                AccountId: 
                    reference: Account

Which would expand to:

- object: Account
   fields:
    Name:
      fake: Company
    Description:
      fake: catch_phrase
    BillingStreet:
      fake: street_address
    BillingCity:
      fake: city
    BillingState:
      fake: state
    BillingPostalCode:
      fake: postalcode
    BillingCountry: Canada
    ShippingStreet:
      fake: street_address
    ShippingCity:
      fake: city
    ShippingState:
      fake: state
    ShippingPostalCode:
      fake: postalcode
    ShippingCountry:
      fake: country
    Phone:
      fake: phone_number
    Fax:
      fake: phone_number
    Website:
      fake: uri
    NumberOfEmployees:
      random_number:
        min: 0
        max: 200000
    AccountNumber:
      random_number:
        min: 0
        max: 10000000
  friends:
    - object: Contact
      fields:
        Salutation:
          fake: prefix
        FirstName:
          fake: FirstName
        LastName:
          fake: LastName
        Email:
          fake: email
        Phone:
          fake: phone_number
        MobilePhone:
          fake: phone_number
        Title:
          fake: job
        Birthdate:
          fake.date_between:
            start_date: -50y
            end_date: -20y
        AccountId:
          reference: Account

prescod avatar Mar 20 '21 01:03 prescod