-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Predicted piece set Combined internal pieces into a predicted piece set for use within orders and recieving app * feat: Fetching prediction pattern sets Updated url mappings for fetching prediction pattern sets
- Loading branch information
1 parent
e3b0697
commit f407caa
Showing
11 changed files
with
149 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
service/grails-app/domain/org/olf/PredictedPieceSet.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.olf | ||
|
||
import org.olf.recurrence.Recurrence | ||
import org.olf.internalPiece.InternalPiece | ||
|
||
import java.time.LocalDate | ||
import grails.compiler.GrailsCompileStatic | ||
import grails.gorm.MultiTenant | ||
import org.hibernate.Session | ||
import org.hibernate.internal.SessionImpl | ||
import com.k_int.web.toolkit.refdata.CategoryId | ||
import com.k_int.web.toolkit.refdata.Defaults | ||
import com.k_int.web.toolkit.refdata.RefdataValue | ||
|
||
class PredictedPieceSet implements MultiTenant<PredictedPieceSet> { | ||
|
||
String id | ||
Date lastUpdated | ||
Date dateCreated | ||
|
||
LocalDate startDate | ||
|
||
Serial serial | ||
SerialRuleset ruleset | ||
|
||
String note | ||
|
||
static hasMany = [ | ||
pieces: InternalPiece | ||
] | ||
|
||
static mappedBy = [ | ||
pieces: 'owner', | ||
// serial: 'predictedPieceSet', | ||
// ruleset: 'predictedPieceSet', | ||
] | ||
|
||
static mapping = { | ||
id column: 'pps_id', generator: 'uuid2', length: 36 | ||
lastUpdated column: 'pps_last_updated' | ||
dateCreated column: 'pps_date_created' | ||
version column: 'pps_version' | ||
startDate column: 'pps_start_date' | ||
note column: 'pps_note' | ||
|
||
pieces cascade: 'all-delete-orphan' | ||
serial cascade: 'all-delete-orphan' | ||
ruleset cascade: 'all-delete-orphan' | ||
} | ||
|
||
static constraints = { | ||
lastUpdated nullable: true | ||
dateCreated nullable: true | ||
note nullable: true | ||
startDate nullable: false | ||
pieces nullable: false | ||
serial nullable: true | ||
ruleset nullable: false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
service/grails-app/views/predictedPieceSet/_predictedPieceSet.gson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import groovy.transform.* | ||
import org.olf.Serial | ||
import groovy.transform.Field | ||
|
||
def should_expand = [ | ||
'serial', | ||
'ruleset', | ||
'pieces', | ||
] | ||
|
||
@Field PredictedPieceSet predictedPieceSet | ||
|
||
json g.render(predictedPieceSet, [expand: should_expand]) |