Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 4fbd2f7

Browse files
dfcoffinclaude
andcommitted
Update service layer imports to use proper entity packages
Replace legacy domain imports with usage entity imports: - BatchList -> BatchListEntity - Subscription -> SubscriptionEntity - UsagePoint -> UsagePointEntity - RetailCustomer -> RetailCustomerEntity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ce3a917 commit 4fbd2f7

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

src/main/java/org/greenbuttonalliance/espi/common/service/UpdateService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
package org.greenbuttonalliance.espi.common.service;
2222

23-
import org.greenbuttonalliance.espi.common.domain.BatchList;
24-
import org.greenbuttonalliance.espi.common.domain.Subscription;
23+
import org.greenbuttonalliance.espi.common.domain.usage.BatchListEntity;
24+
import org.greenbuttonalliance.espi.common.domain.usage.SubscriptionEntity;
2525

2626
public interface UpdateService {
27-
BatchList updatedResources(Subscription subscription);
27+
BatchListEntity updatedResources(SubscriptionEntity subscription);
2828
}

src/main/java/org/greenbuttonalliance/espi/common/service/UsagePointService.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323

2424
import com.sun.syndication.io.FeedException;
25-
import org.greenbuttonalliance.espi.common.domain.legacy.RetailCustomer;
26-
import org.greenbuttonalliance.espi.common.domain.legacy.Subscription;
27-
import org.greenbuttonalliance.espi.common.domain.legacy.UsagePoint;
25+
import org.greenbuttonalliance.espi.common.domain.usage.RetailCustomerEntity;
26+
import org.greenbuttonalliance.espi.common.domain.usage.SubscriptionEntity;
27+
import org.greenbuttonalliance.espi.common.domain.usage.UsagePointEntity;
2828
import org.greenbuttonalliance.espi.common.domain.legacy.atom.EntryType;
2929
import org.greenbuttonalliance.espi.common.repositories.usage.UsagePointRepository;
3030
import org.greenbuttonalliance.espi.common.utils.EntryTypeIterator;
@@ -35,37 +35,37 @@
3535

3636
public interface UsagePointService {
3737

38-
List<UsagePoint> findAllByRetailCustomer(RetailCustomer customer);
38+
List<UsagePointEntity> findAllByRetailCustomer(RetailCustomerEntity customer);
3939

40-
void createOrReplaceByUUID(UsagePoint usagePoint);
40+
void createOrReplaceByUUID(UsagePointEntity usagePoint);
4141

42-
void associateByUUID(RetailCustomer retailCustomer, UUID uuid);
42+
void associateByUUID(RetailCustomerEntity retailCustomer, UUID uuid);
4343

44-
UsagePoint findByUUID(UUID uuid);
44+
UsagePointEntity findByUUID(UUID uuid);
4545

46-
UsagePoint findByHashedId(String usagePointHashedId);
46+
UsagePointEntity findByHashedId(String usagePointHashedId);
4747

48-
List<UsagePoint> findAllUpdatedFor(Subscription subscription);
48+
List<UsagePointEntity> findAllUpdatedFor(SubscriptionEntity subscription);
4949

5050
void deleteByHashedId(String usagePointHashedId);
5151

5252
List<Long> findAllIdsForRetailCustomer(Long id);
5353

54-
String feedFor(List<UsagePoint> usagePoints) throws FeedException;
54+
String feedFor(List<UsagePointEntity> usagePoints) throws FeedException;
5555

56-
String entryFor(UsagePoint usagePoint);
56+
String entryFor(UsagePointEntity usagePoint);
5757

58-
List<UsagePoint> findAllByRetailCustomer(Long retailCustomerId);
58+
List<UsagePointEntity> findAllByRetailCustomer(Long retailCustomerId);
5959

6060
void setRepository(UsagePointRepository usagePointRepository);
6161

6262
void setResourceService(ResourceService resourceService);
6363

64-
void persist(UsagePoint usagePoint);
64+
void persist(UsagePointEntity usagePoint);
6565

66-
UsagePoint findById(Long usagePointId);
66+
UsagePointEntity findById(Long usagePointId);
6767

68-
UsagePoint findById(Long retailCustomerId, Long usagePointId);
68+
UsagePointEntity findById(Long retailCustomerId, Long usagePointId);
6969

7070
EntryType findEntryType(Long retailCustomerId, Long usagePointId);
7171

@@ -77,10 +77,10 @@ public interface UsagePointService {
7777

7878
EntryTypeIterator findEntryTypeIterator(Long retailCustomerId, Long usagePointId);
7979

80-
void add(UsagePoint usagePoint);
80+
void add(UsagePointEntity usagePoint);
8181

82-
void delete(UsagePoint usagePoint);
82+
void delete(UsagePointEntity usagePoint);
8383

84-
UsagePoint importResource(InputStream stream);
84+
UsagePointEntity importResource(InputStream stream);
8585

8686
}

src/main/java/org/greenbuttonalliance/espi/common/service/impl/UpdateServiceImpl.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
package org.greenbuttonalliance.espi.common.service.impl;
2222

23-
import org.greenbuttonalliance.espi.common.domain.BatchList;
24-
import org.greenbuttonalliance.espi.common.domain.Subscription;
25-
import org.greenbuttonalliance.espi.common.domain.UsagePoint;
23+
import org.greenbuttonalliance.espi.common.domain.usage.BatchListEntity;
24+
import org.greenbuttonalliance.espi.common.domain.usage.SubscriptionEntity;
25+
import org.greenbuttonalliance.espi.common.domain.usage.UsagePointEntity;
2626
import org.greenbuttonalliance.espi.common.service.UsagePointService;
2727
import org.greenbuttonalliance.espi.common.service.UpdateService;
2828
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,13 +36,13 @@ public class UpdateServiceImpl implements UpdateService {
3636
@Autowired
3737
private UsagePointService usagePointService;
3838

39-
public BatchList updatedResources(Subscription subscription) {
40-
List<UsagePoint> usagePoints = usagePointService
39+
public BatchListEntity updatedResources(SubscriptionEntity subscription) {
40+
List<UsagePointEntity> usagePoints = usagePointService
4141
.findAllUpdatedFor(subscription);
4242

43-
BatchList batchList = new BatchList();
43+
BatchListEntity batchList = new BatchListEntity();
4444

45-
for (UsagePoint usagePoint : usagePoints) {
45+
for (UsagePointEntity usagePoint : usagePoints) {
4646
batchList.getResources().add(usagePoint.getSelfHref());
4747
}
4848

src/main/java/org/greenbuttonalliance/espi/common/service/impl/UsagePointServiceImpl.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
package org.greenbuttonalliance.espi.common.service.impl;
2222

2323
import com.sun.syndication.io.FeedException;
24-
import org.greenbuttonalliance.espi.common.domain.legacy.RetailCustomer;
25-
import org.greenbuttonalliance.espi.common.domain.legacy.Subscription;
26-
import org.greenbuttonalliance.espi.common.domain.legacy.UsagePoint;
24+
import org.greenbuttonalliance.espi.common.domain.usage.RetailCustomerEntity;
25+
import org.greenbuttonalliance.espi.common.domain.usage.SubscriptionEntity;
26+
import org.greenbuttonalliance.espi.common.domain.usage.UsagePointEntity;
2727
import org.greenbuttonalliance.espi.common.domain.legacy.atom.EntryType;
2828
import org.greenbuttonalliance.espi.common.repositories.usage.ResourceRepository;
2929
import org.greenbuttonalliance.espi.common.repositories.usage.UsagePointRepository;
@@ -72,62 +72,62 @@ public void setRepository(UsagePointRepository usagePointRepository) {
7272
}
7373

7474
@Override
75-
public List<UsagePoint> findAllByRetailCustomer(RetailCustomer customer) {
75+
public List<UsagePointEntity> findAllByRetailCustomer(RetailCustomerEntity customer) {
7676
// TODO: Implement entity to domain conversion
7777
return new ArrayList<>();
7878
}
7979

8080
@Override
81-
public UsagePoint findById(Long usagePointId) {
81+
public UsagePointEntity findById(Long usagePointId) {
8282
// TODO: Implement entity to domain conversion
8383
return null;
8484
}
8585

8686
@Override
87-
public UsagePoint findById(Long retailCustomerId, Long usagePointId) {
87+
public UsagePointEntity findById(Long retailCustomerId, Long usagePointId) {
8888
// TODO: if needed, this needs to be scoped down to the RetailCustomer
8989
// collection and implement entity to domain conversion
9090
return null;
9191
}
9292

9393
@Override
94-
public void persist(UsagePoint up) {
94+
public void persist(UsagePointEntity up) {
9595
// TODO: Implement domain to entity conversion
9696
// this.usagePointRepository.save(up);
9797
}
9898

9999
@Override
100-
public void createOrReplaceByUUID(UsagePoint usagePoint) {
100+
public void createOrReplaceByUUID(UsagePointEntity usagePoint) {
101101
// TODO: Implement this logic in service layer with entity conversion
102102
// Check if exists by UUID, then save or update
103103
}
104104

105105
@Override
106-
public void associateByUUID(RetailCustomer retailCustomer, UUID uuid) {
106+
public void associateByUUID(RetailCustomerEntity retailCustomer, UUID uuid) {
107107
// TODO: Implement this logic in service layer
108108
// Find usage point by UUID and set retail customer
109109
}
110110

111111
@Override
112-
public UsagePoint findByUUID(UUID uuid) {
112+
public UsagePointEntity findByUUID(UUID uuid) {
113113
// TODO: Implement entity to domain conversion
114114
return null;
115115
}
116116

117117
@Override
118-
public UsagePoint findByHashedId(String usagePointHashedId) {
118+
public UsagePointEntity findByHashedId(String usagePointHashedId) {
119119
return findByUUID(UUID.fromString(usagePointHashedId));
120120
}
121121

122122
@Override
123-
public List<UsagePoint> findAllUpdatedFor(Subscription subscription) {
123+
public List<UsagePointEntity> findAllUpdatedFor(SubscriptionEntity subscription) {
124124
// TODO: Implement this logic using findAllUpdatedAfter with subscription timestamp
125125
return new ArrayList<>();
126126
}
127127

128128
@Override
129129
public void deleteByHashedId(String usagePointHashedId) {
130-
UsagePoint usagePoint = findByHashedId(usagePointHashedId);
130+
UsagePointEntity usagePoint = findByHashedId(usagePointHashedId);
131131
if (usagePoint != null) {
132132
usagePointRepository.deleteById(usagePoint.getId());
133133
}
@@ -140,39 +140,39 @@ public List<Long> findAllIdsForRetailCustomer(Long retailCustomerId) {
140140
}
141141

142142
@Override
143-
public String feedFor(List<UsagePoint> usagePoints) throws FeedException {
143+
public String feedFor(List<UsagePointEntity> usagePoints) throws FeedException {
144144
// TODO Auto-generated method stub
145145
return null;
146146
}
147147

148148
@Override
149-
public String entryFor(UsagePoint usagePoint) {
149+
public String entryFor(UsagePointEntity usagePoint) {
150150
// TODO Auto-generated method stub
151151
return null;
152152
}
153153

154154
@Override
155-
public List<UsagePoint> findAllByRetailCustomer(Long retailCustomerId) {
155+
public List<UsagePointEntity> findAllByRetailCustomer(Long retailCustomerId) {
156156
// TODO: Implement entity to domain conversion
157157
return new ArrayList<>();
158158
}
159159

160160
@Override
161-
public void add(UsagePoint usagePoint) {
161+
public void add(UsagePointEntity usagePoint) {
162162
// TODO Auto-generated method stub
163163
}
164164

165165
@Override
166-
public void delete(UsagePoint usagePoint) {
166+
public void delete(UsagePointEntity usagePoint) {
167167

168168
usagePointRepository.deleteById(usagePoint.getId());
169169

170170
}
171171

172172
@Override
173-
public UsagePoint importResource(InputStream stream) {
173+
public UsagePointEntity importResource(InputStream stream) {
174174

175-
UsagePoint usagePoint = null;
175+
UsagePointEntity usagePoint = null;
176176
try {
177177
importService.importData(stream, null);
178178
usagePoint = importService.getEntries().get(0).getContent()

0 commit comments

Comments
 (0)