diff --git a/AstuteClient2/src/app/app-routing.module.ts b/AstuteClient2/src/app/app-routing.module.ts
index 41f605c..f545174 100644
--- a/AstuteClient2/src/app/app-routing.module.ts
+++ b/AstuteClient2/src/app/app-routing.module.ts
@@ -1,32 +1,34 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import {RouterModule, Routes} from '@angular/router';
-import {CustomerComponent} from './customer/customer.component';
-import {SalesOrderComponent} from './sales-order/sales-order.component';
-import {InvoiceComponent} from './invoice/invoice.component';
-import {HomepageComponent} from './homepage/homepage.component';
-import {InvoiceGenComponent} from './invoice-gen/invoice-gen.component';
-import {InvoicePaymentComponent} from './invoice-payment/invoice-payment.component';
-import {LoginComponent} from './login/login.component';
-
-const routes: Routes = [
- { path: '', redirectTo: 'login', pathMatch: 'full'},
- { path: 'home', redirectTo: 'homepage', pathMatch: 'full'},
- { path: 'homepage', component: HomepageComponent },
- { path: 'customer', component: CustomerComponent },
- { path: 'sales-order', component: SalesOrderComponent },
- { path: 'invoice', component: InvoiceComponent },
- { path: 'invoice-gen', component: InvoiceGenComponent },
- { path: 'invoice-payment', component: InvoicePaymentComponent },
- { path: 'login', component: LoginComponent }
-];
-
-@NgModule({
- exports: [RouterModule],
- imports: [
- CommonModule,
- RouterModule.forRoot(routes)
- ],
- declarations: []
-})
-export class AppRoutingModule { }
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import {RouterModule, Routes} from '@angular/router';
+import {CustomerComponent} from './customer/customer.component';
+import {SalesOrderComponent} from './sales-order/sales-order.component';
+import {InvoiceComponent} from './invoice/invoice.component';
+import {HomepageComponent} from './homepage/homepage.component';
+import {InvoiceGenComponent} from './invoice-gen/invoice-gen.component';
+import {InvoicePaymentComponent} from './invoice-payment/invoice-payment.component';
+import {ServiceTypeComponent} from './service-type/service-type.component';
+import {LoginComponent} from './login/login.component';
+
+const routes: Routes = [
+ { path: '', redirectTo: 'login', pathMatch: 'full'},
+ { path: 'home', redirectTo: 'homepage', pathMatch: 'full'},
+ { path: 'homepage', component: HomepageComponent },
+ { path: 'customer', component: CustomerComponent },
+ { path: 'sales-order', component: SalesOrderComponent },
+ { path: 'invoice', component: InvoiceComponent },
+ { path: 'invoice-gen', component: InvoiceGenComponent },
+ { path: 'invoice-payment', component: InvoicePaymentComponent },
+ { path: 'service-type', component: ServiceTypeComponent},
+ { path: 'login', component: LoginComponent }
+];
+
+@NgModule({
+ exports: [RouterModule],
+ imports: [
+ CommonModule,
+ RouterModule.forRoot(routes)
+ ],
+ declarations: []
+})
+export class AppRoutingModule { }
diff --git a/AstuteClient2/src/app/app.module.ts b/AstuteClient2/src/app/app.module.ts
index f8bfeb3..bbd60a2 100644
--- a/AstuteClient2/src/app/app.module.ts
+++ b/AstuteClient2/src/app/app.module.ts
@@ -1,53 +1,55 @@
-import { BrowserModule } from '@angular/platform-browser';
-import { NgModule } from '@angular/core';
-
-import { AppComponent } from './app.component';
-import { CustomerComponent } from './customer/customer.component';
-import { AstuteClientService } from './services/astute-client-service';
-import { AgGridModule } from 'ag-grid-angular';
-import { ModalFormComponent } from './modal-form/modal-form.component';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-import {HttpClientModule} from '@angular/common/http';
-import { AppRoutingModule } from './/app-routing.module';
-import { NavBarComponent } from './nav-bar/nav-bar.component';
-import { SalesOrderComponent } from './sales-order/sales-order.component';
-import { InvoiceComponent } from './invoice/invoice.component';
-import { HomepageComponent } from './homepage/homepage.component';
-import { AppBoxComponent } from './app-box/app-box.component';
-import { InvoiceGenComponent } from './invoice-gen/invoice-gen.component';
-import { TextMaskModule } from 'angular2-text-mask';
-import { LoginComponent } from './login/login.component';
-import { InvoicePaymentComponent } from './invoice-payment/invoice-payment.component';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-import { ReactiveFormsModule } from '@angular/forms';
-
-@NgModule({
- declarations: [
- AppComponent,
- CustomerComponent,
- ModalFormComponent,
- NavBarComponent,
- SalesOrderComponent,
- InvoiceComponent,
- HomepageComponent,
- AppBoxComponent,
- InvoiceGenComponent,
- LoginComponent,
- InvoicePaymentComponent
- ],
- imports: [
- BrowserModule,
- AgGridModule.withComponents([]),
- NgbModule.forRoot(),
- HttpClientModule,
- AppRoutingModule,
- TextMaskModule,
- CommonModule,
- FormsModule,
- ReactiveFormsModule
- ],
- providers: [AstuteClientService],
- bootstrap: [AppComponent]
-})
-export class AppModule { }
+import { BrowserModule } from '@angular/platform-browser';
+import { NgModule } from '@angular/core';
+
+import { AppComponent } from './app.component';
+import { CustomerComponent } from './customer/customer.component';
+import { AstuteClientService } from './services/astute-client-service';
+import { AgGridModule } from 'ag-grid-angular';
+import { ModalFormComponent } from './modal-form/modal-form.component';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import {HttpClientModule} from '@angular/common/http';
+import { AppRoutingModule } from './/app-routing.module';
+import { NavBarComponent } from './nav-bar/nav-bar.component';
+import { SalesOrderComponent } from './sales-order/sales-order.component';
+import { InvoiceComponent } from './invoice/invoice.component';
+import { HomepageComponent } from './homepage/homepage.component';
+import { AppBoxComponent } from './app-box/app-box.component';
+import { InvoiceGenComponent } from './invoice-gen/invoice-gen.component';
+import { TextMaskModule } from 'angular2-text-mask';
+import { LoginComponent } from './login/login.component';
+import { InvoicePaymentComponent } from './invoice-payment/invoice-payment.component';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { ReactiveFormsModule } from '@angular/forms';
+import { ServiceTypeComponent } from './service-type/service-type.component';
+
+@NgModule({
+ declarations: [
+ AppComponent,
+ CustomerComponent,
+ ModalFormComponent,
+ NavBarComponent,
+ SalesOrderComponent,
+ InvoiceComponent,
+ HomepageComponent,
+ AppBoxComponent,
+ InvoiceGenComponent,
+ LoginComponent,
+ InvoicePaymentComponent,
+ ServiceTypeComponent
+ ],
+ imports: [
+ BrowserModule,
+ AgGridModule.withComponents([]),
+ NgbModule.forRoot(),
+ HttpClientModule,
+ AppRoutingModule,
+ TextMaskModule,
+ CommonModule,
+ FormsModule,
+ ReactiveFormsModule
+ ],
+ providers: [AstuteClientService],
+ bootstrap: [AppComponent]
+})
+export class AppModule { }
diff --git a/AstuteClient2/src/app/nav-bar/nav-bar.component.html b/AstuteClient2/src/app/nav-bar/nav-bar.component.html
index d08bef8..c389c05 100644
--- a/AstuteClient2/src/app/nav-bar/nav-bar.component.html
+++ b/AstuteClient2/src/app/nav-bar/nav-bar.component.html
@@ -9,6 +9,7 @@
Sales Order
Invoice
Invoice Payment
+ Service Type
Log off
diff --git a/AstuteClient2/src/app/nav-bar/nav-bar.component.ts b/AstuteClient2/src/app/nav-bar/nav-bar.component.ts
index 490d460..209d0c7 100644
--- a/AstuteClient2/src/app/nav-bar/nav-bar.component.ts
+++ b/AstuteClient2/src/app/nav-bar/nav-bar.component.ts
@@ -10,6 +10,7 @@ export class NavBarComponent implements OnInit {
@Input() salesOrderActive: boolean;
@Input() invoiceActive: boolean;
@Input() invoicePaymentActive: boolean;
+ @Input() serviceTypeActive: boolean;
@Input() logoffActive: boolean;
diff --git a/AstuteClient2/src/app/services/astute-client-service.ts b/AstuteClient2/src/app/services/astute-client-service.ts
index dcc8bfc..a7a3c02 100644
--- a/AstuteClient2/src/app/services/astute-client-service.ts
+++ b/AstuteClient2/src/app/services/astute-client-service.ts
@@ -15,6 +15,7 @@ export class AstuteClientService {
private invoiceDetailUrl = 'http://localhost:8080/astutesystem/invoice/detail';
private invoiceGenUrl = 'http://localhost:8080/astutesystem/invoice/generatedInvoice';
private invoicePaymentUrl = 'http://localhost:8080/astutesystem/invoicePayment';
+ private serviceTypeUrl = 'http://localhost:8080/astutesystem/serviceType';
private sessionId = localStorage.getItem('');
private sessionString = `?sessionId=${this.sessionId}`;
@@ -119,17 +120,6 @@ export class AstuteClientService {
});
}
- public getServiceTypes(): Promise {
- console.log("*** In getPOServiceTypes()");
- const url = `${this.POServiceTypesUrl}`;
- return this.http.get(url)
- .toPromise()
- .then(response => {
- console.log(response['entity']);
- return response['entity'];
- });
- }
-
public getPODetail(ponum): Promise {
console.log("*** In getPODetails()");
const url = `${this.PODetailUrl}?PONum=${ponum}`;
@@ -158,12 +148,6 @@ export class AstuteClientService {
.then(response => response['entity']);
}
- // String serviceDesc;
- // int feeTypeId;
- // Double qty;
- // int serviceTypeId;
- // String schedule;
- // Date deliverBy;
public updatePODetail(ponum, lineItemNo, data) {
console.log("*** In updatePODetail()");
const sessionId = localStorage.getItem('sessionId');
@@ -363,108 +347,33 @@ export class AstuteClientService {
.then(response => response['entity']);
}
- // public getRecord(patientId: number): Promise {
- // const url = `${this.recordsUrl}/${patientId}?sessionId=${this.getSessionId()}`;
- // return this.http.get(url)
- // .toPromise()
- // .then(response => {
- // console.log(response);
- // });
- // }
- //
- // public getInfo(patientId: number): Promise {
- // const url = `${this.recordsUrl}/${patientId}?sessionId=${this.getSessionId()}`;
- // return this.http.get(url)
- // .toPromise()
- // .then(response => {
- // return response['entity'];
- // });
- // }
- //
- // public getVisits(patientId: number): Promise {
- // const url = `${this.recordsUrl}/${patientId}/visits?sessionId=${this.getSessionId()}`;
- // return this.http.get(url)
- // .toPromise()
- // .then(response => {
- // return response['entity'];
- // });
- // }
- //
- // public getAllVisits(): Promise {
- // const url = `${this.recordsUrl}/visits?sessionId=${this.getSessionId()}`;
- // return this.http.get(url)
- // .toPromise()
- // .then(response => {
- // return response['entity'];
- // });
- // }
- //
- // public getVitals(visitId: number): Promise {
- // const url = `${this.visitsUrl}/${visitId}/vitals?sessionId=${this.getSessionId()}`;
- // return this.http.get(url)
- // .toPromise()
- // .then(response => {
- // return response['entity'];
- // });
- // }
- //
- // public getLatestVitals(patientId: number): Promise {
- // const url = `${this.recordsUrl}/${patientId}/vitals?sessionId=${this.getSessionId()}`;
- // return this.http.get(url)
- // .toPromise()
- // .then(response => {
- // return response['entity'];
- // });
- // }
- //
- // public updateInfo(patientId: number, data: any): Promise {
- // const url = `${this.recordsUrl}/${patientId}?sessionId=${this.getSessionId()}`;
- // return this.http.put(url, data)
- // .toPromise()
- // .then(response => response['entity']);
- // }
- // public updateVisit(patientId: number, visit: any): Promise {
- // console.log(visit);
- //
- // const url = `${this.recordsUrl}/${patientId}/visits/${visit.visitId}?sessionId=${this.getSessionId()}`;
- // return this.http.put(url, visit)
- // .toPromise()
- // .then(response => {
- // console.log(response['entity']);
- // return response['entity'];
- // });
- // }
- //
- // public getSessionPatientId(): Promise {
- // const url = `${this.sessionsUrl}/${this.getSessionId()}`;
- // console.log(url);
- // return this.http.get(url)
- // .toPromise()
- // .then(response => {
- // console.log(response);
- // return response['entity'].patientId;
- // });
- // }
- //
- // public startVisit(patientId: number): Promise {
- // const url = `${this.recordsUrl}/${patientId}/visits?${this.getSessionId()}`;
- // return this.http.post(url, null)
- // .toPromise()
- // .then(response => {
- // console.log(response);
- // return response['entity'];
- // });
- // }
- //
- // getMedications() {
- // const url = `${this.medsUrl}?${this.getSessionId()}`;
- // return this.http.get(url)
- // .toPromise()
- // .then(response => {
- // console.log(response);
- // return response['entity'];
- // });
- // }
+ // **************************************** Service Type methods
+ public getServiceTypes(): Promise {
+ console.log("*** In getPOServiceTypes()");
+ const url = `${this.serviceTypeUrl}`;
+ return this.http.get(url)
+ .toPromise()
+ .then(response => {
+ console.log(response['entity']);
+ return response['entity'];
+ });
+ }
+ public updateServiceType(serviceTypeId, serviceTypeDesc, data: any): Promise {
+ console.log("*** In updateServiceType()");
+ const url = `${this.serviceTypeUrl}/${serviceTypeId}/?desc=${serviceTypeDesc}`; //TODO send sessionId
+ console.log("*** updateServiceType is " + url);
+ return this.http.put(url, data)
+ .toPromise()
+ .then(response => response['entity']);
+ }
+
+ public createServiceType(data: any): Promise {
+ console.log("*** In createServiceType()");
+ const url = `${this.serviceTypeUrl}`; //TODO send sessionId
+ return this.http.post(url, data)
+ .toPromise()
+ .then(response => response['entity']);
+ }
}
diff --git a/AstuteSystem/src/main/java/com/astute/model/ServiceType.java b/AstuteSystem/src/main/java/com/astute/model/ServiceType.java
index ac44447..244edf3 100644
--- a/AstuteSystem/src/main/java/com/astute/model/ServiceType.java
+++ b/AstuteSystem/src/main/java/com/astute/model/ServiceType.java
@@ -1,30 +1,29 @@
-package com.astute.model;
-
-import java.sql.Date;
-
-public class ServiceType {
- int serviceTypeId;
- String desc;
-
- public int getServiceTypeId() {
- return serviceTypeId;
- }
-
- public void setServiceTypeId(int serviceTypeId) {
- this.serviceTypeId = serviceTypeId;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
- public ServiceType(int serviceTypeId, String desc) {
- this.serviceTypeId = serviceTypeId;
- this.desc = desc;
- }
-
-}
+package com.astute.model;
+
+
+public class ServiceType {
+ int serviceTypeId;
+ String serviceTypeDesc;
+
+ public int getServiceTypeId() {
+ return serviceTypeId;
+ }
+
+ public void setServiceTypeId(int serviceTypeId) {
+ this.serviceTypeId = serviceTypeId;
+ }
+
+ public String getServiceTypeDesc() {
+ return serviceTypeDesc;
+ }
+
+ public void setServiceTypeDesc(String serviceTypeDesc) {
+ this.serviceTypeDesc = serviceTypeDesc;
+ }
+
+ public ServiceType(int serviceTypeId, String serviceTypeDesc) {
+ this.serviceTypeId = serviceTypeId;
+ this.serviceTypeDesc = serviceTypeDesc;
+ }
+
+}
diff --git a/AstuteSystem/src/main/java/com/astute/requests/ServiceTypeRequest.java b/AstuteSystem/src/main/java/com/astute/requests/ServiceTypeRequest.java
index 6024c20..153b612 100644
--- a/AstuteSystem/src/main/java/com/astute/requests/ServiceTypeRequest.java
+++ b/AstuteSystem/src/main/java/com/astute/requests/ServiceTypeRequest.java
@@ -2,7 +2,7 @@ package com.astute.requests;
public class ServiceTypeRequest {
int serviceTypeId;
- String desc;
+ String serviceTypeDesc;
public int getServiceTypeId() {
return serviceTypeId;
@@ -12,17 +12,17 @@ public class ServiceTypeRequest {
this.serviceTypeId = serviceTypeId;
}
- public String getDesc() {
- return desc;
+ public String getServiceTypeDesc() {
+ return serviceTypeDesc;
}
- public void setDesc(String desc) {
- this.desc = desc;
+ public void setServiceTypeDesc(String serviceTypeDesc) {
+ this.serviceTypeDesc = serviceTypeDesc;
}
public ServiceTypeRequest(int serviceTypeId, String desc) {
this.serviceTypeId = serviceTypeId;
- this.desc = desc;
+ this.serviceTypeDesc = serviceTypeDesc;
}
}
diff --git a/AstuteSystem/src/main/java/com/astute/resources/POResource.java b/AstuteSystem/src/main/java/com/astute/resources/POResource.java
index 32dd53c..614618e 100644
--- a/AstuteSystem/src/main/java/com/astute/resources/POResource.java
+++ b/AstuteSystem/src/main/java/com/astute/resources/POResource.java
@@ -76,7 +76,7 @@ public class POResource {
// Finalize
@Path("/{PONum}/finalize")
- @POST
+ @PUT
public Response finalizePO(@PathParam("PONum") String PONum) throws AstuteException {
POService.finalizePO(PONum);
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
@@ -84,7 +84,7 @@ public class POResource {
// delete
@Path("/{PONum}/delete")
- @POST
+ @PUT
public Response deletePO(@PathParam("PONum") String PONum) throws AstuteException {
POService.deletePO(PONum);
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
diff --git a/AstuteSystem/src/main/java/com/astute/resources/ServiceTypeResource.java b/AstuteSystem/src/main/java/com/astute/resources/ServiceTypeResource.java
index 8331b36..20a96e1 100644
--- a/AstuteSystem/src/main/java/com/astute/resources/ServiceTypeResource.java
+++ b/AstuteSystem/src/main/java/com/astute/resources/ServiceTypeResource.java
@@ -34,10 +34,10 @@ public class ServiceTypeResource {
@Path("/{serviceTypeId}")
@PUT
- public Response updateServiceType(@PathParam("serviceTypeId") int serviceTypeId, @QueryParam("desc") String desc)
+ public Response updateServiceType(@PathParam("serviceTypeId") int serviceTypeId, @QueryParam("serviceTypeDesc") String serviceTypeDesc)
throws AstuteException {
System.out.println("in updateServiceType()");
- service.updateServiceType(serviceTypeId, desc);
+ service.updateServiceType(serviceTypeId, serviceTypeDesc);
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
}
@@ -54,7 +54,7 @@ public class ServiceTypeResource {
public Response createServiceType(ServiceTypeRequest request)
throws AstuteException {
System.out.println("in AstuteSyste createServiceType()");
- service.createServiceType(request.getDesc());
+ service.createServiceType(request.getServiceTypeDesc());
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
}
}
diff --git a/AstuteSystem/src/main/java/com/astute/service/ServiceTypeService.java b/AstuteSystem/src/main/java/com/astute/service/ServiceTypeService.java
index 8838e33..4d91a1b 100644
--- a/AstuteSystem/src/main/java/com/astute/service/ServiceTypeService.java
+++ b/AstuteSystem/src/main/java/com/astute/service/ServiceTypeService.java
@@ -19,12 +19,12 @@ public class ServiceTypeService extends Service{
return getDao().getServiceTypes();
}
- public void createServiceType(String desc) throws AstuteException {
- getDao().createServiceType(desc);
+ public void createServiceType(String serviceTypeDesc) throws AstuteException {
+ getDao().createServiceType(serviceTypeDesc);
}
- public void updateServiceType(int serviceTypeId, String desc) throws AstuteException {
- getDao().updateServiceType(serviceTypeId, desc);
+ public void updateServiceType(int serviceTypeId, String serviceTypeDesc) throws AstuteException {
+ getDao().updateServiceType(serviceTypeId, serviceTypeDesc);
}
public void deleteServiceType(int serviceTypeId) throws AstuteException {