Pārlūkot izejas kodu

added leave dataservice

Stephen Wong 2 gadi atpakaļ
vecāks
revīzija
365fa2cfaa

+ 29 - 0
src/FisAppQueryModule/DS/LeaveBalance.dataservice.ts

@@ -0,0 +1,29 @@
+import { HttpService } from "@nestjs/axios";
+import { Observable } from "rxjs";
+import { LeaveBalance, LeaveBalanceUnion } from "../entities/LeaveBalance";
+import { FisCreateMessageUtility } from "../message/fisappmessagejsutility/interface/export";
+import { CommonDataService } from "./Common.dataservice";
+
+
+export class LeaveBalanceDataService extends CommonDataService {
+    
+    static ResponseService:FisCreateMessageUtility = new FisCreateMessageUtility("FisAppID/Name")
+
+    static data:Record<string,any> = {"serviceId": "Leave Balance Data", "parameter": "" };
+
+    constructor(http: HttpService, ucpId: string, data= LeaveBalanceDataService.data){
+        super(http,ucpId, data);
+    }
+
+
+    getData(className,filter,returnFormatType): Observable<typeof LeaveBalanceUnion> {
+       
+            let message : Array<typeof LeaveBalanceUnion> = [];
+            let data: LeaveBalance[] = [];
+ 
+            return this.getDataWithType(filter,className,message,returnFormatType,data)
+
+    }
+    
+    
+}

+ 29 - 0
src/FisAppQueryModule/DS/LeaveHistory.dataservice.ts

@@ -0,0 +1,29 @@
+import { HttpService } from "@nestjs/axios";
+import { Observable } from "rxjs";
+import { LeaveHistory, LeaveHistoryUnion } from "../entities/LeaveHistory";
+import { FisCreateMessageUtility } from "../message/fisappmessagejsutility/interface/export";
+import { CommonDataService } from "./Common.dataservice";
+
+
+export class LeaveHistoryDataService extends CommonDataService {
+    
+    static ResponseService:FisCreateMessageUtility = new FisCreateMessageUtility("FisAppID/Name")
+
+    static data:Record<string,any> = {"serviceId": "Leave Application Data", "parameter": "" };
+
+    constructor(http: HttpService, ucpId: string, data= LeaveHistoryDataService.data){
+        super(http,ucpId, data);
+    }
+
+
+    getData(className,filter,returnFormatType): Observable<typeof LeaveHistoryUnion> {
+       
+            let message : Array<typeof LeaveHistoryUnion> = [];
+            let data: LeaveHistory[] = [];
+ 
+            return this.getDataWithType(filter,className,message,returnFormatType,data)
+
+    }
+    
+    
+}

+ 29 - 0
src/FisAppQueryModule/DS/LeaveTypeProfile.dataservice.ts

@@ -0,0 +1,29 @@
+import { HttpService } from "@nestjs/axios";
+import { Observable } from "rxjs";
+import { LeaveTypeProfileUnion } from "../entities/LeaveTypeProfile";
+import { FisCreateMessageUtility, LeaveTypeProfile } from "../message/fisappmessagejsutility/interface/export";
+import { CommonDataService } from "./Common.dataservice";
+
+
+export class LeaveTypeProfileDataService extends CommonDataService {
+    
+    static ResponseService:FisCreateMessageUtility = new FisCreateMessageUtility("FisAppID/Name")
+
+    static data:Record<string,any> = {"serviceId": "Leave Type Profile Data", "parameter": "" };
+
+    constructor(http: HttpService, ucpId: string, data= LeaveTypeProfileDataService.data){
+        super(http,ucpId, data);
+    }
+
+
+    getData(className,filter,returnFormatType): Observable<typeof LeaveTypeProfileUnion> {
+       
+            let message : Array<typeof LeaveTypeProfileUnion> = [];
+            let data: LeaveTypeProfile[] = [];
+ 
+            return this.getDataWithType(filter,className,message,returnFormatType,data)
+
+    }
+    
+    
+}

+ 6 - 0
src/FisAppQueryModule/Manager.dataservice.ts

@@ -16,6 +16,9 @@ import { CMAccountProfileDataService } from './DS/CMAccountProfile.dataservice';
 import { CommonDataService } from './DS/Common.dataservice';
 import { DocumentDataService } from './DS/Document.dataservice';
 import { FisServiceProgramProfileDataService } from './DS/FisServiceProgramProfile.dataservice';
+import { LeaveBalanceDataService } from './DS/LeaveBalance.dataservice';
+import { LeaveHistoryDataService } from './DS/LeaveHistory.dataservice';
+import { LeaveTypeProfileDataService } from './DS/LeaveTypeProfile.dataservice';
 import { OrganisationProfileDataService } from './DS/OrganisationProfile.dataservice';
 import { ProductProfileDataService } from './DS/ProductProfile.dataservice';
 import { RoleTypeProfileDataService } from './DS/RoleTypeProfileDataService';
@@ -64,6 +67,9 @@ export class DataServiceManager {
                     DataServiceManager.classes['ServiceProgramProfileDataService'] = new ServiceProgramProfileDataService(this.http, DataServiceManager.ucpId);
                     DataServiceManager.classes['FisServiceProgramProfileDataService'] = new FisServiceProgramProfileDataService(this.http, DataServiceManager.ucpId);
                     DataServiceManager.classes['RoleTypeProfileDataService'] = new RoleTypeProfileDataService(this.http, DataServiceManager.ucpId);
+                    DataServiceManager.classes['LeaveBalanceDataService'] = new LeaveBalanceDataService(this.http, DataServiceManager.ucpId);
+                    DataServiceManager.classes['LeaveHistoryDataService'] = new LeaveHistoryDataService(this.http, DataServiceManager.ucpId);
+                    DataServiceManager.classes['LeaveTypeProfileDataService'] = new LeaveTypeProfileDataService(this.http, DataServiceManager.ucpId);
 
                 },
 

+ 105 - 0
src/FisAppQueryModule/entities/LeaveBalance.ts

@@ -0,0 +1,105 @@
+import { ArgsType,    Field,    Int,  ObjectType } from '@nestjs/graphql';
+import {   SummaryResponse } from './DescendentDataServiceArgument.entity';
+import { LeaveBalance as LeaveBalanceType } from '../message/fisappmessagejsutility/interface/export';
+import { CustomFilter } from './CustomFilter.validate';
+import { CustomReturnFormatType } from './CustomReturnFormatType.validate';
+import { Validate } from 'class-validator'
+import { StatusResponse } from './StatusResponse';
+
+
+export const thisClassName = "LeaveBalanceDataService";
+
+@ObjectType()
+@ArgsType() 
+export class LeaveBalanceArgument {
+
+    className: string = thisClassName;
+
+    
+    @Field({ nullable: true })
+    @Validate(CustomFilter)
+    filter?: string; 
+
+    @Field({ nullable: true })
+    @Validate(CustomReturnFormatType)
+    returnFormatType?: string;
+ 
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveBalanceMessage {
+
+    @Field(type => [LeaveBalance]) 
+    data?: LeaveBalance[]; 
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveBalance implements LeaveBalanceType{
+    @Field(type=> Int,{ nullable: true})
+    emp_role_id: number;
+
+    @Field(type=> Int,{ nullable: true})
+    emp_leave_mas_id: number;
+
+    @Field({ nullable: true})
+    ps_emp_leave_master_emp_lv_pro_rate: string;
+
+    @Field({ nullable: true})
+    ps_emp_leave_master_emp_lv_mas_create_ty: string;
+
+    @Field({ nullable: true})
+    ps_leave_desc: string;
+
+    @Field(type=> Int,{ nullable: true})
+    emp_lv_mas_year: number;
+
+    @Field({ nullable: true})
+    emp_lv_mas_carr_forw: string;
+
+    @Field(type=> Int,{ nullable: true})
+    emp_lv_mas_max_time: number;
+
+    @Field({ nullable: true})
+    emp_lv_pro_rate: string;
+
+    @Field(type=> Int,{ nullable: true})
+    emp_lv_taken: number;
+
+    @Field({ nullable: true})
+    emp_lv_mas_earned: string;
+
+    @Field({ nullable: true})
+    emp_lv_mas_entitled: string;
+
+    @Field({ nullable: true})
+    emp_lv_mas_brou_forw: string;
+
+    @Field({ nullable: true})
+    ps_emp_leave_master_emp_lv_mas_open: string;
+
+    @Field({ nullable: true})
+    ps_emp_leave_master_emp_lv_mas_allow_car: string;
+
+    @Field(type=> Int,{ nullable: true})
+    emp_lv_balance: number; 
+   
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveBalanceUnion {
+
+    @Field(type=> SummaryResponse, { nullable: true})
+    SummaryResponse?:SummaryResponse;
+
+    @Field(type=> StatusResponse, { nullable: true})
+    StatusResponse?:StatusResponse;
+
+    @Field(type=> LeaveBalanceMessage, { nullable: true})
+    LeaveBalanceMessage?:LeaveBalanceMessage
+}

+ 96 - 0
src/FisAppQueryModule/entities/LeaveHistory.ts

@@ -0,0 +1,96 @@
+import { ArgsType,    Field,   Int,  ObjectType } from '@nestjs/graphql';
+import {   SummaryResponse } from './DescendentDataServiceArgument.entity';
+import { LeaveHistory as LeaveHistoryType } from '../message/fisappmessagejsutility/interface/export';
+import { CustomFilter } from './CustomFilter.validate';
+import { CustomReturnFormatType } from './CustomReturnFormatType.validate';
+import { Validate } from 'class-validator'
+import { StatusResponse } from './StatusResponse';
+
+
+export const thisClassName = "LeaveHistoryDataService";
+
+@ObjectType()
+@ArgsType() 
+export class LeaveHistoryArgument {
+
+    className: string = thisClassName;
+
+    
+    @Field({ nullable: true })
+    @Validate(CustomFilter)
+    filter?: string; 
+
+    @Field({ nullable: true })
+    @Validate(CustomReturnFormatType)
+    returnFormatType?: string;
+ 
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveHistoryMessage {
+
+    @Field(type => [LeaveHistory]) 
+    data?: LeaveHistory[]; 
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveHistory implements LeaveHistoryType{
+    @Field(type=> Int,{ nullable: true})
+    ps_doc_id: number;
+    
+    @Field(type=> Int,{ nullable: true})
+    ps_doc_leave_emp_role_id: number;
+
+    @Field({ nullable: true})
+    emp_lv_mas_open: string;
+
+    @Field(type=> Int,{ nullable: true})
+    ps_doc_leave_ps_leave_mas_id: number; 
+
+    @Field(type=> Int,{ nullable: true})
+    emp_lv_mas_year: number;
+
+    @Field(type=> Int,{ nullable: true})
+    ps_emp_leave_master_ps_leave_id:number;
+
+    @Field({ nullable: true})
+    ps_doc_header_ps_doc_ref_no: string;
+
+    @Field({ nullable: true})
+    ps_leave_profile_ps_leave_desc: string;
+
+    @Field({ nullable: true})
+    ps_doc_header_ps_doc_status: string;
+
+    @Field({ nullable: true})
+    ps_doc_leave_ps_dt_applied: string; 
+
+    @Field({ nullable: true})
+    ps_doc_leave_ps_dt_from: string; 
+
+    @Field({ nullable: true})
+    ps_doc_leave_ps_dt_to: string; 
+
+    @Field({ nullable: true})
+    ps_doc_leave_ps_days: string; 
+   
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveHistoryUnion {
+
+    @Field(type=> SummaryResponse, { nullable: true})
+    SummaryResponse?:SummaryResponse;
+
+    @Field(type=> StatusResponse, { nullable: true})
+    StatusResponse?:StatusResponse;
+
+    @Field(type=> LeaveHistoryMessage, { nullable: true})
+    LeaveHistoryMessage?:LeaveHistoryMessage
+}

+ 79 - 0
src/FisAppQueryModule/entities/LeaveTypeProfile.ts

@@ -0,0 +1,79 @@
+import { ArgsType,    Field,    Int,  ObjectType } from '@nestjs/graphql';
+import {   SummaryResponse } from './DescendentDataServiceArgument.entity';
+import { LeaveTypeProfile as LeaveTypeProfileType } from '../message/fisappmessagejsutility/interface/export';
+import { CustomFilter } from './CustomFilter.validate';
+import { CustomReturnFormatType } from './CustomReturnFormatType.validate';
+import { Validate } from 'class-validator'
+import { StatusResponse } from './StatusResponse';
+
+
+export const thisClassName = "LeaveTypeProfileDataService";
+
+@ObjectType()
+@ArgsType() 
+export class LeaveTypeProfileArgument {
+
+    className: string = thisClassName;
+
+    
+    @Field({ nullable: true })
+    @Validate(CustomFilter)
+    filter?: string; 
+
+    @Field({ nullable: true })
+    @Validate(CustomReturnFormatType)
+    returnFormatType?: string;
+ 
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveTypeProfileMessage {
+
+    @Field(type => [LeaveTypeProfile]) 
+    data?: LeaveTypeProfile[]; 
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveTypeProfile implements LeaveTypeProfileType{
+
+    @Field({ nullable: true})
+    ps_emp_leave_master_emp_lv_mas_brou_forw: string;
+
+    @Field(type=> Int,{ nullable: true})
+    emp_lv_mas_year: number;
+
+    @Field({ nullable: true})
+    ps_emp_leave_master_emp_lv_mas_entitled: string;
+
+    @Field(type=> Int,{ nullable: true})
+    emp_role_id: number; 
+
+    @Field(type=> Int,{ nullable: true})
+    emp_leave_mas_id: number; 
+    
+    @Field({ nullable: true})
+    ps_leave_profile_ps_leave_desc: string;
+
+    @Field({ nullable: true})
+    emp_lv_pro_rate: string;  
+   
+}
+
+
+@ObjectType()
+@ArgsType() 
+export class LeaveTypeProfileUnion {
+
+    @Field(type=> SummaryResponse, { nullable: true})
+    SummaryResponse?:SummaryResponse;
+
+    @Field(type=> StatusResponse, { nullable: true})
+    StatusResponse?:StatusResponse;
+
+    @Field(type=> LeaveTypeProfileMessage, { nullable: true})
+    LeaveTypeProfileMessage?:LeaveTypeProfileMessage
+}

+ 20 - 1
src/FisAppQueryModule/fisAppQuery.resolver.ts

@@ -19,6 +19,9 @@ import { RoleTypeProfileArgument, RoleTypeProfileUnion } from './entities/RoleTy
 import { APReceiptDocumentUnion } from './entities/APReceiptDocument';
 import { ARReceiptDocumentUnion } from './entities/ARReceiptDocument';
 import { ProductProfileArgument, ProductProfileUnion } from './entities/ProductProfile';
+import { LeaveBalanceArgument, LeaveBalanceUnion } from './entities/LeaveBalance';
+import { LeaveHistoryArgument, LeaveHistoryUnion } from './entities/LeaveHistory';
+import { LeaveTypeProfileArgument, LeaveTypeProfileUnion } from './entities/LeaveTypeProfile';
 
 @Resolver(() => DataServiceMessage)
 export class FisAppQueryResolver {
@@ -124,9 +127,25 @@ export class FisAppQueryResolver {
 
   @Query(() => ProductProfileUnion, { name: 'ProductProfileQuery' })
   getProductProfileDataService(@Args() dataservice: ProductProfileArgument): Observable<typeof ProductProfileUnion> {
+    const { filter, returnFormatType } = dataservice;
+    return this.fisAppQueryService.ProductProfileGetData(filter, returnFormatType);
+  }
 
+  @Query(() => LeaveBalanceUnion, { name: 'LeaveBalanceQuery' })
+  getLeaveBalanceDataService(@Args() dataservice: LeaveBalanceArgument): Observable<typeof LeaveBalanceUnion> {
     const { filter, returnFormatType } = dataservice;
+    return this.fisAppQueryService.LeaveBalanceGetData(filter, returnFormatType);
+  }
 
-    return this.fisAppQueryService.ProductProfileGetData(filter, returnFormatType);
+  @Query(() => LeaveHistoryUnion, { name: 'LeaveHistoryQuery' })
+  getLeaveHistoryDataService(@Args() dataservice: LeaveHistoryArgument): Observable<typeof LeaveHistoryUnion> {
+    const { filter, returnFormatType } = dataservice;
+    return this.fisAppQueryService.LeaveHistoryGetData(filter, returnFormatType);
+  }
+
+  @Query(() => LeaveTypeProfileUnion, { name: 'LeaveTypeProfileQuery' })
+  getLeaveTypeProfileDataService(@Args() dataservice: LeaveTypeProfileArgument): Observable<typeof LeaveTypeProfileUnion> {
+    const { filter, returnFormatType } = dataservice;
+    return this.fisAppQueryService.LeaveTypeProfileGetData(filter, returnFormatType);
   }
 }

+ 30 - 10
src/FisAppQueryModule/fisAppQuery.service.ts

@@ -14,6 +14,9 @@ import { CMAccountProfileUnion, thisClassName as  CMAccountProfileClassName } fr
 import { DataServiceMessage } from './entities/DataService.entity';
 import { DocumentUnion, thisClassName as DocumentClassName } from './entities/Document';
 import { FisServiceProgramUnion , thisClassName as FisServiceProgramClassName } from './entities/FisServiceProgram';
+import { LeaveBalanceUnion, thisClassName as LeaveBalanceClassName } from './entities/LeaveBalance';
+import { LeaveHistoryUnion, thisClassName as LeaveHistoryClassName } from './entities/LeaveHistory';
+import { LeaveTypeProfileUnion, thisClassName as LeaveTypeProfileClassName } from './entities/LeaveTypeProfile';
 import { OrganisationProfileUnion, thisClassName as OrganisationProfileClassName } from './entities/OrganisationProfile';
 import { ProductProfileUnion, thisClassName as ProductProfileClassName } from './entities/ProductProfile';
 import { RoleTypeProfileUnion, thisClassName as RoleTypeProfileClassName } from './entities/RoleTypeProfile';
@@ -173,14 +176,31 @@ export class FisAppQueryService {
     return getDataObservable;  
   }
 
-  // observableHttp(...data): Observable<any> {
-  //   return new Observable((subscriber) => {
-  //     data.forEach((url) => {
-  //       subscriber.next(
-  //         this.http.get(url).pipe(map((response) => response.data)),
-  //       );
-  //     });
-  //     subscriber.complete();
-  //   });
-  // }
+  LeaveBalanceGetData(filter,returnFormatType) : Observable<typeof LeaveBalanceUnion> {
+    let className = LeaveBalanceClassName
+    let getDataObservable : Observable<typeof LeaveBalanceUnion> = DataServiceManager.getDataServiceData(className,filter, returnFormatType, 1).pipe(map(x=>{
+        return x;
+    }));
+
+    return getDataObservable;  
+  }
+
+  LeaveHistoryGetData(filter,returnFormatType) : Observable<typeof LeaveHistoryUnion> {
+    let className = LeaveHistoryClassName
+    let getDataObservable : Observable<typeof LeaveHistoryUnion> = DataServiceManager.getDataServiceData(className,filter, returnFormatType, 1).pipe(map(x=>{
+        return x;
+    }));
+
+    return getDataObservable;  
+  }
+
+  LeaveTypeProfileGetData(filter,returnFormatType) : Observable<typeof LeaveTypeProfileUnion> {
+    let className = LeaveTypeProfileClassName
+    let getDataObservable : Observable<typeof LeaveTypeProfileUnion> = DataServiceManager.getDataServiceData(className,filter, returnFormatType, 1).pipe(map(x=>{
+        return x;
+    }));
+
+    return getDataObservable;  
+  }
+
 }

+ 1 - 1
src/FisAppQueryModule/message/fisappmessagejsutility

@@ -1 +1 @@
-Subproject commit 9b2fb6d77fcab0f353416cf669a495f63e12af25
+Subproject commit 2fd2fd27913104ed447674eea500a186fac5916f

+ 78 - 0
src/schema.gql

@@ -354,6 +354,81 @@ type FisServiceProgramUnion {
   SummaryResponse: SummaryResponse
 }
 
+type LeaveBalance {
+  emp_leave_mas_id: Int
+  emp_lv_balance: Int
+  emp_lv_mas_brou_forw: String
+  emp_lv_mas_carr_forw: String
+  emp_lv_mas_earned: String
+  emp_lv_mas_entitled: String
+  emp_lv_mas_max_time: Int
+  emp_lv_mas_year: Int
+  emp_lv_pro_rate: String
+  emp_lv_taken: Int
+  emp_role_id: Int
+  ps_emp_leave_master_emp_lv_mas_allow_car: String
+  ps_emp_leave_master_emp_lv_mas_create_ty: String
+  ps_emp_leave_master_emp_lv_mas_open: String
+  ps_emp_leave_master_emp_lv_pro_rate: String
+  ps_leave_desc: String
+}
+
+type LeaveBalanceMessage {
+  data: [LeaveBalance!]!
+}
+
+type LeaveBalanceUnion {
+  LeaveBalanceMessage: LeaveBalanceMessage
+  StatusResponse: StatusResponse
+  SummaryResponse: SummaryResponse
+}
+
+type LeaveHistory {
+  emp_lv_mas_open: String
+  emp_lv_mas_year: Int
+  ps_doc_header_ps_doc_ref_no: String
+  ps_doc_header_ps_doc_status: String
+  ps_doc_id: Int
+  ps_doc_leave_emp_role_id: Int
+  ps_doc_leave_ps_days: String
+  ps_doc_leave_ps_dt_applied: String
+  ps_doc_leave_ps_dt_from: String
+  ps_doc_leave_ps_dt_to: String
+  ps_doc_leave_ps_leave_mas_id: Int
+  ps_emp_leave_master_ps_leave_id: Int
+  ps_leave_profile_ps_leave_desc: String
+}
+
+type LeaveHistoryMessage {
+  data: [LeaveHistory!]!
+}
+
+type LeaveHistoryUnion {
+  LeaveHistoryMessage: LeaveHistoryMessage
+  StatusResponse: StatusResponse
+  SummaryResponse: SummaryResponse
+}
+
+type LeaveTypeProfile {
+  emp_leave_mas_id: Int
+  emp_lv_mas_year: Int
+  emp_lv_pro_rate: String
+  emp_role_id: Int
+  ps_emp_leave_master_emp_lv_mas_brou_forw: String
+  ps_emp_leave_master_emp_lv_mas_entitled: String
+  ps_leave_profile_ps_leave_desc: String
+}
+
+type LeaveTypeProfileMessage {
+  data: [LeaveTypeProfile!]!
+}
+
+type LeaveTypeProfileUnion {
+  LeaveTypeProfileMessage: LeaveTypeProfileMessage
+  StatusResponse: StatusResponse
+  SummaryResponse: SummaryResponse
+}
+
 type OrganisationProfile {
   class_code: String
   class_desc: String
@@ -449,6 +524,9 @@ type Query {
   CMAccountProfileQuery(filter: String, returnFormatType: String): CMAccountProfileUnion!
   DocumentQuery(filter: String, returnFormatType: String): DocumentUnion!
   FisServiceProgramProfileQuery(filter: String, returnFormatType: String): FisServiceProgramUnion!
+  LeaveBalanceQuery(filter: String, returnFormatType: String): LeaveBalanceUnion!
+  LeaveHistoryQuery(filter: String, returnFormatType: String): LeaveHistoryUnion!
+  LeaveTypeProfileQuery(filter: String, returnFormatType: String): LeaveTypeProfileUnion!
   OrganisationProfileQuery(filter: String, returnFormatType: String): OrganisationProfileUnion!
   ProductProfileQuery(filter: String, returnFormatType: String): ProductProfileUnion!
   RoleTypeProfileQuery(filter: String, returnFormatType: String): RoleTypeProfileUnion!