event

Learning Book Discontinued

A learning book was discontinued and left the catalog. cna-one's pricing consumer removes its prices from current and future price tables.

Event Topic: LearningBookKey: id

Overview

Fact: a learning book reached the status DISCONTINUED. Same payload as Learning Book PublishedLearning Book PublishedEventv1.0.0A learning book was published and is on sale. cna-one's pricing consumer opens a pending price for it in every current a...Ownercna-platformSchemaMapView docs.

When it is published. CNA OneCNA OneServicev1.0.0Franchise operating system (franchises and employees, pricing, products and learning books, school operations). Publishe...PublishesGrantApplicationAccess, EmployeeCreated +6SubscribesInviteUser, FranchiseCreated +9Ownercna-platformMapRepoView docs, in franchisorUpdateLearningBookStatus, when the new status is DISCONTINUED, after the status and its history row are written.

What the consumer does. Same handler as Learning Book DraftedLearning Book DraftedEventv1.0.0A learning book was created as a draft or moved back to draft, so it is not on sale. cna-one's pricing consumer removes ...Ownercna-platformSchemaMapView docs (syncLearningBookUnavailableToPrices): soft-deletes every price of the book in the default groups of current and future price tables. Idempotent by construction.

Kafka

Topic (aggregateRoot)LearningBook
Message key (routingKey)payload.id
Contract ownerONE
metadata.eventLearningBookDiscontinued
Consumer grouppricing-price-events

Payload schema

Same payload type as LearningBookPublished (LearningBookPayload); status is DISCONTINUED.

Source of truth

import { LearningBookPayload } from "events/one/learningBook/LearningBookPublished";
class LearningBookDiscontinued extends Event<LearningBookPayload> {
public static owner = "ONE";
public static aggregateRoot = "LearningBook";
public static routingKey = "id";
}

Custom properties

PropertyValue
Contract Ownerx-contract-ownerONE
Kafka Topicx-kafka-topicLearningBook
Message Keyx-message-keyid
Sourcex-sourcecna-one api/app/events/one/learningBook/LearningBookDiscontinued.ts
10 properties
idstring
required

Learning book id (UUID). Kafka message key.

productIdstring
required

Product the edition belongs to (product.products, type LEARNING_BOOK).

publisherIdstring
required

Publisher id (product.publishers).

editioninteger
required

Edition number.

protheusIdstring
required

Id in the Protheus ERP (4 characters).

isbnstring | null

ISBN (13 characters), or null.

urlstring | null

URL of the digital book, or null.

imageUrlstring | null

Cover image URL, or null.

isDigitalContentAvailableboolean
required

Whether digital content is available.

statusstring
required

Publication status (cna-one LearningBookStatus). Matches the event: PUBLISHED, DRAFT or DISCONTINUED; UNDER_REVIEW never reaches the topic.

Allowed values: DRAFT PUBLISHED DISCONTINUED UNDER_REVIEW