6060use Doctrine \Common \Collections \ArrayCollection ;
6161use Doctrine \Common \Collections \Collection ;
6262use Doctrine \ORM \Mapping as ORM ;
63+ use Doctrine \DBAL \Types \Types ;
6364use Symfony \Bridge \Doctrine \Validator \Constraints \UniqueEntity ;
6465use Symfony \Component \Serializer \Annotation \Groups ;
6566use Symfony \Component \Validator \Constraints as Assert ;
101102#[ApiFilter(LikeFilter::class, properties: ["name " , "comment " , "description " , "ipn " , "manufacturer_product_number " ])]
102103#[ApiFilter(TagFilter::class, properties: ["tags " ])]
103104#[ApiFilter(BooleanFilter::class, properties: ["favorite " , "needs_review " ])]
104- #[ApiFilter(RangeFilter::class, properties: ["mass " , "minamount " ])]
105+ #[ApiFilter(RangeFilter::class, properties: ["mass " , "minamount " , " orderamount " ])]
105106#[ApiFilter(DateFilter::class, strategy: DateFilterInterface::EXCLUDE_NULL )]
106- #[ApiFilter(OrderFilter::class, properties: ['name ' , 'id ' , 'addedDate ' , 'lastModified ' ])]
107+ #[ApiFilter(OrderFilter::class, properties: ['name ' , 'id ' , 'orderDelivery ' , ' addedDate ' , 'lastModified ' ])]
107108class Part extends AttachmentContainingDBElement
108109{
109110 use AdvancedPropertyTrait;
@@ -126,6 +127,15 @@ class Part extends AttachmentContainingDBElement
126127 #[UniqueObjectCollection(fields: ['name ' , 'group ' , 'element ' ])]
127128 protected Collection $ parameters ;
128129
130+ /**
131+ * @var \DateTimeInterface|null Set a time when the new order will arive.
132+ * Set to null, if there is no known date or no order.
133+ */
134+ #[Groups(['extended ' , 'full ' , 'import ' , 'part_lot:read ' , 'part_lot:write ' ])]
135+ #[ORM \Column(name: 'orderDelivery ' , type: Types::DATETIME_MUTABLE , nullable: true )]
136+ #[Year2038BugWorkaround]
137+ protected ?\DateTimeInterface $ orderDelivery = null ;
138+
129139
130140 /** *************************************************************
131141 * Overridden properties
@@ -216,6 +226,26 @@ public function __clone()
216226 parent ::__clone ();
217227 }
218228
229+ /**
230+ * Gets the expected delivery date of the part. Returns null, if no delivery is due.
231+ */
232+ public function getOrderDelivery (): ?\DateTimeInterface
233+ {
234+ return $ this ->orderDelivery ;
235+ }
236+
237+ /**
238+ * Sets the expected delivery date of the part. Set to null, if no delivery is due.
239+ *
240+ *
241+ */
242+ public function setOrderDelivery (?\DateTimeInterface $ orderDelivery ): self
243+ {
244+ $ this ->orderDelivery = $ orderDelivery ;
245+
246+ return $ this ;
247+ }
248+
219249 #[Assert \Callback]
220250 public function validate (ExecutionContextInterface $ context , $ payload ): void
221251 {
0 commit comments