All files / examples/order-more/models physical-address.ts

93.33% Statements 14/15
100% Branches 0/0
50% Functions 1/2
93.33% Lines 14/15

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    1x   1x                                                       47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x                     1x            
import { IModel, ICollection, IColumns } from '../../../src/index';
 
export const tableName: string = 'physical_address';
 
export const columns: IColumns = [
  'id',
  'address1',
  'address2',
  'city',
  'province',
  'zip',
  'country',
  'province_code',
  'country_code',
  'latitude',
  'longitude'
];
 
export class PhysicalAddress implements IModel {
  id: number;
  address1: string;
  address2: string;
  city: string;
  province: string;
  zip: string;
  country: string;
  provinceCode: string;
  countryCode: string;
  latitude: string;
  longitude: string;
 
  constructor(props: any) {
    this.id = props.id;
    this.address1 = props.address1;
    this.address2 = props.address2;
    this.city = props.city;
    this.province = props.province;
    this.zip = props.zip;
    this.country = props.country;
    this.provinceCode = props.provinceCode;
    this.countryCode = props.countryCode;
    this.latitude = props.latitude;
    this.longitude = props.longitude;
  }
}
 
export class PhysicalAddresses implements ICollection<PhysicalAddress> {
  models: Array<PhysicalAddress>;
  constructor({ models }: any) {
    this.models = models;
  }
}
 
export const physicalAddressEntity = {
  tableName,
  columns,
  Model: PhysicalAddress,
  Collection: PhysicalAddresses,
}