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

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

Set InventoryItem constraint to more human readable value.

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