Fixed some histories
All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 4m1s
All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 4m1s
This commit is contained in:
parent
692cf8de31
commit
804aa0b9b8
@ -82,11 +82,11 @@ class User(TableABC):
|
|||||||
self._reaction_count = value
|
self._reaction_count = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def birthday(self) -> Optional[datetime]:
|
def birthday(self) -> Optional[date]:
|
||||||
return self._birthday
|
return self._birthday
|
||||||
|
|
||||||
@birthday.setter
|
@birthday.setter
|
||||||
def birthday(self, value: Optional[datetime]):
|
def birthday(self, value: Optional[date]):
|
||||||
self._birthday = value
|
self._birthday = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
from datetime import date
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from cpl_core.dependency_injection import ServiceProviderABC
|
from cpl_core.dependency_injection import ServiceProviderABC
|
||||||
from cpl_query.extension import List
|
from cpl_query.extension import List
|
||||||
|
|
||||||
@ -11,6 +14,7 @@ class UserHistory(HistoryTableABC):
|
|||||||
xp: int,
|
xp: int,
|
||||||
message_count: int,
|
message_count: int,
|
||||||
reaction_count: int,
|
reaction_count: int,
|
||||||
|
birthday: Optional[date],
|
||||||
server: int,
|
server: int,
|
||||||
deleted: bool,
|
deleted: bool,
|
||||||
date_from: str,
|
date_from: str,
|
||||||
@ -24,6 +28,7 @@ class UserHistory(HistoryTableABC):
|
|||||||
self._xp = xp
|
self._xp = xp
|
||||||
self._message_count = message_count
|
self._message_count = message_count
|
||||||
self._reaction_count = reaction_count
|
self._reaction_count = reaction_count
|
||||||
|
self._birthday = birthday
|
||||||
self._server = server
|
self._server = server
|
||||||
|
|
||||||
self._deleted = deleted
|
self._deleted = deleted
|
||||||
@ -50,6 +55,10 @@ class UserHistory(HistoryTableABC):
|
|||||||
def reaction_count(self) -> int:
|
def reaction_count(self) -> int:
|
||||||
return self._reaction_count
|
return self._reaction_count
|
||||||
|
|
||||||
|
@property
|
||||||
|
def birthday(self) -> Optional[date]:
|
||||||
|
return self._birthday
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def server(self) -> int:
|
def server(self) -> int:
|
||||||
return self._server
|
return self._server
|
||||||
|
@ -37,6 +37,9 @@ type UserHistory implements HistoryTableQuery {
|
|||||||
id: ID
|
id: ID
|
||||||
discordId: String
|
discordId: String
|
||||||
xp: Int
|
xp: Int
|
||||||
|
messageCount: Int
|
||||||
|
reactionCount: Int
|
||||||
|
birthday: String
|
||||||
|
|
||||||
server: ID
|
server: ID
|
||||||
|
|
||||||
|
@ -9,6 +9,9 @@ class UserHistoryQuery(HistoryQueryABC):
|
|||||||
self.set_field("id", self.resolve_id)
|
self.set_field("id", self.resolve_id)
|
||||||
self.set_field("discordId", self.resolve_discord_id)
|
self.set_field("discordId", self.resolve_discord_id)
|
||||||
self.set_field("xp", self.resolve_xp)
|
self.set_field("xp", self.resolve_xp)
|
||||||
|
self.set_field("messageCount", lambda x, *_: x.message_count)
|
||||||
|
self.set_field("reactionCount", lambda x, *_: x.reaction_count)
|
||||||
|
self.set_field("birthday", lambda x, *_: None if x.birthday is None else x.birthday.strftime("%d.%m.%Y"))
|
||||||
self.set_field("server", self.resolve_server)
|
self.set_field("server", self.resolve_server)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -268,7 +268,6 @@ export class Queries {
|
|||||||
id
|
id
|
||||||
shortName
|
shortName
|
||||||
roleId
|
roleId
|
||||||
roleName
|
|
||||||
position
|
position
|
||||||
server
|
server
|
||||||
deleted
|
deleted
|
||||||
|
Loading…
Reference in New Issue
Block a user