Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cerops Database

Tasks

erDiagram
"task" {
  String id PK
  String title
  String description "nullable"
  TaskStatus status
  TaskPriority priority
  String category "nullable"
  Int rank
  DateTime deadline "nullable"
  String userId FK
  String plotId FK "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"task" }|--|| "user" : user

task

Action item linked to a User and optionally a Plot.

Properties as follows:

  • id:
  • title:
  • description:
  • status:
  • priority:
  • category:
  • rank:
  • deadline:
  • userId: User id
  • plotId: Plot id
  • createdAt:
  • updatedAt:

Auth

erDiagram
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"session" {
  String id PK
  DateTime expiresAt
  String token UK
  DateTime createdAt
  DateTime updatedAt
  String ipAddress "nullable"
  String userAgent "nullable"
  String userId FK
}
"account" {
  String id PK
  String accountId
  String providerId
  String userId FK
  String accessToken "nullable"
  String refreshToken "nullable"
  String idToken "nullable"
  DateTime accessTokenExpiresAt "nullable"
  DateTime refreshTokenExpiresAt "nullable"
  String scope "nullable"
  String password "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"verification" {
  String id PK
  String identifier
  String value
  DateTime expiresAt
  DateTime createdAt
  DateTime updatedAt
}
"subscription" {
  String id PK
  String plan
  String referenceId FK
  String stripeCustomerId
  String stripeSubscriptionId "nullable"
  String status
  DateTime periodStart "nullable"
  DateTime periodEnd "nullable"
  Boolean cancelAtPeriodEnd
  DateTime cancelAt "nullable"
  DateTime canceledAt "nullable"
  DateTime endedAt "nullable"
  Int seats "nullable"
  String billingInterval "nullable"
  String stripeScheduleId "nullable"
  DateTime trialStart "nullable"
  DateTime trialEnd "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"jwks" {
  String id PK
  String publicKey
  String privateKey
  DateTime createdAt
  DateTime expiresAt "nullable"
}
"oauthClient" {
  String id PK
  String clientId UK
  String clientSecret "nullable"
  Boolean disabled "nullable"
  Boolean skipConsent "nullable"
  Boolean enableEndSession "nullable"
  String subjectType "nullable"
  String scopes
  String userId FK "nullable"
  DateTime createdAt "nullable"
  DateTime updatedAt "nullable"
  String name "nullable"
  String uri "nullable"
  String icon "nullable"
  String contacts
  String tos "nullable"
  String policy "nullable"
  String softwareId "nullable"
  String softwareVersion "nullable"
  String softwareStatement "nullable"
  String redirectUris
  String postLogoutRedirectUris
  String tokenEndpointAuthMethod "nullable"
  String grantTypes
  String responseTypes
  Boolean public "nullable"
  String type "nullable"
  Boolean requirePKCE "nullable"
  String referenceId "nullable"
  Json metadata "nullable"
}
"oauthRefreshToken" {
  String id PK
  String token UK
  String clientId FK
  String sessionId FK "nullable"
  String userId FK
  String referenceId "nullable"
  DateTime expiresAt "nullable"
  DateTime createdAt "nullable"
  DateTime revoked "nullable"
  DateTime authTime "nullable"
  String scopes
}
"oauthAccessToken" {
  String id PK
  String token UK "nullable"
  String clientId FK
  String sessionId FK "nullable"
  String userId FK "nullable"
  String referenceId "nullable"
  String refreshId FK "nullable"
  DateTime expiresAt "nullable"
  DateTime createdAt "nullable"
  String scopes
}
"oauthConsent" {
  String id PK
  String clientId FK
  String userId FK "nullable"
  String referenceId "nullable"
  String scopes
  DateTime createdAt "nullable"
  DateTime updatedAt "nullable"
}
"platform_settings" {
  String id PK
  Boolean billingEnabled
  Boolean maintenanceMode
  Boolean registrationEnabled
  Boolean newMissionsEnabled
  Boolean cooperativesEnabled
  DateTime updatedAt
  String updatedById "nullable"
}
"session" }|--|| "user" : user
"account" }|--|| "user" : user
"subscription" }|--|| "user" : user
"oauthClient" }o--o| "user" : user
"oauthRefreshToken" }|--|| "oauthClient" : oauthclient
"oauthRefreshToken" }o--o| "session" : session
"oauthRefreshToken" }|--|| "user" : user
"oauthAccessToken" }|--|| "oauthClient" : oauthclient
"oauthAccessToken" }o--o| "session" : session
"oauthAccessToken" }o--o| "user" : user
"oauthAccessToken" }o--o| "oauthRefreshToken" : oauthrefreshtoken
"oauthConsent" }|--|| "oauthClient" : oauthclient
"oauthConsent" }o--o| "user" : user

user

Platform user with role-based access. Relates to Session, Account, Plot, Task, Flight, and more.

Properties as follows:

  • id:
  • name:
  • email:
  • emailVerified:
  • image:
  • accountType:
  • onboardingCompleted:
  • stripeCustomerId:
  • createdAt:
  • updatedAt:

session

User session for Better-Auth. Each Session belongs to a User.

Properties as follows:

  • id:
  • expiresAt:
  • token:
  • createdAt:
  • updatedAt:
  • ipAddress:
  • userAgent:
  • userId: User id

account

OAuth / email-password account linked to a User.

Properties as follows:

  • id:
  • accountId:
  • providerId:
  • userId: User id
  • accessToken:
  • refreshToken:
  • idToken:
  • accessTokenExpiresAt:
  • refreshTokenExpiresAt:
  • scope:
  • password:
  • createdAt:
  • updatedAt:

verification

Email verification token.

Properties as follows:

  • id:
  • identifier:
  • value:
  • expiresAt:
  • createdAt:
  • updatedAt:

subscription

Stripe subscription for a User.

Properties as follows:

  • id:
  • plan:
  • referenceId: User id
  • stripeCustomerId:
  • stripeSubscriptionId:
  • status:
  • periodStart:
  • periodEnd:
  • cancelAtPeriodEnd:
  • cancelAt:
  • canceledAt:
  • endedAt:
  • seats:
  • billingInterval:
  • stripeScheduleId:
  • trialStart:
  • trialEnd:
  • createdAt:
  • updatedAt:

jwks

JSON Web Key Set for OAuth.

Properties as follows:

  • id:
  • publicKey:
  • privateKey:
  • createdAt:
  • expiresAt:

oauthClient

OAuth 2.0 client application owned by a User.

Properties as follows:

  • id:
  • clientId:
  • clientSecret:
  • disabled:
  • skipConsent:
  • enableEndSession:
  • subjectType:
  • scopes:
  • userId: User id
  • createdAt:
  • updatedAt:
  • name:
  • uri:
  • icon:
  • contacts:
  • tos:
  • policy:
  • softwareId:
  • softwareVersion:
  • softwareStatement:
  • redirectUris:
  • postLogoutRedirectUris:
  • tokenEndpointAuthMethod:
  • grantTypes:
  • responseTypes:
  • public:
  • type:
  • requirePKCE:
  • referenceId:
  • metadata:

oauthRefreshToken

OAuth 2.0 refresh token belonging to a User, Session, and OauthClient.

Properties as follows:

  • id:
  • token:
  • clientId: OauthClient id
  • sessionId: Session id
  • userId: User id
  • referenceId:
  • expiresAt:
  • createdAt:
  • revoked:
  • authTime:
  • scopes:

oauthAccessToken

OAuth 2.0 access token belonging to a User, Session, and OauthClient.

Properties as follows:

oauthConsent

OAuth 2.0 consent record for a User and OauthClient.

Properties as follows:

  • id:
  • clientId: OauthClient id
  • userId: User id
  • referenceId:
  • scopes:
  • createdAt:
  • updatedAt:

platform_settings

Global platform configuration singleton.

Properties as follows:

  • id:
  • billingEnabled:
  • maintenanceMode:
  • registrationEnabled:
  • newMissionsEnabled:
  • cooperativesEnabled:
  • updatedAt:
  • updatedById:

Cooperative

erDiagram
"cooperative" {
  String id PK
  String name
  String joinCode UK
  String createdById FK
  DateTime createdAt
  DateTime updatedAt
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"cooperative" }|--|| "user" : createdBy

cooperative

Farmer cooperative group created by a User.

Properties as follows:

  • id:
  • name:
  • joinCode:
  • createdById: User id
  • createdAt:
  • updatedAt:

FieldObservation

erDiagram
"field_observation" {
  String id PK
  String userId FK
  String parcelId FK "nullable"
  String cropType "nullable"
  String photoOriginalObjectKey
  String photoThumbnailObjectKey "nullable"
  DateTime capturedAt
  DateTime uploadedAt "nullable"
  Float gpsLat "nullable"
  Float gpsLon "nullable"
  Float gpsAccuracyMeters "nullable"
  FieldObservationGpsAssociationStatus gpsAssociationStatus
  DateTime createdAt
  DateTime updatedAt
}
"plant_disease_diagnosis" {
  String id PK
  String observationId FK
  PlantDiseaseDiagnosisStatus status
  String modelName "nullable"
  String modelVersion "nullable"
  String predictedClass "nullable"
  String crop "nullable"
  String disease "nullable"
  String healthStatus "nullable"
  Float confidence "nullable"
  String severity "nullable"
  Boolean isConfident "nullable"
  Json topPredictions "nullable"
  Json recommendations "nullable"
  Int inferenceDurationMs "nullable"
  String errorCode "nullable"
  String errorMessage "nullable"
  Boolean retryable "nullable"
  String traceId "nullable"
  DateTime processingStartedAt "nullable"
  DateTime completedAt "nullable"
  DateTime failedAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"plot" {
  String id PK
  String name
  PlotSource source
  Float surface
  String userId FK "nullable"
  String rpgSourceKey UK "nullable"
  String rpgIdParcel "nullable"
  String rpgCultivationCode "nullable"
  String rpgGroupCode "nullable"
  String rpgCultureD1 "nullable"
  String rpgCultureD2 "nullable"
  String rpgCategory "nullable"
  Int rpgSourceYear "nullable"
  String rpgDatasetId FK "nullable"
  String rpgRegionCode "nullable"
  String rpgImportJobId FK "nullable"
  DateTime rpgImportedAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"field_observation" }|--|| "user" : user
"field_observation" }o--o| "plot" : parcel
"plant_disease_diagnosis" }o--|| "field_observation" : observation
"plot" }o--o| "user" : user

field_observation

In-field photo observation captured by a User on a Plot.

Properties as follows:

  • id:
  • userId: User id
  • parcelId: Plot id
  • cropType:
  • photoOriginalObjectKey:
  • photoThumbnailObjectKey:
  • capturedAt:
  • uploadedAt:
  • gpsLat:
  • gpsLon:
  • gpsAccuracyMeters:
  • gpsAssociationStatus:
  • createdAt:
  • updatedAt:

plant_disease_diagnosis

AI-powered disease diagnosis for a FieldObservation photo.

Properties as follows:

  • id:
  • observationId: FieldObservation id
  • status:
  • modelName:
  • modelVersion:
  • predictedClass:
  • crop:
  • disease:
  • healthStatus:
  • confidence:
  • severity:
  • isConfident:
  • topPredictions:
  • recommendations:
  • inferenceDurationMs:
  • errorCode:
  • errorMessage:
  • retryable:
  • traceId:
  • processingStartedAt:
  • completedAt:
  • failedAt:
  • createdAt:
  • updatedAt:

Flight

erDiagram
"flight" {
  String id PK
  DateTime scheduledAt
  FlightStatus status
  String plotId FK
  String pilotId FK
  DateTime createdAt
  DateTime updatedAt
}
"image" {
  String id PK
  String url
  String type "nullable"
  String flightId FK "nullable"
  String plotId FK
  DateTime createdAt
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"plot" {
  String id PK
  String name
  PlotSource source
  Float surface
  String userId FK "nullable"
  String rpgSourceKey UK "nullable"
  String rpgIdParcel "nullable"
  String rpgCultivationCode "nullable"
  String rpgGroupCode "nullable"
  String rpgCultureD1 "nullable"
  String rpgCultureD2 "nullable"
  String rpgCategory "nullable"
  Int rpgSourceYear "nullable"
  String rpgDatasetId FK "nullable"
  String rpgRegionCode "nullable"
  String rpgImportJobId FK "nullable"
  DateTime rpgImportedAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"flight" }|--|| "plot" : plot
"flight" }|--|| "user" : pilot
"image" }|--o| "flight" : flight
"image" }|--|| "plot" : plot
"plot" }o--o| "user" : user

flight

Drone flight mission over a Plot flown by a User (pilot).

Properties as follows:

  • id:
  • scheduledAt:
  • status:
  • plotId: Plot id
  • pilotId: User id
  • createdAt:
  • updatedAt:

image

Image captured during a Flight over a Plot.

Properties as follows:

  • id:
  • url:
  • type:
  • flightId: Flight id
  • plotId: Plot id
  • createdAt:

Marketplace

erDiagram
"pilot_profile" {
  String id PK
  String userId FK,UK
  String companyName "nullable"
  Json interventionZone "nullable"
  Boolean available
  String certifications
  Int score
  Float latitude "nullable"
  Float longitude "nullable"
  String stripeConnectedAccountId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"farmer_profile" {
  String id PK
  String userId FK,UK
  String farmName
  String address "nullable"
  String postalCode "nullable"
  String city "nullable"
  String agricultureType "nullable"
  Int parcelCount "nullable"
  Float totalSurface "nullable"
  String crops
  String cooperativeId FK "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"drone" {
  String id PK
  String pilotProfileId FK
  String name
  String model
  DateTime createdAt
}
"sensor" {
  String id PK
  String pilotProfileId FK
  String sensor_kind_code FK
  String name
  DateTime createdAt
}
"sensor_kind" {
  String code PK
  String name
  String description "nullable"
  Boolean active
  DateTime createdAt
  DateTime updatedAt
}
"analysis_option" {
  String id PK
  String code UK
  String name
  String description "nullable"
  Float basePrice "nullable"
  Float pricePerHa "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"mission_pricing_config" {
  String id PK
  String name
  MissionPricingConfigStatus status
  Float missionBasePrice
  Float missionPricePerHa
  Float minimumMissionPrice
  Float platformFeeRate
  DateTime publishedAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"mission_group" {
  String id PK
  DateTime createdAt
}
"mission" {
  String id PK
  String farmerId FK
  Json location
  Float totalSurface
  MissionType type
  DateTime windowStart
  DateTime windowEnd
  Float price
  String pricing_config_id FK "nullable"
  MissionStatus status
  DateTime publishedAt "nullable"
  String pilotProfileId FK "nullable"
  String groupId FK "nullable"
  String validationRejectionReason "nullable"
  String instructions "nullable"
  String product "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"mission_plot" {
  String missionId FK
  String plotId FK
}
"mission_required_sensor" {
  String missionId FK
  String sensor_kind_code FK
}
"analysis_option_sensor_type" {
  String analysis_option_id FK
  String sensor_kind_code FK
}
"mission_analysis" {
  String mission_id FK
  String analysis_option_id FK
}
"deliverable" {
  String id PK
  String missionId FK,UK
  String files
  String comment "nullable"
  DateTime createdAt
}
"payment" {
  String id PK
  String missionId FK,UK
  Float amount
  PaymentStatus status
  String stripePaymentId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"cooperative" {
  String id PK
  String name
  String joinCode UK
  String createdById FK
  DateTime createdAt
  DateTime updatedAt
}
"plot" {
  String id PK
  String name
  PlotSource source
  Float surface
  String userId FK "nullable"
  String rpgSourceKey UK "nullable"
  String rpgIdParcel "nullable"
  String rpgCultivationCode "nullable"
  String rpgGroupCode "nullable"
  String rpgCultureD1 "nullable"
  String rpgCultureD2 "nullable"
  String rpgCategory "nullable"
  Int rpgSourceYear "nullable"
  String rpgDatasetId FK "nullable"
  String rpgRegionCode "nullable"
  String rpgImportJobId FK "nullable"
  DateTime rpgImportedAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"pilot_profile" |o--|| "user" : user
"farmer_profile" |o--|| "user" : user
"farmer_profile" }o--o| "cooperative" : cooperative
"drone" }|--|| "pilot_profile" : pilotProfile
"sensor" }|--|| "pilot_profile" : pilotProfile
"sensor" }|--|| "sensor_kind" : sensorKind
"mission" }|--|| "user" : farmer
"mission" }o--o| "mission_pricing_config" : pricingConfig
"mission" }o--o| "pilot_profile" : pilotProfile
"mission" }o--o| "mission_group" : group
"mission_plot" }|--|| "mission" : mission
"mission_plot" }|--|| "plot" : plot
"mission_required_sensor" }|--|| "mission" : mission
"mission_required_sensor" }|--|| "sensor_kind" : sensorKind
"analysis_option_sensor_type" }|--|| "analysis_option" : analysisOption
"analysis_option_sensor_type" }|--|| "sensor_kind" : sensorKind
"mission_analysis" }|--|| "mission" : mission
"mission_analysis" }|--|| "analysis_option" : analysisOption
"deliverable" |o--|| "mission" : mission
"payment" |o--|| "mission" : mission
"cooperative" }|--|| "user" : createdBy
"plot" }o--o| "user" : user

pilot_profile

Drone pilot profile and capabilities for a User.

Properties as follows:

  • id:
  • userId: User id
  • companyName:
  • interventionZone:
  • available:
  • certifications:
  • score:
  • latitude:
  • longitude:
  • stripeConnectedAccountId:
  • createdAt:
  • updatedAt:

farmer_profile

Farmer profile with farm details for a User, optionally in a Cooperative.

Properties as follows:

  • id:
  • userId: User id
  • farmName:
  • address:
  • postalCode:
  • city:
  • agricultureType:
  • parcelCount:
  • totalSurface:
  • crops:
  • cooperativeId: Cooperative id
  • createdAt:
  • updatedAt:

drone

Drone equipment owned by a PilotProfile.

Properties as follows:

  • id:
  • pilotProfileId: PilotProfile id
  • name:
  • model:
  • createdAt:

sensor

Sensor equipment owned by a PilotProfile, of a specific SensorKind.

Properties as follows:

sensor_kind

Sensor type / model catalog.

Properties as follows:

  • code:
  • name:
  • description:
  • active:
  • createdAt:
  • updatedAt:

analysis_option

Analysis product option for Missions.

Properties as follows:

  • id:
  • code:
  • name:
  • description:
  • basePrice:
  • pricePerHa:
  • createdAt:
  • updatedAt:

mission_pricing_config

Pricing template for Missions.

Properties as follows:

  • id:
  • name:
  • status:
  • missionBasePrice:
  • missionPricePerHa:
  • minimumMissionPrice:
  • platformFeeRate:
  • publishedAt:
  • createdAt:
  • updatedAt:

mission_group

Logical grouping of Missions (e.g. batch).

Properties as follows:

  • id:
  • createdAt:

mission

Farmer-to-pilot mission (spraying / inspection) from a User (farmer), optionally assigned to a PilotProfile.

Properties as follows:

  • id:
  • farmerId: User id
  • location:
  • totalSurface:
  • type:
  • windowStart:
  • windowEnd:
  • price:
  • pricing_config_id: MissionPricingConfig id
  • status:
  • publishedAt:
  • pilotProfileId: PilotProfile id
  • groupId: MissionGroup id
  • validationRejectionReason:
  • instructions:
  • product:
  • createdAt:
  • updatedAt:

mission_plot

Join table linking Missions to Plots.

Properties as follows:

mission_required_sensor

Required SensorKind for a Mission.

Properties as follows:

analysis_option_sensor_type

Compatible SensorKinds for an AnalysisOption.

Properties as follows:

mission_analysis

Selected AnalysisOption for a Mission.

Properties as follows:

deliverable

Mission deliverable files.

Properties as follows:

  • id:
  • missionId: Mission id
  • files:
  • comment:
  • createdAt:

payment

Mission payment via Stripe.

Properties as follows:

  • id:
  • missionId: Mission id
  • amount:
  • status:
  • stripePaymentId:
  • createdAt:
  • updatedAt:

Plot

erDiagram
"plot" {
  String id PK
  String name
  PlotSource source
  Float surface
  String userId FK "nullable"
  String rpgSourceKey UK "nullable"
  String rpgIdParcel "nullable"
  String rpgCultivationCode "nullable"
  String rpgGroupCode "nullable"
  String rpgCultureD1 "nullable"
  String rpgCultureD2 "nullable"
  String rpgCategory "nullable"
  Int rpgSourceYear "nullable"
  String rpgDatasetId FK "nullable"
  String rpgRegionCode "nullable"
  String rpgImportJobId FK "nullable"
  DateTime rpgImportedAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"culture" {
  String id PK
  String userId FK
  String name "nullable"
  String cultureType
  DateTime startedAt
  DateTime harvestedAt "nullable"
  DateTime createdAt
}
"culture_plot" {
  String cultureId FK
  String plotId FK
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"plot" }o--o| "user" : user
"culture" }|--|| "user" : user
"culture_plot" }|--|| "culture" : culture
"culture_plot" }|--|| "plot" : plot

plot

Agricultural parcel / field owned by a User.

Properties as follows:

  • id:
  • name:
  • source:
  • surface:
  • userId: User id
  • rpgSourceKey:
  • rpgIdParcel:
  • rpgCultivationCode:
  • rpgGroupCode:
  • rpgCultureD1:
  • rpgCultureD2:
  • rpgCategory:
  • rpgSourceYear:
  • rpgDatasetId: RpgDataset id
  • rpgRegionCode:
  • rpgImportJobId: RpgImportJob id
  • rpgImportedAt:
  • createdAt:
  • updatedAt:

culture

Crop cycle on one or more Plots.

Properties as follows:

  • id:
  • userId: User id
  • name:
  • cultureType:
  • startedAt:
  • harvestedAt:
  • createdAt:

culture_plot

Join table linking Cultures to Plots.

Properties as follows:

Preview

erDiagram
"parcel_preview" {
  String id PK
  String renderKey UK
  String observationKey
  String parcelId
  String productId
  DateTime acquiredAt
  PreviewLayer layer
  String renderVersion
  PreviewStatus status
  String objectKey "nullable"
  String contentType "nullable"
  Int width "nullable"
  Int height "nullable"
  BigInt sizeBytes "nullable"
  String checksum "nullable"
  String errorCode "nullable"
  String errorMessage "nullable"
  Int attemptCount
  DateTime generatedAt "nullable"
  DateTime expiresAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"plot" {
  String id PK
  String name
  PlotSource source
  Float surface
  String userId FK "nullable"
  String rpgSourceKey UK "nullable"
  String rpgIdParcel "nullable"
  String rpgCultivationCode "nullable"
  String rpgGroupCode "nullable"
  String rpgCultureD1 "nullable"
  String rpgCultureD2 "nullable"
  String rpgCategory "nullable"
  Int rpgSourceYear "nullable"
  String rpgDatasetId FK "nullable"
  String rpgRegionCode "nullable"
  String rpgImportJobId FK "nullable"
  DateTime rpgImportedAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}

parcel_preview

Generated map preview tile for a parcel.

Properties as follows:

  • id:
  • renderKey:
  • observationKey:
  • parcelId:
  • productId:
  • acquiredAt:
  • layer:
  • renderVersion:
  • status:
  • objectKey:
  • contentType:
  • width:
  • height:
  • sizeBytes:
  • checksum:
  • errorCode:
  • errorMessage:
  • attemptCount:
  • generatedAt:
  • expiresAt:
  • createdAt:
  • updatedAt:

Processing

erDiagram
"processing_cube" {
  String id PK
  String parcelId FK
  String geometryHash
  String zarrObjectKey
  String currentManifestObjectKey "nullable"
  Int revision
  String leaseToken UK "nullable"
  String leaseOwner "nullable"
  DateTime leaseAcquiredAt "nullable"
  DateTime leaseExpiresAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"processing_observation" {
  String id PK
  String observationKey UK
  String cubeId FK "nullable"
  String parcelId
  String productId FK
  DateTime acquiredAt
  ProcessingObservationOutcome outcome
  String skipReason "nullable"
  String manifestObjectKey "nullable"
  Int cubeRevision "nullable"
  Float validPixelRatio "nullable"
  Float invalidPixelPercent "nullable"
  String algorithmVersion
  Json metadata
  DateTime createdAt
  DateTime updatedAt
}
"parcel_index_analysis" {
  String id PK
  String observationKey FK
  String parcelId FK
  String productId FK
  DateTime acquiredAt
  String indexCode
  Float valueMean "nullable"
  Float historicalMean "nullable"
  Float historicalStd "nullable"
  Float zScore "nullable"
  Float trendSlope "nullable"
  Float affectedAreaPercent "nullable"
  Float innerAffectedAreaPercent "nullable"
  Float edgeAffectedAreaPercent "nullable"
  ParcelAnalysisSeverity severity
  Float confidence
  Json metadata
  DateTime createdAt
  DateTime updatedAt
}
"parcel_anomaly" {
  String id PK
  String anomalyKey UK
  String observationKey FK
  String parcelId FK
  String productId FK
  DateTime acquiredAt
  String indexCode
  ParcelAnomalyType type
  ParcelAnomalySpatialPattern spatialPattern "nullable"
  ParcelAnalysisSeverity severity
  Float confidence
  String description
  DateTime detectedAt
  Json metadata
}
"parcel_analysis_decision" {
  String id PK
  String observationKey FK,UK
  String parcelId FK
  String productId FK
  DateTime acquiredAt
  ParcelAnalysisDecisionStatus status
  ParcelAnalysisSeverity summarySeverity
  Float confidence
  String phenologyStage "nullable"
  String suppressionReason "nullable"
  Json hypotheses
  String explanation
  Json limitations
  Json metadata
  DateTime createdAt
  DateTime updatedAt
}
"parcel_recommended_action" {
  String id PK
  String actionKey UK
  String analysisDecisionId FK
  String actionCode
  String label
  ParcelRecommendedActionPriority priority
  Float confidence
  String reason
  ParcelRecommendedActionStatus status
  Json metadata
  DateTime createdAt
  DateTime updatedAt
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"plot" {
  String id PK
  String name
  PlotSource source
  Float surface
  String userId FK "nullable"
  String rpgSourceKey UK "nullable"
  String rpgIdParcel "nullable"
  String rpgCultivationCode "nullable"
  String rpgGroupCode "nullable"
  String rpgCultureD1 "nullable"
  String rpgCultureD2 "nullable"
  String rpgCategory "nullable"
  Int rpgSourceYear "nullable"
  String rpgDatasetId FK "nullable"
  String rpgRegionCode "nullable"
  String rpgImportJobId FK "nullable"
  DateTime rpgImportedAt "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"satellite_product" {
  String id PK
  SatelliteProvider provider
  String providerProductId
  String satellite
  String productLevel
  String providerTileId "nullable"
  String tileId FK
  DateTime acquiredAt
  DateTime publishedAt "nullable"
  Float cloudCoverPercent "nullable"
  SatelliteProductStatus status
  String rawObjectKey "nullable"
  String checksum "nullable"
  BigInt sizeBytes "nullable"
  String errorCode "nullable"
  String errorMessage "nullable"
  Int attemptCount
  String claimToken UK "nullable"
  DateTime claimedAt "nullable"
  DateTime claimExpiresAt "nullable"
  Json metadata
  String ingestionRunId FK "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"processing_cube" }|--|| "plot" : parcel
"processing_observation" }o--o| "processing_cube" : cube
"processing_observation" }|--|| "satellite_product" : product
"parcel_index_analysis" }|--|| "processing_observation" : observation
"parcel_index_analysis" }|--|| "plot" : parcel
"parcel_index_analysis" }|--|| "satellite_product" : product
"parcel_anomaly" }|--|| "processing_observation" : observation
"parcel_anomaly" }|--|| "plot" : parcel
"parcel_anomaly" }|--|| "satellite_product" : product
"parcel_analysis_decision" ||--|| "processing_observation" : observation
"parcel_analysis_decision" }|--|| "plot" : parcel
"parcel_analysis_decision" }|--|| "satellite_product" : product
"parcel_recommended_action" }|--|| "parcel_analysis_decision" : analysisDecision
"plot" }o--o| "user" : user

processing_cube

Zarr-based processing cube for a Plot’s time series.

Properties as follows:

  • id:
  • parcelId: Plot id
  • geometryHash:
  • zarrObjectKey:
  • currentManifestObjectKey:
  • revision:
  • leaseToken:
  • leaseOwner:
  • leaseAcquiredAt:
  • leaseExpiresAt:
  • createdAt:
  • updatedAt:

processing_observation

Processing result linking a SatelliteProduct to a Plot.

Properties as follows:

  • id:
  • observationKey:
  • cubeId: ProcessingCube id
  • parcelId: Plot id
  • productId: SatelliteProduct id
  • acquiredAt:
  • outcome:
  • skipReason:
  • manifestObjectKey:
  • cubeRevision:
  • validPixelRatio:
  • invalidPixelPercent:
  • algorithmVersion:
  • metadata:
  • createdAt:
  • updatedAt:

parcel_index_analysis

Vegetation index analysis for a ProcessingObservation on a Plot.

Properties as follows:

  • id:
  • observationKey: ProcessingObservation id
  • parcelId: Plot id
  • productId: SatelliteProduct id
  • acquiredAt:
  • indexCode:
  • valueMean:
  • historicalMean:
  • historicalStd:
  • zScore:
  • trendSlope:
  • affectedAreaPercent:
  • innerAffectedAreaPercent:
  • edgeAffectedAreaPercent:
  • severity:
  • confidence:
  • metadata:
  • createdAt:
  • updatedAt:

parcel_anomaly

Detected anomaly in vegetation patterns on a Plot from a ProcessingObservation.

Properties as follows:

  • id:
  • anomalyKey:
  • observationKey: ProcessingObservation id
  • parcelId: Plot id
  • productId: SatelliteProduct id
  • acquiredAt:
  • indexCode:
  • type:
  • spatialPattern:
  • severity:
  • confidence:
  • description:
  • detectedAt:
  • metadata:

parcel_analysis_decision

Final analysis decision for a ProcessingObservation on a Plot.

Properties as follows:

  • id:
  • observationKey: ProcessingObservation id
  • parcelId: Plot id
  • productId: SatelliteProduct id
  • acquiredAt:
  • status:
  • summarySeverity:
  • confidence:
  • phenologyStage:
  • suppressionReason:
  • hypotheses:
  • explanation:
  • limitations:
  • metadata:
  • createdAt:
  • updatedAt:

Recommended action derived from a ParcelAnalysisDecision.

Properties as follows:

  • id:
  • actionKey:
  • analysisDecisionId: ParcelAnalysisDecision id
  • actionCode:
  • label:
  • priority:
  • confidence:
  • reason:
  • status:
  • metadata:
  • createdAt:
  • updatedAt:

RpgImport

erDiagram
"rpg_dataset" {
  String id PK
  Int sourceYear
  String label
  RpgDatasetStatus status
  DateTime activatedAt "nullable"
  DateTime archivedAt "nullable"
  Int plotCount
  DateTime createdAt
  DateTime updatedAt
}
"rpg_import_job" {
  String id PK
  String datasetId FK
  String sourceUrl
  Json sourceUrls "nullable"
  RpgImportJobMode mode
  RpgImportJobStatus status
  RpgImportScopeType scopeType
  String scopeCode
  String scopeLabel "nullable"
  String createdByUserId FK
  DateTime startedAt "nullable"
  DateTime finishedAt "nullable"
  DateTime activatedAt "nullable"
  DateTime cancelledAt "nullable"
  DateTime createdAt
  DateTime updatedAt
  Int sourceYear
  String sourceLabel "nullable"
  Int importedParcelCount
  Int insertedPlotCount
  Int updatedPlotCount
  Int skippedPlotCount
  Int downloadedPartCount
  Int expectedPartCount
  String errorMessage "nullable"
}
"rpg_import_log" {
  String id PK
  String jobId FK
  DateTime timestamp
  RpgImportLogLevel level
  String step
  String message
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"rpg_import_job" }|--|| "rpg_dataset" : dataset
"rpg_import_job" }|--|| "user" : createdByUser
"rpg_import_log" }|--|| "rpg_import_job" : job

rpg_dataset

RPG (Registre Parcellaire Graphique) dataset for a given year.

Properties as follows:

  • id:
  • sourceYear:
  • label:
  • status:
  • activatedAt:
  • archivedAt:
  • plotCount:
  • createdAt:
  • updatedAt:

rpg_import_job

Import job for RPG parcel data, created by a User, for an RpgDataset.

Properties as follows:

  • id:
  • datasetId: RpgDataset id
  • sourceUrl:
  • sourceUrls:
  • mode:
  • status:
  • scopeType:
  • scopeCode:
  • scopeLabel:
  • createdByUserId: User id
  • startedAt:
  • finishedAt:
  • activatedAt:
  • cancelledAt:
  • createdAt:
  • updatedAt:
  • sourceYear:
  • sourceLabel:
  • importedParcelCount:
  • insertedPlotCount:
  • updatedPlotCount:
  • skippedPlotCount:
  • downloadedPartCount:
  • expectedPartCount:
  • errorMessage:

rpg_import_log

Processing log entry for an RpgImportJob.

Properties as follows:

  • id:
  • jobId: RpgImportJob id
  • timestamp:
  • level:
  • step:
  • message:

Satellite

erDiagram
"satellite_product" {
  String id PK
  SatelliteProvider provider
  String providerProductId
  String satellite
  String productLevel
  String providerTileId "nullable"
  String tileId FK
  DateTime acquiredAt
  DateTime publishedAt "nullable"
  Float cloudCoverPercent "nullable"
  SatelliteProductStatus status
  String rawObjectKey "nullable"
  String checksum "nullable"
  BigInt sizeBytes "nullable"
  String errorCode "nullable"
  String errorMessage "nullable"
  Int attemptCount
  String claimToken UK "nullable"
  DateTime claimedAt "nullable"
  DateTime claimExpiresAt "nullable"
  Json metadata
  String ingestionRunId FK "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"satellite_ingestion_run" {
  String id PK
  DateTime startedAt "nullable"
  DateTime finishedAt "nullable"
  SatelliteIngestionRunStatus status
  SatelliteIngestionRunTrigger trigger
  DateTime queryFrom
  DateTime queryTo
  String requestedTileId FK "nullable"
  String requestedProviderProductId "nullable"
  String requestedByUserId FK "nullable"
  Int productCount
  Int downloadedCount
  Int skippedCount
  Int failedCount
  Json metadata
  DateTime createdAt
  DateTime updatedAt
}
"sentinel2_tile" {
  String id PK
  Int sourceEpsg "nullable"
  Json properties
  DateTime createdAt
  DateTime updatedAt
}
"user" {
  String id PK
  String name
  String email UK
  Boolean emailVerified
  String image "nullable"
  AccountType accountType
  Boolean onboardingCompleted
  String stripeCustomerId "nullable"
  DateTime createdAt
  DateTime updatedAt
}
"satellite_product" }|--|| "sentinel2_tile" : tile
"satellite_product" }|--o| "satellite_ingestion_run" : ingestionRun
"satellite_ingestion_run" }o--o| "sentinel2_tile" : requestedTile
"satellite_ingestion_run" }o--o| "user" : requestedByUser

satellite_product

Satellite imagery product (Sentinel-2 scene) on a Sentinel2Tile.

Properties as follows:

  • id:
  • provider:
  • providerProductId:
  • satellite:
  • productLevel:
  • providerTileId:
  • tileId: Sentinel2Tile id
  • acquiredAt:
  • publishedAt:
  • cloudCoverPercent:
  • status:
  • rawObjectKey:
  • checksum:
  • sizeBytes:
  • errorCode:
  • errorMessage:
  • attemptCount:
  • claimToken:
  • claimedAt:
  • claimExpiresAt:
  • metadata:
  • ingestionRunId: SatelliteIngestionRun id
  • createdAt:
  • updatedAt:

satellite_ingestion_run

Ingestion run that discovers and downloads satellite products, optionally targeting a Sentinel2Tile.

Properties as follows:

  • id:
  • startedAt:
  • finishedAt:
  • status:
  • trigger:
  • queryFrom:
  • queryTo:
  • requestedTileId: Sentinel2Tile id
  • requestedProviderProductId:
  • requestedByUserId: User id
  • productCount:
  • downloadedCount:
  • skippedCount:
  • failedCount:
  • metadata:
  • createdAt:
  • updatedAt:

sentinel2_tile

Sentinel-2 tile grid reference containing SatelliteProducts.

Properties as follows:

  • id:
  • sourceEpsg:
  • properties:
  • createdAt:
  • updatedAt: