Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
// Node module: loopback4-example-microservices
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
import {Entity, model, ModelDefinition} from '@loopback/repository';
@model(require('./account/model-definition'))
export class Account extends Entity {
static definition = new ModelDefinition(
require('./account/model-definition').properties,
);
static modelName = 'Account';
id: string;
customerNumber: string;
balance: number;
branch: string;
type: string;
avgBalance: number;
minimumBalance: number;
constructor(body?: Partial) {
super();
if (body) {
Object.assign(this, body);
length: 512,
precision: null,
scale: null,
mysql: {
columnName: 'city',
dataType: 'varchar',
dataLength: 512,
dataPrecision: null,
dataScale: null,
nullable: 'Y',
},
},
}}
*/
return new ModelDefinition({
name: jugglerDef.name,
// TODO: convert from juggler/LB3 style to LB4
// For example, we need to transform array-type definitions from
// {type: ['string']} to {type: 'array', itemType: 'string'}
properties: jugglerDef.properties,
settings: jugglerDef.options,
});
}