source: trunk/grails-app/domain/Task.groovy @ 816

Last change on this file since 816 was 809, checked in by gav, 14 years ago

Domain change, first draft of TaskProcedureRevisions.

File size: 2.1 KB
RevLine 
[66]1class Task {
[121]2
[66]3    TaskGroup taskGroup
4    TaskStatus taskStatus
[69]5    TaskPriority taskPriority
[252]6    TaskBudgetStatus taskBudgetStatus
[69]7    TaskType taskType
[168]8    Task parentTask
[66]9    Person leadPerson
[472]10    Site site
11    Section section
[116]12    Asset primaryAsset
[472]13    AssetSubItem assetSubItem
[131]14    TaskRecurringSchedule taskRecurringSchedule
[809]15    TaskProcedureRevision taskProcedureRevision
[121]16
[66]17    String description
18    String comment = ""
19    Date targetStartDate = new Date()
20    Date targetCompletionDate = new Date()
[181]21    boolean approved = false
22    boolean trash = false
[418]23    boolean attentionFlag = false
[592]24    boolean safetyRequirement = false
[728]25    boolean regulatoryRequirement = false
26    boolean mandatoryRequirement = false
[592]27    boolean positiveFault = false
[66]28
[418]29    static hasMany = [entries: Entry,
[147]30                        taskModifications: TaskModification,
[242]31                        assignedGroups: AssignedGroup,
[241]32                        assignedPersons: AssignedPerson,
[116]33                        subTasks: Task,
34                        associatedAssets: Asset,
35                        inventoryMovements: InventoryMovement]
[66]36
[131]37    static mappedBy = [taskRecurringSchedule:"task"]
38
[807]39    static mapping = {
40        primaryAsset lazy:false
41    }
42
[69]43    static belongsTo = [TaskGroup, TaskStatus, Task, Person]
[66]44
45    static constraints = {
[131]46        description(blank:false,maxSize:75)
[446]47        comment(maxSize:1000)
[66]48        targetStartDate()
[446]49        targetCompletionDate(validator: {val, obj ->
50            if(val.before(obj.targetStartDate))
51                return 'before.targetStartDate'
52        })
[66]53        leadPerson()
[69]54        taskPriority()
[252]55        taskBudgetStatus()
[66]56        taskStatus()
[146]57        parentTask(nullable:true)
[472]58        site(nullable:true)
59        section(nullable:true)
[146]60        primaryAsset(nullable:true)
[472]61        assetSubItem(nullable:true)
[146]62        taskRecurringSchedule(nullable:true)
[809]63        taskProcedureRevision(nullable:true)
[146]64
[66]65    }
66
[799]67    String toString() {
68        def s = "#${this.id} - "
69        if(this.primaryAsset)
70            s += "${primaryAsset.name}: "
71        s += "${this.description}"
72    }
73
[66]74}
Note: See TracBrowser for help on using the repository browser.