Skip to content

Commit

Permalink
Merge pull request ONDC-Official#12 from bluecypher/log-validator
Browse files Browse the repository at this point in the history
Log validator
  • Loading branch information
BLR-0118 authored Mar 14, 2023
2 parents 94f2b69 + 17b38cd commit c84c938
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 38 deletions.
2 changes: 1 addition & 1 deletion utilities/log-validation-utility/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The tool is a NODE.js based utility to check the conformance and compliance of t

Log Validation Tool requires [Node.js](https://nodejs.org/) to run.

1. Clone the repository, navigate to Log-Validation_Utility and install the dependencies.
1. Clone the repository, navigate to log-validation-utility and install the dependencies.

```sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,45 @@ onSearchRules = [
},

{
if: { properties: { category_id: { const: "F&B" } } },
if: {
properties: {
category_id: {
enum: [
"F&B",
"Continental",
"Middle Eastern",
"North Indian",
"Pan-Asian",
"Regional Indian",
"South Indian",
"Tex-Mexican",
"World Cuisines",
"Healthy Food",
"Fast Food",
"Desserts",
"Bakes & Cakes",
"Beverages (MTO)",
],
},
},
},
then: {
required: ["@ondc/org/fssai_license_no"],
},
},
{
if: { properties: { category_id: { const: "Packaged Foods" } } },
if: {
properties: {
category_id: {
enum: [
"Gourmet & World Foods",
"Beverages",
"Bakery, Cakes & Dairy",
"Snacks & Branded Foods",
],
},
},
},
then: {
required: ["@ondc/org/fssai_license_no"],
},
Expand All @@ -33,7 +65,18 @@ onSearchRules = [
if: {
properties: {
category_id: {
const: "Packaged Commodities",
enum: [
"Masala & Seasoning",
"Oil & Ghee",
"Foodgrains",
"Eggs, Meat & Fish",
"Cleaning & Household",
"Beauty & Hygiene",
"Kitchen Accessories",
"Baby Care",
"Pet Care",
"Stationery",
],
},
},
},
Expand All @@ -46,7 +89,12 @@ onSearchRules = [
if: {
properties: {
category_id: {
const: "Packaged Foods",
enum: [
"Gourmet & World Foods",
"Beverages",
"Bakery, Cakes & Dairy",
"Snacks & Branded Foods",
],
},
},
},
Expand All @@ -58,7 +106,7 @@ onSearchRules = [
if: {
properties: {
category_id: {
const: "fruits and vegetables",
const: "Fruits and Vegetables",
},
},
},
Expand All @@ -68,13 +116,45 @@ onSearchRules = [
},

{
if: { properties: { category_id: { const: "F&B" } } },
if: {
properties: {
category_id: {
enum: [
"Continental",
"Middle Eastern",
"North Indian",
"Pan-Asian",
"Regional Indian",
"South Indian",
"Tex-Mexican",
"World Cuisines",
"Healthy Food",
"Fast Food",
"Desserts",
"Bakes & Cakes",
"Beverages (MTO)",
"F&B",
],
},
},
},
then: {
required: ["tags"],
},
},
{
if: { properties: { category_id: { const: "Packaged Foods" } } },
if: {
properties: {
category_id: {
enum: [
"Gourmet & World Foods",
"Beverages",
"Bakery, Cakes & Dairy",
"Snacks & Branded Foods",
],
},
},
},
then: {
required: ["tags"],
},
Expand All @@ -83,7 +163,22 @@ onSearchRules = [
if: {
properties: {
category_id: {
const: "f&b",
enum: [
"F&B",
"Continental",
"Middle Eastern",
"North Indian",
"Pan-Asian",
"Regional Indian",
"South Indian",
"Tex-Mexican",
"World Cuisines",
"Healthy Food",
"Fast Food",
"Desserts",
"Bakes & Cakes",
"Beverages (MTO)",
],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,50 +152,80 @@ module.exports = {
},
time: {
type: "object",
properties: {
days: {
type: "string",
},
range: {

oneOf: [
{
type: "object",
properties: {
start: {
days: {
type: "string",
minLength: 4,
maxLength: 4,
},
end: {
type: "string",
minLength: 4,
maxLength: 4,
range: {
type: "object",
properties: {
start: {
type: "string",
minLength: 4,
maxLength: 4,
},
end: {
type: "string",
minLength: 4,
maxLength: 4,
},
},
required: ["start", "end"],
},
schedule: {
type: "object",
properties: {
holidays: {
type: "array",
items: {
type: "string",
},
},
},
required: ["holidays"],
additionalProperties: false,
},
},
required: ["start", "end"],
required: ["days", "range", "schedule"],
},
schedule: {
{
type: "object",
properties: {
holidays: {
type: "array",
items: {
type: "string",
},
},
frequency: {
days: {
type: "string",
format: "duration",
},
times: {
type: "array",
items: {
type: "string",

schedule: {
type: "object",
properties: {
holidays: {
type: "array",
items: {
type: "string",
},
},
frequency: {
type: "string",
format: "duration",
},
times: {
type: "array",
items: {
type: "string",
},
},
},
required: ["holidays", "frequency", "times"],
},
},
required: ["holidays"],
required: ["days", "schedule"],
additionalProperties: false,
},
},
required: ["days", "schedule"],
],
},
},
required: ["id", "address", "gps", "time"],
Expand Down

0 comments on commit c84c938

Please sign in to comment.