Course Share Schema
Campos
Course Share Schema
Cross-tenant sharing configuration for an academy course
courseId
Reference to a course in the sharing (MSP) tenant
recipientType
Type of recipient. Phase 1 of ADR 0066b only implements TENANT; TEAM/USER reserved.
TENANTTEAMUSERrecipientId
ID of the recipient tenant (or team/user in future phases). Null only while an invitation is open or was declined (ADR 1168): the code decides who accepts.
pricingSnapshot
Frozen pricing terms at the time of the share. Phase 1 stores the values; actual charging happens in Phase 2 (course_charges).
mode
Pricing mode. Phase 1 supports free + fixed_per_seat.
freefixed_per_seatamountCents
Charge per enrollment in EUR cents (gross).
currency
taxRatePercent
chargingMode
external: the tenants settle between themselves, Codemeta only records the enrollments (invitation to an unrelated tenant, ADR 1168). wholesale: charge is bundled into the customer-tenant wholesale invoice (Phase 2). direct_stripe: customer pays in real-time via Stripe Connect on the MSP account (Phase 3).
wholesaledirect_stripeexternalpublishToPublicCatalog
If true, the course is listed on the MSP public catalog at /academy/:mspSlug. Anonymous users can browse and self-register via email-token flow.
maxEnrollments
Optional cap on total enrollments via this share. Null = unlimited.
enrollmentDeadline
Optional ISO date-time after which no further enrollments are allowed.
allowSelfEnrollment
If true, customer-tenant users can self-enroll; if false, only a customer-tenant manager may enroll others.
requireManagerApproval
If true, self-enrollments are pending until a customer-tenant manager approves them.
status
Share lifecycle. Auto-paused when either tenant loses the required academy module. invited/declined belong to invitations to unrelated tenants (ADR 1168) and grant no access.
activepausedrevokedinviteddeclinedinvitationCodeHash
SHA-256 of the invitation code. Null once redeemed or declined. Never returned.
invitedAt
Set when the share started as an invitation; stays after acceptance.
invitedBy
User in the source tenant who issued the invitation.
invitationExpiresAt
The code can no longer be redeemed after this time.
acceptedAt
When the recipient tenant agreed to the terms.
acceptedBy
User in the RECIPIENT tenant who agreed to the terms.
declinedAt
When a recipient declined the invitation.
recipientEndedAt
When the recipient ended the share. The source tenant cannot reactivate it afterwards.
createdBy
User ID (in source tenant) who created the share.
updatedBy
User ID who last updated the share.
Ningún campo coincide con el filtro.
Endpoints estándar
Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:
GET /api/v1/course_shares— Lista, paginada y filtrableGET /api/v1/course_shares/<id>— Una entidadPOST /api/v1/course_shares— CrearPATCH /api/v1/course_shares/<id>— Actualización parcialDELETE /api/v1/course_shares/<id>— Eliminación lógicaGET /api/v1/course_shares/<id>/timeline— Auditoría y actividades