mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-02 10:04:09 +03:00
fix: small tenant refactor fixes (#2375)
This commit is contained in:
parent
bb8cddddc4
commit
3432615a17
@ -10,7 +10,7 @@ export interface FieldMetadataTargetColumnMapUrl {
|
||||
}
|
||||
|
||||
export interface FieldMetadataTargetColumnMapMoney {
|
||||
value: number;
|
||||
amount: number;
|
||||
currency: string;
|
||||
}
|
||||
|
||||
|
@ -5,13 +5,15 @@ import {
|
||||
Resolver,
|
||||
} from 'src/tenant/resolver-builder/interfaces/resolvers-builder.interface';
|
||||
import { SchemaBuilderContext } from 'src/tenant/schema-builder/interfaces/schema-builder-context.interface';
|
||||
import { FactoryInterface } from 'src/tenant/resolver-builder/interfaces/factory.interface';
|
||||
import { ResolverBuilderFactoryInterface } from 'src/tenant/resolver-builder/interfaces/resolver-builder-factory.interface';
|
||||
|
||||
import { DataSourceService } from 'src/metadata/data-source/data-source.service';
|
||||
import { PGGraphQLQueryRunner } from 'src/tenant/resolver-builder/pg-graphql/pg-graphql-query-runner';
|
||||
|
||||
@Injectable()
|
||||
export class CreateManyResolverFactory implements FactoryInterface {
|
||||
export class CreateManyResolverFactory
|
||||
implements ResolverBuilderFactoryInterface
|
||||
{
|
||||
public static methodName = 'createMany' as const;
|
||||
|
||||
constructor(private readonly dataSourceService: DataSourceService) {}
|
||||
|
@ -5,14 +5,16 @@ import {
|
||||
Resolver,
|
||||
} from 'src/tenant/resolver-builder/interfaces/resolvers-builder.interface';
|
||||
import { SchemaBuilderContext } from 'src/tenant/schema-builder/interfaces/schema-builder-context.interface';
|
||||
import { FactoryInterface } from 'src/tenant/resolver-builder/interfaces/factory.interface';
|
||||
import { ResolverBuilderFactoryInterface } from 'src/tenant/resolver-builder/interfaces/resolver-builder-factory.interface';
|
||||
|
||||
import { DataSourceService } from 'src/metadata/data-source/data-source.service';
|
||||
import { PGGraphQLQueryRunner } from 'src/tenant/resolver-builder/pg-graphql/pg-graphql-query-runner';
|
||||
import { FieldMetadata } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
|
||||
@Injectable()
|
||||
export class CreateOneResolverFactory implements FactoryInterface {
|
||||
export class CreateOneResolverFactory
|
||||
implements ResolverBuilderFactoryInterface
|
||||
{
|
||||
public static methodName = 'createOne' as const;
|
||||
|
||||
constructor(private readonly dataSourceService: DataSourceService) {}
|
||||
|
@ -5,14 +5,16 @@ import {
|
||||
Resolver,
|
||||
} from 'src/tenant/resolver-builder/interfaces/resolvers-builder.interface';
|
||||
import { SchemaBuilderContext } from 'src/tenant/schema-builder/interfaces/schema-builder-context.interface';
|
||||
import { FactoryInterface } from 'src/tenant/resolver-builder/interfaces/factory.interface';
|
||||
import { ResolverBuilderFactoryInterface } from 'src/tenant/resolver-builder/interfaces/resolver-builder-factory.interface';
|
||||
|
||||
import { DataSourceService } from 'src/metadata/data-source/data-source.service';
|
||||
import { PGGraphQLQueryRunner } from 'src/tenant/resolver-builder/pg-graphql/pg-graphql-query-runner';
|
||||
import { FieldMetadata } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
|
||||
@Injectable()
|
||||
export class DeleteOneResolverFactory implements FactoryInterface {
|
||||
export class DeleteOneResolverFactory
|
||||
implements ResolverBuilderFactoryInterface
|
||||
{
|
||||
public static methodName = 'deleteOne' as const;
|
||||
|
||||
constructor(private readonly dataSourceService: DataSourceService) {}
|
||||
|
@ -5,13 +5,15 @@ import {
|
||||
Resolver,
|
||||
} from 'src/tenant/resolver-builder/interfaces/resolvers-builder.interface';
|
||||
import { SchemaBuilderContext } from 'src/tenant/schema-builder/interfaces/schema-builder-context.interface';
|
||||
import { FactoryInterface } from 'src/tenant/resolver-builder/interfaces/factory.interface';
|
||||
import { ResolverBuilderFactoryInterface } from 'src/tenant/resolver-builder/interfaces/resolver-builder-factory.interface';
|
||||
|
||||
import { DataSourceService } from 'src/metadata/data-source/data-source.service';
|
||||
import { PGGraphQLQueryRunner } from 'src/tenant/resolver-builder/pg-graphql/pg-graphql-query-runner';
|
||||
|
||||
@Injectable()
|
||||
export class FindManyResolverFactory implements FactoryInterface {
|
||||
export class FindManyResolverFactory
|
||||
implements ResolverBuilderFactoryInterface
|
||||
{
|
||||
public static methodName = 'findMany' as const;
|
||||
|
||||
constructor(private readonly dataSourceService: DataSourceService) {}
|
||||
|
@ -5,14 +5,14 @@ import {
|
||||
Resolver,
|
||||
} from 'src/tenant/resolver-builder/interfaces/resolvers-builder.interface';
|
||||
import { SchemaBuilderContext } from 'src/tenant/schema-builder/interfaces/schema-builder-context.interface';
|
||||
import { FactoryInterface } from 'src/tenant/resolver-builder/interfaces/factory.interface';
|
||||
import { ResolverBuilderFactoryInterface } from 'src/tenant/resolver-builder/interfaces/resolver-builder-factory.interface';
|
||||
|
||||
import { DataSourceService } from 'src/metadata/data-source/data-source.service';
|
||||
import { PGGraphQLQueryRunner } from 'src/tenant/resolver-builder/pg-graphql/pg-graphql-query-runner';
|
||||
import { FieldMetadata } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
|
||||
@Injectable()
|
||||
export class FindOneResolverFactory implements FactoryInterface {
|
||||
export class FindOneResolverFactory implements ResolverBuilderFactoryInterface {
|
||||
public static methodName = 'findOne' as const;
|
||||
|
||||
constructor(private readonly dataSourceService: DataSourceService) {}
|
||||
|
@ -5,14 +5,16 @@ import {
|
||||
UpdateOneResolverArgs,
|
||||
} from 'src/tenant/resolver-builder/interfaces/resolvers-builder.interface';
|
||||
import { SchemaBuilderContext } from 'src/tenant/schema-builder/interfaces/schema-builder-context.interface';
|
||||
import { FactoryInterface } from 'src/tenant/resolver-builder/interfaces/factory.interface';
|
||||
import { ResolverBuilderFactoryInterface } from 'src/tenant/resolver-builder/interfaces/resolver-builder-factory.interface';
|
||||
|
||||
import { DataSourceService } from 'src/metadata/data-source/data-source.service';
|
||||
import { PGGraphQLQueryRunner } from 'src/tenant/resolver-builder/pg-graphql/pg-graphql-query-runner';
|
||||
import { FieldMetadata } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
|
||||
@Injectable()
|
||||
export class UpdateOneResolverFactory implements FactoryInterface {
|
||||
export class UpdateOneResolverFactory
|
||||
implements ResolverBuilderFactoryInterface
|
||||
{
|
||||
public static methodName = 'updateOne' as const;
|
||||
|
||||
constructor(private readonly dataSourceService: DataSourceService) {}
|
||||
|
@ -2,6 +2,6 @@ import { SchemaBuilderContext } from 'src/tenant/schema-builder/interfaces/schem
|
||||
|
||||
import { Resolver } from './resolvers-builder.interface';
|
||||
|
||||
export interface FactoryInterface {
|
||||
export interface ResolverBuilderFactoryInterface {
|
||||
create(context: SchemaBuilderContext): Resolver;
|
||||
}
|
@ -16,7 +16,7 @@ import {
|
||||
ResolverBuilderMethodNames,
|
||||
ResolverBuilderMethods,
|
||||
} from './interfaces/resolvers-builder.interface';
|
||||
import { FactoryInterface } from './interfaces/factory.interface';
|
||||
import { ResolverBuilderFactoryInterface } from './interfaces/resolver-builder-factory.interface';
|
||||
|
||||
@Injectable()
|
||||
export class ResolverFactory {
|
||||
@ -36,7 +36,10 @@ export class ResolverFactory {
|
||||
objectMetadataCollection: ObjectMetadataInterface[],
|
||||
resolverBuilderMethods: ResolverBuilderMethods,
|
||||
): Promise<IResolvers> {
|
||||
const factories = new Map<ResolverBuilderMethodNames, FactoryInterface>([
|
||||
const factories = new Map<
|
||||
ResolverBuilderMethodNames,
|
||||
ResolverBuilderFactoryInterface
|
||||
>([
|
||||
['findMany', this.findManyResolverFactory],
|
||||
['findOne', this.findOneResolverFactory],
|
||||
['createMany', this.createManyResolverFactory],
|
||||
|
Loading…
Reference in New Issue
Block a user