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

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

Add comment property to InventoryItem domain class and views.

File size: 1.8 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 comment = ""
11    String manufacturersPartNumber
12    BigDecimal estimatedUnitPriceAmount
13    Currency estimatedUnitPriceCurrency
14    String suppliersPartNumber
15    Integer unitsInStock = 0
16    Integer reorderPoint
17    Integer recommendedReorderPoint
18    Integer averageDeliveryTime
19    boolean isActive = true
20    boolean isObsolete = false
21    boolean enableReorder = true
22
23    static mapping = {
24        picture cascade: 'all-delete-orphan', lazy: true, inverse: true
25    }
26
27    static hasMany = [alternateItems: InventoryItem,
28                                    spareFor: Asset,
29                                    inventoryMovements: InventoryMovement,
30                                    manufacturers: Manufacturer,
31                                    suppliers: Supplier]
32
33//     static belongsTo = []
34
35    static constraints = {
36        picture(nullable:true)
37        name(unique:true, blank:false, maxSize:50)
38        description(maxSize:255)
39        comment(maxSize:500)
40        unitsInStock(min:0)
41        unitOfMeasure()
42        estimatedUnitPriceAmount(nullable:true, max: new BigDecimal(1000000000000))
43        estimatedUnitPriceCurrency(nullable:true)
44        reorderPoint()
45        enableReorder()
46        recommendedReorderPoint(nullable:true)
47        isActive()
48        isObsolete()
49        inventoryGroup()
50        inventoryType()
51        manufacturersPartNumber(blank:true, nullable:true)
52        suppliersPartNumber(blank:true, nullable:true)
53        averageDeliveryTime(nullable:true)
54        averageDeliveryPeriod(nullable:true)
55    }
56
57    String toString() {"${this.name}"}
58}
Note: See TracBrowser for help on using the repository browser.