Skip to content

Instantly share code, notes, and snippets.

@jhonylucas74
Created December 4, 2018 18:57
Show Gist options
  • Save jhonylucas74/eaf9316629772bb86e14f779c53b60f7 to your computer and use it in GitHub Desktop.
Save jhonylucas74/eaf9316629772bb86e14f779c53b60f7 to your computer and use it in GitHub Desktop.
const respostaESIG = {
data_especifica: "20-08-2018",
hora_abertura: "18:00",
hora_fechamento: "22:00",
id: 2651839,
maximo_encaixe: 0,
maximo_por_dia: 10,
maximo_retorno: 0,
};
const enviarProBomedico = {
medicoId: /* Id que você usou pra retornar os horários na ESIG
é o mesmo id que está vinculado no S.I.. naquele dipara de agendas.
*/,
referencia: respostaESIG.id,
inicio: respostaESIG.hora_abertura,
fim: respostaESIG.hora_fechamento,
dia: moment(data_especifica).day() == 0 ? 7 : moment(data_especifica).day(),
tipo: 0, // deixa hora marcada como padrão,
duracao: moment(respostaESIG.hora_abertura).diff(moment(respostaESIG.hora_fechamento), 'minutes') / respostaESIG.maximo_por_dia,
limite: respostaESIG.maximo_por_dia,
data: moment(respostaESIG.data_especifica).toDate()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment