Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCMOHAD-25932 || Updated the status #1037

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/default/classes/FetchAndGenerateCSV.cls
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public with sharing class FetchAndGenerateCSV {
List<Account> accounts = [SELECT Id, RegId__c, Name, HealthAuthority__c, ExemptionofAddressPublication__c, Phone, Extension__c, Fax, Website, Status__c, Parent.Name,
(SELECT ContactId, PrimaryContact__c, Contact.Name FROM AccountContactRelations WHERE PrimaryContact__c = true LIMIT 1),
(SELECT RegistrationCertificate__c FROM AccountBusinessLicenses__r WHERE Status = 'Active' LIMIT 1),
(SELECT ServiceName__c FROM Services__r WHERE ServiceName__c IN: serviceNameList LIMIT 50),
(SELECT ServiceName__c, Status__c FROM Services__r WHERE ServiceName__c IN: serviceNameList LIMIT 50),
(SELECT Id, Location.VisitorAddress.Address FROM AssociatedLocations WHERE ActiveTo = NULL LIMIT 1),
Account.LicenseType__r.RegulatoryAuthorizationCode__c,
(SELECT Quantity, Type__c FROM Assets WHERE Type__c IN: typeList AND ParentId = NULL AND Quantity > 0.00)
Expand Down Expand Up @@ -140,7 +140,7 @@ public with sharing class FetchAndGenerateCSV {
// Helper method to get the service flag
private static String getServiceFlag(List<Service__c> services, String serviceName){
for(Service__c service : services){
if(!String.isEmpty(serviceName) && serviceName.containsIgnoreCase(service.ServiceName__c)){
if(service.Status__c == 'Active' && service.ServiceName__c == serviceName){
return '-1'; // Flag '-1' if service name is found
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/default/classes/FetchAndGenerateCSVTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private class FetchAndGenerateCSVTest {
ServiceName__c = 'Assistance with daily living activities',
ServiceType__c = 'Assisted Living Service',
ProvidedBy__c = 'Registrant',
Status__c = 'Active',
Account__c = Residence.id
);
insert ser;
Expand Down Expand Up @@ -122,6 +123,7 @@ private class FetchAndGenerateCSVTest {
ServiceName__c = 'Assistance with daily living activities',
ServiceType__c = 'Assisted Living Service',
ProvidedBy__c = 'Registrant',
Status__c = 'Active',
Account__c = Residence.id
);
insert ser;
Expand Down