fix(billing): stop back-office edits from changing Payple renewal charges
This commit is contained in:
parent
957e136789
commit
f456d737c4
8 changed files with 639 additions and 3 deletions
|
|
@ -8,7 +8,6 @@ import {
|
|||
actorEmail,
|
||||
adminErrorResponse,
|
||||
adminJsonResponse,
|
||||
adminRpcError,
|
||||
parsePagination,
|
||||
parseSubscriptionMutationRequest,
|
||||
readAdminJson,
|
||||
|
|
@ -19,6 +18,7 @@ import {
|
|||
validateQueryKeys,
|
||||
validateSubscriptionRpcResult,
|
||||
} from '../_shared/admin-contract.ts'
|
||||
import { subscriptionRpcError } from './rpc-error.ts'
|
||||
|
||||
const SUBSCRIPTION_COLUMNS = 'id, user_id, tier, status, provider, payment_provider, current_period_start, current_period_end, overage_credits, admin_note, cancel_at, created_at, updated_at'
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ async function mutateSubscription(req: Request, action: SubscriptionAction): Pro
|
|||
p_admin_note: mutation.adminNote ?? null,
|
||||
p_memo: mutation.memo,
|
||||
})
|
||||
if (error) throw adminRpcError(error)
|
||||
if (error) throw subscriptionRpcError(error)
|
||||
const response = validateSubscriptionRpcResult(data, mutation)
|
||||
return adminJsonResponse(response, corsHeaders, action === 'create' ? 201 : 200)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue