Skip to content

Commit

Permalink
Merge pull request #113 from nginformatica/fix/importer-tests
Browse files Browse the repository at this point in the history
fix: apis sst importer
  • Loading branch information
danielamarioti authored Jul 22, 2024
2 parents eb2c309 + bb5c9c7 commit 6267150
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 44 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.128",
"version": "0.0.1-alpha.129",
"description": "A small library to expose the broker types",
"main": "index.ts",
"typings": "index.d.ts",
Expand Down
35 changes: 18 additions & 17 deletions src/ttalk/schemas/IpeDelivery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,12 @@ export const IpeDeliveryInfo = t.intersection([
caExpirationDate: datetime,
/** Quantidade Entregue */
deliveryAmount: t.number,
/** Motivo */
reason: t.union([
t.literal(0),
t.literal(1),
t.literal(2),
t.literal(3),
t.literal(4),
t.literal(5),
t.literal(6),
t.literal(7),
t.literal(8),
t.literal(9),
]),
/** Indica se é efetivo */
effective: t.boolean,
}),
t.partial({
/** Indica se é efetivo */
effective: t.boolean,
/** Data de Devolução */
returnDate: datetime,
returnDate: t.union([datetime, t.null]),
/** Quantidade Devolvida */
amountReturned: t.number,
/** Motivo da Devolução */
Expand All @@ -49,15 +36,29 @@ export const IpeDeliveryInfo = t.intersection([
t.literal(2),
t.literal(3),
t.literal(4),
t.null
]),
/** Observações */
observation: t.string,
/** Data de Assinatura */
issueDate: datetime,
/** Data da Última Manutenção */
lastMaintenanceDate: datetime,
lastMaintenanceDate: t.union([datetime, t.null]),
/** Custo */
cost: t.number,
/** Motivo */
reason: t.union([
t.literal(0),
t.literal(1),
t.literal(2),
t.literal(3),
t.literal(4),
t.literal(5),
t.literal(6),
t.literal(7),
t.literal(8),
t.literal(9),
]),
})
])
export type IpeDeliveryInfo = t.TypeOf<typeof IpeDeliveryInfo>
Expand Down
20 changes: 12 additions & 8 deletions src/ttalk/schemas/Risk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ const Training = t.type({
])
})

const Periodicity = t.type({
description: t.string,
fromAge: t.number,
toAge: t.number,
periodicity: t.number,
postAdmission: t.number,
})
const Periodicity = t.intersection([
t.type({
fromAge: t.number,
toAge: t.number,
periodicity: t.number,
postAdmission: t.number,
}),
t.partial({
description: t.string,
})
])

const Exam = t.intersection([
t.type({
Expand Down Expand Up @@ -163,7 +167,7 @@ export const RiskInfo = t.intersection([
/** Observações */
observation: t.string,
/**Data de eliminação do risco */
eliminationDate: datetime,
eliminationDate: t.union([datetime, t.null]),
})
])
export type RiskInfo = t.TypeOf<typeof RiskInfo>
Expand Down
12 changes: 6 additions & 6 deletions src/ttalk/schemas/SickNote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ export const SickNoteInfo = t.intersection([
/** Observações */
observation: t.string,
/** Descrição do Tipo de Afastamento */
typeOfAbsence: t.string,
typeOfAbsence: t.union([t.string, t.null]),
/** Descrição do Tipo de Abono */
typeOfAllowance: t.string,
typeOfAllowance: t.union([t.string, t.null]),
/** Data de Início do Afastamento */
absenceStartDate: datetime,
absenceStartDate: t.union([datetime, t.null]),
/** Data de Termino do Afastamento */
absenceEndDate: datetime,
absenceEndDate: t.union([datetime, t.null]),
/** Data de Início do Abono */
allowanceStartDate: datetime,
allowanceStartDate: t.union([datetime, t.null]),
/** Data de Termino do Abono */
allowanceEndDate: datetime,
allowanceEndDate: t.union([datetime, t.null]),
/** Data da Perícia */
reviewDate: datetime,
/** Data de Previsão de Termino do Benefício */
Expand Down
29 changes: 17 additions & 12 deletions src/ttalk/schemas/Vaccine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
import * as t from 'io-ts'
import { Paging } from '../apis/types/totvsApiTypesBase'

const Info = t.type({
description: t.string,
gender: t.union([t.literal(0), t.literal(1), t.literal(2)]),
fromAge: t.number,
toAge: t.number,
reinforcement: t.union([t.literal(0), t.literal(1), t.literal(2)]),
reinforcementInterval: t.number,
secondDoseInterval: t.number,
thirdDoseInterval: t.number,
})
const Info = t.intersection([
t.type({
description: t.string,
gender: t.union([t.literal(0), t.literal(1), t.literal(2)]),
fromAge: t.number,
toAge: t.number,
reinforcement: t.union([t.literal(0), t.literal(1), t.literal(2)]),
reinforcementInterval: t.number,
}),
t.partial({
secondDoseInterval: t.number,
thirdDoseInterval: t.number,
})

])

export const VaccineInfo = t.intersection([
t.type({
Expand All @@ -27,8 +32,6 @@ export const VaccineInfo = t.intersection([
vaccine: Info,
/** Data de Aplicação */
date: t.string,
/** Status */
status: t.union([t.literal(0), t.literal(1), t.literal(2)]),
/** Dose Atual */
currentDose: t.union([t.literal(0), t.literal(1), t.literal(2), t.literal(3)]),
/** Dose */
Expand All @@ -37,6 +40,8 @@ export const VaccineInfo = t.intersection([
t.partial({
/** Lote */
batch: t.string,
/** Status */
status: t.union([t.literal(0), t.literal(1), t.literal(2), t.null]),
})
])
export type VaccineInfo = t.TypeOf<typeof VaccineInfo>
Expand Down

0 comments on commit 6267150

Please sign in to comment.