Skip to content

Commit 561a149

Browse files
committed
ExampleScreenerImportService reads Firestore exports and builds new screeners linked to the user
1 parent 02ff51e commit 561a149

File tree

2 files changed

+429
-10
lines changed

2 files changed

+429
-10
lines changed

builder-api/src/main/java/org/acme/functions/AccountHooks.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,18 @@
44
import jakarta.enterprise.context.ApplicationScoped;
55
import jakarta.inject.Inject;
66

7-
import org.acme.model.domain.Screener;
8-
import org.acme.persistence.ScreenerRepository;
7+
import org.acme.service.ExampleScreenerImportService;
98

109
@ApplicationScoped
1110
public class AccountHooks {
1211
@Inject
13-
ScreenerRepository screenerRepository;
12+
ExampleScreenerImportService exampleScreenerImportService;
1413

1514
public Boolean addExampleScreenerToAccount(String userId) {
1615
try {
1716
Log.info("Running ADD_EXAMPLE_SCREENER hook for user: " + userId);
18-
String screenerName = "Example screener - Philly Property Tax Relief";
19-
String screenerDescription = "Example description";
20-
Screener exampleScreener = Screener
21-
.create(userId, screenerName, screenerDescription);
22-
23-
String screenerId = screenerRepository
24-
.saveNewWorkingScreener(exampleScreener);
17+
String screenerId = exampleScreenerImportService.importForUser(userId);
18+
Log.info("Imported example screener " + screenerId + " for user " + userId);
2519
return true;
2620
} catch (Exception e) {
2721
Log.error(

0 commit comments

Comments
 (0)