First step of https://github.com/twentyhq/twenty/issues/6868 Adds min.., max.. queries for DATETIME fields adds min.., max.., avg.., sum.. queries for NUMBER fields (count distinct operation and composite fields such as CURRENCY handling will be dealt with in a future PR) <img width="1422" alt="Capture d’écran 2024-11-06 à 15 48 46" src="https://github.com/user-attachments/assets/4bcdece0-ad3e-4536-9720-fe4044a36719"> --------- Co-authored-by: Charles Bochet <charles@twenty.com> Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
@ -2,10 +2,10 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { EntityManager } from 'typeorm';
|
||||
|
||||
import { Record } from 'src/engine/api/graphql/workspace-query-builder/interfaces/record.interface';
|
||||
import { ObjectRecord } from 'src/engine/api/graphql/workspace-query-builder/interfaces/object-record.interface';
|
||||
|
||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||
import { objectRecordDiffMerge } from 'src/engine/core-modules/event-emitter/utils/object-record-diff-merge';
|
||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||
|
||||
@Injectable()
|
||||
export class TimelineActivityRepository {
|
||||
@ -15,7 +15,7 @@ export class TimelineActivityRepository {
|
||||
|
||||
async upsertOne(
|
||||
name: string,
|
||||
properties: Partial<Record>,
|
||||
properties: Partial<ObjectRecord>,
|
||||
objectName: string,
|
||||
recordId: string,
|
||||
workspaceId: string,
|
||||
@ -105,7 +105,7 @@ export class TimelineActivityRepository {
|
||||
private async updateTimelineActivity(
|
||||
dataSourceSchema: string,
|
||||
id: string,
|
||||
properties: Partial<Record>,
|
||||
properties: Partial<ObjectRecord>,
|
||||
workspaceMemberId: string | undefined,
|
||||
workspaceId: string,
|
||||
) {
|
||||
@ -121,7 +121,7 @@ export class TimelineActivityRepository {
|
||||
private async insertTimelineActivity(
|
||||
dataSourceSchema: string,
|
||||
name: string,
|
||||
properties: Partial<Record>,
|
||||
properties: Partial<ObjectRecord>,
|
||||
objectName: string,
|
||||
recordId: string,
|
||||
workspaceMemberId: string | undefined,
|
||||
@ -151,7 +151,7 @@ export class TimelineActivityRepository {
|
||||
objectName: string,
|
||||
activities: {
|
||||
name: string;
|
||||
properties: Partial<Record> | null;
|
||||
properties: Partial<ObjectRecord> | null;
|
||||
workspaceMemberId: string | undefined;
|
||||
recordId: string | null;
|
||||
linkedRecordCachedName: string;
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
import { DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
|
||||
import { ObjectRecordCreateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-create.event';
|
||||
import { ObjectRecordDeleteEvent } from 'src/engine/core-modules/event-emitter/types/object-record-delete.event';
|
||||
import { ObjectRecordDestroyEvent } from 'src/engine/core-modules/event-emitter/types/object-record-destroy.event';
|
||||
import { ObjectRecordUpdateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-update.event';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { generateFakeObjectRecord } from 'src/modules/workflow/workflow-builder/utils/generate-fake-object-record';
|
||||
import { DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
|
||||
|
||||
export const generateFakeObjectRecordEvent = <Entity>(
|
||||
objectMetadataEntity: ObjectMetadataEntity,
|
||||
|
||||
Reference in New Issue
Block a user