Skip to content

Commit

Permalink
Iterate on getByDate
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanjnelson committed Aug 8, 2024
1 parent b5675f6 commit 5b844a6
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Query } from 'cypher-query-builder';
import { Without } from 'type-fest/source/merge-exclusive';
import {
CalendarDate,
EnhancedResource,
ID,
PublicOf,
Range,
Expand Down Expand Up @@ -57,26 +58,28 @@ export class PeriodicReportEdgeDBRepository
throw new Error('Method not implemented.');
}

getByDate(
async getByDate(

Check failure on line 61 in src/components/periodic-report/periodic-report.edgedb.repository.ts

View workflow job for this annotation

GitHub Actions / lint

Property 'getByDate' in type 'PeriodicReportEdgeDBRepository' is not assignable to the same property in base type 'PublicOf<PeriodicReportRepository>'.
parentId: ID,
date: CalendarDate,
reportType: ReportType,
_session: Session,
) {
const resource = e.cast(e.Resource, e.uuid(parentId));
const enhancedResource = EnhancedResource.of(
resolveReportType({ type: reportType }),
);
const resource = e.cast(enhancedResource.db, e.uuid(parentId));

const report = e.select(e.PeriodicReport, (report) => ({
const report = e.select(resource, (report) => ({
filter: e.all(
e.set(
e.op(resource.id, '=', report.container.id),
e.op(report.start, '<=', date),
e.op(report.end, '>=', date),
),
),
...report.is(resolveReportType(reportType)),
}));

return this.db.run(report);
return await this.db.run(report);
}

getCurrentDue(
Expand Down

0 comments on commit 5b844a6

Please sign in to comment.