Commit 7d6a57cb authored by hasan khaddour's avatar hasan khaddour

add traks reuests

parent 20bbe93f
...@@ -15,7 +15,7 @@ export class JwtInterceptor implements HttpInterceptor { ...@@ -15,7 +15,7 @@ export class JwtInterceptor implements HttpInterceptor {
if (token) { if (token) {
request = request.clone({ request = request.clone({
setHeaders: { setHeaders: {
Authorization: `Bearer ${token.trim()}` Authorization: `Bearer ${token.replace(/"/g,'').trim()}`
} }
}); });
} }
......
<div *ngIf="customer" class="card col-6 offset-1 mb-3" style="border-radius: .5rem;"> <div class="container-fluid" *ngIf="customer">
<div class="row g-0"> <div class="row justify-content-center">
<div class="col-md-4 gradient-custom text-center text-black" <div class="col-8 offset-2 ">
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;"> <div class="card shadow">
<h5>{{customer.customerName}}</h5> <div class="card-body">
<p>{{customer.email}}</p> <div class="col-6 col-sm-12 text-center mb-4">
</div> <img src="/assets/images/users/4.jpg" class="navbar-brand-img brand-sm mx-auto mb-4" alt="...">
<div class="col-md-8">
<div class="card-body p-4"> <h3 class="mb-0 text-uppercase">{{customer.customerName}}</h3>
<h6>Information:</h6> <p> <small>{{customer.email}}</small></p>
<hr class="mt-0 mb-4"> </div>
<div class="row pt-1">
</div>
<div class="col-6 mb-3"> <hr>
<h6>Address</h6> <div class="row ml-4">
<p class="text-muted">{{customer.address.city}} - {{customer.address.streetName}}</p> <p><strong>العنوان</strong></p>
<p class="text-muted">Street Name : {{customer.address.streetNumber}} </p> <p>المدينة {{customer.address.city}}</p>
</div> <p>الشارع {{customer.address.streetName}} {{customer.address.streetNumber}}</p>
</div>
<div class="row mb-4">
<button class="col-4 offset-1 m-4 btn btn-danger" (click)="onDelete(customer.id)">إزالة</button>
<div *ngIf="customer.contactInfo.length!=0" class="col-12 mb-3"> <button class="col-4 m-4 btn btn-info" (click)="addContact(customer.id)">إضافة معلومة اتصال</button>
<h6>contact Info</h6>
<p *ngFor="let contact of customer.contactInfo" class="text-muted">{{contact.contactType}} - {{contact.contactValue}}</p>
</div>
</div>
<div class="row pt-1">
</div>
</div> </div>
</div>
</div> </div> <!-- /.card-body -->
</div> </div> <!-- /.card -->
</div> <!-- /.col-12 -->
</div> <!-- .row -->
\ No newline at end of file
...@@ -33,4 +33,18 @@ export class CustomerDetailsComponent implements OnInit { ...@@ -33,4 +33,18 @@ export class CustomerDetailsComponent implements OnInit {
}); });
} }
addContact(arg0: number) {
throw new Error('Method not implemented.');
}
onDelete(id: number) {
this.customerService.deleteCustomer(id).subscribe({
next : (data)=> {
this.toastr.success('تم حذف الجهة بنجاح');
this.router.navigate(['/customers']);
},
error: (err)=>this.toastr.error('لقد حدث خطاء ما')
});
}
} }
\ No newline at end of file
...@@ -33,7 +33,7 @@ export class CustomerService { ...@@ -33,7 +33,7 @@ export class CustomerService {
return this.http.put<void>(`${this.config.getServerUrl()}/Customers/${id}` ,customer); return this.http.put<void>(`${this.config.getServerUrl()}/Customers/${id}` ,customer);
} }
public deleteCustomer(id: number): Observable<void> { public deleteCustomer(customerId: number): Observable<void> {
return this.http.delete<void>(`${this.config.getServerUrl()}/Customers/${id}`); return this.http.delete<void>(`${this.config.getServerUrl()}/Customers/${customerId}`);
} }
} }
import { TestBed } from '@angular/core/testing';
import { FinancialSpendingService } from './financial-spending.service';
describe('FinancialSpendingService', () => {
let service: FinancialSpendingService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(FinancialSpendingService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { EmployeeWork } from "../valueObjects/EmployeeWork";
import { EmployeeWorkInfo } from "../valueObjects/EmployeeWorkInfo";
export class AddEmployeeTrackRequest {
trackId: number;
employeeId: number;
employeeWorkInfo: EmployeeWorkInfo;
employeeWork: EmployeeWork;
notes: string;
projectId: number;
}
export class AddStepTrackRequest {
stepId: number;
trackId: number;
executionState: string;
trackDate: Date;
trackExecutionRatio: number;
}
import { TrackInfo } from "../valueObjects/trackInfo";
export class CreateTrackRequest {
trackInfo: TrackInfo;
notes: string;
projectId: number;
}
export class GetTracksByProjectRequest {
projectId: number;
pageNumber: number | null;
pageSize: number | null;
}
export class RemoveTrackRequest {
trackId: number;
}
import { EmployeeWork } from "../valueObjects/EmployeeWork";
import { EmployeeWorkInfo } from "../valueObjects/EmployeeWorkInfo";
export class UpdateEmployeeWorkTrackRequest {
employeeTrackId: number;
trackId: number;
employeeId: number;
employeeWorkInfo: EmployeeWorkInfo;
employeeWork: EmployeeWork;
notes: string;
}
export class CompleteTrackRequest{
trackId :number
completionDate :number
projectId : number
}
import { TestBed } from '@angular/core/testing';
import { TrackService } from './track.service';
describe('TrackService', () => {
let service: TrackService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TrackService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
@Injectable({ @Injectable({
...@@ -5,5 +6,6 @@ import { Injectable } from '@angular/core'; ...@@ -5,5 +6,6 @@ import { Injectable } from '@angular/core';
}) })
export class TrackService { export class TrackService {
constructor() { } constructor(private http : HttpClient) { }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment