Skip to content

feat: diamond specific FAP spreadsheet columns#1656

Open
GrantDLS wants to merge 8 commits into
developfrom
UAS-14554-fap-fields-spreadsheet
Open

feat: diamond specific FAP spreadsheet columns#1656
GrantDLS wants to merge 8 commits into
developfrom
UAS-14554-fap-fields-spreadsheet

Conversation

@GrantDLS

@GrantDLS GrantDLS commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

We want to include some different fields in the FAP spreadsheet download, so this change adds in the new fields and renames some others. It uses dependency injection to introduce this functionality so that existing configurations are unaffected.

Motivation and Context

The getDataRow function was changed from positional parameters to a single FapDataRowInput object because the function is selected through dependency injection and different facility implementations require different inputs.

The facility-specific implementations require different subsets of proposal data, and the positional API became fragile as new values such as the instrument ID were introduced. A named object prevents argument-order errors, provides a stable interface across implementations, and allows each facility to consume only the fields it requires.

The reason this worked before is because the function was being called with 14 parameters. The default implementation only needed 11 params and so would just ignore the additional 3. Following this same approach meant that the DLS implementation wasn't able to only accept 12 params - it needed to accept the extra three from the STFC implementation, plus the extra instrument ID that was needed.

How Has This Been Tested

Extra cypress fixtures have been added to test the inclusion of the new columns and the renamed ones.

Comment thread apps/backend/src/middlewares/factory/xlsx.ts Outdated
Comment thread apps/backend/src/factory/xlsx/fap.ts
@GrantDLS GrantDLS changed the title Uas 14554 fap fields spreadsheet feat: Uas 14554 fap fields spreadsheet Jul 21, 2026
@GrantDLS GrantDLS changed the title feat: Uas 14554 fap fields spreadsheet feat: Diamond specific FAP spreadsheet columns Jul 21, 2026
@GrantDLS GrantDLS changed the title feat: Diamond specific FAP spreadsheet columns feat: diamond specific FAP spreadsheet columns Jul 21, 2026
@GrantDLS
GrantDLS marked this pull request as ready for review July 21, 2026 13:12
@GrantDLS
GrantDLS requested a review from a team as a code owner July 21, 2026 13:12
@GrantDLS
GrantDLS requested review from Bhaswati1148 and removed request for a team July 21, 2026 13:12

@TCMeldrum TCMeldrum Jul 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you ever run the cypress tests in DEPENDENCY_CONFIG === 'dls'? if not i don't think we need this file?

@zacharyjhankin zacharyjhankin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bug in the code where the comments to users and the comments to mangement are mixed up

image

'Institution',
'Instrument',
'Instrument available Time',
'TA Recommended Time',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be changed to "Technical Review Recommended Time", as confirmed with Marcos. This is to match the UI as "TA" makes no sense.

@zacharyjhankin

Copy link
Copy Markdown
Collaborator

I think Average Score can't be zero when there is no data, it should be . At least for our implementation of it

nullFieldHelper(row.instrName),
nullFieldHelper(row.instrAvailTime),
nullFieldHelper(row.techReviewTimeAllocation),
nullFieldHelper(row.fapTimeAllocation ?? row.techReviewTimeAllocation),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely this is not right, they are completely different values

const userDataSource = container.resolve<UserDataSource>(
Tokens.UserDataSource
);
const pi = proposerId

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like pi here, its not clear if they are a principleInvestigator, or a propserID. I think they are the same thing. If I am right should be principleInvestigator

instrumentAvailabilityTime: number;
fapTimeAllocation: number | null;
proposalTitle: string;
proposalId: number | null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be nullable?

};
}

export function populateDLSRow(row: DLSFapRowObj): (string | number)[] {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to pass the DLSFapRowObj type here because you're not even using the new instrumentRequestedTime value. That is being used here callFapDLSPopulateRow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants