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

Last change on this file since 559 was 472, checked in by gav, 15 years ago

Change Task domain class to have site, section and assetSubItem.

File size: 1.7 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 scheduled = false
22    boolean approved = false
23    boolean trash = false
24    boolean attentionFlag = false
25
26    static hasMany = [entries: Entry,
27                        taskModifications: TaskModification,
28                        assignedGroups: AssignedGroup,
29                        assignedPersons: AssignedPerson,
30                        subTasks: Task,
31                        associatedAssets: Asset,
32                        inventoryMovements: InventoryMovement]
33
34    static mappedBy = [taskRecurringSchedule:"task"]
35
36    static belongsTo = [TaskGroup, TaskStatus, Task, Person]
37
38    static constraints = {
39        description(blank:false,maxSize:75)
40        comment(maxSize:1000)
41        targetStartDate()
42        targetCompletionDate(validator: {val, obj ->
43            if(val.before(obj.targetStartDate))
44                return 'before.targetStartDate'
45        })
46        leadPerson()
47        taskPriority()
48        taskBudgetStatus()
49        taskStatus()
50        parentTask(nullable:true)
51        site(nullable:true)
52        section(nullable:true)
53        primaryAsset(nullable:true)
54        assetSubItem(nullable:true)
55        taskRecurringSchedule(nullable:true)
56        taskProcedure(nullable:true)
57
58    }
59
60    String toString() {"${this.id} - ${this.description}"}
61}
Note: See TracBrowser for help on using the repository browser.