mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add all enums
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { EventToApproveDetails } from "src/app/models/entiry/agenda/eventToApproveDetails"
|
||||
import { EventOutputDTO } from "../model/eventDTOOutput"
|
||||
import { EAttendeeType, EEventCategory, EEventOwnerType, EEventStatus } from "../model/enums";
|
||||
|
||||
function getTextInsideParentheses(inputString) {
|
||||
var startIndex = inputString.indexOf('(');
|
||||
@@ -18,7 +19,7 @@ export class EventToApproveDetailsMapper {
|
||||
static toDomain(dto: EventOutputDTO): EventToApproveDetails {
|
||||
|
||||
let category;
|
||||
if(dto.category == 1) {
|
||||
if(dto.category == EEventCategory.Oficial) {
|
||||
category = 'Oficial'
|
||||
} else {
|
||||
category = 'Pessoal'
|
||||
@@ -27,40 +28,44 @@ export class EventToApproveDetailsMapper {
|
||||
let color;
|
||||
|
||||
// if(dto.ownerType != 'PR') {
|
||||
if(dto.ownerType == 2) {
|
||||
color = 'MDGPR'
|
||||
} else {
|
||||
color = 'PR'
|
||||
let ownerType;
|
||||
if(dto.ownerType == EEventOwnerType.PR) {
|
||||
ownerType = 'PR'
|
||||
} else if(dto.ownerType == EEventOwnerType.MD) {
|
||||
ownerType = 'MD'
|
||||
} else if(dto.ownerType == EEventOwnerType.Others) {
|
||||
ownerType = 'Other'
|
||||
}
|
||||
|
||||
let activityInstanceName;
|
||||
let taskStatus;
|
||||
|
||||
if(dto.status == 1) {
|
||||
if(dto.status == EEventStatus.Pending) {
|
||||
activityInstanceName = 'Aprovar evento'
|
||||
taskStatus = 'Pending' //////
|
||||
} else if(dto.status == 2) {
|
||||
} else if(dto.status == EEventStatus.Revision) {
|
||||
activityInstanceName = 'Editar evento'
|
||||
taskStatus = 'Revision' //////
|
||||
} else if (dto.status == 3) {
|
||||
} else if (dto.status == EEventStatus.Approved) {
|
||||
activityInstanceName = 'Evento Aprovado'
|
||||
taskStatus = 'Approved' //////
|
||||
} else if (dto.status == 4) {
|
||||
} else if (dto.status == EEventStatus.Declined) {
|
||||
activityInstanceName = 'Declined'
|
||||
taskStatus = 'Declined' //////
|
||||
} else if (dto.status == 5) {
|
||||
} else if (dto.status == EEventStatus.Communicated) {
|
||||
activityInstanceName = 'Communicated'
|
||||
taskStatus = 'Communicated' //////
|
||||
} else if (dto.status == 6) {
|
||||
} else if (dto.status == EEventStatus.ToCommunicate) {
|
||||
activityInstanceName = 'ToCommunicate'
|
||||
taskStatus = 'ToCommunicate' //////
|
||||
}
|
||||
|
||||
function EAttendeeType(num) {
|
||||
if(num == 1) {
|
||||
function FEAttendeeType(num) {
|
||||
if(num == EAttendeeType.Required) {
|
||||
return 'Required'
|
||||
} else if (num == 2) {
|
||||
} else if (num == EAttendeeType.Acknowledgment) {
|
||||
return 'Acknowledgment'
|
||||
} else if (num == 3) {
|
||||
} else if (num == EAttendeeType.Optional) {
|
||||
return 'Optional'
|
||||
}
|
||||
}
|
||||
@@ -115,10 +120,10 @@ export class EventToApproveDetailsMapper {
|
||||
...dto.attendees.map( e => ({
|
||||
Name: e.name,
|
||||
EmailAddress: e.emailAddress,
|
||||
IsRequired: EAttendeeType(e.attendeeType) == 'Required',
|
||||
IsRequired: FEAttendeeType(e.attendeeType) == 'Required',
|
||||
UserType: "GD",
|
||||
wxUserId: e.wxUserId,
|
||||
attendeeType: EAttendeeType(e.attendeeType)
|
||||
attendeeType: FEAttendeeType(e.attendeeType)
|
||||
}))
|
||||
],
|
||||
//"EventOrganizer": "{\"$type\":\"GabineteDigital.k2RESTidentifier_EventPerson, GabineteDigital, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\",\"EmailAddress\":\"agenda.mdgpr@gabinetedigital.local\",\"Name\":\"Agenda do Ministro e Director do Gabinete do PR\",\"IsRequired\":true}",
|
||||
|
||||
Reference in New Issue
Block a user