Add lastStamp to availability and show it on people tiles
Server query extended with MAX(BU_BU) per user as LAST_STAMP, exposed via the Availability model. Client formats it as DD.MM. HH:mm next to the loggedIn dot, replacing the mocked time.
This commit is contained in:
@@ -11,4 +11,6 @@ public class Availability
|
||||
public bool LOGGED_IN { get; set; }
|
||||
[JsonPropertyName("extension")]
|
||||
public string? US_EXTENSION { get; set; }
|
||||
[JsonPropertyName("lastStamp")]
|
||||
public DateTime? LAST_STAMP { get; set; }
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ internal class ZeitConsensRepository(IConfiguration config) : Repository(config)
|
||||
ma.MA_USER_NAME
|
||||
,bu.LOGGED_IN
|
||||
,us.US_EXTENSION
|
||||
,buLastStamp.LAST_STAMP
|
||||
FROM dbo.MA_DATEN ma
|
||||
INNER JOIN projectmanagement.dbo.CP_USER us on us.US_LOGINNAME = ma.MA_USER_NAME
|
||||
OUTER APPLY (
|
||||
@@ -20,6 +21,11 @@ internal class ZeitConsensRepository(IConfiguration config) : Repository(config)
|
||||
AND
|
||||
BU_BU >= @from AND BU_BU < @to
|
||||
) bu
|
||||
OUTER APPLY (
|
||||
SELECT MAX(BU_BU) AS LAST_STAMP
|
||||
FROM dbo.BU
|
||||
WHERE bu.BU_MA_NR = ma.MA_NR
|
||||
) buLastStamp
|
||||
WHERE
|
||||
ma.MA_USER_AKTIV = 1
|
||||
""";
|
||||
|
||||
Reference in New Issue
Block a user