Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat(payments): subscription lifecycle, renewal invoices and plan-based write access

Đang mở
#908 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Priyanshubhartistm đang làm issue này rồi.

Từ ngày 19/10/2026.

  • #909 của @Priyanshubhartistm — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

enhancement

Is your feature request related to a problem? Please describe.
With the subscription data model in place, nothing creates or extends a subscription, issues renewal invoices, or ends access when a period lapses. Write access still depends only on the permanent is_admitted flag.

Describe the solution you'd like

  • A SubscriptionService for subscribe, renew and status transitions (active → renewal_pending → past_due → expired).
  • PaymentsService.confirmInvoice extends the subscription period (same transaction as the invoice confirmation). All five confirmation paths (maintenance poll and the Zebedee/LNbits/OpenNode/Nodeless callbacks) already go through it, so the invoice carries its plan_id instead of each callback learning about plans.
  • POST /invoices accepts a plan id; existing admission behaviour is unchanged when no plans are configured.
  • A periodic sweep (maintenance worker) that issues renewal invoices before period end and moves overdue subscriptions through grace to expired.
  • isUserAdmitted checks for an active subscription, reusing the existing admission cache so there is no extra database read per event.
  • Tests for each transition, the confirm path, and the cache behaviour.

Additional context

  • Design: #673. Renewal is invoice-based: Lightning cannot pull funds, so the relay issues a renewal invoice and the user pays it.
Ngôn ngữ chính
TypeScript
Star
829
Fork
234
Merge trung bình
17 giờ 46 phút
Pull request đã merge (30 ngày)
73

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cameri/nostream

Tất cả issue của cameri/nostream

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.