99const MATH = "00"
1010
1111// DecomposeCNJ decompose cnj format number into the specifics:
12- // NNNNNNN-DD. AAAA.J.TR.OOOO
12+ // lawsuitCNJFormat [ NNNNNNN]-[DD].[ AAAA].[J].[CT].[0000]
1313// LawsuitNumber = [NNNNNNN]
1414// VerifyingDigit = [DD]
1515// ProtocolYear = [AAAA]
@@ -42,28 +42,30 @@ func DecomposeCNJ(cnj string) (DecomposedCNJ, error) {
4242 dt , err := CNJDatabase .FetchDistrict (semiCNJ )
4343 if err != nil {
4444 return DecomposedCNJ {
45- LawsuitNumber : lawsuitNumber ,
46- VerifyingDigit : verifyingDigit ,
47- ProtocolYear : yearProtocol ,
48- Segment : segment ,
49- Court : court ,
50- SourceUnit : sourceUnit ,
51- ArgNumber : argNumber ,
52- District : err .Error (),
53- UF : err .Error (),
45+ LawsuitCNJFormat : lawsuitNumber + "-" + verifyingDigit + "." + yearProtocol + "." + segment + "." + court + "." + sourceUnit ,
46+ LawsuitNumber : lawsuitNumber ,
47+ VerifyingDigit : verifyingDigit ,
48+ ProtocolYear : yearProtocol ,
49+ Segment : segment ,
50+ Court : court ,
51+ SourceUnit : sourceUnit ,
52+ ArgNumber : argNumber ,
53+ District : err .Error (),
54+ UF : err .Error (),
5455 }, err
5556 }
5657
5758 return DecomposedCNJ {
58- LawsuitNumber : lawsuitNumber ,
59- VerifyingDigit : verifyingDigit ,
60- ProtocolYear : yearProtocol ,
61- Segment : segment ,
62- Court : court ,
63- SourceUnit : sourceUnit ,
64- ArgNumber : argNumber ,
65- District : dt .SourceUnit ,
66- UF : dt .UF ,
59+ LawsuitCNJFormat : lawsuitNumber + "-" + verifyingDigit + "." + yearProtocol + "." + segment + "." + court + "." + sourceUnit ,
60+ LawsuitNumber : lawsuitNumber ,
61+ VerifyingDigit : verifyingDigit ,
62+ ProtocolYear : yearProtocol ,
63+ Segment : segment ,
64+ Court : court ,
65+ SourceUnit : sourceUnit ,
66+ ArgNumber : argNumber ,
67+ District : dt .SourceUnit ,
68+ UF : dt .UF ,
6769 }, nil
6870 } else {
6971 lawsuitNumber := cnj [0 :7 ]
@@ -88,29 +90,31 @@ func DecomposeCNJ(cnj string) (DecomposedCNJ, error) {
8890 if err != nil {
8991 if err != nil {
9092 return DecomposedCNJ {
91- LawsuitNumber : lawsuitNumber ,
92- VerifyingDigit : verifyingDigit ,
93- ProtocolYear : yearProtocol ,
94- Segment : segment ,
95- Court : court ,
96- SourceUnit : sourceUnit ,
97- ArgNumber : argNumber ,
98- District : err .Error (),
99- UF : err .Error (),
93+ LawsuitCNJFormat : lawsuitNumber + "-" + verifyingDigit + "." + yearProtocol + "." + segment + "." + court + "." + sourceUnit ,
94+ LawsuitNumber : lawsuitNumber ,
95+ VerifyingDigit : verifyingDigit ,
96+ ProtocolYear : yearProtocol ,
97+ Segment : segment ,
98+ Court : court ,
99+ SourceUnit : sourceUnit ,
100+ ArgNumber : argNumber ,
101+ District : err .Error (),
102+ UF : err .Error (),
100103 }, err
101104 }
102105 }
103106
104107 return DecomposedCNJ {
105- LawsuitNumber : lawsuitNumber ,
106- VerifyingDigit : verifyingDigit ,
107- ProtocolYear : yearProtocol ,
108- Segment : segment ,
109- Court : court ,
110- SourceUnit : sourceUnit ,
111- ArgNumber : argNumber ,
112- District : dt .District ,
113- UF : dt .UF ,
108+ LawsuitCNJFormat : lawsuitNumber + "-" + verifyingDigit + "." + yearProtocol + "." + segment + "." + court + "." + sourceUnit ,
109+ LawsuitNumber : lawsuitNumber ,
110+ VerifyingDigit : verifyingDigit ,
111+ ProtocolYear : yearProtocol ,
112+ Segment : segment ,
113+ Court : court ,
114+ SourceUnit : sourceUnit ,
115+ ArgNumber : argNumber ,
116+ District : dt .District ,
117+ UF : dt .UF ,
114118 }, nil
115119
116120 }
0 commit comments