feat: per-operator settings — house rules + card acceptance (multi-tenant)
Chatelet is multi-tenant: any LNbits user can host rooms. What an operator decides for all their rooms now lives in chatelet.operator_settings, keyed by user id and created lazily (m003, which also indexes bookings by guest): check-in/out times, cancellation policy, and accept_fiat. Guests see it: the public room view (both doors) gains house_rules and payment_methods, and the kind:30402 listing carries payment_methods, checkin_time and checkout_time tags so a generic Nostr client can render the right pay buttons and rules without our RPC. The check-in DM reads the room owner's rules instead of the instance row. Card is offered only when the operator opted in, the room is fiat-priced, and LNbits core has a fiat provider for that user — resolved through settings.get_fiat_providers_for_user(owner), the one seam lnbits#67's per-user Stripe credentials will plug into; chatelet never sees creds. Operator endpoints: GET/PUT /api/v1/operator (admin key → wallet user) and RPC twins chatelet_operator_get/update (AUTH_WALLET); saving re-publishes the owner's active listings. Admin UI moves the house-rule inputs into a per-operator card with the card toggle and a provider hint. The old house-rule columns on settings stay for old rows but are no longer read. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
feaaef93e3
commit
9ab52f2c69
17 changed files with 531 additions and 42 deletions
|
|
@ -171,19 +171,6 @@
|
|||
<q-input outlined dense type="number" label="Deposit %"
|
||||
v-model.number="settings.deposit_percent"></q-input>
|
||||
</div>
|
||||
<div class="col-6 col-md-3">
|
||||
<q-input outlined dense label="Check-in time"
|
||||
v-model="settings.checkin_time"></q-input>
|
||||
</div>
|
||||
<div class="col-6 col-md-3">
|
||||
<q-input outlined dense label="Check-out time"
|
||||
v-model="settings.checkout_time"></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input outlined dense type="textarea" autogrow
|
||||
label="Cancellation policy"
|
||||
v-model="settings.cancellation_policy"></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-toggle v-model="settings.publish_availability"
|
||||
label="Publish blocked dates to a public calendar (kind:31923)"></q-toggle>
|
||||
|
|
@ -193,6 +180,48 @@
|
|||
:loading="settingsLoading"></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg"></q-separator>
|
||||
|
||||
<!-- Per-operator: applies to every room owned by this account -->
|
||||
<div class="text-h6 q-mb-xs">Your rooms: house rules & payments</div>
|
||||
<div class="text-caption text-grey q-mb-md">
|
||||
Shown to guests on each of your rooms and sent in the check-in message.
|
||||
</div>
|
||||
<div class="row q-col-gutter-md" style="max-width: 760px">
|
||||
<div class="col-6 col-md-3">
|
||||
<q-input outlined dense label="Check-in time"
|
||||
v-model="operator.checkin_time"></q-input>
|
||||
</div>
|
||||
<div class="col-6 col-md-3">
|
||||
<q-input outlined dense label="Check-out time"
|
||||
v-model="operator.checkout_time"></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input outlined dense type="textarea" autogrow
|
||||
label="Cancellation policy"
|
||||
v-model="operator.cancellation_policy"></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-toggle v-model="operator.accept_fiat"
|
||||
:disable="!(operator.available_fiat_providers || []).length"
|
||||
label="Accept card payments for my rooms"></q-toggle>
|
||||
<div class="text-caption text-grey">
|
||||
<span v-if="(operator.available_fiat_providers || []).length">
|
||||
Via {{ (operator.available_fiat_providers || []).join(', ') }}. Guests can pay
|
||||
a fiat-priced room by card; sat-priced rooms stay Lightning-only.
|
||||
</span>
|
||||
<span v-else>
|
||||
No fiat payment provider is enabled for your account — ask the
|
||||
LNbits admin to enable one (e.g. Stripe) before turning this on.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-btn color="primary" label="Save my settings" @click="saveOperator"
|
||||
:loading="operatorLoading"></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
|
||||
</q-tab-panels>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue