Skip to content

Commit

Permalink
Type, naming and lint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TerryvanWalen committed Jan 31, 2025
1 parent 2447c33 commit c6c66a8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/client/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ import Search from './pages/Search/Search';
import { ToeristscheVerhuurThema } from './pages/ToeristischeVerhuur/ToeristischeVerhuur';
import { ToeristischeVerhuurDetail } from './pages/ToeristischeVerhuur/ToeristischeVerhuurDetail';
import { ToeristischeVerhuurVergunningen } from './pages/ToeristischeVerhuur/ToeristischeVerhuurVergunningenList';
import Varen from './pages/Varen/Varen';
import { Varen } from './pages/Varen/Varen';
import VergunningDetail from './pages/VergunningDetail/VergunningDetail';
import Vergunningen from './pages/Vergunningen/Vergunningen';
import VergunningV2Detail from './pages/VergunningenV2/VergunningDetail';
Expand Down
11 changes: 9 additions & 2 deletions src/client/pages/Bodem/config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import { generatePath } from 'react-router-dom';

import { LoodMetingFrontend } from '../../../server/services/bodem/types';
import { VarenFrontend } from '../../../server/services/varen/config-and-types';
import { AppRoutes } from '../../../universal/config/routes';
import { dateSort } from '../../../universal/helpers/date';
import { LinkProps } from '../../../universal/types';
import {
DisplayProps,
WithDetailLinkComponent,
} from '../../components/Table/TableV2';

export const displayPropsAanvragen = {
export const displayPropsAanvragen: DisplayProps<
WithDetailLinkComponent<VarenFrontend>
> = {
detailLinkComponent: 'Adres',
datumAanvraagFormatted: 'Aangevraagd',
dateRequestFormatted: 'Aangevraagd',
status: 'Status',
};

Expand Down
15 changes: 7 additions & 8 deletions src/client/pages/Varen/Varen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,21 @@ function useVarenThemaData() {
(item) => item.caseType === caseTypeVaren.VarenRederRegistratie
);

const span = 4;

const labelMap = {
company: 'Bedrijfsnaam',
email: 'E-mailadres',
phone: 'Telefoonnummer',
bsnkvk: 'KVK nummer',
adres: 'Adres',
address: 'Adres',
};

const gegevensAanvrager: RowSet | null = varenRederRegistratie
? {
rows: entries(labelMap).map(([key, label]) => {
const content = varenRederRegistratie[key];
return { label, content, span };
}),
rows: entries(labelMap).map(([key, label]) => ({
label,
content: varenRederRegistratie[key],
span: 4,
})),
}
: null;

Expand All @@ -63,7 +62,7 @@ function useVarenThemaData() {
};
}

export default function Varen() {
export function Varen() {
const { gegevensAanvrager, tableItems, tableConfig, isLoading, isError } =
useVarenThemaData();

Expand Down
5 changes: 3 additions & 2 deletions src/server/services/varen/config-and-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export type VarenRegistratieRederType = DecosZaakBase & {
decision: 'Verleend' | 'Ingetrokken';
company: string | null;
bsnkvk: string | null;
adres: string | null;
postal: string | null;
address: string | null;
postalCode: string | null;
city: string | null;
phone: string | null;
email: string | null;
Expand All @@ -38,6 +38,7 @@ export interface VarenVergunningExploitatieType extends DecosZaakBase {
| 'Aanvullende informatie gevraagd'
| 'Nadere informatie nodig'
| 'Besluit';
// eslint-disable-next-line no-magic-numbers
formAppearance: 1 | 2 | 3;
segment:
| 'Beeldbepalend groot'
Expand Down
15 changes: 8 additions & 7 deletions src/server/services/varen/decos-zaken.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {
DecosZaakTransformer,
SELECT_FIELDS_TRANSFORM_BASE,
} from '../decos/decos-types';
import type {
CaseTypeVaren,
VarenRegistratieRederType,
VarenVergunningExploitatieType,
VarenVergunningLigplaatsType,
} from './config-and-types';
import {
DecosZaakBase,
DecosZaakTransformer,
SELECT_FIELDS_TRANSFORM_BASE,
} from '../decos/decos-types';

export const VarenRegistratieReder: DecosZaakTransformer<VarenRegistratieRederType> =
{
Expand All @@ -25,8 +26,8 @@ export const VarenRegistratieReder: DecosZaakTransformer<VarenRegistratieRederTy
...SELECT_FIELDS_TRANSFORM_BASE,
company: 'company',
num2: 'bsnkvk',
mailaddress: 'adres',
zipcode: 'postal',
mailaddress: 'address',
zipcode: 'postalCode',
city: 'city',
phone1: 'phone',
email1: 'email',
Expand Down Expand Up @@ -92,5 +93,5 @@ export const decosCaseToZaakTransformers = decosZaakTransformers.reduce(
...acc,
[zaakTransformer.caseType]: zaakTransformer,
}),
{} as Record<CaseTypeVaren, DecosZaakTransformer<any>> // TODO: type key as varen casetype
{} as Record<CaseTypeVaren, DecosZaakTransformer<DecosZaakBase>>
);

0 comments on commit c6c66a8

Please sign in to comment.