-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c9458c
commit dc93dcd
Showing
2 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
snowfakery_samples/OSC/MembershipSchemaAndBenefits_PricebookProducts.recipe.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
### ------------- [ ORDER OF INSERT ]------------ ### | ||
# 1-0. Pricebook2 | ||
# 1-1. Product2 | ||
# 1-2. PricebookEntry | ||
|
||
|
||
### ----------- [ MembershipSchemaAndBenefits_basic.recipe.yml Summary ]---------- ### | ||
# Query Standard Price Book | ||
# Create [3] products called "Individual Membership", "Houshold Membership", "Corporate Membership" | ||
# https://github.com/SFDO-Community-Sprints/MembershipSchemaAndBenefits | ||
|
||
|
||
### ----------- [ CLI RUN ]---------- ### | ||
|
||
# cci task run generate_and_load_from_yaml --generator_yaml snowfakery_samples/OSC/MembershipSchemaAndBenefits_PricebookProducts.recipe.yml --num_records 300 --num_records_tablename npe03__Recurring_Donation__c --org qa | ||
# snowfakery --output-format json --output-file src/foo.json snowfakery_samples/OSC/MembershipSchemaAndBenefits_PricebookProducts.recipe.yml | ||
|
||
### ----------- [ Recipe Starts ]---------- ### | ||
|
||
# Import Pricebook, Product, Price Book Entry | ||
- plugin: snowfakery.standard_plugins.Salesforce.SalesforceQuery | ||
|
||
- object: Pricebook2 | ||
fields: | ||
__pricebook_from_salesforce: | ||
SOQLDataset.shuffle: | ||
fields: Id | ||
from: Pricebook2 | ||
where: IsStandard = true | ||
id: ${{__pricebook_from_salesforce.Id}} | ||
isActive: true | ||
|
||
- object: Product2 | ||
fields: | ||
|
||
friend: | ||
- object: PricebookEntry | ||
fields: | ||
IsActive: true | ||
UnitPrice: DOUBLE | ||
ProductCode: STRING | ||
Product2Id: Product2 | ||
Pricebook2Id: ${{Pricebook2.id}} | ||
|
||
|
95 changes: 95 additions & 0 deletions
95
snowfakery_samples/OSC/MembershipSchemaAndBenefits_basic.recipe.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
### ------------- [ ORDER OF INSERT ]------------ ### | ||
# 1-0. Account (Household) | ||
# 1-1. Contact - Household Members | ||
# 1-2. Pricebook2 (Imported) | ||
# 1-3. Product2 (Imported) | ||
# 1-4. PricebookEntry (Imported) | ||
# 1-7. Opportunity | ||
# 1-8. OpportunityLineItem | ||
# 1-5. Membership__c | ||
# 1-6. Membership_Contact_Role__c | ||
|
||
|
||
### ----------- [ MembershipSchemaAndBenefits_basic.recipe.yml Summary ]---------- ### | ||
# Household Account with multiple contacts and a single contact, Organication Account without primary contact | ||
# Query Standard Price Book | ||
# Create [3] products called "Individual Membership", "Houshold Membership", "Corporate Membership" | ||
# Membership record is specific to a related account and opportunity records. | ||
# Membership Contact role differenciates household members roles among the same membership. | ||
# There is an apex trigger handler that creates a membership contact role for primary contact. | ||
# https://github.com/SFDO-Community-Sprints/MembershipSchemaAndBenefits | ||
|
||
|
||
### ----------- [ CLI RUN ]---------- ### | ||
|
||
# cci task run generate_and_load_from_yaml --generator_yaml snowfakery_samples/OSC/MembershipSchemaAndBenefits_basic.recipe.yml --num_records 300 --num_records_tablename npe03__Recurring_Donation__c --org qa | ||
# snowfakery --output-format json --output-file src/foo.json snowfakery_samples/OSC/MembershipSchemaAndBenefits_basic.recipe.yml | ||
|
||
### ----------- [ Recipe Starts ]---------- ### | ||
|
||
# Import Pricebook, Product, Price Book Entry | ||
- include_file: MembershipSchemaAndBenefits_PricebookProducts.recipe.yml | ||
|
||
- object: Account | ||
fields: | ||
|
||
# MembershipSchemaAndBenefits custom fields | ||
First_Membership_Start_Date__c: DATE | ||
Membership_End_Date__c: DATE | ||
Membership_Status__c: PICKLIST | ||
Membership_Type__c: PICKLIST | ||
Primary_Membership__c: REFERENCE | ||
|
||
|
||
- object: Contact | ||
fields: | ||
# MembershipSchemaAndBenefits custom fields | ||
Last_Membership_Start_Date__c: DATE | ||
First_Membership_Start_Date__c: DATE | ||
Membership_End_Date__c: DATE | ||
Membership_Status__c: PICKLIST | ||
Membership_Type__c: PICKLIST | ||
|
||
- object: Membership__c | ||
fields: | ||
Name: STRING | ||
|
||
Start_Date__c: DATE | ||
End_Date__c: DATE | ||
Type__c: PICKLIST | ||
Origin__c: PICKLIST | ||
|
||
Account__c: REFERENCE | ||
Opportunity__c: REFERENCE | ||
Primary_Contact__c: REFERENCE | ||
Product__c: REFERENCE | ||
|
||
|
||
- object: Membership_Contact_Role__c | ||
fields: | ||
Name: STRING | ||
Start_Date__c: DATE | ||
End_Date__c: DATE | ||
Role__c: PICKLIST | ||
|
||
Is_Primary__c: BOOLEAN | ||
|
||
Membership__c: REFERENCE | ||
Contact__c: REFERENCE | ||
|
||
- object: Opportunity | ||
fields: | ||
|
||
- object: OpportunityLineItem | ||
fields: | ||
Name: STRING(Automated) | ||
Quantity: DOUBLE | ||
|
||
UnitPrice: CURRENCY | ||
Description: STRING | ||
|
||
Membership__c: REFERENCE | ||
OpportunityId: REFERENCE | ||
PricebookEntryId: REFERENCE | ||
Product2Id: REFERENCE | ||
ProductCode: STRING |