fix(clients): stale signature bug, monthly turnover/annual income fields, senior citizen/PWD classification
- Fix signature-document reads picking the oldest upload instead of the latest across 7 call sites (CKYC tab, view/delete-signature dialogs, edit-wizard preview, cashier transaction entry, signatory service, record-master) by sorting on document id instead of an unsorted find(). - Add Monthly Turnover and Annual Income fields alongside the renamed Yearly Turnover field. - Add Senior Citizen (auto-detected from DOB) and Person with Disability classification, with a required disability-certificate upload gate before client creation can proceed. - Add Graduate and Diploma as distinct Education Levels, with diploma-specific degree options. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -66,9 +66,12 @@ export class SignatoryService {
|
||||
fetchClientSignature(clientId: number | string): Observable<string | null> {
|
||||
return this.http.get<any[]>(`/clients/${clientId}/documents`).pipe(
|
||||
switchMap((docs: any[]) => {
|
||||
const sigDoc = (docs || []).find(
|
||||
(d: any) => d.name === 'clientSignature' || d.name?.toLowerCase().includes('signature')
|
||||
);
|
||||
// Multiple 'clientSignature' documents can exist for clients who re-cropped/replaced
|
||||
// their signature before uploads became single-slot, so pick the highest id (latest)
|
||||
// rather than the first unordered match.
|
||||
const sigDoc = (docs || [])
|
||||
.filter((d: any) => d.name === 'clientSignature' || d.name?.toLowerCase().includes('signature'))
|
||||
.sort((a: any, b: any) => b.id - a.id)[0];
|
||||
if (!sigDoc) {
|
||||
return of(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user