Skip to content

Commit

Permalink
feat(RUP-398): Implementar mockup: gestion de turnos de aceso directo…
Browse files Browse the repository at this point in the history
… (API)
  • Loading branch information
aldoEMatamala committed Jun 3, 2024
1 parent 4e7a13a commit b73d319
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
29 changes: 29 additions & 0 deletions modules/rup/routes/habilitacionTemporalProf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { MongoQuery, ResourceBase, SearchFieldsType } from '@andes/core';
import { HabilitacionTemporalProf } from '../schemas/habilitacionTemporalProf';
import { ISnomedConcept, SnomedConcept } from '../../rup/schemas/snomed-concept';

class HabilitacionTemporalProfResource extends ResourceBase {
Model = HabilitacionTemporalProf;
resourceName = 'habilitacionTemporalProf';
searchFields = {
profesional: {
field: 'profesional._id',
fn: MongoQuery.equalMatch
},
horaInicio: {
field: 'horaInicio',
fn: (value) => (MongoQuery.matchDate(value))
},
horaFin: {
field: 'horaFin',
fn: (value) => (MongoQuery.matchDate(value))
},
prestacion: {
field: 'prestacion',
fn: MongoQuery.equalMatch
},
};
}

export const HabilitacionTemporalProfCtr = new HabilitacionTemporalProfResource({});
export const HabilitacionTemporalProfRouter = HabilitacionTemporalProfCtr.makeRoutes();
23 changes: 23 additions & 0 deletions modules/rup/schemas/habilitacionTemporalProf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as mongoose from 'mongoose';
import { ISnomedConcept, SnomedConcept } from '../../rup/schemas/snomed-concept';

export const HabilitacionTemporalProfSchema = new mongoose.Schema({
id: mongoose.Types.ObjectId,
profesionalHabilitado: {
nombre: String,
apellido: String,
documento: Number,
id: { type: mongoose.Schema.Types.ObjectId, ref: 'profesional' }
},
prestacion: mongoose.SchemaTypes.ObjectId,
horaInicio: {
type: Date,
required: true
},
horaFin: {
type: Date,
required: true
},

});
export const HabilitacionTemporalProf = mongoose.model('habilitacionTemporalProf', HabilitacionTemporalProfSchema, 'habiilitacionTemporalProf');

0 comments on commit b73d319

Please sign in to comment.