mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add domain layer
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
import { ProcessesService } from "src/app/services/processes.service";
|
||||
import { GenericBehaviorProcess } from "src/app/domain/process/GenericBehaviorTaskActions"
|
||||
import { task } from "src/app/models/ExpedientTaskModalPage";
|
||||
|
||||
function prohibited (a: any) {
|
||||
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
|
||||
console.log("first(): called");
|
||||
};
|
||||
}
|
||||
|
||||
function permited (a: any) {
|
||||
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
|
||||
console.log("first(): called");
|
||||
};
|
||||
}
|
||||
|
||||
export class DispatchDomain {
|
||||
|
||||
static processes: ProcessesService
|
||||
|
||||
/**
|
||||
* @pt arquivar
|
||||
* @event 'Concluir Despacho'
|
||||
* @param note
|
||||
* @param documents
|
||||
* @param serialNumber
|
||||
* @returns
|
||||
*/
|
||||
@prohibited({userRoleId:[], permission:[]})
|
||||
static async archive(note:string, documents:any, serialNumber) {
|
||||
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Arquivo",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
return await this.processes.CompleteTask(body).toPromise()
|
||||
}
|
||||
|
||||
/**
|
||||
* @pt executado
|
||||
* @event 'Tarefa de Despacho', 'Reexecutar Despacho'
|
||||
* @param note
|
||||
* @param documents
|
||||
* @param serialNumber
|
||||
* @returns
|
||||
* @emits finish proceses
|
||||
*/
|
||||
static async executed(note:string, documents:any, serialNumber) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Conhecimento",
|
||||
"ActionTypeId": 104,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
return await this.processes.CompleteTask(body).toPromise()
|
||||
}
|
||||
|
||||
/**
|
||||
* @pt reexecutar
|
||||
* @event 'Concluir Despacho'
|
||||
* @param note
|
||||
* @param documents
|
||||
* @param serialNumber
|
||||
* @returns
|
||||
*/
|
||||
static async rerun(note:string, documents:any, serialNumber) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Reexecução",
|
||||
"ActionTypeId": 100000010,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
return await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @event 'Concluir Despacho', 'Reexecutar Despacho', 'Tarefa de Despacho'
|
||||
* @param SerialNumber
|
||||
*/
|
||||
static async sendToPending(SerialNumber) {
|
||||
this.processes.SetTaskToPending(SerialNumber).toPromise();
|
||||
}
|
||||
|
||||
/**
|
||||
* @pt pedido de parecer
|
||||
* @event 'Reexecutar Despacho', 'Tarefa de Despacho'
|
||||
*/
|
||||
static async requestAppear() {
|
||||
return GenericBehaviorProcess.requestAppear(task, {})
|
||||
}
|
||||
|
||||
/**
|
||||
* @pt Efetuar Despacho
|
||||
* @event 'Concluir Despacho', 'Reexecutar Despacho', 'Tarefa de Despacho'
|
||||
*/
|
||||
static async PerformeDispatch(body) {
|
||||
return GenericBehaviorProcess.PerformeDispatch(body)
|
||||
}
|
||||
|
||||
/**
|
||||
* @pt marcar reunião
|
||||
* @event 'Concluir Despacho', 'Reexecutar Despacho', 'Tarefa de Despacho'
|
||||
*/
|
||||
static async setUpMeeting() {}
|
||||
|
||||
/**
|
||||
* @event 'Reexecutar Despacho' , 'Tarefa de Despacho'
|
||||
*/
|
||||
static async Delegar(task, note, taskParticipants) {
|
||||
let body = {
|
||||
"SerialNumber": task.SerialNumber,
|
||||
"DispatchDocId": task.DocId,
|
||||
"FolderID": task.FolderId || task.FolderID,
|
||||
"Subject": task.Folio,
|
||||
"Comment": note,
|
||||
"DelegatedUserEmail": taskParticipants[0].EmailAddress,
|
||||
}
|
||||
|
||||
return this.processes.DelegateTask(body).toPromise()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user