Skip to content

Commit

Permalink
feat: [Contracts] Remap contract actions for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
radulescuandrew committed Oct 2, 2024
1 parent 23e80b4 commit c852b02
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,13 @@ export class ActionsArchiveRepository
'archive.eventName in (:...eventNames) AND archive.createdOn >= :startDate AND archive.createdOn <= :endDate',
{
eventNames: [
TrackedEventName.CREATE_CONTRACT,
TrackedEventName.APPROVE_CONTRACT,
TrackedEventName.REJECT_CONTRACT,
TrackedEventName.CREATE_DOCUMENT_CONTRACT,
TrackedEventName.VALIDATE_DOCUMENT_CONTRACT,
TrackedEventName.SIGN_DOCUMENT_CONTRACT_BY_NGO,
TrackedEventName.SIGN_DOCUMENT_CONTRACT_BY_VOLUNTEER,
TrackedEventName.REJECT_DOCUMENT_CONTRACT_BY_NGO,
TrackedEventName.REJECT_DOCUMENT_CONTRACT_BY_VOLUNTEER,
TrackedEventName.DELETE_DOCUMENT_CONTRACT,
],
startDate: startOfMonth(new Date()),
endDate: endOfMonth(new Date()),
Expand Down
10 changes: 7 additions & 3 deletions backend/src/usecases/actions-archive/get-many-news.usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export class GetManyNewsUsecase
break;
case NewsType.CONTRACTS:
events = [
TrackedEventName.CREATE_CONTRACT,
TrackedEventName.APPROVE_CONTRACT,
TrackedEventName.REJECT_CONTRACT,
TrackedEventName.CREATE_DOCUMENT_CONTRACT,
TrackedEventName.VALIDATE_DOCUMENT_CONTRACT,
TrackedEventName.SIGN_DOCUMENT_CONTRACT_BY_NGO,
TrackedEventName.SIGN_DOCUMENT_CONTRACT_BY_VOLUNTEER,
TrackedEventName.REJECT_DOCUMENT_CONTRACT_BY_NGO,
TrackedEventName.REJECT_DOCUMENT_CONTRACT_BY_VOLUNTEER,
TrackedEventName.DELETE_DOCUMENT_CONTRACT,
];
break;
case NewsType.LOGGED_HOURS:
Expand Down
8 changes: 8 additions & 0 deletions mobile/src/common/enums/tracked-event-name.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ export enum TrackedEventName {
CREATE_CONTRACT = 'CREATE_CONTRACT',
APPROVE_CONTRACT = 'APPROVE_CONTRACT',
REJECT_CONTRACT = 'REJECT_CONTRACT',

CREATE_DOCUMENT_CONTRACT = 'CREATE_DOCUMENT_CONTRACT',
VALIDATE_DOCUMENT_CONTRACT = 'VALIDATE_DOCUMENT_CONTRACT',
SIGN_DOCUMENT_CONTRACT_BY_NGO = 'SIGN_DOCUMENT_CONTRACT_BY_NGO',
SIGN_DOCUMENT_CONTRACT_BY_VOLUNTEER = 'SIGN_DOCUMENT_CONTRACT_BY_VOLUNTEER',
REJECT_DOCUMENT_CONTRACT_BY_NGO = 'REJECT_DOCUMENT_CONTRACT_BY_NGO',
REJECT_DOCUMENT_CONTRACT_BY_VOLUNTEER = 'REJECT_DOCUMENT_CONTRACT_BY_VOLUNTEER',
DELETE_DOCUMENT_CONTRACT = 'DELETE_DOCUMENT_CONTRACT',
}

0 comments on commit c852b02

Please sign in to comment.