Skip to content

Commit

Permalink
Add all flow properties
Browse files Browse the repository at this point in the history
  • Loading branch information
manelcecs committed Dec 26, 2023
1 parent 124a9eb commit d17595c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 8 deletions.
22 changes: 20 additions & 2 deletions src/domain-services/flows/flow-search-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,25 @@ export class FlowSearchService {
updatedAt: flow.updatedAt.toISOString(),
activeStatus: flow.activeStatus,
restricted: flow.restricted,
flowDate: flow.flowDate ? flow.flowDate.toISOString() : null,
decisionDate: flow.decisionDate ? flow.decisionDate.toISOString() : null,
firstReportedDate: flow.firstReportedDate
? flow.firstReportedDate.toISOString()
: null,
budgetYear: flow.budgetYear,
exchangeRate: flow.exchangeRate ? flow.exchangeRate.toString() : null,
origAmount: flow.origAmount ? flow.origAmount.toString() : null,
origCurrency: flow.origCurrency ? flow.origCurrency.toString() : null,
description: flow.description,
notes: flow.notes,
versionStartDate: flow.versionStartDate
? flow.versionStartDate.toISOString()
: null,
versionEndDate: flow.versionEndDate
? flow.versionEndDate.toISOString()
: null,
newMoney: flow.newMoney,

// Optional fields
categories,
organizations,
Expand All @@ -938,8 +957,7 @@ export class FlowSearchService {
usageYears,
childIDs,
parentIDs,
origAmount: flow.origAmount ? flow.origAmount.toString() : null,
origCurrency: flow.origCurrency ? flow.origCurrency.toString() : null,

externalReferences,
reportDetails,
parkedParentSource,
Expand Down
42 changes: 36 additions & 6 deletions src/domain-services/flows/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,42 @@ export class BaseFlow extends BaseType {

@Field({ nullable: false })
restricted: boolean;

@Field(() => String, { nullable: true })
flowDate: string | null;

@Field(() => String, { nullable: true })
decisionDate: string | null;

@Field(() => String, { nullable: true })
firstReportedDate: string | null;

@Field(() => String, { nullable: true })
budgetYear: string | null;

@Field(() => String, { nullable: true })
exchangeRate: string | null;

@Field(() => String, { nullable: true })
origAmount: string | null;

@Field(() => String, { nullable: true })
origCurrency: string | null;

@Field(() => String, { nullable: true })
description: string | null;

@Field(() => String, { nullable: true })
notes: string | null;

@Field(() => String, { nullable: true })
versionStartDate: string | null;

@Field(() => String, { nullable: true })
versionEndDate: string | null;

@Field(() => Boolean, { nullable: true })
newMoney: boolean | null;
}

@ObjectType()
Expand Down Expand Up @@ -111,12 +147,6 @@ export class Flow extends BaseFlow {
@Field(() => [Number], { nullable: false })
parentIDs: number[];

@Field(() => String, { nullable: true })
origAmount: string | null;

@Field(() => String, { nullable: true })
origCurrency: string | null;

@Field(() => [FlowExternalReference], { nullable: false })
externalReferences: FlowExternalReference[];

Expand Down

0 comments on commit d17595c

Please sign in to comment.