[DEV-5312] Get delta processor program field from mongodb
parent
d7f01e12c8
commit
5e5932fe9d
|
@ -81,6 +81,9 @@ export interface DeltaDocument
|
||||||
/** The document id */
|
/** The document id */
|
||||||
id: DocumentId,
|
id: DocumentId,
|
||||||
|
|
||||||
|
/** The source program */
|
||||||
|
programId: string,
|
||||||
|
|
||||||
/** The entity name */
|
/** The entity name */
|
||||||
agentName: string,
|
agentName: string,
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,9 @@ export type DocumentMeta =
|
||||||
/** The document id */
|
/** The document id */
|
||||||
id: DocumentId,
|
id: DocumentId,
|
||||||
|
|
||||||
|
/** The source program */
|
||||||
|
program: string,
|
||||||
|
|
||||||
/** The entity name */
|
/** The entity name */
|
||||||
entity_name: string,
|
entity_name: string,
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,7 @@ export class DeltaProcessor
|
||||||
const ratedata = doc.ratedata || {};
|
const ratedata = doc.ratedata || {};
|
||||||
const meta = {
|
const meta = {
|
||||||
id: doc.id,
|
id: doc.id,
|
||||||
|
program: doc.programId,
|
||||||
entity_name: doc.agentName,
|
entity_name: doc.agentName,
|
||||||
entity_id: +doc.agentEntityId,
|
entity_id: +doc.agentEntityId,
|
||||||
startDate: doc.startDate,
|
startDate: doc.startDate,
|
||||||
|
|
|
@ -139,7 +139,7 @@ export class V1MessageWriter implements MessageWriter
|
||||||
},
|
},
|
||||||
program: {
|
program: {
|
||||||
Program: {
|
Program: {
|
||||||
id: 'quote_server',
|
id: meta.program,
|
||||||
version: '',
|
version: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -40,6 +40,7 @@ export class MongoDeltaDao implements DeltaDao
|
||||||
/** The document fields to read */
|
/** The document fields to read */
|
||||||
readonly RESULT_FIELDS: Record<string, number> = {
|
readonly RESULT_FIELDS: Record<string, number> = {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
programId: 1,
|
||||||
agentName: 1,
|
agentName: 1,
|
||||||
agentEntityId: 1,
|
agentEntityId: 1,
|
||||||
startDate: 1,
|
startDate: 1,
|
||||||
|
|
|
@ -428,6 +428,7 @@ describe( 'system.DeltaProcessor', () =>
|
||||||
const createdData = <UnixTimestamp>234234234;
|
const createdData = <UnixTimestamp>234234234;
|
||||||
const doc = <DeltaDocument[]>[ {
|
const doc = <DeltaDocument[]>[ {
|
||||||
id: <DocumentId>123,
|
id: <DocumentId>123,
|
||||||
|
programId: 'mega',
|
||||||
agentName: entity_num,
|
agentName: entity_num,
|
||||||
agentEntityId: entity_id,
|
agentEntityId: entity_id,
|
||||||
startDate: createdData,
|
startDate: createdData,
|
||||||
|
@ -447,6 +448,7 @@ describe( 'system.DeltaProcessor', () =>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: <DocumentId>234,
|
id: <DocumentId>234,
|
||||||
|
programId: 'mega',
|
||||||
agentName: entity_num,
|
agentName: entity_num,
|
||||||
agentEntityId: entity_id,
|
agentEntityId: entity_id,
|
||||||
startDate: createdData,
|
startDate: createdData,
|
||||||
|
@ -471,6 +473,7 @@ describe( 'system.DeltaProcessor', () =>
|
||||||
entity_id: 4321,
|
entity_id: 4321,
|
||||||
entity_name: 'Some Agency',
|
entity_name: 'Some Agency',
|
||||||
id: 123,
|
id: 123,
|
||||||
|
program: 'mega',
|
||||||
lastUpdate: 123123123,
|
lastUpdate: 123123123,
|
||||||
startDate: 234234234,
|
startDate: 234234234,
|
||||||
},
|
},
|
||||||
|
@ -483,6 +486,7 @@ describe( 'system.DeltaProcessor', () =>
|
||||||
entity_id: 4321,
|
entity_id: 4321,
|
||||||
entity_name: 'Some Agency',
|
entity_name: 'Some Agency',
|
||||||
id: 234,
|
id: 234,
|
||||||
|
program: 'mega',
|
||||||
lastUpdate: 123123123,
|
lastUpdate: 123123123,
|
||||||
startDate: 234234234,
|
startDate: 234234234,
|
||||||
},
|
},
|
||||||
|
@ -548,6 +552,7 @@ describe( 'system.DeltaProcessor', () =>
|
||||||
const emitter = new EventEmitter();
|
const emitter = new EventEmitter();
|
||||||
const doc = <DeltaDocument[]>[ {
|
const doc = <DeltaDocument[]>[ {
|
||||||
id: <DocumentId>123,
|
id: <DocumentId>123,
|
||||||
|
programId: 'mega',
|
||||||
agentName: 'Some Agency',
|
agentName: 'Some Agency',
|
||||||
agentEntityId: 4321,
|
agentEntityId: 4321,
|
||||||
startDate: <UnixTimestamp>234234234,
|
startDate: <UnixTimestamp>234234234,
|
||||||
|
@ -567,6 +572,7 @@ describe( 'system.DeltaProcessor', () =>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: <DocumentId>234,
|
id: <DocumentId>234,
|
||||||
|
programId: 'mega',
|
||||||
agentName: 'Some Agency',
|
agentName: 'Some Agency',
|
||||||
agentEntityId: 4321,
|
agentEntityId: 4321,
|
||||||
startDate: <UnixTimestamp>234234234,
|
startDate: <UnixTimestamp>234234234,
|
||||||
|
@ -591,6 +597,7 @@ describe( 'system.DeltaProcessor', () =>
|
||||||
entity_id: 4321,
|
entity_id: 4321,
|
||||||
entity_name: 'Some Agency',
|
entity_name: 'Some Agency',
|
||||||
id: 123,
|
id: 123,
|
||||||
|
program: 'mega',
|
||||||
lastUpdate: 123123123,
|
lastUpdate: 123123123,
|
||||||
startDate: 234234234,
|
startDate: 234234234,
|
||||||
},
|
},
|
||||||
|
|
|
@ -372,11 +372,13 @@ describe( 'system.V1MessageWriter', () =>
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
it( 'Message is formatted correctly', () =>
|
it( 'Message is formatted correctly', () =>
|
||||||
{
|
{
|
||||||
const bucket = { foo: [ 'bar', 'baz' ] };
|
const bucket = { foo: [ 'bar', 'baz' ] };
|
||||||
const ratedata = {};
|
const ratedata = {};
|
||||||
const doc_id = <DocumentId>123;
|
const doc_id = <DocumentId>123;
|
||||||
|
const program = 'mega';
|
||||||
const entity_name = 'Some Agency';
|
const entity_name = 'Some Agency';
|
||||||
const entity_id = 123;
|
const entity_id = 123;
|
||||||
const startDate = <UnixTimestamp>345;
|
const startDate = <UnixTimestamp>345;
|
||||||
|
@ -386,6 +388,7 @@ describe( 'system.V1MessageWriter', () =>
|
||||||
const encoder = createMockEncoderCtor( schema );
|
const encoder = createMockEncoderCtor( schema );
|
||||||
const meta = <DocumentMeta>{
|
const meta = <DocumentMeta>{
|
||||||
id: doc_id,
|
id: doc_id,
|
||||||
|
program: program,
|
||||||
entity_name: entity_name,
|
entity_name: entity_name,
|
||||||
entity_id: entity_id,
|
entity_id: entity_id,
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
|
@ -442,7 +445,7 @@ describe( 'system.V1MessageWriter', () =>
|
||||||
},
|
},
|
||||||
program: {
|
program: {
|
||||||
Program: {
|
Program: {
|
||||||
id: 'quote_server',
|
id: program,
|
||||||
version: '',
|
version: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue