source: trunk/grails-app/domain/InventoryItem.groovy @ 395

Last change on this file since 395 was 182, checked in by gav, 15 years ago

Add support for inventory item Pictures and Images.
Add new PersonService, refactor CreateDataService and TaskService to suite.

File size: 1.6 KB
Line 
1class  InventoryItem {
2    InventoryGroup inventoryGroup
3    InventoryType inventoryType
4    UnitOfMeasure unitOfMeasure
5    InventoryLocation inventoryLocation
6    Period averageDeliveryPeriod
7    Picture picture
8    String name
9    String description = ""
10    String manufacturersPartNumber
11    String suppliersPartNumber
12    Integer unitsInStock = 0
13    Integer reorderPoint
14    Integer recommendedReorderPoint
15    Integer averageDeliveryTime
16    boolean isActive = true
17    boolean isObsolete = false
18    boolean enableReorder = true
19
20    static mapping = {
21        picture cascade: 'all-delete-orphan', lazy: true, inverse: true
22    }
23
24    static hasMany = [alternateItems: InventoryItem,
25                                    spareFor: Asset,
26                                    inventoryMovements: InventoryMovement,
27                                    manufacturers: Manufacturer,
28                                    suppliers: Supplier]
29
30//     static belongsTo = []
31
32    static constraints = {
33        picture(nullable:true)
34        name(unique:true, blank:false, maxSize:50)
35        description()
36        unitsInStock(min:0)
37        unitOfMeasure()
38        reorderPoint()
39        enableReorder()
40        recommendedReorderPoint(nullable:true)
41        isActive()
42        isObsolete()
43        inventoryGroup()
44        inventoryType()
45        manufacturersPartNumber(blank:true, nullable:true)
46        suppliersPartNumber(blank:true, nullable:true)
47        averageDeliveryTime(nullable:true)
48        averageDeliveryPeriod(nullable:true)
49    }
50
51    String toString() {"${this.name}"}
52}
Note: See TracBrowser for help on using the repository browser.