Skip to content

Commit

Permalink
add ai and milestone filters
Browse files Browse the repository at this point in the history
  • Loading branch information
rdonigian committed Feb 7, 2025
1 parent c5f1203 commit c561da3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/engagement/dto/list-engagements.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import {
SecuredList,
SortablePaginationInput,
} from '~/common';
import { LanguageFilters } from '../../language/dto';
import {
AIAssistedTranslation,
LanguageFilters,
LanguageMilestone,
} from '../../language/dto';
import { ProjectFilters } from '../../project/dto';
import { UserFilters } from '../../user/dto';
import {
Expand Down Expand Up @@ -73,6 +77,14 @@ export abstract class EngagementFilters {
@Type(() => DateFilter)
@ValidateNested()
readonly endDate?: DateFilter;

@Field(() => [LanguageMilestone], {
nullable: true,
})
readonly milestoneReached?: readonly LanguageMilestone[];

@Field(() => [AIAssistedTranslation], { nullable: true })
readonly usingAIAssistedTranslation?: readonly AIAssistedTranslation[];
}

@InputType()
Expand Down
2 changes: 2 additions & 0 deletions src/components/engagement/engagement.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,8 @@ export const engagementFilters = filter.define(() => EngagementFilters, {
node('node', 'User'),
]),
),
milestoneReached: filter.stringListProp(),
usingAIAssistedTranslation: filter.stringListProp(),
});

export const engagementSorters = defineSorters(IEngagement, {
Expand Down
1 change: 1 addition & 0 deletions src/components/language/dto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from './update-language.dto';
export * from './delete-language.dto';
export * from './first-scripture.dto';
export * from './language-milestone.enum';
export * from './ai-assisted-translation.enum';

0 comments on commit c561da3

Please sign in to comment.