Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VAS-1133] feat: Add new api key for printPaymentsNotice product #584

Merged
merged 7 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/locale/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@
"FDR_ORG": "FdR - Flussi di Rendicontazione (EC)",
"FDR_PSP": "FdR - Flussi di Rendicontazione (PSP)",
"BO_EXT_EC": "Backoffice External (EC)",
"BO_EXT_PSP": "Backoffice External (PSP)"
"BO_EXT_PSP": "Backoffice External (PSP)",
"PRINT_NOTICE": "Stampa Avvisi"
}
},
"channelsPage": {
Expand Down
66 changes: 20 additions & 46 deletions src/model/ApiKey.tsx
Original file line number Diff line number Diff line change
@@ -1,58 +1,32 @@
import {ENV} from "../utils/env";
import { TFunction } from 'react-i18next';
import { ENV } from '../utils/env';

export type ProductKeys = {
id: string;
displayName: string;
primaryKey: string;
secondaryKey: string;
id: string;
displayName: string;
primaryKey: string;
secondaryKey: string;
};

export type AvailableProductKeys = {
id: string;
title: string;
disabled: boolean;
id: string;
title: string;
disabled: boolean;
};

export type ConfiguredProductKeys = {
id: string;
key: string;
id: string;
key: string;
};

export const NODOAUTH = 'Connessione con nodo';
export const GPD = 'GPD - Posizioni Debitorie';
export const GPD_REP = 'GPD - Gestione flussi di rendicontazione';
export const GPD_PAY = 'GPD - Recupero ricevute';
export const BIZ = 'BIZ - Recupero ricevute Ente Creditore';
export const FDR_ORG = 'FdR - Flussi di Rendicontazione (EC)';
export const FDR_PSP = 'FdR - Flussi di Rendicontazione (PSP)';
export const BO_EXT_EC = 'Backoffice External (EC)';
export const BO_EXT_PSP = 'Backoffice External (PSP)';
export const API_KEY_PRODUCTS = (t: TFunction, isPsp: boolean): Array<ConfiguredProductKeys> => {
const list = isPsp
? ['NODOAUTH', 'BO_EXT_PSP']
: ['NODOAUTH', 'GPD', 'GPD_PAY', 'GPD_REP', 'BIZ', 'BO_EXT_EC', 'PRINT_NOTICE'];

export const API_KEY_PSP_PRODUCTS = (): Array<ConfiguredProductKeys> => {
const list = [
{id: 'NODOAUTH', key: NODOAUTH},
{id: 'BO_EXT_PSP', key: BO_EXT_PSP}
];

if (ENV.FEATURES.FDR.ENABLED) {
return [...list, {id: 'FDR_PSP', key: FDR_PSP}];
}
return list;
};


export const API_KEY_PRODUCTS = (): Array<ConfiguredProductKeys> => {
const list = [
{id: 'NODOAUTH', key: NODOAUTH},
{id: 'GPD', key: GPD},
{id: 'GPD_PAY', key: GPD_PAY},
{id: 'GPD_REP', key: GPD_REP},
{id: 'BIZ', key: BIZ},
{id: 'BO_EXT_EC', key: BO_EXT_EC}
];

if (ENV.FEATURES.FDR.ENABLED) {
return [...list, {id: 'FDR_ORG', key: FDR_ORG}];
}
return list;
if (ENV.FEATURES.FDR.ENABLED) {
// eslint-disable-next-line functional/immutable-data
list.push(isPsp ? 'FDR_PSP' : 'FDR_ORG');
}
return list.map((el) => ({ id: el, key: t(`addApiKeyPage.products.${el}`) }));
};
Loading
Loading