Skip to content

Commit

Permalink
Feature/end case code (#118)
Browse files Browse the repository at this point in the history
* Change and adapting == codeDecison and libelleCodeDecision ==> endCaseCode and libelleEndCaseCode

* adapting codeDecision and libelleDecision to endCaseCode & libelleEndCaseCode

* removing unnecessery codeDecison & libelleCodeDecision, and fixing dbsder-api-types to fix version - npm i dbsder-api-types@1.3.1 --save --save-exact

* addapting postman body test - PUT - 200 - Enregistre une décision TJ

* remove yarn.lock

* cleaning

---------

Co-authored-by: Antoine Jeanneney <antoine.jeanneney@justice.fr>
  • Loading branch information
Bouba-cassation and Antoine Jeanneney authored Mar 7, 2024
1 parent 161ef08 commit 66570ac
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 44 deletions.
2 changes: 1 addition & 1 deletion documentation/postman/API DBSDER.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"decision\": {\n \n \"_id\": \"507f1f77bcf86cd799439011\",\n \"analysis\": {\n \"analyse\": [\n \"someAnalyse\"\n ],\n \"doctrine\": \"someDoctrine\",\n \"link\": \"someLink\",\n \"reference\": [\n \"someReference\"\n ],\n \"source\": \"TJ\",\n \"summary\": \"someSummary\",\n \"target\": \"someTarget\",\n \"title\": [\n \"someTitle\"\n ]\n },\n \"appeals\": [\n \"someAppeal\"\n ],\n \"chamberId\": \"someChamberId\",\n \"chamberName\": \"someChamberName\",\n \"dateCreation\": \"2023-06-11\",\n \"dateDecision\": \"2023-06-10\",\n \"decatt\": [\n 1,\n 2\n ],\n \"jurisdictionCode\": \"someJurisdictionCode\",\n \"jurisdictionId\": \"someJurisdictionId\",\n \"jurisdictionName\": \"someJurisdictionName\",\n \"labelStatus\": \"toBeTreated\",\n \"occultation\": {\n \"additionalTerms\": \"someAdditionalTerms\",\n \"categoriesToOmit\": [\n \"someCategoriesToOmit\"\n ]\n },\n \"originalText\": \"someOriginalText\",\n \"registerNumber\": \"someRegisterNumber\",\n \"solution\": \"someSolution\",\n \"sourceId\": 1,\n \"sourceName\": \"TJ\",\n \"publication\": [\n \"somePublication\"\n ],\n \"formation\": \"someFormation\",\n \"blocOccultation\": 1,\n \"NAOCode\": \"someNAOCode\",\n \"natureAffaireCivil\": \"someNatureAffaireCivil\",\n \"natureAffairePenal\": \"someNatureAffairePenal\",\n \"codeMatiereCivil\": \"someCodeMatiereCivil\",\n \"public\": true,\n \"numeroRoleGeneral\": \"01/12345\",\n \"codeService\": \"0A\",\n \"libelleService\": \"Libelle de service\",\n \"codeDecision\": \"0aA\",\n \"libelleCodeDecision\": \"some libelle code decision\",\n \"codeNAC\": \"11F\",\n \"libelleNAC\": \"Demande en dommages-intérêts contre un organisme\",\n \"codeNature\": \"6C\",\n \"libelleNatureParticuliere\": \"Autres demandes en matière de frais et dépens\",\n \"selection\": false,\n \"matiereDeterminee\": true,\n \"pourvoiLocal\": false,\n \"pourvoiCourDeCassation\": false,\n \"debatPublic\": true,\n \"indicateurQPC\": true\n } \n}",
"raw": "{\n \"decision\": {\n \n \"_id\": \"507f1f77bcf86cd799439011\",\n \"analysis\": {\n \"analyse\": [\n \"someAnalyse\"\n ],\n \"doctrine\": \"someDoctrine\",\n \"link\": \"someLink\",\n \"reference\": [\n \"someReference\"\n ],\n \"source\": \"TJ\",\n \"summary\": \"someSummary\",\n \"target\": \"someTarget\",\n \"title\": [\n \"someTitle\"\n ]\n },\n \"appeals\": [\n \"someAppeal\"\n ],\n \"chamberId\": \"someChamberId\",\n \"chamberName\": \"someChamberName\",\n \"dateCreation\": \"2023-06-11\",\n \"dateDecision\": \"2023-06-10\",\n \"decatt\": [\n 1,\n 2\n ],\n \"jurisdictionCode\": \"someJurisdictionCode\",\n \"jurisdictionId\": \"someJurisdictionId\",\n \"jurisdictionName\": \"someJurisdictionName\",\n \"labelStatus\": \"toBeTreated\",\n \"occultation\": {\n \"additionalTerms\": \"someAdditionalTerms\",\n \"categoriesToOmit\": [\n \"someCategoriesToOmit\"\n ]\n },\n \"originalText\": \"someOriginalText\",\n \"registerNumber\": \"someRegisterNumber\",\n \"solution\": \"someSolution\",\n \"sourceId\": 1,\n \"sourceName\": \"TJ\",\n \"publication\": [\n \"somePublication\"\n ],\n \"formation\": \"someFormation\",\n \"blocOccultation\": 1,\n \"NAOCode\": \"someNAOCode\",\n \"natureAffaireCivil\": \"someNatureAffaireCivil\",\n \"natureAffairePenal\": \"someNatureAffairePenal\",\n \"codeMatiereCivil\": \"someCodeMatiereCivil\",\n \"public\": true,\n \"numeroRoleGeneral\": \"01/12345\",\n \"codeService\": \"0A\",\n \"libelleService\": \"Libelle de service\",\n \"endCodeCase\": \"0aA\",\n \"libelleEndCodeCase\": \"some libelle code decision\",\n \"codeNAC\": \"11F\",\n \"libelleNAC\": \"Demande en dommages-intérêts contre un organisme\",\n \"codeNature\": \"6C\",\n \"libelleNatureParticuliere\": \"Autres demandes en matière de frais et dépens\",\n \"selection\": false,\n \"matiereDeterminee\": true,\n \"pourvoiLocal\": false,\n \"pourvoiCourDeCassation\": false,\n \"debatPublic\": true,\n \"indicateurQPC\": true\n } \n}",
"options": {
"raw": {
"language": "json"
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@nestjs/terminus": "10.1.1",
"class-transformer": "0.5.1",
"class-validator": "0.14.0",
"dbsder-api-types": "1.1.33",
"dbsder-api-types": "1.3.4",
"express-basic-auth": "1.2.1",
"joi": "17.11.0",
"mongoose": "7.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ export class GetDecisionByIdResponse {
})
endCaseCode?: string

@ApiPropertyOptional({
description: 'Libellé endCaseCode / codeDecision',
example: mockUtils.createDecisionTJDto.libelleEndCaseCode
})
libelleEndCaseCode?: string

@ApiPropertyOptional({
description: 'Nom du fichier source de la décision'
})
Expand All @@ -226,12 +232,6 @@ export class GetDecisionByIdResponse {
})
pubCategory?: string

@ApiPropertyOptional({
description: 'Code de la décision',
example: mockUtils.createDecisionTJDto.codeDecision
})
codeDecision?: string

@ApiPropertyOptional({
description: 'Code de la nature de la décision',
example: mockUtils.createDecisionTJDto.codeNature
Expand Down Expand Up @@ -266,12 +266,6 @@ export class GetDecisionByIdResponse {
})
idDecisionWinci?: string

@ApiPropertyOptional({
description: 'Libellé du code décision',
example: mockUtils.createDecisionTJDto.libelleCodeDecision
})
libelleCodeDecision?: string

@ApiPropertyOptional({
description: 'Libellé du code NAC',
example: mockUtils.createDecisionTJDto.libelleNAC
Expand Down
9 changes: 3 additions & 6 deletions src/infrastructure/db/models/decision.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export class Decision {
@Prop()
endCaseCode?: string

@Prop()
libelleEndCaseCode?: string

@Prop()
filenameSource?: string

Expand All @@ -126,9 +129,6 @@ export class Decision {
@Prop({ type: Object })
labelTreatments?: LabelTreatment[]

@Prop()
codeDecision: string

@Prop()
codeNature: string

Expand All @@ -141,9 +141,6 @@ export class Decision {
@Prop({ type: Object })
decisionAssociee: DecisionAssociee

@Prop()
libelleCodeDecision: string

@Prop()
libelleNAC: string

Expand Down
20 changes: 6 additions & 14 deletions src/infrastructure/dto/createDecision.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,13 @@ export class CreateDecisionDTO {
NPCode?: string

@ApiPropertyOptional({
description: "Code de fin d'affaire/code décision",
type: String
description: 'CodeDecision/endCaseCode. Au format : ^[0-9a-zA-Z]{3}$',
type: String,
example: mockUtils.createDecisionTJDto.endCaseCode
})
@IsOptional()
@IsString()
@Matches('^[0-9a-zA-Z]{3}$')
endCaseCode?: string

@ApiPropertyOptional({
Expand All @@ -534,16 +536,6 @@ export class CreateDecisionDTO {

// TJ VVV

@ApiPropertyOptional({
description: 'Code du type de décision. Au format : ^[0-9a-zA-Z]{3}$',
type: String,
example: mockUtils.createDecisionTJDto.codeDecision
})
@IsOptional()
@IsString()
@Matches('^[0-9a-zA-Z]{3}$')
codeDecision?: string

@ApiPropertyOptional({
description: 'Identifiant du service de la juridiction. Au format: ^[\\S]{2}$$',
type: String,
Expand Down Expand Up @@ -579,12 +571,12 @@ export class CreateDecisionDTO {
@ApiPropertyOptional({
description: 'Libellé du type de décision',
type: String,
example: mockUtils.createDecisionTJDto.libelleCodeDecision
example: mockUtils.createDecisionTJDto.libelleEndCaseCode
})
@IsOptional()
@IsString()
@Length(0, 200)
libelleCodeDecision?: string
libelleEndCaseCode?: string

@ApiPropertyOptional({
description: 'Libellé du code NAC de la décision',
Expand Down
12 changes: 6 additions & 6 deletions src/infrastructure/utils/mock.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ export class MockUtils {

decisionModel = {
NACCode: '45C',
codeDecision: '',
endCaseCode: '',
codeNature: '',
codeService: '',
debatPublic: false,
decisionAssociee: undefined,
libelleCodeDecision: '',
libelleEndCaseCode: '',
libelleNAC: '',
libelleNatureParticuliere: '',
libelleService: '',
Expand Down Expand Up @@ -176,12 +176,12 @@ export class MockUtils {

decisionPseudonymisee = {
NACCode: '45C',
codeDecision: '',
endCaseCode: '',
codeNature: '',
codeService: '',
debatPublic: false,
decisionAssociee: undefined,
libelleCodeDecision: '',
libelleEndCaseCode: '',
libelleNAC: '',
libelleNatureParticuliere: '',
libelleService: '',
Expand Down Expand Up @@ -231,14 +231,14 @@ export class MockUtils {

createDecisionTJDto = {
...this.createDecisionDTO,
codeDecision: '0aA',
endCaseCode: '0aA',
codeNature: '6C',
codeService: '0A',
debatPublic: true,
indicateurQPC: true,
libelleNAC: 'Demande en dommages-intérêts contre un organisme',
libelleService: 'Libelle de service',
libelleCodeDecision: 'some libelle code decision',
libelleEndCaseCode: 'some libelle code decision / endCaseCode',
libelleNatureParticuliere: 'Autres demandes en matière de frais et dépens',
matiereDeterminee: true,
numeroRoleGeneral: '01/12345',
Expand Down

0 comments on commit 66570ac

Please sign in to comment.