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

feat: add export template api #35

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

tomwwinter
Copy link
Contributor

No description provided.

Copy link
Member

@sleidig sleidig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite good and clean! Just a few remarks regarding naming and comments for easier understanding of the code.
Nice test coverage also!

  • update README with a short section on the feature + setup instructions
  • add open-api specs file for our endpoints
  • naming of the endpoint + module (export reminds me more of csv exports ... but I understand the intention behind this also ...)

Copy link
Member

@sleidig sleidig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Thanks for adding all this documentation. Really helpful.

* The ExportTemplate entity is then created in the frontend.
* Default implementation of the [CreateTemplateUseCase] interface.
*
* This use case is responsible for creating a template by making a POST request to a specified
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* This use case is responsible for creating a template by making a POST request to a specified
* This use case is responsible for registering a template file by making a POST request to a specified

paths:
/template:
post:
summary: Post a new template
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: Post a new template
summary: Post a new template
description: Registers a template file. Creating the TemplateExport entity is handled by the client not by this endpoint through the server.

required: true
schema:
type: string
description: The ID of the template to be rendered
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: The ID of the template to be rendered
description: The ID of the TemplateExport entity to be rendered

properties:
convertTo:
type: string
description: The format to convert the template to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: The format to convert the template to
description: The format to convert the template to, e.g. "pdf" in order to receive a PDF file in the reponse

Comment on lines +91 to +98
summary: Fetch an existing template
parameters:
- name: templateId
in: path
required: true
schema:
type: string
description: The ID of the template to be rendered
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: Fetch an existing template
parameters:
- name: templateId
in: path
required: true
schema:
type: string
description: The ID of the template to be rendered
summary: Fetch an existing template file
description: Get the uploaded template file with its placeholders (not a generated document filled with data based on the template)
parameters:
- name: templateId
in: path
required: true
schema:
type: string
description: The ID of the TemplateExport entity


## Overview

The export module is responsible for handling various template-based export operations. This module primarily focuses on generating PDFs for entities within the AAM system.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The export module is responsible for handling various template-based export operations. This module primarily focuses on generating PDFs for entities within the AAM system.
The export module is responsible for handling various template-based export operations.
This module primarily focuses on generating PDFs for entities within the Aam Digital system.

(trying to use "Aam" rather than "AAM" consistently. Otherwise people often mistake this for an acronym)


### Dependencies

This service is using an external template engine for handle placeholder replacement in files and render PDF files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This service is using an external template engine for handle placeholder replacement in files and render PDF files.
This service is using an external template engine to handle placeholder replacement in files and render PDF (or other supported) files.


info:
description: |-
Carbone Cloud/On-premise Open API reference.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Carbone Cloud/On-premise Open API reference.
Carbone Cloud/On-premise Open API reference.
This API is used by the aam-services backend internally, exposing its functionality through our own, auth protected endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants