Skip to content

Commit

Permalink
Merge pull request #122 from nginformatica/fix/importer-documents-sst
Browse files Browse the repository at this point in the history
fix: types documents
  • Loading branch information
danielamarioti authored Oct 11, 2024
2 parents 3e6abf5 + fe6c16c commit a50d9ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 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.134",
"version": "0.0.1-alpha.135",
"description": "A small library to expose the broker types",
"typings": "index.d.ts",
"types": "index.d.ts",
Expand Down
25 changes: 15 additions & 10 deletions src/ttalk/schemas/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ const CostCenter = t.type({
description: t.string
})

const Responsible = t.type({
erpId: t.string,
name: t.string,
individualRegistration: t.string,
birthday: datetime,
gender: t.union([t.literal(0), t.literal(1)]),
})
const Responsible = t.intersection([
t.type({
erpId: t.string,
name: t.string,
birthday: datetime,
}),
t.partial({
individualRegistration: t.string,
gender: t.union([t.literal(0), t.literal(1)]),
})
])


export const DocumentInfo = t.intersection([
t.type({
Expand Down Expand Up @@ -49,15 +54,15 @@ export const DocumentInfo = t.intersection([
/** Data de Fim */
endDate: datetime,
/** Data de Vencimento */
expirationDate: datetime,
expirationDate: t.union([datetime, t.null]),
/** Código da Versão */
review: t.string,
/** Tipo de Deficiência */
responsible: Responsible,
/** Número do documento */
documentNumber: t.string,
documentNumber: t.union([t.string, t.null]),
/** Sigla Estado */
documentState: t.string,
documentState: t.union([t.string, t.null]),
/** Entidade */
entityType: t.union([
t.literal(0),
Expand Down

0 comments on commit a50d9ef

Please sign in to comment.