Skip to content

Commit

Permalink
Merge pull request #83 from nginformatica/feature/remove-obrigatory-f…
Browse files Browse the repository at this point in the history
…ield
  • Loading branch information
jacksjm authored Feb 28, 2023
2 parents 15ae296 + 3861132 commit 32b4311
Show file tree
Hide file tree
Showing 9 changed files with 305 additions and 273 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quirons-broker",
"version": "0.0.1-alpha.100",
"version": "0.0.1-alpha.101",
"description": "A small library to expose the broker types",
"main": "index.ts",
"typings": "index.d.ts",
Expand Down
72 changes: 38 additions & 34 deletions src/inventory/schema/CostCenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,45 +113,49 @@ export const CostCenterReturn = t.type({

export const CostCenterError = t.type({
Header: HeaderReturn,
Content: t.type({
ReturnContent: t.union([
t.string,
t.type({
Error: t.string
Content: t.intersection([
t.type({
ProcessingInformation: t.type({
Status: t.union([
t.literal('Error'),
t.literal('ERROR'),
t.literal('error')
]),
ProcessedOn: t.union([datetime, date]),
Details: t.array(t.intersection([
t.type({
Code: t.string,
Message: t.string,
}),
t.partial({
DetailedMessage: nullable(t.string),
HelpUrl: nullable(t.string),
helpUrl: nullable(t.string)
})
]))
}),
ReceivedMessage: t.type({
UUID: t.string,
Event: t.union([
t.literal('upsert'),
t.literal('delete'),
t.literal('Upsert'),
t.literal('Delete'),
t.literal('UPSERT'),
t.literal('DELETE')
]),
SentBy: t.string
})
]),
ProcessingInformation: t.type({
Status: t.union([
t.literal('Error'),
t.literal('ERROR'),
t.literal('error')
]),
ProcessedOn: t.union([datetime, date]),
Details: t.array(t.intersection([
}),
t.partial({
ReturnContent: t.union([
t.string,
t.type({
Code: t.string,
Message: t.string,
}),
t.partial({
DetailedMessage: nullable(t.string),
HelpUrl: nullable(t.string),
helpUrl: nullable(t.string)
Error: t.string
})
]))
}),
ReceivedMessage: t.type({
UUID: t.string,
Event: t.union([
t.literal('upsert'),
t.literal('delete'),
t.literal('Upsert'),
t.literal('Delete'),
t.literal('UPSERT'),
t.literal('DELETE')
]),
SentBy: t.string
})
})
])
})

export const CostCenterInfo = t.type({
Expand Down
72 changes: 38 additions & 34 deletions src/inventory/schema/Item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,45 +130,49 @@ export const ItemReturn = t.type({

export const ItemError = t.type({
Header: HeaderReturn,
Content: t.type({
ReturnContent: t.union([
t.string,
t.type({
Error: t.string
Content: t.intersection([
t.type({
ProcessingInformation: t.type({
Status: t.union([
t.literal('Error'),
t.literal('ERROR'),
t.literal('error')
]),
ProcessedOn: t.union([datetime, date]),
Details: t.array(t.intersection([
t.type({
Code: t.string,
Message: t.string,
}),
t.partial({
DetailedMessage: nullable(t.string),
HelpUrl: nullable(t.string),
helpUrl: nullable(t.string)
})
]))
}),
ReceivedMessage: t.type({
UUID: t.string,
Event: t.union([
t.literal('upsert'),
t.literal('delete'),
t.literal('Upsert'),
t.literal('Delete'),
t.literal('UPSERT'),
t.literal('DELETE')
]),
SentBy: t.string
})
]),
ProcessingInformation: t.type({
Status: t.union([
t.literal('Error'),
t.literal('ERROR'),
t.literal('error')
]),
ProcessedOn: t.union([datetime, date]),
Details: t.array(t.intersection([
}),
t.partial({
ReturnContent: t.union([
t.string,
t.type({
Code: t.string,
Message: t.string,
}),
t.partial({
DetailedMessage: nullable(t.string),
HelpUrl: nullable(t.string),
helpUrl: nullable(t.string)
Error: t.string
})
]))
}),
ReceivedMessage: t.type({
UUID: t.string,
Event: t.union([
t.literal('upsert'),
t.literal('delete'),
t.literal('Upsert'),
t.literal('Delete'),
t.literal('UPSERT'),
t.literal('DELETE')
]),
SentBy: t.string
})
})
])
})

export const ItemInfo = t.type({
Expand Down
72 changes: 38 additions & 34 deletions src/inventory/schema/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,45 +143,49 @@ export const RequestReturn = t.type({

export const RequestError = t.type({
Header: HeaderReturn,
Content: t.type({
ReturnContent: t.union([
t.string,
t.type({
Error: t.string
Content: t.intersection([
t.type({
ProcessingInformation: t.type({
Status: t.union([
t.literal('Error'),
t.literal('ERROR'),
t.literal('error')
]),
ProcessedOn: t.union([datetime, date]),
Details: t.array(t.intersection([
t.type({
Code: t.string,
Message: t.string,
}),
t.partial({
DetailedMessage: nullable(t.string),
HelpUrl: nullable(t.string),
helpUrl: nullable(t.string)
})
]))
}),
ReceivedMessage: t.type({
UUID: t.string,
Event: t.union([
t.literal('upsert'),
t.literal('delete'),
t.literal('Upsert'),
t.literal('Delete'),
t.literal('UPSERT'),
t.literal('DELETE')
]),
SentBy: t.string
})
]),
ProcessingInformation: t.type({
Status: t.union([
t.literal('Error'),
t.literal('ERROR'),
t.literal('error')
]),
ProcessedOn: t.union([datetime, date]),
Details: t.array(t.intersection([
}),
t.partial({
ReturnContent: t.union([
t.string,
t.type({
Code: t.string,
Message: t.string,
}),
t.partial({
DetailedMessage: nullable(t.string),
HelpUrl: nullable(t.string),
helpUrl: nullable(t.string)
Error: t.string
})
]))
}),
ReceivedMessage: t.type({
UUID: t.string,
Event: t.union([
t.literal('upsert'),
t.literal('delete'),
t.literal('Upsert'),
t.literal('Delete'),
t.literal('UPSERT'),
t.literal('DELETE')
]),
SentBy: t.string
})
})
])
})

export const RequestInfo = t.type({
Expand Down
72 changes: 38 additions & 34 deletions src/inventory/schema/Seller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,45 +113,49 @@ export const SellerReturn = t.type({

export const SellerError = t.type({
Header: HeaderReturn,
Content: t.type({
ReturnContent: t.union([
t.string,
t.type({
Error: t.string
Content: t.intersection([
t.type({
ProcessingInformation: t.type({
Status: t.union([
t.literal('Error'),
t.literal('ERROR'),
t.literal('error')
]),
ProcessedOn: t.union([datetime, date]),
Details: t.array(t.intersection([
t.type({
Code: t.string,
Message: t.string,
}),
t.partial({
DetailedMessage: nullable(t.string),
HelpUrl: nullable(t.string),
helpUrl: nullable(t.string)
})
]))
}),
ReceivedMessage: t.type({
UUID: t.string,
Event: t.union([
t.literal('upsert'),
t.literal('delete'),
t.literal('Upsert'),
t.literal('Delete'),
t.literal('UPSERT'),
t.literal('DELETE')
]),
SentBy: t.string
})
]),
ProcessingInformation: t.type({
Status: t.union([
t.literal('Error'),
t.literal('ERROR'),
t.literal('error')
]),
ProcessedOn: t.union([datetime, date]),
Details: t.array(t.intersection([
}),
t.partial({
ReturnContent: t.union([
t.string,
t.type({
Code: t.string,
Message: t.string,
}),
t.partial({
DetailedMessage: nullable(t.string),
HelpUrl: nullable(t.string),
helpUrl: nullable(t.string)
Error: t.string
})
]))
}),
ReceivedMessage: t.type({
UUID: t.string,
Event: t.union([
t.literal('upsert'),
t.literal('delete'),
t.literal('Upsert'),
t.literal('Delete'),
t.literal('UPSERT'),
t.literal('DELETE')
]),
SentBy: t.string
})
})
])
})

export const SellerInfo = t.type({
Expand Down
Loading

0 comments on commit 32b4311

Please sign in to comment.