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.
feat: Add methods for listing and finding member Groups.
- Loading branch information
1 parent
c0f4af2
commit b2da2d0
Showing
4 changed files
with
80 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
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,37 @@ | ||
import type { FavroApi } from '$types/FavroApi'; | ||
import { BravoEntity } from '$lib/BravoEntity.js'; | ||
|
||
/** Hydrated Favro Organization. */ | ||
export class BravoGroup extends BravoEntity<FavroApi.Group.Model> { | ||
get name() { | ||
return this._data.name; | ||
} | ||
|
||
get groupId() { | ||
return this._data.groupId; | ||
} | ||
|
||
get organizationId() { | ||
return this._data.organizationId; | ||
} | ||
|
||
get creatorUserId() { | ||
return this._data.creatorUserId; | ||
} | ||
|
||
get memberCount() { | ||
return this._data.memberCount; | ||
} | ||
|
||
get members() { | ||
return [...this._data.members]; | ||
} | ||
|
||
equals(group: BravoGroup) { | ||
return ( | ||
this.hasSameConstructor(group) && | ||
this.organizationId === group.organizationId && | ||
this.groupId === group.groupId | ||
); | ||
} | ||
} |
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