Skip to content

Commit

Permalink
feat: UX attempt at travaux public
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierJp committed Jan 7, 2025
1 parent 57a3d4b commit 0d86f9b
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 307 deletions.

This file was deleted.

2 changes: 1 addition & 1 deletion app/(header-default)/documents/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import extractParamsAppRouter, {
} from '#utils/server-side-helper/app/extract-params';
import getSession from '#utils/server-side-helper/app/get-session';
import { Metadata } from 'next';
import TravauxPublicsSection from '../../../../components/espace-agent-components/travaux-publics-section';
import ActesSection from './_components/actes';
import JustificatifsSection from './_components/justificatifs';
import { SummaryDocuments } from './_components/summary-documents';
import TravauxPublicsSection from './_components/travaux-publics-section';

export const generateMetadata = async (
props: AppRouterProps
Expand Down

This file was deleted.

30 changes: 0 additions & 30 deletions clients/api-entreprise/certificats/cibtp.ts

This file was deleted.

30 changes: 0 additions & 30 deletions clients/api-entreprise/certificats/cnetp.ts

This file was deleted.

30 changes: 0 additions & 30 deletions clients/api-entreprise/certificats/probtp.ts

This file was deleted.

67 changes: 67 additions & 0 deletions clients/api-entreprise/travaux-publics/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import routes from '#clients/routes';
import { IDocumentDownloader } from '#models/espace-agent/travaux-publics';
import { Siren, Siret } from '#utils/helpers';
import clientAPIEntreprise, { IAPIEntrepriseResponse } from '../client';

export type IAPIEntrepriseDocumentTravauxPublics = IAPIEntrepriseResponse<{
document_url: string;
expires_in: number;
}>;

/**
* GET document CIBTP
*/
export const clientApiEntrepriseCibtp = async (siret: Siret) => {
return await clientAPIEntreprise(
`${
process.env.API_ENTREPRISE_URL
}${routes.apiEntreprise.certifications.cibtp(siret)}`,
mapToDomainObject
);
};

/**
* GET document Pro BTP
*/
export const clientApiEntrepriseProbtp = async (siret: Siret) => {
return await clientAPIEntreprise(
`${
process.env.API_ENTREPRISE_URL
}${routes.apiEntreprise.certifications.probtp(siret)}`,
mapToDomainObject
);
};

/**
* GET document CNETP
*/
export const clientApiEntrepriseCnetp = async (siren: Siren) => {
return await clientAPIEntreprise(
`${
process.env.API_ENTREPRISE_URL
}${routes.apiEntreprise.certifications.cnetp(siren)}`,
mapToDomainObject
);
};

/**
* GET document FNTP
*/
export const clientApiEntrepriseCarteProfessionnelleTravauxPublics = async (
siren: Siren
) => {
return await clientAPIEntreprise(
`${
process.env.API_ENTREPRISE_URL
}${routes.apiEntreprise.carteProfessionnelleTravauxPublics(siren)}`,
mapToDomainObject
);
};

const mapToDomainObject = (
response: IAPIEntrepriseDocumentTravauxPublics
): IDocumentDownloader => {
return {
url: response.data.document_url,
};
};
Loading

0 comments on commit 0d86f9b

Please sign in to comment.