137 lines
4.1 KiB
TypeScript
137 lines
4.1 KiB
TypeScript
import { PrismaService } from '../prisma/prisma.service';
|
|
import { CreateCustomFieldValueDto, UpdateCustomFieldValueDto } from '../shared/dto/custom-field.dto';
|
|
export declare class CustomFieldsService {
|
|
private prisma;
|
|
constructor(prisma: PrismaService);
|
|
createCustomFieldValue(createCustomFieldValueDto: CreateCustomFieldValueDto): Promise<{
|
|
customField: {
|
|
name: string;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
typeMachineId: string | null;
|
|
typePieceId: string | null;
|
|
typeComposantId: string | null;
|
|
type: string;
|
|
required: boolean;
|
|
defaultValue: string | null;
|
|
options: string[];
|
|
};
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
machineId: string | null;
|
|
composantId: string | null;
|
|
pieceId: string | null;
|
|
value: string;
|
|
customFieldId: string;
|
|
}>;
|
|
findCustomFieldValuesByEntity(entityType: string, entityId: string): Promise<({
|
|
customField: {
|
|
name: string;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
typeMachineId: string | null;
|
|
typePieceId: string | null;
|
|
typeComposantId: string | null;
|
|
type: string;
|
|
required: boolean;
|
|
defaultValue: string | null;
|
|
options: string[];
|
|
};
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
machineId: string | null;
|
|
composantId: string | null;
|
|
pieceId: string | null;
|
|
value: string;
|
|
customFieldId: string;
|
|
})[]>;
|
|
findOneCustomFieldValue(id: string): Promise<({
|
|
customField: {
|
|
name: string;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
typeMachineId: string | null;
|
|
typePieceId: string | null;
|
|
typeComposantId: string | null;
|
|
type: string;
|
|
required: boolean;
|
|
defaultValue: string | null;
|
|
options: string[];
|
|
};
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
machineId: string | null;
|
|
composantId: string | null;
|
|
pieceId: string | null;
|
|
value: string;
|
|
customFieldId: string;
|
|
}) | null>;
|
|
updateCustomFieldValue(id: string, updateCustomFieldValueDto: UpdateCustomFieldValueDto): Promise<{
|
|
customField: {
|
|
name: string;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
typeMachineId: string | null;
|
|
typePieceId: string | null;
|
|
typeComposantId: string | null;
|
|
type: string;
|
|
required: boolean;
|
|
defaultValue: string | null;
|
|
options: string[];
|
|
};
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
machineId: string | null;
|
|
composantId: string | null;
|
|
pieceId: string | null;
|
|
value: string;
|
|
customFieldId: string;
|
|
}>;
|
|
removeCustomFieldValue(id: string): Promise<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
machineId: string | null;
|
|
composantId: string | null;
|
|
pieceId: string | null;
|
|
value: string;
|
|
customFieldId: string;
|
|
}>;
|
|
upsertCustomFieldValue(customFieldId: string, entityType: string, entityId: string, value: string): Promise<{
|
|
customField: {
|
|
name: string;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
typeMachineId: string | null;
|
|
typePieceId: string | null;
|
|
typeComposantId: string | null;
|
|
type: string;
|
|
required: boolean;
|
|
defaultValue: string | null;
|
|
options: string[];
|
|
};
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
machineId: string | null;
|
|
composantId: string | null;
|
|
pieceId: string | null;
|
|
value: string;
|
|
customFieldId: string;
|
|
}>;
|
|
}
|