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

Last change on this file since 673 was 592, checked in by gav, 15 years ago

Domain change, added safetyRequirement, mandatoryRegulatory and positiveFault attributes to Task.
Update views and logic to suite.
Complete's ticket #70.

File size: 1.8 KB
Line 
1class Task {
2
3    TaskGroup taskGroup
4    TaskStatus taskStatus
5    TaskPriority taskPriority
6    TaskBudgetStatus taskBudgetStatus
7    TaskType taskType
8    Task parentTask
9    Person leadPerson
10    Site site
11    Section section
12    Asset primaryAsset
13    AssetSubItem assetSubItem
14    TaskRecurringSchedule taskRecurringSchedule
15    TaskProcedure taskProcedure
16
17    String description
18    String comment = ""
19    Date targetStartDate = new Date()
20    Date targetCompletionDate = new Date()
21    boolean approved = false
22    boolean trash = false
23    boolean attentionFlag = false
24    boolean safetyRequirement = false
25    boolean mandatoryRegulatory = false
26    boolean positiveFault = false
27
28    static hasMany = [entries: Entry,
29                        taskModifications: TaskModification,
30                        assignedGroups: AssignedGroup,
31                        assignedPersons: AssignedPerson,
32                        subTasks: Task,
33                        associatedAssets: Asset,
34                        inventoryMovements: InventoryMovement]
35
36    static mappedBy = [taskRecurringSchedule:"task"]
37
38    static belongsTo = [TaskGroup, TaskStatus, Task, Person]
39
40    static constraints = {
41        description(blank:false,maxSize:75)
42        comment(maxSize:1000)
43        targetStartDate()
44        targetCompletionDate(validator: {val, obj ->
45            if(val.before(obj.targetStartDate))
46                return 'before.targetStartDate'
47        })
48        leadPerson()
49        taskPriority()
50        taskBudgetStatus()
51        taskStatus()
52        parentTask(nullable:true)
53        site(nullable:true)
54        section(nullable:true)
55        primaryAsset(nullable:true)
56        assetSubItem(nullable:true)
57        taskRecurringSchedule(nullable:true)
58        taskProcedure(nullable:true)
59
60    }
61
62    String toString() {"${this.id} - ${this.description}"}
63}
Note: See TracBrowser for help on using the repository browser.