-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for deleting TPW items
- Loading branch information
1 parent
6925c3f
commit 3f46ea8
Showing
7 changed files
with
490 additions
and
91 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
export enum ItemAction { | ||
DELETE = 'deleted', | ||
} | ||
|
||
export enum ItemType { | ||
DCL, | ||
THIRD_PARTY, | ||
} | ||
|
||
export class NonExistentItemException extends Error { | ||
constructor(public id: string) { | ||
super("The item doesn't exist.") | ||
} | ||
} | ||
|
||
export class ThirdPartyItemAlreadyPublishedException extends Error { | ||
constructor(public id: string, public urn: string, action: ItemAction) { | ||
super(`The third party item is already published. It can't be ${action}.`) | ||
} | ||
} | ||
|
||
export class DCLItemAlreadyPublishedException extends Error { | ||
constructor( | ||
public id: string, | ||
public blockchainItemId: string, | ||
public contractAddress: string, | ||
action: ItemAction | ||
) { | ||
super( | ||
`The collection that contains this item has been already published. The item can't be ${action}.` | ||
) | ||
} | ||
} | ||
|
||
export class CollectionForItemLockedException extends Error { | ||
constructor(public id: string, action: ItemAction) { | ||
super(`The collection for the item is locked. The item can't be ${action}.`) | ||
} | ||
} | ||
|
||
export class InconsistentItemException extends Error { | ||
constructor(public id: string, message: string) { | ||
super(message) | ||
} | ||
} |
Oops, something went wrong.