Adding stripe integration by making the server logic independent of the input fields: - query factories (remote server, foreign data wrapper, foreign table) to loop on fields and values without hardcoding the names of the fields - adding stripe input and type - add the logic to handle static schema. Simply creating a big object to store into the server Additional work: - rename username field to user. This is the input intended for postgres user mapping and we now need a matching by name --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
32 lines
887 B
TypeScript
32 lines
887 B
TypeScript
import { Field, InputType } from '@nestjs/graphql';
|
|
|
|
import { IsOptional } from 'class-validator';
|
|
import GraphQLJSON from 'graphql-type-json';
|
|
|
|
import {
|
|
ForeignDataWrapperOptions,
|
|
RemoteServerType,
|
|
} from 'src/engine/metadata-modules/remote-server/remote-server.entity';
|
|
import {
|
|
UserMappingOptions,
|
|
UserMappingOptionsUpdateInput,
|
|
} from 'src/engine/metadata-modules/remote-server/types/user-mapping-options';
|
|
|
|
@InputType()
|
|
export class UpdateRemoteServerInput<T extends RemoteServerType> {
|
|
@Field(() => String)
|
|
id: string;
|
|
|
|
@IsOptional()
|
|
@Field(() => GraphQLJSON, { nullable: true })
|
|
foreignDataWrapperOptions?: Partial<ForeignDataWrapperOptions<T>>;
|
|
|
|
@IsOptional()
|
|
@Field(() => UserMappingOptionsUpdateInput, { nullable: true })
|
|
userMappingOptions?: Partial<UserMappingOptions>;
|
|
|
|
@IsOptional()
|
|
@Field(() => String, { nullable: true })
|
|
schema?: string;
|
|
}
|