Skip to main content

backbone_inventory/exports/
events.rs

1//! Public events for Inventory module
2//!
3//! Generated by metaphor-schema. Do not edit manually.
4//!
5//! These events are published by this module for other modules to subscribe to.
6//! Events are the primary mechanism for cross-module communication.
7
8use serde::{Deserialize, Serialize};
9use chrono::{DateTime, Utc};
10
11use super::types::*;
12
13// ============================================================================
14// PICKINGBATCH EVENTS
15// ============================================================================
16
17/// Event published when a PickingBatch is created
18#[derive(Debug, Clone, Serialize, Deserialize)]
19pub struct PickingBatchCreatedEvent {
20    pub id: PickingBatchId,
21    pub data: PickingBatchDto,
22    pub occurred_at: DateTime<Utc>,
23}
24
25/// Event published when a PickingBatch is updated
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct PickingBatchUpdatedEvent {
28    pub id: PickingBatchId,
29    pub data: PickingBatchDto,
30    pub occurred_at: DateTime<Utc>,
31}
32
33/// Event published when a PickingBatch is deleted
34#[derive(Debug, Clone, Serialize, Deserialize)]
35pub struct PickingBatchDeletedEvent {
36    pub id: PickingBatchId,
37    pub occurred_at: DateTime<Utc>,
38}
39
40// ============================================================================
41// DELIVERYNOTE EVENTS
42// ============================================================================
43
44/// Event published when a DeliveryNote is created
45#[derive(Debug, Clone, Serialize, Deserialize)]
46pub struct DeliveryNoteCreatedEvent {
47    pub id: DeliveryNoteId,
48    pub data: DeliveryNoteDto,
49    pub occurred_at: DateTime<Utc>,
50}
51
52/// Event published when a DeliveryNote is updated
53#[derive(Debug, Clone, Serialize, Deserialize)]
54pub struct DeliveryNoteUpdatedEvent {
55    pub id: DeliveryNoteId,
56    pub data: DeliveryNoteDto,
57    pub occurred_at: DateTime<Utc>,
58}
59
60/// Event published when a DeliveryNote is deleted
61#[derive(Debug, Clone, Serialize, Deserialize)]
62pub struct DeliveryNoteDeletedEvent {
63    pub id: DeliveryNoteId,
64    pub occurred_at: DateTime<Utc>,
65}
66
67// ============================================================================
68// DELIVERYNOTEITEM EVENTS
69// ============================================================================
70
71/// Event published when a DeliveryNoteItem is created
72#[derive(Debug, Clone, Serialize, Deserialize)]
73pub struct DeliveryNoteItemCreatedEvent {
74    pub id: DeliveryNoteItemId,
75    pub data: DeliveryNoteItemDto,
76    pub occurred_at: DateTime<Utc>,
77}
78
79/// Event published when a DeliveryNoteItem is updated
80#[derive(Debug, Clone, Serialize, Deserialize)]
81pub struct DeliveryNoteItemUpdatedEvent {
82    pub id: DeliveryNoteItemId,
83    pub data: DeliveryNoteItemDto,
84    pub occurred_at: DateTime<Utc>,
85}
86
87/// Event published when a DeliveryNoteItem is deleted
88#[derive(Debug, Clone, Serialize, Deserialize)]
89pub struct DeliveryNoteItemDeletedEvent {
90    pub id: DeliveryNoteItemId,
91    pub occurred_at: DateTime<Utc>,
92}
93
94// ============================================================================
95// INVENTORYCOMPANYSETTING EVENTS
96// ============================================================================
97
98/// Event published when a InventoryCompanySetting is created
99#[derive(Debug, Clone, Serialize, Deserialize)]
100pub struct InventoryCompanySettingCreatedEvent {
101    pub id: InventoryCompanySettingId,
102    pub data: InventoryCompanySettingDto,
103    pub occurred_at: DateTime<Utc>,
104}
105
106/// Event published when a InventoryCompanySetting is updated
107#[derive(Debug, Clone, Serialize, Deserialize)]
108pub struct InventoryCompanySettingUpdatedEvent {
109    pub id: InventoryCompanySettingId,
110    pub data: InventoryCompanySettingDto,
111    pub occurred_at: DateTime<Utc>,
112}
113
114/// Event published when a InventoryCompanySetting is deleted
115#[derive(Debug, Clone, Serialize, Deserialize)]
116pub struct InventoryCompanySettingDeletedEvent {
117    pub id: InventoryCompanySettingId,
118    pub occurred_at: DateTime<Utc>,
119}
120
121// ============================================================================
122// LANDEDCOST EVENTS
123// ============================================================================
124
125/// Event published when a LandedCost is created
126#[derive(Debug, Clone, Serialize, Deserialize)]
127pub struct LandedCostCreatedEvent {
128    pub id: LandedCostId,
129    pub data: LandedCostDto,
130    pub occurred_at: DateTime<Utc>,
131}
132
133/// Event published when a LandedCost is updated
134#[derive(Debug, Clone, Serialize, Deserialize)]
135pub struct LandedCostUpdatedEvent {
136    pub id: LandedCostId,
137    pub data: LandedCostDto,
138    pub occurred_at: DateTime<Utc>,
139}
140
141/// Event published when a LandedCost is deleted
142#[derive(Debug, Clone, Serialize, Deserialize)]
143pub struct LandedCostDeletedEvent {
144    pub id: LandedCostId,
145    pub occurred_at: DateTime<Utc>,
146}
147
148// ============================================================================
149// LANDEDCOSTLINE EVENTS
150// ============================================================================
151
152/// Event published when a LandedCostLine is created
153#[derive(Debug, Clone, Serialize, Deserialize)]
154pub struct LandedCostLineCreatedEvent {
155    pub id: LandedCostLineId,
156    pub data: LandedCostLineDto,
157    pub occurred_at: DateTime<Utc>,
158}
159
160/// Event published when a LandedCostLine is updated
161#[derive(Debug, Clone, Serialize, Deserialize)]
162pub struct LandedCostLineUpdatedEvent {
163    pub id: LandedCostLineId,
164    pub data: LandedCostLineDto,
165    pub occurred_at: DateTime<Utc>,
166}
167
168/// Event published when a LandedCostLine is deleted
169#[derive(Debug, Clone, Serialize, Deserialize)]
170pub struct LandedCostLineDeletedEvent {
171    pub id: LandedCostLineId,
172    pub occurred_at: DateTime<Utc>,
173}
174
175// ============================================================================
176// LANDEDCOSTADJUSTMENTLINE EVENTS
177// ============================================================================
178
179/// Event published when a LandedCostAdjustmentLine is created
180#[derive(Debug, Clone, Serialize, Deserialize)]
181pub struct LandedCostAdjustmentLineCreatedEvent {
182    pub id: LandedCostAdjustmentLineId,
183    pub data: LandedCostAdjustmentLineDto,
184    pub occurred_at: DateTime<Utc>,
185}
186
187/// Event published when a LandedCostAdjustmentLine is updated
188#[derive(Debug, Clone, Serialize, Deserialize)]
189pub struct LandedCostAdjustmentLineUpdatedEvent {
190    pub id: LandedCostAdjustmentLineId,
191    pub data: LandedCostAdjustmentLineDto,
192    pub occurred_at: DateTime<Utc>,
193}
194
195/// Event published when a LandedCostAdjustmentLine is deleted
196#[derive(Debug, Clone, Serialize, Deserialize)]
197pub struct LandedCostAdjustmentLineDeletedEvent {
198    pub id: LandedCostAdjustmentLineId,
199    pub occurred_at: DateTime<Utc>,
200}
201
202// ============================================================================
203// LOCATION EVENTS
204// ============================================================================
205
206/// Event published when a Location is created
207#[derive(Debug, Clone, Serialize, Deserialize)]
208pub struct LocationCreatedEvent {
209    pub id: LocationId,
210    pub data: LocationDto,
211    pub occurred_at: DateTime<Utc>,
212}
213
214/// Event published when a Location is updated
215#[derive(Debug, Clone, Serialize, Deserialize)]
216pub struct LocationUpdatedEvent {
217    pub id: LocationId,
218    pub data: LocationDto,
219    pub occurred_at: DateTime<Utc>,
220}
221
222/// Event published when a Location is deleted
223#[derive(Debug, Clone, Serialize, Deserialize)]
224pub struct LocationDeletedEvent {
225    pub id: LocationId,
226    pub occurred_at: DateTime<Utc>,
227}
228
229// ============================================================================
230// STOCKMOVE EVENTS
231// ============================================================================
232
233/// Event published when a StockMove is created
234#[derive(Debug, Clone, Serialize, Deserialize)]
235pub struct StockMoveCreatedEvent {
236    pub id: StockMoveId,
237    pub data: StockMoveDto,
238    pub occurred_at: DateTime<Utc>,
239}
240
241/// Event published when a StockMove is updated
242#[derive(Debug, Clone, Serialize, Deserialize)]
243pub struct StockMoveUpdatedEvent {
244    pub id: StockMoveId,
245    pub data: StockMoveDto,
246    pub occurred_at: DateTime<Utc>,
247}
248
249/// Event published when a StockMove is deleted
250#[derive(Debug, Clone, Serialize, Deserialize)]
251pub struct StockMoveDeletedEvent {
252    pub id: StockMoveId,
253    pub occurred_at: DateTime<Utc>,
254}
255
256// ============================================================================
257// STOCKMOVELINE EVENTS
258// ============================================================================
259
260/// Event published when a StockMoveLine is created
261#[derive(Debug, Clone, Serialize, Deserialize)]
262pub struct StockMoveLineCreatedEvent {
263    pub id: StockMoveLineId,
264    pub data: StockMoveLineDto,
265    pub occurred_at: DateTime<Utc>,
266}
267
268/// Event published when a StockMoveLine is updated
269#[derive(Debug, Clone, Serialize, Deserialize)]
270pub struct StockMoveLineUpdatedEvent {
271    pub id: StockMoveLineId,
272    pub data: StockMoveLineDto,
273    pub occurred_at: DateTime<Utc>,
274}
275
276/// Event published when a StockMoveLine is deleted
277#[derive(Debug, Clone, Serialize, Deserialize)]
278pub struct StockMoveLineDeletedEvent {
279    pub id: StockMoveLineId,
280    pub occurred_at: DateTime<Utc>,
281}
282
283// ============================================================================
284// OPERATIONTYPE EVENTS
285// ============================================================================
286
287/// Event published when a OperationType is created
288#[derive(Debug, Clone, Serialize, Deserialize)]
289pub struct OperationTypeCreatedEvent {
290    pub id: OperationTypeId,
291    pub data: OperationTypeDto,
292    pub occurred_at: DateTime<Utc>,
293}
294
295/// Event published when a OperationType is updated
296#[derive(Debug, Clone, Serialize, Deserialize)]
297pub struct OperationTypeUpdatedEvent {
298    pub id: OperationTypeId,
299    pub data: OperationTypeDto,
300    pub occurred_at: DateTime<Utc>,
301}
302
303/// Event published when a OperationType is deleted
304#[derive(Debug, Clone, Serialize, Deserialize)]
305pub struct OperationTypeDeletedEvent {
306    pub id: OperationTypeId,
307    pub occurred_at: DateTime<Utc>,
308}
309
310// ============================================================================
311// TRANSFER EVENTS
312// ============================================================================
313
314/// Event published when a Transfer is created
315#[derive(Debug, Clone, Serialize, Deserialize)]
316pub struct TransferCreatedEvent {
317    pub id: TransferId,
318    pub data: TransferDto,
319    pub occurred_at: DateTime<Utc>,
320}
321
322/// Event published when a Transfer is updated
323#[derive(Debug, Clone, Serialize, Deserialize)]
324pub struct TransferUpdatedEvent {
325    pub id: TransferId,
326    pub data: TransferDto,
327    pub occurred_at: DateTime<Utc>,
328}
329
330/// Event published when a Transfer is deleted
331#[derive(Debug, Clone, Serialize, Deserialize)]
332pub struct TransferDeletedEvent {
333    pub id: TransferId,
334    pub occurred_at: DateTime<Utc>,
335}
336
337// ============================================================================
338// ROUTE EVENTS
339// ============================================================================
340
341/// Event published when a Route is created
342#[derive(Debug, Clone, Serialize, Deserialize)]
343pub struct RouteCreatedEvent {
344    pub id: RouteId,
345    pub data: RouteDto,
346    pub occurred_at: DateTime<Utc>,
347}
348
349/// Event published when a Route is updated
350#[derive(Debug, Clone, Serialize, Deserialize)]
351pub struct RouteUpdatedEvent {
352    pub id: RouteId,
353    pub data: RouteDto,
354    pub occurred_at: DateTime<Utc>,
355}
356
357/// Event published when a Route is deleted
358#[derive(Debug, Clone, Serialize, Deserialize)]
359pub struct RouteDeletedEvent {
360    pub id: RouteId,
361    pub occurred_at: DateTime<Utc>,
362}
363
364// ============================================================================
365// ROUTERULE EVENTS
366// ============================================================================
367
368/// Event published when a RouteRule is created
369#[derive(Debug, Clone, Serialize, Deserialize)]
370pub struct RouteRuleCreatedEvent {
371    pub id: RouteRuleId,
372    pub data: RouteRuleDto,
373    pub occurred_at: DateTime<Utc>,
374}
375
376/// Event published when a RouteRule is updated
377#[derive(Debug, Clone, Serialize, Deserialize)]
378pub struct RouteRuleUpdatedEvent {
379    pub id: RouteRuleId,
380    pub data: RouteRuleDto,
381    pub occurred_at: DateTime<Utc>,
382}
383
384/// Event published when a RouteRule is deleted
385#[derive(Debug, Clone, Serialize, Deserialize)]
386pub struct RouteRuleDeletedEvent {
387    pub id: RouteRuleId,
388    pub occurred_at: DateTime<Utc>,
389}
390
391// ============================================================================
392// REORDERINGRULE EVENTS
393// ============================================================================
394
395/// Event published when a ReorderingRule is created
396#[derive(Debug, Clone, Serialize, Deserialize)]
397pub struct ReorderingRuleCreatedEvent {
398    pub id: ReorderingRuleId,
399    pub data: ReorderingRuleDto,
400    pub occurred_at: DateTime<Utc>,
401}
402
403/// Event published when a ReorderingRule is updated
404#[derive(Debug, Clone, Serialize, Deserialize)]
405pub struct ReorderingRuleUpdatedEvent {
406    pub id: ReorderingRuleId,
407    pub data: ReorderingRuleDto,
408    pub occurred_at: DateTime<Utc>,
409}
410
411/// Event published when a ReorderingRule is deleted
412#[derive(Debug, Clone, Serialize, Deserialize)]
413pub struct ReorderingRuleDeletedEvent {
414    pub id: ReorderingRuleId,
415    pub occurred_at: DateTime<Utc>,
416}
417
418// ============================================================================
419// PURCHASERECEIPT EVENTS
420// ============================================================================
421
422/// Event published when a PurchaseReceipt is created
423#[derive(Debug, Clone, Serialize, Deserialize)]
424pub struct PurchaseReceiptCreatedEvent {
425    pub id: PurchaseReceiptId,
426    pub data: PurchaseReceiptDto,
427    pub occurred_at: DateTime<Utc>,
428}
429
430/// Event published when a PurchaseReceipt is updated
431#[derive(Debug, Clone, Serialize, Deserialize)]
432pub struct PurchaseReceiptUpdatedEvent {
433    pub id: PurchaseReceiptId,
434    pub data: PurchaseReceiptDto,
435    pub occurred_at: DateTime<Utc>,
436}
437
438/// Event published when a PurchaseReceipt is deleted
439#[derive(Debug, Clone, Serialize, Deserialize)]
440pub struct PurchaseReceiptDeletedEvent {
441    pub id: PurchaseReceiptId,
442    pub occurred_at: DateTime<Utc>,
443}
444
445// ============================================================================
446// PURCHASERECEIPTITEM EVENTS
447// ============================================================================
448
449/// Event published when a PurchaseReceiptItem is created
450#[derive(Debug, Clone, Serialize, Deserialize)]
451pub struct PurchaseReceiptItemCreatedEvent {
452    pub id: PurchaseReceiptItemId,
453    pub data: PurchaseReceiptItemDto,
454    pub occurred_at: DateTime<Utc>,
455}
456
457/// Event published when a PurchaseReceiptItem is updated
458#[derive(Debug, Clone, Serialize, Deserialize)]
459pub struct PurchaseReceiptItemUpdatedEvent {
460    pub id: PurchaseReceiptItemId,
461    pub data: PurchaseReceiptItemDto,
462    pub occurred_at: DateTime<Utc>,
463}
464
465/// Event published when a PurchaseReceiptItem is deleted
466#[derive(Debug, Clone, Serialize, Deserialize)]
467pub struct PurchaseReceiptItemDeletedEvent {
468    pub id: PurchaseReceiptItemId,
469    pub occurred_at: DateTime<Utc>,
470}
471
472// ============================================================================
473// QUANT EVENTS
474// ============================================================================
475
476/// Event published when a Quant is created
477#[derive(Debug, Clone, Serialize, Deserialize)]
478pub struct QuantCreatedEvent {
479    pub id: QuantId,
480    pub data: QuantDto,
481    pub occurred_at: DateTime<Utc>,
482}
483
484/// Event published when a Quant is updated
485#[derive(Debug, Clone, Serialize, Deserialize)]
486pub struct QuantUpdatedEvent {
487    pub id: QuantId,
488    pub data: QuantDto,
489    pub occurred_at: DateTime<Utc>,
490}
491
492/// Event published when a Quant is deleted
493#[derive(Debug, Clone, Serialize, Deserialize)]
494pub struct QuantDeletedEvent {
495    pub id: QuantId,
496    pub occurred_at: DateTime<Utc>,
497}
498
499// ============================================================================
500// SCRAP EVENTS
501// ============================================================================
502
503/// Event published when a Scrap is created
504#[derive(Debug, Clone, Serialize, Deserialize)]
505pub struct ScrapCreatedEvent {
506    pub id: ScrapId,
507    pub data: ScrapDto,
508    pub occurred_at: DateTime<Utc>,
509}
510
511/// Event published when a Scrap is updated
512#[derive(Debug, Clone, Serialize, Deserialize)]
513pub struct ScrapUpdatedEvent {
514    pub id: ScrapId,
515    pub data: ScrapDto,
516    pub occurred_at: DateTime<Utc>,
517}
518
519/// Event published when a Scrap is deleted
520#[derive(Debug, Clone, Serialize, Deserialize)]
521pub struct ScrapDeletedEvent {
522    pub id: ScrapId,
523    pub occurred_at: DateTime<Utc>,
524}
525
526// ============================================================================
527// SCRAPREASONTAG EVENTS
528// ============================================================================
529
530/// Event published when a ScrapReasonTag is created
531#[derive(Debug, Clone, Serialize, Deserialize)]
532pub struct ScrapReasonTagCreatedEvent {
533    pub id: ScrapReasonTagId,
534    pub data: ScrapReasonTagDto,
535    pub occurred_at: DateTime<Utc>,
536}
537
538/// Event published when a ScrapReasonTag is updated
539#[derive(Debug, Clone, Serialize, Deserialize)]
540pub struct ScrapReasonTagUpdatedEvent {
541    pub id: ScrapReasonTagId,
542    pub data: ScrapReasonTagDto,
543    pub occurred_at: DateTime<Utc>,
544}
545
546/// Event published when a ScrapReasonTag is deleted
547#[derive(Debug, Clone, Serialize, Deserialize)]
548pub struct ScrapReasonTagDeletedEvent {
549    pub id: ScrapReasonTagId,
550    pub occurred_at: DateTime<Utc>,
551}
552
553// ============================================================================
554// STOCKENTRY EVENTS
555// ============================================================================
556
557/// Event published when a StockEntry is created
558#[derive(Debug, Clone, Serialize, Deserialize)]
559pub struct StockEntryCreatedEvent {
560    pub id: StockEntryId,
561    pub data: StockEntryDto,
562    pub occurred_at: DateTime<Utc>,
563}
564
565/// Event published when a StockEntry is updated
566#[derive(Debug, Clone, Serialize, Deserialize)]
567pub struct StockEntryUpdatedEvent {
568    pub id: StockEntryId,
569    pub data: StockEntryDto,
570    pub occurred_at: DateTime<Utc>,
571}
572
573/// Event published when a StockEntry is deleted
574#[derive(Debug, Clone, Serialize, Deserialize)]
575pub struct StockEntryDeletedEvent {
576    pub id: StockEntryId,
577    pub occurred_at: DateTime<Utc>,
578}
579
580// ============================================================================
581// STOCKENTRYITEM EVENTS
582// ============================================================================
583
584/// Event published when a StockEntryItem is created
585#[derive(Debug, Clone, Serialize, Deserialize)]
586pub struct StockEntryItemCreatedEvent {
587    pub id: StockEntryItemId,
588    pub data: StockEntryItemDto,
589    pub occurred_at: DateTime<Utc>,
590}
591
592/// Event published when a StockEntryItem is updated
593#[derive(Debug, Clone, Serialize, Deserialize)]
594pub struct StockEntryItemUpdatedEvent {
595    pub id: StockEntryItemId,
596    pub data: StockEntryItemDto,
597    pub occurred_at: DateTime<Utc>,
598}
599
600/// Event published when a StockEntryItem is deleted
601#[derive(Debug, Clone, Serialize, Deserialize)]
602pub struct StockEntryItemDeletedEvent {
603    pub id: StockEntryItemId,
604    pub occurred_at: DateTime<Utc>,
605}
606
607// ============================================================================
608// STOCKLEDGERENTRY EVENTS
609// ============================================================================
610
611/// Event published when a StockLedgerEntry is created
612#[derive(Debug, Clone, Serialize, Deserialize)]
613pub struct StockLedgerEntryCreatedEvent {
614    pub id: StockLedgerEntryId,
615    pub data: StockLedgerEntryDto,
616    pub occurred_at: DateTime<Utc>,
617}
618
619/// Event published when a StockLedgerEntry is updated
620#[derive(Debug, Clone, Serialize, Deserialize)]
621pub struct StockLedgerEntryUpdatedEvent {
622    pub id: StockLedgerEntryId,
623    pub data: StockLedgerEntryDto,
624    pub occurred_at: DateTime<Utc>,
625}
626
627/// Event published when a StockLedgerEntry is deleted
628#[derive(Debug, Clone, Serialize, Deserialize)]
629pub struct StockLedgerEntryDeletedEvent {
630    pub id: StockLedgerEntryId,
631    pub occurred_at: DateTime<Utc>,
632}
633
634// ============================================================================
635// BIN EVENTS
636// ============================================================================
637
638/// Event published when a Bin is created
639#[derive(Debug, Clone, Serialize, Deserialize)]
640pub struct BinCreatedEvent {
641    pub id: BinId,
642    pub data: BinDto,
643    pub occurred_at: DateTime<Utc>,
644}
645
646/// Event published when a Bin is updated
647#[derive(Debug, Clone, Serialize, Deserialize)]
648pub struct BinUpdatedEvent {
649    pub id: BinId,
650    pub data: BinDto,
651    pub occurred_at: DateTime<Utc>,
652}
653
654/// Event published when a Bin is deleted
655#[derive(Debug, Clone, Serialize, Deserialize)]
656pub struct BinDeletedEvent {
657    pub id: BinId,
658    pub occurred_at: DateTime<Utc>,
659}
660
661// ============================================================================
662// STOCKRECONCILIATION EVENTS
663// ============================================================================
664
665/// Event published when a StockReconciliation is created
666#[derive(Debug, Clone, Serialize, Deserialize)]
667pub struct StockReconciliationCreatedEvent {
668    pub id: StockReconciliationId,
669    pub data: StockReconciliationDto,
670    pub occurred_at: DateTime<Utc>,
671}
672
673/// Event published when a StockReconciliation is updated
674#[derive(Debug, Clone, Serialize, Deserialize)]
675pub struct StockReconciliationUpdatedEvent {
676    pub id: StockReconciliationId,
677    pub data: StockReconciliationDto,
678    pub occurred_at: DateTime<Utc>,
679}
680
681/// Event published when a StockReconciliation is deleted
682#[derive(Debug, Clone, Serialize, Deserialize)]
683pub struct StockReconciliationDeletedEvent {
684    pub id: StockReconciliationId,
685    pub occurred_at: DateTime<Utc>,
686}
687
688// ============================================================================
689// STOCKRECONCILIATIONITEM EVENTS
690// ============================================================================
691
692/// Event published when a StockReconciliationItem is created
693#[derive(Debug, Clone, Serialize, Deserialize)]
694pub struct StockReconciliationItemCreatedEvent {
695    pub id: StockReconciliationItemId,
696    pub data: StockReconciliationItemDto,
697    pub occurred_at: DateTime<Utc>,
698}
699
700/// Event published when a StockReconciliationItem is updated
701#[derive(Debug, Clone, Serialize, Deserialize)]
702pub struct StockReconciliationItemUpdatedEvent {
703    pub id: StockReconciliationItemId,
704    pub data: StockReconciliationItemDto,
705    pub occurred_at: DateTime<Utc>,
706}
707
708/// Event published when a StockReconciliationItem is deleted
709#[derive(Debug, Clone, Serialize, Deserialize)]
710pub struct StockReconciliationItemDeletedEvent {
711    pub id: StockReconciliationItemId,
712    pub occurred_at: DateTime<Utc>,
713}
714
715// ============================================================================
716// PACKAGETYPE EVENTS
717// ============================================================================
718
719/// Event published when a PackageType is created
720#[derive(Debug, Clone, Serialize, Deserialize)]
721pub struct PackageTypeCreatedEvent {
722    pub id: PackageTypeId,
723    pub data: PackageTypeDto,
724    pub occurred_at: DateTime<Utc>,
725}
726
727/// Event published when a PackageType is updated
728#[derive(Debug, Clone, Serialize, Deserialize)]
729pub struct PackageTypeUpdatedEvent {
730    pub id: PackageTypeId,
731    pub data: PackageTypeDto,
732    pub occurred_at: DateTime<Utc>,
733}
734
735/// Event published when a PackageType is deleted
736#[derive(Debug, Clone, Serialize, Deserialize)]
737pub struct PackageTypeDeletedEvent {
738    pub id: PackageTypeId,
739    pub occurred_at: DateTime<Utc>,
740}
741
742// ============================================================================
743// STORAGECATEGORY EVENTS
744// ============================================================================
745
746/// Event published when a StorageCategory is created
747#[derive(Debug, Clone, Serialize, Deserialize)]
748pub struct StorageCategoryCreatedEvent {
749    pub id: StorageCategoryId,
750    pub data: StorageCategoryDto,
751    pub occurred_at: DateTime<Utc>,
752}
753
754/// Event published when a StorageCategory is updated
755#[derive(Debug, Clone, Serialize, Deserialize)]
756pub struct StorageCategoryUpdatedEvent {
757    pub id: StorageCategoryId,
758    pub data: StorageCategoryDto,
759    pub occurred_at: DateTime<Utc>,
760}
761
762/// Event published when a StorageCategory is deleted
763#[derive(Debug, Clone, Serialize, Deserialize)]
764pub struct StorageCategoryDeletedEvent {
765    pub id: StorageCategoryId,
766    pub occurred_at: DateTime<Utc>,
767}
768
769// ============================================================================
770// STORAGECATEGORYCAPACITY EVENTS
771// ============================================================================
772
773/// Event published when a StorageCategoryCapacity is created
774#[derive(Debug, Clone, Serialize, Deserialize)]
775pub struct StorageCategoryCapacityCreatedEvent {
776    pub id: StorageCategoryCapacityId,
777    pub data: StorageCategoryCapacityDto,
778    pub occurred_at: DateTime<Utc>,
779}
780
781/// Event published when a StorageCategoryCapacity is updated
782#[derive(Debug, Clone, Serialize, Deserialize)]
783pub struct StorageCategoryCapacityUpdatedEvent {
784    pub id: StorageCategoryCapacityId,
785    pub data: StorageCategoryCapacityDto,
786    pub occurred_at: DateTime<Utc>,
787}
788
789/// Event published when a StorageCategoryCapacity is deleted
790#[derive(Debug, Clone, Serialize, Deserialize)]
791pub struct StorageCategoryCapacityDeletedEvent {
792    pub id: StorageCategoryCapacityId,
793    pub occurred_at: DateTime<Utc>,
794}
795
796// ============================================================================
797// PUTAWAYRULE EVENTS
798// ============================================================================
799
800/// Event published when a PutawayRule is created
801#[derive(Debug, Clone, Serialize, Deserialize)]
802pub struct PutawayRuleCreatedEvent {
803    pub id: PutawayRuleId,
804    pub data: PutawayRuleDto,
805    pub occurred_at: DateTime<Utc>,
806}
807
808/// Event published when a PutawayRule is updated
809#[derive(Debug, Clone, Serialize, Deserialize)]
810pub struct PutawayRuleUpdatedEvent {
811    pub id: PutawayRuleId,
812    pub data: PutawayRuleDto,
813    pub occurred_at: DateTime<Utc>,
814}
815
816/// Event published when a PutawayRule is deleted
817#[derive(Debug, Clone, Serialize, Deserialize)]
818pub struct PutawayRuleDeletedEvent {
819    pub id: PutawayRuleId,
820    pub occurred_at: DateTime<Utc>,
821}
822
823// ============================================================================
824// LOT EVENTS
825// ============================================================================
826
827/// Event published when a Lot is created
828#[derive(Debug, Clone, Serialize, Deserialize)]
829pub struct LotCreatedEvent {
830    pub id: LotId,
831    pub data: LotDto,
832    pub occurred_at: DateTime<Utc>,
833}
834
835/// Event published when a Lot is updated
836#[derive(Debug, Clone, Serialize, Deserialize)]
837pub struct LotUpdatedEvent {
838    pub id: LotId,
839    pub data: LotDto,
840    pub occurred_at: DateTime<Utc>,
841}
842
843/// Event published when a Lot is deleted
844#[derive(Debug, Clone, Serialize, Deserialize)]
845pub struct LotDeletedEvent {
846    pub id: LotId,
847    pub occurred_at: DateTime<Utc>,
848}
849
850// ============================================================================
851// PACKAGE EVENTS
852// ============================================================================
853
854/// Event published when a Package is created
855#[derive(Debug, Clone, Serialize, Deserialize)]
856pub struct PackageCreatedEvent {
857    pub id: PackageId,
858    pub data: PackageDto,
859    pub occurred_at: DateTime<Utc>,
860}
861
862/// Event published when a Package is updated
863#[derive(Debug, Clone, Serialize, Deserialize)]
864pub struct PackageUpdatedEvent {
865    pub id: PackageId,
866    pub data: PackageDto,
867    pub occurred_at: DateTime<Utc>,
868}
869
870/// Event published when a Package is deleted
871#[derive(Debug, Clone, Serialize, Deserialize)]
872pub struct PackageDeletedEvent {
873    pub id: PackageId,
874    pub occurred_at: DateTime<Utc>,
875}
876
877// ============================================================================
878// WAREHOUSE EVENTS
879// ============================================================================
880
881/// Event published when a Warehouse is created
882#[derive(Debug, Clone, Serialize, Deserialize)]
883pub struct WarehouseCreatedEvent {
884    pub id: WarehouseId,
885    pub data: WarehouseDto,
886    pub occurred_at: DateTime<Utc>,
887}
888
889/// Event published when a Warehouse is updated
890#[derive(Debug, Clone, Serialize, Deserialize)]
891pub struct WarehouseUpdatedEvent {
892    pub id: WarehouseId,
893    pub data: WarehouseDto,
894    pub occurred_at: DateTime<Utc>,
895}
896
897/// Event published when a Warehouse is deleted
898#[derive(Debug, Clone, Serialize, Deserialize)]
899pub struct WarehouseDeletedEvent {
900    pub id: WarehouseId,
901    pub occurred_at: DateTime<Utc>,
902}
903
904// ============================================================================
905// STOCKITEM EVENTS
906// ============================================================================
907
908/// Event published when a StockItem is created
909#[derive(Debug, Clone, Serialize, Deserialize)]
910pub struct StockItemCreatedEvent {
911    pub id: StockItemId,
912    pub data: StockItemDto,
913    pub occurred_at: DateTime<Utc>,
914}
915
916/// Event published when a StockItem is updated
917#[derive(Debug, Clone, Serialize, Deserialize)]
918pub struct StockItemUpdatedEvent {
919    pub id: StockItemId,
920    pub data: StockItemDto,
921    pub occurred_at: DateTime<Utc>,
922}
923
924/// Event published when a StockItem is deleted
925#[derive(Debug, Clone, Serialize, Deserialize)]
926pub struct StockItemDeletedEvent {
927    pub id: StockItemId,
928    pub occurred_at: DateTime<Utc>,
929}
930
931// ============================================================================
932// MODULE EVENT ENUM
933// ============================================================================
934
935/// All events published by Inventory module
936#[derive(Debug, Clone, Serialize, Deserialize)]
937#[serde(tag = "type")]
938pub enum InventoryEvent {
939    PickingBatchCreated(PickingBatchCreatedEvent),
940    PickingBatchUpdated(PickingBatchUpdatedEvent),
941    PickingBatchDeleted(PickingBatchDeletedEvent),
942    DeliveryNoteCreated(DeliveryNoteCreatedEvent),
943    DeliveryNoteUpdated(DeliveryNoteUpdatedEvent),
944    DeliveryNoteDeleted(DeliveryNoteDeletedEvent),
945    DeliveryNoteItemCreated(DeliveryNoteItemCreatedEvent),
946    DeliveryNoteItemUpdated(DeliveryNoteItemUpdatedEvent),
947    DeliveryNoteItemDeleted(DeliveryNoteItemDeletedEvent),
948    InventoryCompanySettingCreated(InventoryCompanySettingCreatedEvent),
949    InventoryCompanySettingUpdated(InventoryCompanySettingUpdatedEvent),
950    InventoryCompanySettingDeleted(InventoryCompanySettingDeletedEvent),
951    LandedCostCreated(LandedCostCreatedEvent),
952    LandedCostUpdated(LandedCostUpdatedEvent),
953    LandedCostDeleted(LandedCostDeletedEvent),
954    LandedCostLineCreated(LandedCostLineCreatedEvent),
955    LandedCostLineUpdated(LandedCostLineUpdatedEvent),
956    LandedCostLineDeleted(LandedCostLineDeletedEvent),
957    LandedCostAdjustmentLineCreated(LandedCostAdjustmentLineCreatedEvent),
958    LandedCostAdjustmentLineUpdated(LandedCostAdjustmentLineUpdatedEvent),
959    LandedCostAdjustmentLineDeleted(LandedCostAdjustmentLineDeletedEvent),
960    LocationCreated(LocationCreatedEvent),
961    LocationUpdated(LocationUpdatedEvent),
962    LocationDeleted(LocationDeletedEvent),
963    StockMoveCreated(StockMoveCreatedEvent),
964    StockMoveUpdated(StockMoveUpdatedEvent),
965    StockMoveDeleted(StockMoveDeletedEvent),
966    StockMoveLineCreated(StockMoveLineCreatedEvent),
967    StockMoveLineUpdated(StockMoveLineUpdatedEvent),
968    StockMoveLineDeleted(StockMoveLineDeletedEvent),
969    OperationTypeCreated(OperationTypeCreatedEvent),
970    OperationTypeUpdated(OperationTypeUpdatedEvent),
971    OperationTypeDeleted(OperationTypeDeletedEvent),
972    TransferCreated(TransferCreatedEvent),
973    TransferUpdated(TransferUpdatedEvent),
974    TransferDeleted(TransferDeletedEvent),
975    RouteCreated(RouteCreatedEvent),
976    RouteUpdated(RouteUpdatedEvent),
977    RouteDeleted(RouteDeletedEvent),
978    RouteRuleCreated(RouteRuleCreatedEvent),
979    RouteRuleUpdated(RouteRuleUpdatedEvent),
980    RouteRuleDeleted(RouteRuleDeletedEvent),
981    ReorderingRuleCreated(ReorderingRuleCreatedEvent),
982    ReorderingRuleUpdated(ReorderingRuleUpdatedEvent),
983    ReorderingRuleDeleted(ReorderingRuleDeletedEvent),
984    PurchaseReceiptCreated(PurchaseReceiptCreatedEvent),
985    PurchaseReceiptUpdated(PurchaseReceiptUpdatedEvent),
986    PurchaseReceiptDeleted(PurchaseReceiptDeletedEvent),
987    PurchaseReceiptItemCreated(PurchaseReceiptItemCreatedEvent),
988    PurchaseReceiptItemUpdated(PurchaseReceiptItemUpdatedEvent),
989    PurchaseReceiptItemDeleted(PurchaseReceiptItemDeletedEvent),
990    QuantCreated(QuantCreatedEvent),
991    QuantUpdated(QuantUpdatedEvent),
992    QuantDeleted(QuantDeletedEvent),
993    ScrapCreated(ScrapCreatedEvent),
994    ScrapUpdated(ScrapUpdatedEvent),
995    ScrapDeleted(ScrapDeletedEvent),
996    ScrapReasonTagCreated(ScrapReasonTagCreatedEvent),
997    ScrapReasonTagUpdated(ScrapReasonTagUpdatedEvent),
998    ScrapReasonTagDeleted(ScrapReasonTagDeletedEvent),
999    StockEntryCreated(StockEntryCreatedEvent),
1000    StockEntryUpdated(StockEntryUpdatedEvent),
1001    StockEntryDeleted(StockEntryDeletedEvent),
1002    StockEntryItemCreated(StockEntryItemCreatedEvent),
1003    StockEntryItemUpdated(StockEntryItemUpdatedEvent),
1004    StockEntryItemDeleted(StockEntryItemDeletedEvent),
1005    StockLedgerEntryCreated(StockLedgerEntryCreatedEvent),
1006    StockLedgerEntryUpdated(StockLedgerEntryUpdatedEvent),
1007    StockLedgerEntryDeleted(StockLedgerEntryDeletedEvent),
1008    BinCreated(BinCreatedEvent),
1009    BinUpdated(BinUpdatedEvent),
1010    BinDeleted(BinDeletedEvent),
1011    StockReconciliationCreated(StockReconciliationCreatedEvent),
1012    StockReconciliationUpdated(StockReconciliationUpdatedEvent),
1013    StockReconciliationDeleted(StockReconciliationDeletedEvent),
1014    StockReconciliationItemCreated(StockReconciliationItemCreatedEvent),
1015    StockReconciliationItemUpdated(StockReconciliationItemUpdatedEvent),
1016    StockReconciliationItemDeleted(StockReconciliationItemDeletedEvent),
1017    PackageTypeCreated(PackageTypeCreatedEvent),
1018    PackageTypeUpdated(PackageTypeUpdatedEvent),
1019    PackageTypeDeleted(PackageTypeDeletedEvent),
1020    StorageCategoryCreated(StorageCategoryCreatedEvent),
1021    StorageCategoryUpdated(StorageCategoryUpdatedEvent),
1022    StorageCategoryDeleted(StorageCategoryDeletedEvent),
1023    StorageCategoryCapacityCreated(StorageCategoryCapacityCreatedEvent),
1024    StorageCategoryCapacityUpdated(StorageCategoryCapacityUpdatedEvent),
1025    StorageCategoryCapacityDeleted(StorageCategoryCapacityDeletedEvent),
1026    PutawayRuleCreated(PutawayRuleCreatedEvent),
1027    PutawayRuleUpdated(PutawayRuleUpdatedEvent),
1028    PutawayRuleDeleted(PutawayRuleDeletedEvent),
1029    LotCreated(LotCreatedEvent),
1030    LotUpdated(LotUpdatedEvent),
1031    LotDeleted(LotDeletedEvent),
1032    PackageCreated(PackageCreatedEvent),
1033    PackageUpdated(PackageUpdatedEvent),
1034    PackageDeleted(PackageDeletedEvent),
1035    WarehouseCreated(WarehouseCreatedEvent),
1036    WarehouseUpdated(WarehouseUpdatedEvent),
1037    WarehouseDeleted(WarehouseDeletedEvent),
1038    StockItemCreated(StockItemCreatedEvent),
1039    StockItemUpdated(StockItemUpdatedEvent),
1040    StockItemDeleted(StockItemDeletedEvent),
1041}
1042
1043/// Metadata for module events
1044#[derive(Debug, Clone, Serialize, Deserialize)]
1045pub struct InventoryEventMetadata {
1046    pub module: &'static str,
1047    pub version: &'static str,
1048}
1049
1050impl Default for InventoryEventMetadata {
1051    fn default() -> Self {
1052        Self {
1053            module: "inventory",
1054            version: "1.0",
1055        }
1056    }
1057}
1058
1059// ============================================================================
1060// CUSTOM EVENTS
1061// ============================================================================
1062
1063// Add custom public events here