Skip to content

Commit

Permalink
feat: minnor bug found and corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielFillol committed Oct 19, 2023
1 parent 98251d8 commit 78ece0d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion CNJ/decomposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,23 @@ func DecomposeCNJ(cnj string) (DecomposedCNJ, error) {

var tj string
if sg.Number == 1 || sg.Number == 2 || sg.Number == 3 || sg.Number == 7 {
tj = sg.Short
courtNumber, err := strconv.Atoi(court)
if err != nil {
return DecomposedCNJ{
LawsuitCNJFormat: lawsuitNumber + "-" + verifyingDigit + "." + yearProtocol + "." + segment + "." + court + "." + sourceUnit,
LawsuitNumber: lawsuitNumber,
VerifyingDigit: verifyingDigit,
ProtocolYear: yearProtocol,
Segment: segment,
Court: court,
SourceUnit: sourceUnit,
ArgNumber: argNumber,
District: err.Error(),
UF: err.Error(),
TJ: err.Error(),
}, err
}
tj = sg.Short + strconv.Itoa(courtNumber)
} else {
tj = sg.Short + dt.UF
}
Expand Down

0 comments on commit 78ece0d

Please sign in to comment.