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

add traks reuests

parent 20bbe93f
......@@ -15,7 +15,7 @@ export class JwtInterceptor implements HttpInterceptor {
if (token) {
request = request.clone({
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="row g-0">
<div class="col-md-4 gradient-custom text-center text-black"
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;">
<h5>{{customer.customerName}}</h5>
<p>{{customer.email}}</p>
</div>
<div class="col-md-8">
<div class="card-body p-4">
<h6>Information:</h6>
<hr class="mt-0 mb-4">
<div class="row pt-1">
<div class="col-6 mb-3">
<h6>Address</h6>
<p class="text-muted">{{customer.address.city}} - {{customer.address.streetName}}</p>
<p class="text-muted">Street Name : {{customer.address.streetNumber}} </p>
</div>
<div class="container-fluid" *ngIf="customer">
<div class="row justify-content-center">
<div class="col-8 offset-2 ">
<div class="card shadow">
<div class="card-body">
<div class="col-6 col-sm-12 text-center mb-4">
<img src="/assets/images/users/4.jpg" class="navbar-brand-img brand-sm mx-auto mb-4" alt="...">
<h3 class="mb-0 text-uppercase">{{customer.customerName}}</h3>
<p> <small>{{customer.email}}</small></p>
</div>
</div>
<hr>
<div class="row ml-4">
<p><strong>العنوان</strong></p>
<p>المدينة {{customer.address.city}}</p>
<p>الشارع {{customer.address.streetName}} {{customer.address.streetNumber}}</p>
</div>
<div class="row mb-4">
<div *ngIf="customer.contactInfo.length!=0" class="col-12 mb-3">
<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>
<button class="col-4 offset-1 m-4 btn btn-danger" (click)="onDelete(customer.id)">إزالة</button>
<button class="col-4 m-4 btn btn-info" (click)="addContact(customer.id)">إضافة معلومة اتصال</button>
</div>
</div>
</div>
</div>
</div> <!-- /.card-body -->
</div> <!-- /.card -->
</div> <!-- /.col-12 -->
</div> <!-- .row -->
\ No newline at end of file
......@@ -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 {
return this.http.put<void>(`${this.config.getServerUrl()}/Customers/${id}` ,customer);
}
public deleteCustomer(id: number): Observable<void> {
return this.http.delete<void>(`${this.config.getServerUrl()}/Customers/${id}`);
public deleteCustomer(customerId: number): Observable<void> {
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';
@Injectable({
......@@ -5,5 +6,6 @@ import { Injectable } from '@angular/core';
})
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