MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / Order

Class Order

packages/repository/src/__tests__/unit/model/model.unit.ts:536–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534
535 describe('rejectNavigationalPropertiesInData', () => {
536 class Order extends Entity {
537 static definition = new ModelDefinition('Order')
538 .addProperty('id', {type: 'string', id: true})
539 .addRelation(<BelongsToDefinition>{
540 name: 'customer',
541 type: RelationType.belongsTo,
542 targetsMany: false,
543 source: Order,
544 target: () => User,
545 keyFrom: 'customerId',
546 });
547
548 id: string;
549 customerId: string;
550
551 customer?: User;
552 }
553
554 it('accepts data with no navigational properties', () => {
555 rejectNavigationalPropertiesInData(Order, {id: '1'});

Callers

nothing calls this directly

Calls 2

addRelationMethod · 0.80
addPropertyMethod · 0.80

Tested by

no test coverage detected