generated from bscotch/typescript-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82e3e7b
commit 5133cb4
Showing
1 changed file
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import type { DataFavroCard } from '$/types/FavroCardTypes.js'; | ||
import { BravoEntity } from '$lib/BravoEntity.js'; | ||
|
||
export class BravoCard extends BravoEntity<DataFavroCard> { | ||
get name() { | ||
return this._data.name; | ||
} | ||
|
||
/** The card's ID within a widget */ | ||
get cardId() { | ||
return this._data.cardId; | ||
} | ||
|
||
/** The card's global ID, the same in all widgets in which this card appears */ | ||
get cardCommonId() { | ||
return this._data.cardCommonId; | ||
} | ||
|
||
get columnId() { | ||
return this._data.columnId; | ||
} | ||
|
||
get parentCardId() { | ||
return this._data.parentCardId; | ||
} | ||
|
||
get widgetCommonId() { | ||
return this._data.widgetCommonId; | ||
} | ||
|
||
get tags() { | ||
return [...this._data.tags]; | ||
} | ||
|
||
get detailedDescription() { | ||
return this._data.detailedDescription; | ||
} | ||
|
||
get attachments() { | ||
return this._data.attachments; | ||
} | ||
|
||
/** | ||
* Delete this card from its Widget (the one it | ||
* was fetched from in search results). Optionally | ||
* delete it everywhere else, too! | ||
*/ | ||
async delete(everywhere = false) { | ||
return this._client.deleteCard(this.cardId, everywhere); | ||
} | ||
|
||
equals(org: BravoCard) { | ||
return ( | ||
this.hasSameConstructor(org) && this.cardCommonId === org.cardCommonId | ||
); | ||
} | ||
} |