59
59
use Doctrine \Common \Collections \ArrayCollection ;
60
60
use Doctrine \Common \Collections \Collection ;
61
61
use Doctrine \ORM \Mapping as ORM ;
62
+ use Doctrine \DBAL \Types \Types ;
62
63
use Symfony \Bridge \Doctrine \Validator \Constraints \UniqueEntity ;
63
64
use Symfony \Component \Serializer \Annotation \Groups ;
64
65
use Symfony \Component \Validator \Constraints as Assert ;
99
100
#[ApiFilter(PartStoragelocationFilter::class, properties: ["storage_location " ])]
100
101
#[ApiFilter(LikeFilter::class, properties: ["name " , "comment " , "description " , "ipn " , "tags " , "manufacturer_product_number " ])]
101
102
#[ApiFilter(BooleanFilter::class, properties: ["favorite " , "needs_review " ])]
102
- #[ApiFilter(RangeFilter::class, properties: ["mass " , "minamount " ])]
103
+ #[ApiFilter(RangeFilter::class, properties: ["mass " , "minamount " , " orderamount " ])]
103
104
#[ApiFilter(DateFilter::class, strategy: DateFilterInterface::EXCLUDE_NULL )]
104
- #[ApiFilter(OrderFilter::class, properties: ['name ' , 'id ' , 'addedDate ' , 'lastModified ' ])]
105
+ #[ApiFilter(OrderFilter::class, properties: ['name ' , 'id ' , 'orderDelivery ' , ' addedDate ' , 'lastModified ' ])]
105
106
class Part extends AttachmentContainingDBElement
106
107
{
107
108
use AdvancedPropertyTrait;
@@ -124,6 +125,15 @@ class Part extends AttachmentContainingDBElement
124
125
#[UniqueObjectCollection(fields: ['name ' , 'group ' , 'element ' ])]
125
126
protected Collection $ parameters ;
126
127
128
+ /**
129
+ * @var \DateTimeInterface|null Set a time when the new order will arive.
130
+ * Set to null, if there is no known date or no order.
131
+ */
132
+ #[Groups(['extended ' , 'full ' , 'import ' , 'part_lot:read ' , 'part_lot:write ' ])]
133
+ #[ORM \Column(name: 'orderDelivery ' , type: Types::DATETIME_MUTABLE , nullable: true )]
134
+ #[Year2038BugWorkaround]
135
+ protected ?\DateTimeInterface $ orderDelivery = null ;
136
+
127
137
128
138
/** *************************************************************
129
139
* Overridden properties
@@ -214,6 +224,26 @@ public function __clone()
214
224
parent ::__clone ();
215
225
}
216
226
227
+ /**
228
+ * Gets the expected delivery date of the part. Returns null, if no delivery is due.
229
+ */
230
+ public function getOrderDelivery (): ?\DateTimeInterface
231
+ {
232
+ return $ this ->orderDelivery ;
233
+ }
234
+
235
+ /**
236
+ * Sets the expected delivery date of the part. Set to null, if no delivery is due.
237
+ *
238
+ *
239
+ */
240
+ public function setOrderDelivery (?\DateTimeInterface $ orderDelivery ): self
241
+ {
242
+ $ this ->orderDelivery = $ orderDelivery ;
243
+
244
+ return $ this ;
245
+ }
246
+
217
247
#[Assert \Callback]
218
248
public function validate (ExecutionContextInterface $ context , $ payload ): void
219
249
{
0 commit comments