| [116] | 1 | class InventoryItem { |
|---|
| 2 | InventoryGroup inventoryGroup |
|---|
| 3 | InventoryType inventoryType |
|---|
| 4 | UnitOfMeasure unitOfMeasure |
|---|
| [175] | 5 | InventoryLocation inventoryLocation |
|---|
| [182] | 6 | Picture picture |
|---|
| [435] | 7 | Supplier preferredSupplier |
|---|
| [116] | 8 | String name |
|---|
| 9 | String description = "" |
|---|
| [422] | 10 | String comment = "" |
|---|
| [405] | 11 | BigDecimal estimatedUnitPriceAmount |
|---|
| 12 | Currency estimatedUnitPriceCurrency |
|---|
| [116] | 13 | String suppliersPartNumber |
|---|
| [175] | 14 | Integer unitsInStock = 0 |
|---|
| [116] | 15 | Integer reorderPoint |
|---|
| [715] | 16 | Integer reorderQuantity |
|---|
| [116] | 17 | boolean isActive = true |
|---|
| 18 | boolean isObsolete = false |
|---|
| [616] | 19 | boolean enableReorderListing = true |
|---|
| [116] | 20 | |
|---|
| [182] | 21 | static mapping = { |
|---|
| 22 | picture cascade: 'all-delete-orphan', lazy: true, inverse: true |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| [720] | 25 | static hasMany = [spareFor: Asset, |
|---|
| [116] | 26 | inventoryMovements: InventoryMovement, |
|---|
| [435] | 27 | alternateSuppliers: Supplier] |
|---|
| [116] | 28 | |
|---|
| 29 | // static belongsTo = [] |
|---|
| 30 | |
|---|
| 31 | static constraints = { |
|---|
| [182] | 32 | picture(nullable:true) |
|---|
| [175] | 33 | name(unique:true, blank:false, maxSize:50) |
|---|
| [422] | 34 | description(maxSize:255) |
|---|
| 35 | comment(maxSize:500) |
|---|
| [175] | 36 | unitsInStock(min:0) |
|---|
| 37 | unitOfMeasure() |
|---|
| [416] | 38 | estimatedUnitPriceAmount(nullable:true, max: new BigDecimal(1000000000000)) |
|---|
| [405] | 39 | estimatedUnitPriceCurrency(nullable:true) |
|---|
| [116] | 40 | reorderPoint() |
|---|
| [616] | 41 | enableReorderListing() |
|---|
| [715] | 42 | reorderQuantity(nullable:true) |
|---|
| [116] | 43 | isActive() |
|---|
| 44 | isObsolete() |
|---|
| 45 | inventoryGroup() |
|---|
| 46 | inventoryType() |
|---|
| 47 | suppliersPartNumber(blank:true, nullable:true) |
|---|
| [435] | 48 | preferredSupplier(nullable:true) |
|---|
| [116] | 49 | } |
|---|
| 50 | |
|---|
| 51 | String toString() {"${this.name}"} |
|---|
| [425] | 52 | |
|---|
| [562] | 53 | static searchable = { |
|---|
| [566] | 54 | only = ['name', 'description', 'comment', 'isActive', 'isObsolete', 'inventoryLocation', 'inventoryGroup', 'spareFor'] |
|---|
| [562] | 55 | //name boost: 1.5 |
|---|
| 56 | inventoryLocation component: true |
|---|
| [566] | 57 | inventoryGroup component: true |
|---|
| [562] | 58 | spareFor component: true |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| [116] | 61 | } |
|---|