Skip to content

Commit

Permalink
Merge b19d4d3 into 1281aec
Browse files Browse the repository at this point in the history
  • Loading branch information
javikalsan committed Jan 9, 2024
2 parents 1281aec + b19d4d3 commit ebde42b
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 ebde42b

Please sign in to comment.