Skip to content

Commit

Permalink
馃悰 Display technology value
Browse files Browse the repository at this point in the history
Co-authored-by: Beatrigz <beatriz.plana@somenergia.coop>
  • Loading branch information
javikalsan and Beatrigz committed Jan 9, 2024
1 parent 1281aec commit b19d4d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
5 changes: 2 additions & 3 deletions backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@
]

ProductionTechnology = Literal[
'FV', # Photovoltaic
'H', # Hidraulic
'E', # Eolic
'b11', # Photovoltaic
'b42', # Hidraulic
]

DeviationIncluded = Literal[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ export function transformInstallationDetails(data) {
if (!data) return undefined
const t = i18n.t
const productionTecnologyOptions = {
FV: t('INSTALLATION_DETAIL.TECHNOLOGY_PHOTOVOLTAIC'),
H: t('INSTALLATION_DETAIL.TECHNOLOGY_HYDRO'),
E: t('INSTALLATION_DETAIL.TECHNOLOGY_WIND'),
b11: t('INSTALLATION_DETAIL.TECHNOLOGY_PHOTOVOLTAIC'),
b42: t('INSTALLATION_DETAIL.TECHNOLOGY_HYDRO'),
}
return {
...data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,16 @@ describe('transformInstallationDetails', () => {
const result = transformInstallationDetails(contractData)
expect(result['technology']).toEqual('-')
})
it('technology, replace E by E贸lica', () => {
const contractData = {
technology: 'E',
}
const result = transformInstallationDetails(contractData)
expect(result['technology']).toEqual('E贸lica')
})
it('technology, replace PV by Fotovolt谩ica', () => {
const contractData = {
technology: 'FV',
technology: 'b11',
}
const result = transformInstallationDetails(contractData)
expect(result['technology']).toEqual('Fotovolt谩ica')
})
it('technology, replace H by Hidroel茅ctrica', () => {
const contractData = {
technology: 'H',
technology: 'b42',
}
const result = transformInstallationDetails(contractData)
expect(result['technology']).toEqual('Hidroel茅ctrica')
Expand Down

0 comments on commit b19d4d3

Please sign in to comment.