Abschaltgrund und Loeschfrist in der Funktionsansicht (featureView, frist.js)
featureView liefert zusaetzlich disabledReason, disabledAt und loeschungAm (Berliner Tag, 30 Tage nach disabledAt); alle drei nur im Zustand disabled, sonst null. Neu termine/frist.js mit LOESCHFRIST_TAGE, loeschzeit und loeschTag (nur zeit.js/util.js). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
144b053851
commit
35c9800856
4 files changed
+183
No files matched your search
@@ -7,6 +7,7 @@ import { getStripe, retrieveCheckoutSession } from './stripeBilling.js'
|
||||
import { anleitungsLink, featureConfig, featureHaken, featureKeys, ticketFreischaltungKeys, ticketTexte } from './featureRegistry.js'
|
||||
import { zustimmungFuerSitzung } from './featureConsents.js'
|
||||
import { laeuft } from './aboStatus.js'
|
||||
import { loeschTag } from './termine/frist.js'
|
||||
import { createFeatureTicket } from './ticketAdmin.js'
|
||||
|
||||
export const FEATURE_KEYS = featureKeys()
|
||||
@@ -119,7 +120,14 @@ async function ticketWoid(ticketId) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ansicht einer Funktion fuer Kunde und Team. Abschaltgrund (disabledReason, ohne Grund = Altbestand => null), Zeitpunkt
|
||||
* (disabledAt) und Berliner Loeschtag (loeschungAm, 30 Tage danach, termine/frist.js) gibt es nur im Zustand `disabled`;
|
||||
* in jedem anderen Zustand sind alle drei null, auch wenn am Dokument noch Reste einer frueheren Abschaltung stehen.
|
||||
* loeschungAm ist null, wenn disabledAt fehlt oder nicht lesbar ist.
|
||||
*/
|
||||
async function featureView(doc) {
|
||||
const abgeschaltet = doc?.state === 'disabled'
|
||||
return {
|
||||
state: doc?.state || 'off',
|
||||
siteKey: doc?.siteKey || null,
|
||||
@@ -127,6 +135,9 @@ async function featureView(doc) {
|
||||
orderedAt: doc?.orderedAt || null,
|
||||
activatedAt: doc?.activatedAt || null,
|
||||
invoiceUrl: doc?.invoiceUrl || null,
|
||||
disabledReason: abgeschaltet ? doc.disabledReason || null : null,
|
||||
disabledAt: abgeschaltet ? doc.disabledAt || null : null,
|
||||
loeschungAm: abgeschaltet ? loeschTag(doc.disabledAt) : null,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user