All files / graphql/matcomp matcomp.interface.ts

73.33% Statements 11/15
100% Branches 0/0
20% Functions 1/5
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45                                                    2x 2x 2x 3x   2x 3x   2x 3x   2x 3x     3x      
import { Field, ID, ObjectType } from '@nestjs/graphql';
 
import { initializeClassProperties } from '../../utils/class.util';
import type { AppMatcompArgs } from './dto/matcomp.args';
import type { AppMatcompInput } from './matcomp-input.interface';
import type { AppMatcompModel } from './model/matcomp.model';
 
/**
 * Matcomp query interface.
 */
export interface IMatcompQuery {
  findAll(args: AppMatcompArgs): AppMatcomp[];
  findOneById(id: string): AppMatcomp | undefined;
}
 
/**
 * Matcomp mutation interface.
 */
export interface IMatcompMutation {
  create(id: AppMatcompInput): AppMatcomp;
  remove(id: string): AppMatcomp | undefined;
}
 
/**
 * Matcomp interface with initialization.
 */
@ObjectType()
export class AppMatcomp implements AppMatcompModel {
  @Field(() => ID)
  public id = '';
 
  @Field(() => String)
  public name = '';
 
  @Field(() => String)
  public description = '';
 
  @Field(() => Date)
  public creationDate = new Date();
 
  constructor(input?: AppMatcomp | AppMatcompInput) {
    initializeClassProperties<AppMatcomp | AppMatcompInput>(this, input);
  }
}