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

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

Set InventoryItem constraint to more human readable value.

File size: 1.8 KB
RevLine 
[116]1class  InventoryItem {
2    InventoryGroup inventoryGroup
3    InventoryType inventoryType
4    UnitOfMeasure unitOfMeasure
[175]5    InventoryLocation inventoryLocation
6    Period averageDeliveryPeriod
[182]7    Picture picture
[116]8    String name
9    String description = ""
10    String manufacturersPartNumber
[405]11    BigDecimal estimatedUnitPriceAmount
12    Currency estimatedUnitPriceCurrency
[116]13    String suppliersPartNumber
[175]14    Integer unitsInStock = 0
[116]15    Integer reorderPoint
16    Integer recommendedReorderPoint
17    Integer averageDeliveryTime
18    boolean isActive = true
19    boolean isObsolete = false
20    boolean enableReorder = true
21
[182]22    static mapping = {
23        picture cascade: 'all-delete-orphan', lazy: true, inverse: true
24    }
25
[116]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 = {
[182]35        picture(nullable:true)
[175]36        name(unique:true, blank:false, maxSize:50)
[116]37        description()
[175]38        unitsInStock(min:0)
39        unitOfMeasure()
[416]40        estimatedUnitPriceAmount(nullable:true, max: new BigDecimal(1000000000000))
[405]41        estimatedUnitPriceCurrency(nullable:true)
[116]42        reorderPoint()
43        enableReorder()
[175]44        recommendedReorderPoint(nullable:true)
[116]45        isActive()
46        isObsolete()
47        inventoryGroup()
48        inventoryType()
49        manufacturersPartNumber(blank:true, nullable:true)
50        suppliersPartNumber(blank:true, nullable:true)
[146]51        averageDeliveryTime(nullable:true)
[175]52        averageDeliveryPeriod(nullable:true)
[116]53    }
54
55    String toString() {"${this.name}"}
56}
Note: See TracBrowser for help on using the repository browser.