mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 14:04:04 +00:00
feat(member): add away billing policies
This commit is contained in:
@@ -3,9 +3,16 @@ import type { ReminderTarget } from './reminders'
|
||||
|
||||
export const HOUSEHOLD_TOPIC_ROLES = ['purchase', 'feedback', 'reminders', 'payments'] as const
|
||||
export const HOUSEHOLD_MEMBER_LIFECYCLE_STATUSES = ['active', 'away', 'left'] as const
|
||||
export const HOUSEHOLD_MEMBER_ABSENCE_POLICIES = [
|
||||
'resident',
|
||||
'away_rent_and_utilities',
|
||||
'away_rent_only',
|
||||
'inactive'
|
||||
] as const
|
||||
|
||||
export type HouseholdTopicRole = (typeof HOUSEHOLD_TOPIC_ROLES)[number]
|
||||
export type HouseholdMemberLifecycleStatus = (typeof HOUSEHOLD_MEMBER_LIFECYCLE_STATUSES)[number]
|
||||
export type HouseholdMemberAbsencePolicy = (typeof HOUSEHOLD_MEMBER_ABSENCE_POLICIES)[number]
|
||||
|
||||
export interface HouseholdTelegramChatRecord {
|
||||
householdId: string
|
||||
@@ -52,6 +59,13 @@ export interface HouseholdMemberRecord {
|
||||
isAdmin: boolean
|
||||
}
|
||||
|
||||
export interface HouseholdMemberAbsencePolicyRecord {
|
||||
householdId: string
|
||||
memberId: string
|
||||
effectiveFromPeriod: string
|
||||
policy: HouseholdMemberAbsencePolicy
|
||||
}
|
||||
|
||||
export interface HouseholdBillingSettingsRecord {
|
||||
householdId: string
|
||||
settlementCurrency: CurrencyCode
|
||||
@@ -197,4 +211,13 @@ export interface HouseholdConfigurationRepository {
|
||||
memberId: string,
|
||||
status: HouseholdMemberLifecycleStatus
|
||||
): Promise<HouseholdMemberRecord | null>
|
||||
listHouseholdMemberAbsencePolicies(
|
||||
householdId: string
|
||||
): Promise<readonly HouseholdMemberAbsencePolicyRecord[]>
|
||||
upsertHouseholdMemberAbsencePolicy(input: {
|
||||
householdId: string
|
||||
memberId: string
|
||||
effectiveFromPeriod: string
|
||||
policy: HouseholdMemberAbsencePolicy
|
||||
}): Promise<HouseholdMemberAbsencePolicyRecord | null>
|
||||
}
|
||||
|
||||
@@ -13,8 +13,11 @@ export type {
|
||||
ReleaseProcessedBotMessageInput
|
||||
} from './processed-bot-messages'
|
||||
export {
|
||||
HOUSEHOLD_MEMBER_ABSENCE_POLICIES,
|
||||
HOUSEHOLD_MEMBER_LIFECYCLE_STATUSES,
|
||||
HOUSEHOLD_TOPIC_ROLES,
|
||||
type HouseholdMemberAbsencePolicy,
|
||||
type HouseholdMemberAbsencePolicyRecord,
|
||||
type HouseholdConfigurationRepository,
|
||||
type HouseholdBillingSettingsRecord,
|
||||
type HouseholdJoinTokenRecord,
|
||||
|
||||
Reference in New Issue
Block a user