@@ -43,7 +43,7 @@ describe('Activity Repository', () => {
4343 await activityRepo . logActivity ( {
4444 entityType : 'patient' ,
4545 entityId : 1 ,
46- action : 'create ' ,
46+ action : 'created ' ,
4747 title : 'Patient Created' ,
4848 description : 'New patient John Doe created' ,
4949 patientId : 1
@@ -52,16 +52,16 @@ describe('Activity Repository', () => {
5252 const activities = await activityRepo . getRecentActivities ( 10 )
5353
5454 expect ( activities . length ) . toBe ( 1 )
55- expect ( activities [ 0 ] . entity_type ) . toBe ( 'patient' )
56- expect ( activities [ 0 ] . action ) . toBe ( 'create ' )
55+ expect ( activities [ 0 ] . entityType ) . toBe ( 'patient' )
56+ expect ( activities [ 0 ] . action ) . toBe ( 'created ' )
5757 expect ( activities [ 0 ] . title ) . toBe ( 'Patient Created' )
5858 } )
5959
6060 it ( 'should log a surgery activity' , async ( ) => {
6161 await activityRepo . logActivity ( {
6262 entityType : 'surgery' ,
6363 entityId : 5 ,
64- action : 'update ' ,
64+ action : 'updated ' ,
6565 title : 'Surgery Updated' ,
6666 description : 'Surgery details modified' ,
6767 patientId : 1 ,
@@ -71,15 +71,15 @@ describe('Activity Repository', () => {
7171 const activities = await activityRepo . getRecentActivities ( 10 )
7272
7373 expect ( activities . length ) . toBe ( 1 )
74- expect ( activities [ 0 ] . entity_type ) . toBe ( 'surgery' )
75- expect ( activities [ 0 ] . surgery_id ) . toBe ( 5 )
74+ expect ( activities [ 0 ] . entityType ) . toBe ( 'surgery' )
75+ expect ( activities [ 0 ] . surgeryId ) . toBe ( 5 )
7676 } )
7777
7878 it ( 'should log a followup activity' , async ( ) => {
7979 await activityRepo . logActivity ( {
8080 entityType : 'followup' ,
8181 entityId : 10 ,
82- action : 'create ' ,
82+ action : 'created ' ,
8383 title : 'Followup Added' ,
8484 description : 'New followup note added' ,
8585 patientId : 1 ,
@@ -88,7 +88,7 @@ describe('Activity Repository', () => {
8888
8989 const activities = await activityRepo . getRecentActivities ( 10 )
9090
91- expect ( activities [ 0 ] . entity_type ) . toBe ( 'followup' )
91+ expect ( activities [ 0 ] . entityType ) . toBe ( 'followup' )
9292 } )
9393 } )
9494
@@ -104,7 +104,7 @@ describe('Activity Repository', () => {
104104 await activityRepo . logActivity ( {
105105 entityType : 'patient' ,
106106 entityId : i ,
107- action : 'create ' ,
107+ action : 'created ' ,
108108 title : `Activity ${ i } ` ,
109109 description : `Description ${ i } ` ,
110110 patientId : i
@@ -120,7 +120,7 @@ describe('Activity Repository', () => {
120120 await activityRepo . logActivity ( {
121121 entityType : 'patient' ,
122122 entityId : 1 ,
123- action : 'create ' ,
123+ action : 'created ' ,
124124 title : 'First' ,
125125 description : 'First activity' ,
126126 patientId : 1
@@ -132,7 +132,7 @@ describe('Activity Repository', () => {
132132 await activityRepo . logActivity ( {
133133 entityType : 'patient' ,
134134 entityId : 2 ,
135- action : 'create ' ,
135+ action : 'created ' ,
136136 title : 'Second' ,
137137 description : 'Second activity' ,
138138 patientId : 2
@@ -151,7 +151,7 @@ describe('Activity Repository', () => {
151151 await activityRepo . logActivity ( {
152152 entityType : 'patient' ,
153153 entityId : 1 ,
154- action : 'create ' ,
154+ action : 'created ' ,
155155 title : 'Patient 1 Created' ,
156156 description : 'Patient 1' ,
157157 patientId : 1
@@ -160,7 +160,7 @@ describe('Activity Repository', () => {
160160 await activityRepo . logActivity ( {
161161 entityType : 'patient' ,
162162 entityId : 2 ,
163- action : 'create ' ,
163+ action : 'created ' ,
164164 title : 'Patient 2 Created' ,
165165 description : 'Patient 2' ,
166166 patientId : 2
@@ -169,7 +169,7 @@ describe('Activity Repository', () => {
169169 await activityRepo . logActivity ( {
170170 entityType : 'patient' ,
171171 entityId : 1 ,
172- action : 'update ' ,
172+ action : 'updated ' ,
173173 title : 'Patient 1 Updated' ,
174174 description : 'Patient 1 update' ,
175175 patientId : 1
@@ -178,14 +178,14 @@ describe('Activity Repository', () => {
178178 const activities = await activityRepo . getActivitiesForEntity ( 'patient' , 1 )
179179
180180 expect ( activities . length ) . toBe ( 2 )
181- expect ( activities . every ( ( a ) => a . entity_id === 1 ) ) . toBe ( true )
181+ expect ( activities . every ( ( a ) => a . entityId === 1 ) ) . toBe ( true )
182182 } )
183183
184184 it ( 'should filter by entity type and id' , async ( ) => {
185185 await activityRepo . logActivity ( {
186186 entityType : 'patient' ,
187187 entityId : 1 ,
188- action : 'create ' ,
188+ action : 'created ' ,
189189 title : 'Patient Activity' ,
190190 description : 'Patient' ,
191191 patientId : 1
@@ -194,7 +194,7 @@ describe('Activity Repository', () => {
194194 await activityRepo . logActivity ( {
195195 entityType : 'surgery' ,
196196 entityId : 1 ,
197- action : 'create ' ,
197+ action : 'created ' ,
198198 title : 'Surgery Activity' ,
199199 description : 'Surgery' ,
200200 patientId : 1 ,
@@ -218,7 +218,7 @@ describe('Activity Repository', () => {
218218 await activityRepo . logActivity ( {
219219 entityType : 'patient' ,
220220 entityId : 1 ,
221- action : 'create ' ,
221+ action : 'created ' ,
222222 title : 'Patient Created' ,
223223 description : 'New patient' ,
224224 patientId : 1
@@ -227,7 +227,7 @@ describe('Activity Repository', () => {
227227 await activityRepo . logActivity ( {
228228 entityType : 'surgery' ,
229229 entityId : 1 ,
230- action : 'create ' ,
230+ action : 'created ' ,
231231 title : 'Surgery Created' ,
232232 description : 'New surgery' ,
233233 patientId : 1 ,
@@ -237,7 +237,7 @@ describe('Activity Repository', () => {
237237 await activityRepo . logActivity ( {
238238 entityType : 'patient' ,
239239 entityId : 1 ,
240- action : 'update ' ,
240+ action : 'updated ' ,
241241 title : 'Patient Updated' ,
242242 description : 'Patient modified' ,
243243 patientId : 1
@@ -255,14 +255,14 @@ describe('Activity Repository', () => {
255255 const result = await activityRepo . listActivityLog ( { entityType : 'patient' } )
256256
257257 expect ( result . data . length ) . toBe ( 2 )
258- expect ( result . data . every ( ( a ) => a . entity_type === 'patient' ) ) . toBe ( true )
258+ expect ( result . data . every ( ( a ) => a . entityType === 'patient' ) ) . toBe ( true )
259259 } )
260260
261261 it ( 'should filter by action' , async ( ) => {
262- const result = await activityRepo . listActivityLog ( { action : 'create ' } )
262+ const result = await activityRepo . listActivityLog ( { action : 'created ' } )
263263
264264 expect ( result . data . length ) . toBe ( 2 )
265- expect ( result . data . every ( ( a ) => a . action === 'create ' ) ) . toBe ( true )
265+ expect ( result . data . every ( ( a ) => a . action === 'created ' ) ) . toBe ( true )
266266 } )
267267
268268 it ( 'should filter by search term' , async ( ) => {
0 commit comments