-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Add CustomerEvent and CustomerAddressEvent
Co-authored-by: Elena Trubetskaia <[email protected]>
- Loading branch information
1 parent
3497e81
commit 480de31
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/core/src/event-bus/events/customer-address-event.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { RequestContext } from '../../api/common/request-context'; | ||
import { Address } from '../../entity/address/address.entity'; | ||
import { VendureEvent } from '../vendure-event'; | ||
|
||
/** | ||
* @description | ||
* This event is fired whenever a {@link Customer} is added, updated | ||
* or deleted. | ||
* | ||
* @docsCategory events | ||
* @docsPage Event Types | ||
*/ | ||
export class CustomerAddressEvent extends VendureEvent { | ||
constructor( | ||
public ctx: RequestContext, | ||
public address: Address, | ||
public type: 'created' | 'updated' | 'deleted', | ||
) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { RequestContext } from '../../api/common/request-context'; | ||
import { Customer } from '../../entity/customer/customer.entity'; | ||
import { VendureEvent } from '../vendure-event'; | ||
|
||
/** | ||
* @description | ||
* This event is fired whenever a {@link Customer} is added, updated | ||
* or deleted. | ||
* | ||
* @docsCategory events | ||
* @docsPage Event Types | ||
*/ | ||
export class CustomerEvent extends VendureEvent { | ||
constructor( | ||
public ctx: RequestContext, | ||
public customer: Customer, | ||
public type: 'created' | 'updated' | 'deleted', | ||
) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters