Naalya Handbook
School featuresAdmissions and recruitment

Admission payments

When an application can be paid, and which older fee-before-submit claims no longer match the service.

Admission fees connect two modules that deliberately don't import each other: payments knows how to charge; admissions knows who owns an application. The bridge is a resource-bound payment with an inverted dependency: worth understanding because it's the template for charging any future resource.

Resolving the fee

ensureAdmissionFeeCharge runs after submit has stored submitted. It does nothing when a charge already exists. Otherwise it calls findAdmissionFeeItem. That method keeps active compulsory items whose reason is ADMISSION_FEES and whose audience has a resource rule for application. A campus-scoped item for this campus is used. If none, a school-scoped item for the campus’s school is used. Null means no charge, and the application stays submitted. It does not throw No admission fee is configured for this campus.

Paying it

initiatePayment does not require draft, and it does not call assertComplete. The application must be submitted or approved. Otherwise it throws The admission fee can be paid once the application is submitted. The caller’s user id must equal application.userId, or it throws You can only pay for your own application. ledgerService.resourceChargeSummary with no row throws No admission fee is due on this application. A paid summary throws The admission fee is already paid. pendingResourcePayment for that charge is returned when one exists. Otherwise ledgerService.pay runs with deferRegistration: true and one allocation of the outstanding amount. Submit does not read this summary. Admit does, through admissionFeeUnpaid. That check is false when bursary is off, and false when no charge exists. It is true only when bursary is on and the charge is unpaid. The route also requires Feature.BURSARY, so a school with bursary off cannot start the payment from this controller even though admit will not wait for it.

initiatePayment does not call the resolver. The generic PaymentItemService.pay path does, when the item’s audience is resource-bound.

Who may pay

ApplicationAudienceResolver registers itself for ResourceAudienceType.APPLICATION at module init. resolveOwnership loads the application. A missing row returns null, and pay then throws You do not own this resource. Otherwise owned is true only when application.userId equals the paying user. campusId is the application’s campus. ownerUserId is application.userId, which is the account the charge is raised on. listOwned returns every application with that userId. The label is the learner’s first and last name. There is no guest-profile column in this check.

A resource type with no registered resolver throws No resolver registered for resource "${resource}". That is a BadRequestException, not a silent skip.

Sources

Naalya-API a5dff0c208d5193c274d3d1f87787b55344d5d30: admission-application.service.ts (initiatePayment, submit, admit, ensureAdmissionFeeCharge), payment-item.service.ts (findAdmissionFeeItem, pay, resolveResourcePayment), application/audience/application-audience.resolver.ts, payment-item/audience/resource/resource-audience.registry.ts. No payment was made.

Where to go next

On this page