All files / test-utils/blog/models person.ts

88.24% Statements 15/17
100% Branches 0/0
50% Functions 1/2
88.24% Lines 15/17

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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79    1x   1x                                                                                         11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x                       1x            
import { IModel, ICollection, IColumns } from '../../../src/index';
 
export const tableName: string = 'person';
 
export const columns: IColumns = [
  'id',
  'first_name',
  'last_name',
  'slug',
  'email',
  'picture',
  'cover_photo',
  'brand',
  'tagline',
  'display_name',
  'biography',
  'title'
];
 
interface IPersonProps {
  id: number;
  firstName: string;
  lastName: string;
  slug: string;
  email: string;
  picture: string;
  coverPhoto: string;
  brand: string;
  tagline: string;
  displayName: string;
  biography: string;
  title: string;
}
 
export class Person implements IModel {
  id: number;
  firstName: string;
  lastName: string;
  slug: string;
  email: string;
  picture: string;
  coverPhoto: string;
  brand: string;
  tagline: string;
  displayName: string;
  biography: string;
  title: string;
 
  constructor(props: IPersonProps) {
    this.id = props.id;
    this.firstName = props.firstName;
    this.lastName = props.lastName;
    this.slug = props.slug;
    this.email = props.email;
    this.picture = props.picture;
    this.coverPhoto = props.coverPhoto;
    this.brand = props.brand;
    this.tagline = props.tagline;
    this.displayName = props.displayName;
    this.biography = props.biography;
    this.title = props.title;
  }
}
 
export class Persons implements ICollection<Person> {
  models: Array<Person>;
  constructor({ models }: any) {
    this.models = models;
    return this;
  }
}
 
export const personEntity = {
  tableName,
  columns,
  Model: Person,
  Collection: Persons
};