event

Charge Installment Payment Undone

The school undid the payment of an installment of a charge it receives: the installment open again (PENDING), with its charge and the undone payment. Published by cna-one, one message per installment of the payment. No consumer yet.

Event Topic: ChargeInstallmentKey: idNo consumer

Overview

Fact: the payment that covered the installment was undone, and the installment is open again. It takes back the Charge Installment PaidCharge Installment PaidEventv1.0.0A payment now covers an installment of a charge a school receives: the installment after the payment, PAID or, on a cred...Ownercna-platformSchemaMapView docs published for the same installment and payment. The payload has the same shape: the installment right after the write, with its charge, and the undone payment.

When it is published. CNA OneCNA OneServicev1.0.0Franchise operating system (franchises and employees, pricing, products and learning books, school operations, receivabl...PublishesGrantApplicationAccess, EmployeeCreated +19SubscribesInviteUser, FranchiseCreated +17Ownercna-platformMapRepoView docs, from undoChargePayment through chargeInstallmentPaymentUndoneProducer, after the transaction that marks the payment as undone, opens its installments again, takes each of its receipts out of its cash account on the school’s today and records the reason in the history of each charge:

  1. One message per installment of the payment, all in a single produce call.
  2. status is PENDING, expectedSettlementOn is null, and payment is the undone payment, with undoneAt set.
  3. A credit card payment is undone whole: every installment it covers opens again, settled (Charge Installment SettledCharge Installment SettledEventv1.0.0The money of a credit card payment reached the school for an installment of a charge it receives: the installment PAID, ...Ownercna-platformSchemaMapView docs) or still pending settlement, and each receipt a settled one got leaves its bank account.
  4. Only a payment an employee registered and nobody has undone yet is undone. A payment undone by someone else in the meantime stores and publishes nothing.

The reason the employee gives stays in the history of the charge; it is not in the payload.

No consumer yet. A consumer that acted on Charge Installment PaidCharge Installment PaidEventv1.0.0A payment now covers an installment of a charge a school receives: the installment after the payment, PAID or, on a cred...Ownercna-platformSchemaMapView docs for the same payment.id decides here whether to revert what it did.

Kafka

Topic (aggregateRoot)ChargeInstallment
Message key (routingKey)payload.id
Contract ownerONE
metadata.eventChargeInstallmentPaymentUndone
Consumer group(none yet)

Payload schema

Source of truth

ChargeInstallmentPaidPayload is the type of Charge Installment PaidCharge Installment PaidEventv1.0.0A payment now covers an installment of a charge a school receives: the installment after the payment, PAID or, on a cred...Ownercna-platformSchemaMapView docs.

import { ChargeInstallmentPaidPayload } from "events/one/chargeInstallment/ChargeInstallmentPaid";
class ChargeInstallmentPaymentUndone extends Event<ChargeInstallmentPaidPayload> {
public static owner = "ONE";
public static aggregateRoot = "ChargeInstallment";
public static routingKey = "id";
public static version = "1.0.0";
}

The class exists only in cna-one.

Custom properties

PropertyValue
Contract Ownerx-contract-ownerONE
Kafka Topicx-kafka-topicChargeInstallment
Message Keyx-message-keyid
Sourcex-sourcecna-one api/app/events/one/chargeInstallment/ChargeInstallmentPaymentUndone.ts
25 properties
idstring
required

Id (UUID) of the installment (financial.charge_installments). Kafka message key.

franchiseIdstring
required

School (franchise) the installment belongs to.

chargeIdstring
required

Charge (financial.charges) the installment belongs to.

chargeCodestring
required

Code of the charge, unique per school: COB, the school code and seven hexadecimal digits, e.g. COB-SP-090-1A2B3C4.

contractIdstring | null

Contract (school_ops.contracts) the charge bills, or null for a charge with no contract.

studentIdstring | null

Student (school_ops.students) the charge is for, or null.

enrollmentIdstring | null

Enrollment (module) the installment is owed for. Set only when its charge bills a single item of the contract; null otherwise.

contractItemIdstring | null

Contract line the installment is owed for. Set only when its charge bills a single item of the contract; null otherwise.

payerPersonIdstring
required

Person (common.persons) who pays the charge. For the charges of a contract, the contract holder.

revenueTypestring
required

Kind of revenue the installment is (cna-one RevenueType).

Allowed values: ENROLLMENT_FEE OTHER_FEE LEARNING_BOOK TUITION TERMINATION_SETTLEMENT AD_HOC
numberinteger
required

Position of the installment in its schedule, from 1.

totalNumberinteger
required

How many installments the schedule has.

dueOnstring<date>
required

Day the installment is due, YYYY-MM-DD, no time zone.

originalAmountstring
required

Decimal as a string with two places: the amount of the installment before discounts, late fee and interest.

statusstring
required

Status of the installment after the undoing (cna-one ChargeInstallmentStatus): always PENDING, open again.

Allowed values: PENDING PAID PENDING_SETTLEMENT UNDER_RENEGOTIATION CANCELLED REVERSED
expectedSettlementOnstring | null<date>

Always null in this event: the installment has no payment in force any more.

paymentobject
required

The payment that was undone. It no longer covers the installment.