From 1e12946b9992ce9e1730080116244527ca0a48cd Mon Sep 17 00:00:00 2001 From: Jeremy Lee Date: Tue, 11 Jul 2023 14:33:33 +0000 Subject: [PATCH 1/2] Updated sourceApiVersion from 53.0 to 57.0 in sfdx-project.json to align the commit, promote and deploy operations with the latest supported api version of Copado --- sfdx-project.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sfdx-project.json b/sfdx-project.json index 0eee5bf..5efe9c4 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -1 +1,16 @@ -{"packageDirectories":[{"path":"force-app","versionName":"","versionNumber":"","dependencies":[],"default":true,"package":""}],"namespace":"","sfdcLoginUrl":"https://login.salesforce.com","sourceApiVersion":"53.0","packageAliases":{}} \ No newline at end of file +{ + "packageDirectories": [ + { + "path": "force-app", + "versionName": "", + "versionNumber": "", + "dependencies": [], + "default": true, + "package": "" + } + ], + "namespace": "", + "sfdcLoginUrl": "https://login.salesforce.com", + "sourceApiVersion": "57.0", + "packageAliases": {} +} \ No newline at end of file From ffe1793e4b2c25e8a945bca886f30eaecb7afbb5 Mon Sep 17 00:00:00 2001 From: Jeremy Lee Date: Tue, 11 Jul 2023 14:34:08 +0000 Subject: [PATCH 2/2] US-0000071 DevTracker Logic Creation/Updates --- .../default/classes/AccountAutomations.cls | 29 +++ .../classes/AccountAutomations.cls-meta.xml | 5 + .../classes/AccountAutomationsTest.cls | 48 +++++ .../AccountAutomationsTest.cls-meta.xml | 5 + .../Developer__c/Developer__c.object-meta.xml | 166 ++++++++++++++++++ .../fields/Machine__c.field-meta.xml | 30 ++++ 6 files changed, 283 insertions(+) create mode 100644 force-app/main/default/classes/AccountAutomations.cls create mode 100644 force-app/main/default/classes/AccountAutomations.cls-meta.xml create mode 100644 force-app/main/default/classes/AccountAutomationsTest.cls create mode 100644 force-app/main/default/classes/AccountAutomationsTest.cls-meta.xml create mode 100644 force-app/main/default/objects/Developer__c/Developer__c.object-meta.xml create mode 100644 force-app/main/default/objects/Developer__c/fields/Machine__c.field-meta.xml diff --git a/force-app/main/default/classes/AccountAutomations.cls b/force-app/main/default/classes/AccountAutomations.cls new file mode 100644 index 0000000..0476e4b --- /dev/null +++ b/force-app/main/default/classes/AccountAutomations.cls @@ -0,0 +1,29 @@ +public class AccountAutomations { + Public static Account setDefaultDescription(Account a){ + If (a.Description != null) return a; + Else { + a.Description = 'Default description'; + return a; + } + } + public static Account setDefaultBillingAddress(Account a){ + a.billingstreet = 'Basauri, 6'; + a.billingstate = 'Madrid'; + a.billingpostalcode ='28023'; + return a; + } + public static Account setDefaultShippingAddress(Account a){ + a.shippingstreet = 'Basauri, 6'; + a.shippingstate = 'Madrid'; + a.shippingpostalcode ='28023'; + return a; + } + public static Account setDefaultPhone(Account a) { + a.Phone='688456789'; + return a; + } + public static Account setDefaultURL(Account a) { + a.website = 'www.copa.do'; + return a; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/AccountAutomations.cls-meta.xml b/force-app/main/default/classes/AccountAutomations.cls-meta.xml new file mode 100644 index 0000000..4b0bc9f --- /dev/null +++ b/force-app/main/default/classes/AccountAutomations.cls-meta.xml @@ -0,0 +1,5 @@ + + + 55.0 + Active + diff --git a/force-app/main/default/classes/AccountAutomationsTest.cls b/force-app/main/default/classes/AccountAutomationsTest.cls new file mode 100644 index 0000000..4e408a9 --- /dev/null +++ b/force-app/main/default/classes/AccountAutomationsTest.cls @@ -0,0 +1,48 @@ +@IsTest +private class AccountAutomationsTest { + + @isTest static void testDefaultDescription(){ + Account acc = new Account(Name = 'My Test Account'); + insert acc; + acc = AccountAutomations.setDefaultDescription(acc); + System.assertEquals('Default description', acc.Description, 'When description is null, it is updated to Default description'); + + acc.Description = 'New Description Manual'; + + acc = AccountAutomations.setDefaultDescription(acc); + System.assertNotEquals('Default description', acc.Description, 'When description is NOT null, it is NOT updated to Default description'); + } + + @isTest static void testDefaultBillingAddress(){ + Account acc = new Account(Name = 'My Test Account'); + insert acc; + acc = AccountAutomations.setDefaultBillingAddress(acc); + System.assertEquals('Basauri, 6', acc.BillingStreet, 'Default BillingStreet is Basauri, 6'); + System.assertEquals('Madrid', acc.BillingState, 'Default BillingState is Madrid'); + System.assertEquals('28023', acc.BillingPostalCode, 'Default BillingPostalCode is 28023'); + } + + @isTest static void testDefaultShippingAddress(){ + Account acc = new Account(Name = 'My Test Account'); + insert acc; + acc = AccountAutomations.setDefaultShippingAddress(acc); + System.assertEquals('Basauri, 6', acc.ShippingStreet, 'Default ShippingStreet is Basauri, 6'); + System.assertEquals('Madrid', acc.ShippingState, 'Default Shippingtate is Madrid'); + System.assertEquals('28023', acc.ShippingPostalCode, 'Default ShippingPostalCode is 28023'); + } + + @isTest static void testDefaultPhone(){ + Account acc = new Account(Name = 'My Test Account'); + insert acc; + acc = AccountAutomations.setDefaultPhone(acc); + System.assertEquals('688456789', acc.Phone, 'Default phone number is 688456789'); + } + + @isTest static void testDefaultURL(){ + Account acc = new Account(Name = 'My Test Account'); + insert acc; + acc = AccountAutomations.setDefaultURL(acc); + System.assertEquals('www.copa.do', acc.Website, 'Default website is www.copa.do'); + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/AccountAutomationsTest.cls-meta.xml b/force-app/main/default/classes/AccountAutomationsTest.cls-meta.xml new file mode 100644 index 0000000..4b0bc9f --- /dev/null +++ b/force-app/main/default/classes/AccountAutomationsTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 55.0 + Active + diff --git a/force-app/main/default/objects/Developer__c/Developer__c.object-meta.xml b/force-app/main/default/objects/Developer__c/Developer__c.object-meta.xml new file mode 100644 index 0000000..108bf86 --- /dev/null +++ b/force-app/main/default/objects/Developer__c/Developer__c.object-meta.xml @@ -0,0 +1,166 @@ + + + + Accept + Default + + + Accept + Large + Default + + + Accept + Small + Default + + + CancelEdit + Default + + + CancelEdit + Large + Default + + + CancelEdit + Small + Default + + + Clone + Default + + + Clone + Large + Default + + + Clone + Small + Default + + + Delete + Default + + + Delete + Large + Default + + + Delete + Small + Default + + + Edit + Default + + + Edit + Large + Default + + + Edit + Small + Default + + + List + Default + + + List + Large + Default + + + List + Small + Default + + + New + Default + + + New + Large + Default + + + New + Small + Default + + + SaveEdit + Default + + + SaveEdit + Large + Default + + + SaveEdit + Small + Default + + + Tab + Default + + + Tab + Large + Default + + + Tab + Small + Default + + + View + Default + + + View + Large + Default + + + View + Small + Default + + false + SYSTEM + Deployed + false + true + false + false + false + false + false + true + true + Private + Feminine + + + + Text + + Developers + + ReadWrite + Public + diff --git a/force-app/main/default/objects/Developer__c/fields/Machine__c.field-meta.xml b/force-app/main/default/objects/Developer__c/fields/Machine__c.field-meta.xml new file mode 100644 index 0000000..3935c13 --- /dev/null +++ b/force-app/main/default/objects/Developer__c/fields/Machine__c.field-meta.xml @@ -0,0 +1,30 @@ + + + Machine__c + false + + false + false + Picklist + + true + + false + + Mac + false + + + + Windows + false + + + + Other + false + + + + +