Ouvrir la plateforme Enterprise à l'écosystème développeurs et partenaires.
Cette couche permet :
Public API API Keys OAuth2 Developer Portal API Documentation SDK Foundation
afin de transformer la plateforme en écosystème extensible.
À l'issue de cette étape :
✓ Public API ✓ API Keys ✓ OAuth2 ✓ Developer Portal ✓ API Documentation ✓ SDK Foundation ✓ Developer Platform
Platform Core ↓ API Platform ├── Public REST API ├── OAuth2 Provider ├── API Keys ├── Developer Portal ├── API Documentation ├── SDK Registry └── Usage Analytics ↓ Partners Developers Integrators Marketplace Apps
model ApiApplication {
id String
@id
@default(uuid())
tenantId String?
name String
description String?
clientId String
@unique
clientSecretHash String
applicationType ApiApplicationType
status ApiApplicationStatus
createdBy String
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
apiKeys ApiKey[]
@@index([status])
}
model ApiKey {
id String
@id
@default(uuid())
applicationId String
keyPrefix String
keyHash String
scopes String[]
active Boolean
@default(true)
expiresAt DateTime?
lastUsedAt DateTime?
createdAt DateTime
@default(now())
application ApiApplication
@relation(
fields:[applicationId],
references:[id],
onDelete:Cascade
)
@@index([applicationId])
@@index([active])
}
model OAuthClient {
id String
@id
@default(uuid())
applicationId String
redirectUris String[]
grantTypes String[]
scopes String[]
active Boolean
@default(true)
createdAt DateTime
@default(now())
@@index([applicationId])
}
model ApiAccessLog {
id String
@id
@default(uuid())
applicationId String?
endpoint String
method String
statusCode Int
responseTimeMs Int
ipAddress String?
createdAt DateTime
@default(now())
@@index([applicationId])
@@index([createdAt])
@@index([endpoint])
}
model ApiRateLimit {
id String
@id
@default(uuid())
applicationId String
requestsPerMinute Int
requestsPerHour Int
requestsPerDay Int
createdAt DateTime
@default(now())
@@unique([applicationId])
}
enum ApiApplicationType {
INTERNAL
PARTNER
PUBLIC
MARKETPLACE
}
enum ApiApplicationStatus {
PENDING
ACTIVE
SUSPENDED
REVOKED
}
npx prisma migrate dev \
--name platform_api_core
src/modules/platform-api ├── applications ├── api-keys ├── oauth ├── documentation ├── analytics ├── portal └── platform-api.module.ts
ApiApplicationService ApiKeyService OAuthService ApiDocumentationService ApiAnalyticsService DeveloperPortalService
api-key.service.ts
Generate Key Rotate Key Revoke Key Scope Management Expiration
pk_live_xxxxxxxxx pk_test_xxxxxxxxx
generateApiKey() rotateApiKey() revokeApiKey() validateApiKey()
oauth.service.ts
Authorization Code Client Credentials Refresh Token PKCE
GET /oauth/authorize POST /oauth/token POST /oauth/revoke GET /oauth/userinfo
crm.read crm.write property.read reservation.read reservation.write analytics.read
CRM API Property API Reservation API Finance API Marketing API
/api/v1 /api/v2
REST OpenAPI 3 JSON API Pagination Filtering Sorting
api-documentation.service.ts
Swagger OpenAPI Postman Collection SDK Examples
Authentication Endpoints Examples Errors Rate Limits
developer-portal.service.ts
Applications API Keys Usage Analytics Documentation SDK Downloads
Requests Errors Latency Quota Usage Top APIs
sdk-registry.service.ts
TypeScript SDK Node.js SDK Python SDK PHP SDK Java SDK
OpenAPI Codegen Versioning
const client = new PlatformClient({
apiKey: process.env.API_KEY
});
const properties =
await client.properties.list();
api-analytics.service.ts
Requests Errors Latency Rate Limits Usage By Endpoint
GET /developer/apps POST /developer/apps POST /developer/api-keys GET /developer/analytics GET /developer/docs GET /developer/sdk
{
"application":"Partner PMS",
"requestsToday":124550,
"avgLatency":78,
"errorRate":0.12,
"quotaUsage":68
}
developer.read developer.apps.manage developer.keys.manage developer.analytics.read developer.docs.manage developer.admin
API_KEY_CREATED API_KEY_ROTATED OAUTH_CLIENT_CREATED APPLICATION_REGISTERED API_RATE_LIMIT_TRIGGERED SDK_GENERATED
Toutes les heures API Analytics Aggregation Toutes les nuits Usage Rollup Quota Refresh SDK Publication Check
Compatible avec :
Webhooks Event Bus Realtime Events Partner Integrations Marketplace Apps
Le Sprint 10-A.1 est terminé lorsque :
✓ Public API créée ✓ API Keys créées ✓ OAuth2 créé ✓ Developer Portal créé ✓ API Documentation créée ✓ SDK Foundation créée ✓ Developer Platform opérationnelle
ApiApplication ApiKey OAuthClient ApiAccessLog ApiRateLimit ApiApplicationService ApiKeyService OAuthService ApiDocumentationService DeveloperPortalService ApiAnalyticsService SDK Registry Developer Platform
Construire la plateforme d'intégration Enterprise permettant à l'écosystème externe de réagir en temps réel aux événements métier.
Cette couche permet :
Webhook Engine Event Bus Event Catalog Realtime Events Partner Integrations Integration Dashboard
afin d'interconnecter la plateforme avec :
PMS ERP CRM OTA Paiements Marketing Marketplace Apps Partenaires
À l'issue de cette étape :
✓ Webhook Engine ✓ Event Bus ✓ Event Catalog ✓ Realtime Events ✓ Partner Integrations ✓ Integration Dashboard ✓ Integration Platform
Platform Core ↓ Domain Events ↓ Event Bus ├── CRM Events ├── Property Events ├── Reservation Events ├── Finance Events ├── Marketing Events ├── Loyalty Events └── Marketplace Events ↓ Webhook Engine ↓ Partner Integrations ↓ External Systems
model EventDefinition {
id String
@id
@default(uuid())
code String
@unique
category EventCategory
name String
description String?
schemaVersion String
active Boolean
@default(true)
createdAt DateTime
@default(now())
@@index([category])
}
model EventSubscription {
id String
@id
@default(uuid())
tenantId String
applicationId String
eventCode String
active Boolean
@default(true)
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([applicationId])
@@index([eventCode])
}
model WebhookEndpoint {
id String
@id
@default(uuid())
tenantId String
applicationId String?
name String
targetUrl String
secretKeyHash String
active Boolean
@default(true)
retryEnabled Boolean
@default(true)
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([active])
}
model WebhookDelivery {
id String
@id
@default(uuid())
endpointId String
eventCode String
payload Json
status WebhookDeliveryStatus
responseCode Int?
responseTimeMs Int?
retryCount Int
@default(0)
deliveredAt DateTime?
createdAt DateTime
@default(now())
@@index([endpointId])
@@index([status])
@@index([createdAt])
}
model IntegrationConnection {
id String
@id
@default(uuid())
tenantId String
provider IntegrationProvider
externalAccountId String?
status IntegrationStatus
configuration Json
lastSyncAt DateTime?
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([provider])
@@index([status])
}
model EventLog {
id String
@id
@default(uuid())
tenantId String?
eventCode String
aggregateType String
aggregateId String
payload Json
publishedAt DateTime
@default(now())
@@index([eventCode])
@@index([publishedAt])
}
enum EventCategory {
CRM
PROPERTY
RESERVATION
PAYMENT
FINANCE
MARKETING
LOYALTY
REFERRAL
MARKETPLACE
}
enum WebhookDeliveryStatus {
PENDING
PROCESSING
SUCCESS
FAILED
RETRYING
DEAD_LETTER
}
enum IntegrationProvider {
AIRBNB
BOOKING
EXPEDIA
STRIPE
HUBSPOT
SALESFORCE
ZAPIER
MAKE
CUSTOM
}
enum IntegrationStatus {
PENDING
ACTIVE
FAILED
DISCONNECTED
}
npx prisma migrate dev \
--name integration_platform
src/modules/integrations ├── events ├── webhooks ├── subscriptions ├── providers ├── dashboard └── integrations.module.ts
EventBusService EventCatalogService WebhookEngineService WebhookDeliveryService IntegrationConnectionService IntegrationDashboardService
event-bus.service.ts
Publish Subscribe Replay Retry Dead Letter Queue
publish() subscribe() unsubscribe() replayEvent() moveToDeadLetter()
CUSTOMER_CREATED PROPERTY_CREATED RESERVATION_CREATED PAYMENT_COMPLETED CHECKIN_COMPLETED CHECKOUT_COMPLETED LOYALTY_POINTS_EARNED
event-catalog.service.ts
Schemas Payloads Versions Examples Compatibility
{
"event":"RESERVATION_CREATED",
"version":"1.0",
"reservationId":"..."
}
webhook-engine.service.ts
HTTPS HMAC Signature Retries Backoff Dead Letter Queue
X-Webhook-Signature X-Webhook-Event X-Webhook-Timestamp
registerEndpoint() dispatchWebhook() verifySignature() retryDelivery()
1 min 5 min 15 min 1 h 6 h
Kafka RabbitMQ NATS Redis Streams
selon l'architecture cible.
crm.* reservation.* property.* payment.* marketing.*
Event Replay Consumer Groups Partitioning Event Retention
integration-connection.service.ts
Airbnb Booking Expedia Stripe HubSpot Salesforce Zapier Make
connect() disconnect() sync() refreshToken() testConnection()
REST Webhook OAuth2 API Key
integration-dashboard.service.ts
Events Published Webhook Success Rate Retry Queue Failed Deliveries Active Integrations
Delivery Rate Average Latency Retry Rate Consumer Lag Integration Health
GET /integrations/events GET /integrations/subscriptions POST /integrations/webhooks GET /integrations/webhooks/deliveries GET /integrations/connections POST /integrations/connections GET /integrations/dashboard
{
"eventsPublished":152340,
"deliveryRate":99.87,
"failedDeliveries":42,
"activeIntegrations":28,
"avgLatencyMs":74
}
integration.read integration.webhooks.manage integration.events.manage integration.connections.manage integration.analytics.read integration.admin
EVENT_PUBLISHED WEBHOOK_REGISTERED WEBHOOK_DELIVERED WEBHOOK_FAILED INTEGRATION_CONNECTED INTEGRATION_DISCONNECTED
Toutes les minutes Webhook Retry Processor Dead Letter Processor Toutes les heures Integration Health Check Event Retention Cleanup Analytics Aggregation
Compatible avec :
Marketplace Apps App Store Extensions Plugins Embedded Apps
Le Sprint 10-A.2 est terminé lorsque :
✓ Webhook Engine créé ✓ Event Bus créé ✓ Event Catalog créé ✓ Realtime Events créés ✓ Partner Integrations créées ✓ Integration Dashboard créé ✓ Integration Platform opérationnelle
EventDefinition EventSubscription WebhookEndpoint WebhookDelivery IntegrationConnection EventLog EventBusService EventCatalogService WebhookEngineService WebhookDeliveryService IntegrationConnectionService IntegrationDashboardService Integration Platform
Construire l'écosystème applicatif Enterprise permettant aux partenaires, intégrateurs et développeurs de distribuer des extensions sur la plateforme.
Cette couche permet :
App Marketplace App Installation Extension Framework Embedded Apps Plugin SDK App Management
afin de transformer la plateforme en véritable système extensible.
À l'issue de cette étape :
✓ App Marketplace ✓ App Installation ✓ Extension Framework ✓ Embedded Apps ✓ Plugin SDK ✓ App Management ✓ Ecosystem Platform
Developer Platform ↓ Marketplace Platform ├── App Registry ├── App Store ├── Installation Engine ├── Extension Framework ├── Embedded Apps ├── Plugin SDK └── App Analytics ↓ Customers Partners Developers Marketplace Ecosystem
model MarketplaceApp {
id String
@id
@default(uuid())
developerId String
code String
@unique
name String
description String?
version String
category AppCategory
status AppStatus
logoUrl String?
websiteUrl String?
documentationUrl String?
verified Boolean
@default(false)
publishedAt DateTime?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
@@index([category])
@@index([status])
}
model AppInstallation {
id String
@id
@default(uuid())
tenantId String
appId String
installedBy String
status AppInstallationStatus
configuration Json?
installedAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
@@unique([tenantId, appId])
@@index([tenantId])
@@index([status])
}
model AppPermission {
id String
@id
@default(uuid())
appId String
permissionCode String
required Boolean
@default(true)
createdAt DateTime
@default(now())
@@index([appId])
@@index([permissionCode])
}
model AppExtension {
id String
@id
@default(uuid())
appId String
extensionPoint String
componentType ExtensionComponentType
configuration Json
active Boolean
@default(true)
createdAt DateTime
@default(now())
@@index([appId])
@@index([extensionPoint])
}
model AppUsageMetric {
id String
@id
@default(uuid())
appId String
tenantId String
metricDate DateTime
activeUsers Int
@default(0)
apiCalls Int
@default(0)
executions Int
@default(0)
createdAt DateTime
@default(now())
@@index([appId])
@@index([tenantId])
@@index([metricDate])
}
enum AppCategory {
CRM
PROPERTY
RESERVATION
FINANCE
MARKETING
LOYALTY
ANALYTICS
OPERATIONS
INTEGRATION
PRODUCTIVITY
}
enum AppStatus {
DRAFT
REVIEW
PUBLISHED
SUSPENDED
DEPRECATED
}
enum AppInstallationStatus {
PENDING
INSTALLED
DISABLED
FAILED
UNINSTALLED
}
enum ExtensionComponentType {
PAGE
WIDGET
ACTION
WEBHOOK
AUTOMATION
SIDEBAR
}
npx prisma migrate dev \
--name marketplace_apps_core
src/modules/marketplace ├── apps ├── installations ├── extensions ├── sdk ├── analytics ├── reviews └── marketplace.module.ts
MarketplaceAppService AppInstallationService ExtensionFrameworkService PluginSDKService MarketplaceAnalyticsService AppManagementService
marketplace-app.service.ts
Publish App Update App Archive App Verify App Search Apps
CRM Reservations Finance Marketing Analytics Operations Integrations
publishApp() submitForReview() verifyApp() searchMarketplace() getFeaturedApps()
app-installation.service.ts
Install Upgrade Disable Enable Uninstall
Marketplace ↓ Review Permissions ↓ Install ↓ Configure ↓ Activate
installApp() upgradeApp() enableApp() disableApp() uninstallApp()
extension-framework.service.ts
Dashboard Widgets Property Pages Reservation Pages CRM Pages Sidebar Menus Custom Actions
Manifest Permissions Lifecycle Hooks Sandbox Isolation
registerExtension() loadExtension() executeExtension() validateManifest()
iFrame Apps Micro Frontends Remote Modules Widget Embedding
CSP Sandbox OAuth Context Scoped Permissions Tenant Isolation
{
"name":"Revenue Optimizer",
"version":"1.0.0",
"permissions":[
"analytics.read",
"property.read"
],
"extensions":[
{
"type":"widget",
"location":"dashboard"
}
]
}
plugin-sdk.service.ts
TypeScript SDK React SDK REST SDK Webhook SDK Event SDK
import {
AppSDK
} from '@platform/sdk';
const sdk = new AppSDK();
sdk.dashboard.registerWidget({
id: 'revenue-widget'
});
API Access Events Storage Notifications UI Extensions
app-management.service.ts
Versions Permissions Usage Errors Licensing
Installs Active Apps Crashes Latency Usage
GET /marketplace/apps
GET /marketplace/apps/{id}
POST /marketplace/apps
POST /marketplace/apps/{id}/publish
POST /marketplace/installations
DELETE /marketplace/installations/{id}
GET /marketplace/analytics
{
"app":"Revenue Optimizer",
"category":"ANALYTICS",
"installs":824,
"rating":4.8,
"verified":true
}
marketplace.read marketplace.publish marketplace.install marketplace.manage marketplace.analytics marketplace.admin
APP_PUBLISHED APP_VERIFIED APP_INSTALLED APP_UNINSTALLED EXTENSION_REGISTERED SDK_GENERATED
Toutes les heures Marketplace Analytics Refresh Toutes les nuits App Health Check Permission Audit Version Compatibility Scan
Compatible avec :
Partner Ecosystem Monetization Billing Marketplace Revenue Sharing App Store Economy
Le Sprint 10-B.1 est terminé lorsque :
✓ App Marketplace créé ✓ App Installation créée ✓ Extension Framework créé ✓ Embedded Apps créées ✓ Plugin SDK créé ✓ App Management créé ✓ Marketplace Platform opérationnelle
MarketplaceApp AppInstallation AppPermission AppExtension AppUsageMetric MarketplaceAppService AppInstallationService ExtensionFrameworkService PluginSDKService MarketplaceAnalyticsService AppManagementService Marketplace Platform
Finaliser l'écosystème Marketplace Enterprise en ajoutant la monétisation, la gestion des partenaires et l'économie applicative.
Cette couche permet :
App Billing Subscriptions Revenue Sharing Partner Portal App Analytics Marketplace Economy
afin de créer une plateforme économique complète autour du Marketplace.
À l'issue de cette étape :
✓ App Billing ✓ Subscriptions ✓ Revenue Sharing ✓ Partner Portal ✓ App Analytics ✓ Marketplace Economy ✓ Partner Ecosystem Platform
Marketplace Platform ↓ Marketplace Economy Layer ├── Billing Engine ├── Subscription Management ├── Revenue Sharing ├── Partner Portal ├── Marketplace Analytics ├── Payout Engine └── Ecosystem Intelligence ↓ Partners Developers Vendors Integrators
model MarketplaceSubscription {
id String
@id
@default(uuid())
tenantId String
appId String
planCode String
status SubscriptionStatus
monthlyPrice Decimal
@db.Decimal(14,2)
startedAt DateTime
expiresAt DateTime?
cancelledAt DateTime?
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([appId])
@@index([status])
}
model MarketplaceInvoice {
id String
@id
@default(uuid())
subscriptionId String
invoiceNumber String
@unique
amount Decimal
@db.Decimal(14,2)
currency String
status InvoiceStatus
dueDate DateTime
paidAt DateTime?
createdAt DateTime
@default(now())
@@index([subscriptionId])
@@index([status])
}
model RevenueShare {
id String
@id
@default(uuid())
appId String
partnerId String
grossRevenue Decimal
@db.Decimal(14,2)
platformFee Decimal
@db.Decimal(14,2)
partnerRevenue Decimal
@db.Decimal(14,2)
settlementPeriod String
calculatedAt DateTime
@default(now())
@@index([appId])
@@index([partnerId])
}
model PartnerProfile {
id String
@id
@default(uuid())
companyName String
legalName String?
website String?
contactEmail String
status PartnerStatus
verificationStatus VerificationStatus
joinedAt DateTime
@default(now())
@@index([status])
@@index([verificationStatus])
}
model MarketplacePayout {
id String
@id
@default(uuid())
partnerId String
payoutPeriod String
amount Decimal
@db.Decimal(14,2)
currency String
status PayoutStatus
processedAt DateTime?
createdAt DateTime
@default(now())
@@index([partnerId])
@@index([status])
}
model MarketplaceAnalyticsSnapshot {
id String
@id
@default(uuid())
snapshotDate DateTime
totalApps Int
activeSubscriptions Int
monthlyRevenue Decimal
@db.Decimal(14,2)
partnerRevenue Decimal
@db.Decimal(14,2)
activePartners Int
createdAt DateTime
@default(now())
@@index([snapshotDate])
}
enum SubscriptionStatus {
TRIAL
ACTIVE
PAST_DUE
CANCELLED
EXPIRED
}
enum InvoiceStatus {
DRAFT
ISSUED
PAID
VOID
OVERDUE
}
enum PartnerStatus {
ACTIVE
SUSPENDED
TERMINATED
}
enum VerificationStatus {
PENDING
VERIFIED
REJECTED
}
enum PayoutStatus {
PENDING
PROCESSING
COMPLETED
FAILED
}
npx prisma migrate dev \
--name marketplace_monetization
src/modules/marketplace-economy ├── billing ├── subscriptions ├── revenue-sharing ├── partners ├── payouts ├── analytics └── marketplace-economy.module.ts
MarketplaceBillingService SubscriptionService RevenueSharingService PartnerPortalService PayoutService MarketplaceEconomyAnalyticsService
marketplace-billing.service.ts
Free Subscription Usage-Based Hybrid Enterprise Contract
createInvoice() collectPayment() refundInvoice() generateBillingCycle()
Stripe Invoices Taxes Payment Methods
subscription.service.ts
Trial Monthly Annual Enterprise
startSubscription() upgradePlan() downgradePlan() cancelSubscription() renewSubscription()
Starter Professional Business Enterprise
revenue-sharing.service.ts
70/30 80/20 85/15 Custom Contracts
calculateRevenueShare() generateSettlement() calculatePartnerRevenue() reconcileRevenue()
1000 € ↓ Plateforme 20% ↓ Partenaire 80%
partner-portal.service.ts
Applications Revenue Installs Subscriptions Payouts Analytics
MRR ARR Installs Active Customers Revenue Share
KYC Tax Forms Identity Bank Accounts
payout.service.ts
Bank Transfer SEPA ACH Stripe Connect
generatePayout() approvePayout() executePayout() trackPayout()
Monthly Bi-Monthly Quarterly
marketplace-economy-analytics.service.ts
Marketplace MRR Marketplace ARR Partner Revenue Install Growth App Retention Revenue Per App
Marketplace GMV Take Rate Partner LTV Partner Churn Subscription Growth
GET /marketplace/partners POST /marketplace/partners GET /marketplace/subscriptions POST /marketplace/subscriptions GET /marketplace/payouts GET /marketplace/revenue-sharing GET /marketplace/economy/dashboard
{
"marketplaceMrr":125000,
"activePartners":84,
"monthlyPayouts":92000,
"takeRate":18.4,
"subscriptionGrowth":12.8
}
marketplace.partner.read marketplace.partner.manage marketplace.billing.manage marketplace.payout.manage marketplace.economy.read marketplace.admin
PARTNER_REGISTERED PARTNER_VERIFIED SUBSCRIPTION_STARTED INVOICE_GENERATED PAYOUT_EXECUTED REVENUE_SHARE_CALCULATED
Toutes les nuits Revenue Share Calculation Billing Cycle Processing Subscription Renewal Marketplace KPI Refresh Toutes les semaines Partner Health Review
À la fin du Sprint 10-B.2 :
✓ Developer Platform ✓ Integration Platform ✓ Marketplace Platform ✓ Marketplace Economy ✓ Partner Portal ✓ Revenue Sharing ✓ Ecosystem Platform
sont entièrement opérationnels.
Compatible avec :
Enterprise Platform Operations Observability SRE Platform Reliability Security Operations Compliance Operations
Le Sprint 10-B.2 est terminé lorsque :
✓ App Billing créé ✓ Subscription Management créé ✓ Revenue Sharing créé ✓ Partner Portal créé ✓ Marketplace Analytics créé ✓ Marketplace Economy finalisée
MarketplaceSubscription MarketplaceInvoice RevenueShare PartnerProfile MarketplacePayout MarketplaceAnalyticsSnapshot MarketplaceBillingService SubscriptionService RevenueSharingService PartnerPortalService PayoutService MarketplaceEconomyAnalyticsService Marketplace Economy Platform