60
60
use Doctrine \Common \Collections \ArrayCollection ;
61
61
use Doctrine \Common \Collections \Collection ;
62
62
use Doctrine \ORM \Mapping as ORM ;
63
+ use Doctrine \DBAL \Types \Types ;
63
64
use Symfony \Bridge \Doctrine \Validator \Constraints \UniqueEntity ;
64
65
use Symfony \Component \Serializer \Annotation \Groups ;
65
66
use Symfony \Component \Validator \Constraints as Assert ;
101
102
#[ApiFilter(LikeFilter::class, properties: ["name " , "comment " , "description " , "ipn " , "manufacturer_product_number " ])]
102
103
#[ApiFilter(TagFilter::class, properties: ["tags " ])]
103
104
#[ApiFilter(BooleanFilter::class, properties: ["favorite " , "needs_review " ])]
104
- #[ApiFilter(RangeFilter::class, properties: ["mass " , "minamount " ])]
105
+ #[ApiFilter(RangeFilter::class, properties: ["mass " , "minamount " , " orderamount " ])]
105
106
#[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 ' ])]
107
108
class Part extends AttachmentContainingDBElement
108
109
{
109
110
use AdvancedPropertyTrait;
@@ -126,6 +127,15 @@ class Part extends AttachmentContainingDBElement
126
127
#[UniqueObjectCollection(fields: ['name ' , 'group ' , 'element ' ])]
127
128
protected Collection $ parameters ;
128
129
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
+
129
139
130
140
/** *************************************************************
131
141
* Overridden properties
@@ -216,6 +226,26 @@ public function __clone()
216
226
parent ::__clone ();
217
227
}
218
228
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
+
219
249
#[Assert \Callback]
220
250
public function validate (ExecutionContextInterface $ context , $ payload ): void
221
251
{
0 commit comments