Skip to content

Commit

Permalink
Improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielFillol committed Apr 23, 2022
1 parent 8d1f75e commit 065b95b
Show file tree
Hide file tree
Showing 11 changed files with 10,173 additions and 9,916 deletions.
19 changes: 13 additions & 6 deletions CNJ/cnj.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
package CNJ

//AnalysisCNJ returns:
//
// receivedCNJ
//
// validCNJ given by ValidateCNJ
//
// segmentName and segmentShort given by GetSegment
//
// sourceUnitType and SourceUnitNumber given by GetSourceUnit
//
// courtType and courtNumber given by GetOriginCourt
//
// detailed is a struct on it's on given by DecomposeCNJ
type AnalysisCNJ struct {
ReceivedCNJ string `json:"received_cnj,omitempty"`
Expand All @@ -25,6 +19,16 @@ type AnalysisCNJ struct {
Detailed DecomposedCNJ `json:"Detailed"`
}

//DecomposedCNJ returns the CNJ in decomposed manner:
// lawsuitNumber: [NNNNNNN]
// verifyingDigit: [DD]
// protocolYear: [AAAA]
// segment: [J]
// court: [CT]
// sourceUnit: [0000]
// argNumber: [NNNNNNNAAAAJCT0000] + "00"
// district: district where the lawsuit was proposed, frequently a city name
// uf: the uf of the correspondent district
type DecomposedCNJ struct {
LawsuitNumber string `json:"lawsuit_number,omitempty"`
VerifyingDigit string `json:"verifying_digit,omitempty"`
Expand All @@ -38,6 +42,7 @@ type DecomposedCNJ struct {
}

//AnalyzeCNJ returns the complex struct AnalysisCNJ containing all the useful data from this package
//
func AnalyzeCNJ(cnj string) (AnalysisCNJ, error) {
decomposedCNJ, err := DecomposeCNJ(cnj)
if err != nil {
Expand Down Expand Up @@ -78,6 +83,8 @@ func AnalyzeCNJ(cnj string) (AnalysisCNJ, error) {

}

//WriteCNJ returns a single string with all organized interpretation of CNJ information
//
func WriteCNJ(number AnalysisCNJ) string {
lawsuit := number.Detailed.LawsuitNumber
year := number.Detailed.ProtocolYear
Expand Down
Loading

0 comments on commit 065b95b

Please sign in to comment.