Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions schema/Alert/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
# Alert

## Overview
An **Alert** is a notification or exception raised during shipment transit — delays, damage, customs holds, SLA breaches, or failed deliveries.
Schema definition for Alert in the Beckn Protocol v2.0.1

## IRI
`https://schema.beckn.org/logistics/Alert`
## Versions

## Alert Types
- DELAY: Shipment running late
- DAMAGE: Package damaged in transit
- LOSS: Package lost
- FAILED_DELIVERY: Delivery attempt failed
- SLA_BREACH: Service level agreement breached
- CUSTOMS_HOLD: Interstate/international customs hold

## Version
Current version: **v2.0** — [v2.0/attributes.yaml](./v2.0/attributes.yaml)
| Version | attributes.yaml | attributes.jsonschema.yaml | context.jsonld | vocab.jsonld | README |
|---|---|---|---|---|---|
| **v2.0** | [https://schema.beckn.io/Alert/v2.0/attributes.yaml](https://schema.beckn.io/Alert/v2.0/attributes.yaml) | [https://schema.beckn.io/Alert/v2.0/attributes.jsonschema.yaml](https://schema.beckn.io/Alert/v2.0/attributes.jsonschema.yaml) | [https://schema.beckn.io/Alert/v2.0/context.jsonld](https://schema.beckn.io/Alert/v2.0/context.jsonld) | [https://schema.beckn.io/Alert/v2.0/vocab.jsonld](https://schema.beckn.io/Alert/v2.0/vocab.jsonld) | [https://schema.beckn.io/Alert/v2.0/README.md](https://schema.beckn.io/Alert/v2.0/README.md) |
28 changes: 28 additions & 0 deletions schema/Alert/v2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Alert — v2.0

Schema definition for Alert in the Beckn Protocol v2.0.1

## Files

| File | Purpose |
|---|---|
| [https://schema.beckn.io/Alert/attributes.yaml](https://schema.beckn.io/Alert/attributes.yaml) | OpenAPI schema envelope (latest path) |
| [https://schema.beckn.io/Alert/v2.0/attributes.yaml](https://schema.beckn.io/Alert/v2.0/attributes.yaml) | OpenAPI schema envelope (versioned path) |
| [https://schema.beckn.io/Alert/attributes.jsonschema.yaml](https://schema.beckn.io/Alert/attributes.jsonschema.yaml) | JSON Schema document (latest path) |
| [https://schema.beckn.io/Alert/v2.0/attributes.jsonschema.yaml](https://schema.beckn.io/Alert/v2.0/attributes.jsonschema.yaml) | JSON Schema document (versioned path) |
| [https://schema.beckn.io/Alert/context.jsonld](https://schema.beckn.io/Alert/context.jsonld) | JSON-LD context (latest path) |
| [https://schema.beckn.io/Alert/v2.0/context.jsonld](https://schema.beckn.io/Alert/v2.0/context.jsonld) | JSON-LD context (versioned path) |
| [https://schema.beckn.io/Alert/vocab.jsonld](https://schema.beckn.io/Alert/vocab.jsonld) | RDF vocabulary (latest path) |
| [https://schema.beckn.io/Alert/v2.0/vocab.jsonld](https://schema.beckn.io/Alert/v2.0/vocab.jsonld) | RDF vocabulary (versioned path) |

## Properties

| Property | Required | Type | Description |
|---|---|---|---|
| `@context` | yes | string | - |
| `@type` | yes | string | - |
| `affectedEntities` | no | array | IDs of entities affected (route/order/fulfillment/etc.) |
| `descriptor` | yes | $ref: https://schema.beckn.io/Descriptor/v2.1/attributes.yaml#/components/schemas/Descriptor | - |
| `id` | yes | string | - |
| `severity` | no | string | - |
| `validity` | no | $ref: https://schema.beckn.io/TimePeriod/v2.1/attributes.yaml#/components/schemas/TimePeriod | - |
106 changes: 24 additions & 82 deletions schema/Alert/v2.0/attributes.yaml
Original file line number Diff line number Diff line change
@@ -1,95 +1,37 @@
openapi: 3.1.0
openapi: 3.1.1
info:
title: Alert
version: 2.0.0
description: Schema definition for the Alert entity in the Beckn Logistics domain.
contact:
name: Beckn Foundation
url: https://beckn.org
description: Schema definition for Alert in the Beckn Protocol v2.0.1
license:
name: MIT
url: https://opensource.org/licenses/MIT
paths: {}
name: CC-BY-NC-SA 4.0 International
contact:
name: Beckn Labs
url: https://beckn.io
components:
schemas:
Alert:
type: object
x-iri: https://schema.beckn.io/Alert/v2.0
description: Schema definition for Alert in the Beckn Protocol v2.0.1
title: Alert
description: >
An Alert is a notification or warning related to a shipment, such as delays,
exceptions, damage reports, or SLA breaches. Maps to beckn:Event.
required:
- id
- type
- severity
- message
- timestamp
type: object
properties:
id:
type: string
example: "ALT-0001"
shipmentId:
type: string
example: "SHP-2024-001234"
type:
type: string
enum:
- DELAY
- DAMAGE
- LOSS
- FAILED_DELIVERY
- CUSTOMS_HOLD
- WEATHER_DISRUPTION
- ROUTE_DEVIATION
- SLA_BREACH
- ADDRESS_ISSUE
- PAYMENT_FAILED
example: "DELAY"
severity:
type: string
enum:
- INFO
- WARNING
- CRITICAL
example: "WARNING"
message:
type: string
example: "Your shipment is delayed by 4 hours due to traffic at NH-44."
cause:
type: string
description: Root cause of the alert
example: "Highway accident causing major traffic backlog"
impactedETA:
type: string
format: date-time
description: Revised ETA due to alert
timestamp:
type: string
format: date-time
resolvedAt:
type: string
format: date-time
status:
type: string
enum:
- OPEN
- ACKNOWLEDGED
- RESOLVED
example: "OPEN"
notificationChannels:
affectedEntities:
description: IDs of entities affected (route/order/fulfillment/etc.)
type: array
items:
type: string
enum:
- SMS
- EMAIL
- PUSH
- WHATSAPP
example: ["SMS", "PUSH"]
actionRequired:
type: boolean
description: Whether customer action is needed
example: false
suggestedAction:
descriptor:
$ref: https://schema.beckn.io/Descriptor/v2.1/attributes.yaml#/components/schemas/Descriptor
id:
type: string
example: "Please reschedule delivery for tomorrow."
severity:
type: string
validity:
$ref: https://schema.beckn.io/TimePeriod/v2.1/attributes.yaml#/components/schemas/TimePeriod
required:
- id
- descriptor
additionalProperties: false
x-tags:
- common
18 changes: 18 additions & 0 deletions schema/Alert/v2.0/context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@context": {
"@version": 1.1,
"@protected": true,
"xsd": "http://www.w3.org/2001/XMLSchema#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"beckn": "https://schema.beckn.io/LinkedData/v2.1/context.jsonld",
"Alert": "beckn:Alert",
"@context": "beckn:@context",
"@type": "beckn:@type",
"affectedEntities": "beckn:affectedEntities",
"descriptor": "beckn:descriptor",
"id": "beckn:id",
"severity": "beckn:severity",
"validity": "beckn:validity"
}
}
37 changes: 37 additions & 0 deletions schema/Alert/v2.0/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$id": "https://schema.beckn.io/Alert/v2.0",
"x-iri": "https://schema.beckn.io/Alert/v2.0",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Schema definition for Alert in the Beckn Protocol v2.0.1",
"title": "Alert",
"type": "object",
"properties": {
"affectedEntities": {
"description": "IDs of entities affected (route/order/fulfillment/etc.)",
"type": "array",
"items": {
"type": "string"
}
},
"descriptor": {
"$ref": "https://schema.beckn.io/Descriptor/v2.1/schema.json"
},
"id": {
"type": "string"
},
"severity": {
"type": "string"
},
"validity": {
"$ref": "https://schema.beckn.io/TimePeriod/v2.1/schema.json"
}
},
"required": [
"id",
"descriptor"
],
"additionalProperties": false,
"x-tags": [
"common"
]
}
68 changes: 68 additions & 0 deletions schema/Alert/v2.0/vocab.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"@context": {
"@version": 1.1,
"beckn": "https://schema.beckn.io/LinkedData/v2.1/context.jsonld",
"owl": "http://www.w3.org/2002/07/owl#",
"schema": "https://schema.org/version/latest/schemaorg-current-https.jsonld",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"Alert": "beckn:Alert",
"@type": "beckn:@type",
"affectedEntities": "beckn:affectedEntities",
"descriptor": "beckn:descriptor",
"id": "beckn:id",
"severity": "beckn:severity",
"validity": "beckn:validity"
},
"@graph": [
{
"@id": "beckn:Alert",
"@type": "rdfs:Class",
"rdfs:label": "Alert",
"rdfs:comment": "Schema definition for Alert in the Beckn Protocol v2.0.1"
},
{
"@id": "beckn:@context",
"@type": "rdf:Property",
"rdfs:label": "@context",
"rdfs:comment": "TODO: Description Needed - @context"
},
{
"@id": "beckn:@type",
"@type": "rdf:Property",
"rdfs:label": "@type",
"rdfs:comment": "TODO: Description Needed - @type"
},
{
"@id": "beckn:affectedEntities",
"@type": "rdf:Property",
"rdfs:label": "affected Entities",
"rdfs:comment": "IDs of entities affected (route/order/fulfillment/etc.)"
},
{
"@id": "beckn:descriptor",
"@type": "rdf:Property",
"rdfs:label": "descriptor",
"rdfs:comment": "TODO: Description Needed - descriptor"
},
{
"@id": "beckn:id",
"@type": "rdf:Property",
"rdfs:label": "id",
"rdfs:comment": "TODO: Description Needed - id"
},
{
"@id": "beckn:severity",
"@type": "rdf:Property",
"rdfs:label": "severity",
"rdfs:comment": "TODO: Description Needed - severity"
},
{
"@id": "beckn:validity",
"@type": "rdf:Property",
"rdfs:label": "validity",
"rdfs:comment": "TODO: Description Needed - validity"
}
]
}
11 changes: 5 additions & 6 deletions schema/CancellationPolicy/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# CancellationPolicy

## Overview
**CancellationPolicy** defines the terms and charges for cancelling a shipment booking at various stages of the fulfillment lifecycle.
Schema definition for CancellationPolicy in the Beckn Protocol v2.0.1

## IRI
`https://schema.beckn.org/logistics/CancellationPolicy`
## Versions

## Version
Current version: **v2.0** — [v2.0/attributes.yaml](./v2.0/attributes.yaml)
| Version | attributes.yaml | attributes.jsonschema.yaml | context.jsonld | vocab.jsonld | README |
|---|---|---|---|---|---|
| **v2.0** | [https://schema.beckn.io/CancellationPolicy/v2.0/attributes.yaml](https://schema.beckn.io/CancellationPolicy/v2.0/attributes.yaml) | [https://schema.beckn.io/CancellationPolicy/v2.0/attributes.jsonschema.yaml](https://schema.beckn.io/CancellationPolicy/v2.0/attributes.jsonschema.yaml) | [https://schema.beckn.io/CancellationPolicy/v2.0/context.jsonld](https://schema.beckn.io/CancellationPolicy/v2.0/context.jsonld) | [https://schema.beckn.io/CancellationPolicy/v2.0/vocab.jsonld](https://schema.beckn.io/CancellationPolicy/v2.0/vocab.jsonld) | [https://schema.beckn.io/CancellationPolicy/v2.0/README.md](https://schema.beckn.io/CancellationPolicy/v2.0/README.md) |
23 changes: 23 additions & 0 deletions schema/CancellationPolicy/v2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# CancellationPolicy — v2.0

Schema definition for CancellationPolicy in the Beckn Protocol v2.0.1

## Files

| File | Purpose |
|---|---|
| [https://schema.beckn.io/CancellationPolicy/attributes.yaml](https://schema.beckn.io/CancellationPolicy/attributes.yaml) | OpenAPI schema envelope (latest path) |
| [https://schema.beckn.io/CancellationPolicy/v2.0/attributes.yaml](https://schema.beckn.io/CancellationPolicy/v2.0/attributes.yaml) | OpenAPI schema envelope (versioned path) |
| [https://schema.beckn.io/CancellationPolicy/attributes.jsonschema.yaml](https://schema.beckn.io/CancellationPolicy/attributes.jsonschema.yaml) | JSON Schema document (latest path) |
| [https://schema.beckn.io/CancellationPolicy/v2.0/attributes.jsonschema.yaml](https://schema.beckn.io/CancellationPolicy/v2.0/attributes.jsonschema.yaml) | JSON Schema document (versioned path) |
| [https://schema.beckn.io/CancellationPolicy/context.jsonld](https://schema.beckn.io/CancellationPolicy/context.jsonld) | JSON-LD context (latest path) |
| [https://schema.beckn.io/CancellationPolicy/v2.0/context.jsonld](https://schema.beckn.io/CancellationPolicy/v2.0/context.jsonld) | JSON-LD context (versioned path) |
| [https://schema.beckn.io/CancellationPolicy/vocab.jsonld](https://schema.beckn.io/CancellationPolicy/vocab.jsonld) | RDF vocabulary (latest path) |
| [https://schema.beckn.io/CancellationPolicy/v2.0/vocab.jsonld](https://schema.beckn.io/CancellationPolicy/v2.0/vocab.jsonld) | RDF vocabulary (versioned path) |

## Properties

| Property | Required | Type | Description |
|---|---|---|---|
| `@context` | no | string | CPD |
| `@type` | no | string | - |
Loading