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

Add endpoint /contract/expired to get expired contracts #30559

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

kadogo
Copy link
Contributor

@kadogo kadogo commented Aug 6, 2024

NEW|New Adding /contracts/expired endpoint

The interface let us see the contracts that will be expiring based on a configuration value. We wanted a way to get them through the web service. It was easier to just add an endpoint for it than doing multiple search.

Our instance is pretty old (14.0.5) but the patch applied properly on the develop branch.

Don't hesitate to update the code if there is a better way to do.

Cheers

@eldy eldy added the PR to fix - Continuous Integration Test failed The PHP unit tests return something wrong with our code. Check the details to know what to fix. label Aug 6, 2024
@kadogo
Copy link
Contributor Author

kadogo commented Aug 8, 2024

Hello @eldy

Does it mean I need to fix the spaces / tabs issues mentionned here https://github.com/Dolibarr/dolibarr/actions/runs/10267943407/job/28409725198?pr=30559 and that the PR itself will be good to be merged ?

@eldy
Copy link
Member

eldy commented Aug 13, 2024

PR are analysed only once there is no CTI errors.
Also what is goal of endpoint ? Because what is "expired" is not a contract but lines of a contract.
So it would be better to add an endpoint called /lines/expired if goal is to return all lines of contract that are expired.

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Aug 13, 2024
@kadogo
Copy link
Contributor Author

kadogo commented Aug 13, 2024

Hello @eldy

The PR is to have a way to get the expiration like we can see in the interface.

image

image

It really looks like it is the contract that is expired based on the number of days that we configure in the backend configuration. Our Dolibarr version is pretty old, so maybe there are some differences with the stable version.

Regards

@eldy
Copy link
Member

eldy commented Aug 18, 2024

Hello @eldy

The PR is to have a way to get the expiration like we can see in the interface.

image

image

It really looks like it is the contract that is expired based on the number of days that we configure in the backend configuration. Our Dolibarr version is pretty old, so maybe there are some differences with the stable version.

Regards

No it is not the contract, it is the line of contract (called "service lines"). On screenshot we see the date of end of line. But each line is inside one and only contract, so we can show the contract once we have an expired line. Note that we can have several times the same contract if a contract has 2 lines expired.

@kadogo
Copy link
Contributor Author

kadogo commented Aug 19, 2024

Hello @eldy
Thanks for your answer.

In the interface it really looks like it is the contract, but I don't mind changing it as contract/lines/expired if you prefer. But the return is a contract object and not just the expired lines. Is that alright?

Is there a notion of begin / end of a contract that is stored when the contract is expired?

@eldy
Copy link
Member

eldy commented Aug 20, 2024

Is there a notion of begin / end of a contract that is stored when the contract is expired?

No. There is no notion of begin / end of a contract stored, expiration is stored into each lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed PR to fix - Continuous Integration Test failed The PHP unit tests return something wrong with our code. Check the details to know what to fix.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants