Files
cbsnexora/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.html
T
AdityaandClaude Opus 4.7 83ea57ccf0 Client-stepper: pre-fill existing KYC/address proofs in edit, fix identifier saves
Edit-mode now shows the previously selected KYC document type + uploaded file thumbnail
(loads from /clients/{id}/identifiers + /client_identifiers/{id}/documents). Same for
address proof on the India address step. Closes the gap where editing a client showed
an empty file picker even when proof had been uploaded on create.

Identifier-save hardened across all three callsites (create-client, edit-client,
identities-tab.createIdentifierWithDocs) - the KYC chip picker proofId is a CODE
string ('AADHAAR'), but backend ClientIdentifierRequest.documentTypeId is Long, which
Spring rejects with HttpMessageNotReadableException -> 400. resolveDocumentTypeId
helper looks up the code against /kyc/proof-types?type=id and substitutes the numeric
CodeValue id before posting. Skips silently for constitution-specific non-individual
docs that have no CodeValue mapping.

KYC payload normalises panNumber / enterprisePan / gstinNumber / cinNumber via
toUpperCase + whitespace strip so user-typed lowercase or trailing spaces don't trip
the backend regex (validation.msg.CLIENTKYC.panNumber.does.not.match.regexp).

State name match in client-address save now normalises both sides (lowercase, collapse
underscores + spaces) so legacy MADHYA_PRADESH resolves to 'Madhya Pradesh' returned
by api.postalpincode.in. Backed by tenant migration 0297.

Identities-tab resolver flattened - was returning identifiers before the per-row
forkJoin(getClientIdentificationDocuments) completed, so the view rendered empty
documents arrays. Now uses switchMap + forkJoin so the resolver awaits completion.

Also bundles concurrent work-in-progress on letter-mgmt, organization, users,
bank-calendar, shell, nominee/notes/identifier dialogs, and theming.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 12:40:58 +05:30

94 lines
3.5 KiB
HTML

<!--
Copyright since 2025 Mifos Initiative
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<div class="tab-container mat-typography">
<h3>{{ 'labels.heading.Notes' | translate }}</h3>
<div class="add-note-section">
<form
#formRef="ngForm"
[formGroup]="noteForm"
class="layout-row align-start-baseline gap-10px"
(ngSubmit)="addNote()"
>
<mat-form-field class="flex-85-minus-20px">
<textarea
required
formControlName="note"
matInput
placeholder="{{ 'labels.text.Write a note' | translate }} ..."
cdkTextareaAutosize
cdkAutosizeMinRows="2"
matTooltip="At least two words required — e.g. 'Hello User', 'Updated mobile', 'Re-KYC done'."
matTooltipPosition="above"
matTooltipShowDelay="300"
(keydown)="onNoteKeyDown($event)"
(input)="onNoteInput($event)"
></textarea>
@if (noteForm.controls['note'].touched && noteForm.controls['note'].hasError('required')) {
<mat-error>Note cannot be empty.</mat-error>
}
@if (noteForm.controls['note'].touched && noteForm.controls['note'].hasError('minWords')) {
<mat-error>Note must contain at least 2 words (whitespace doesn't count).</mat-error>
}
</mat-form-field>
<button type="submit" mat-raised-button class="flex-1" color="primary" [disabled]="!noteForm.valid">
<fa-icon icon="plus" class="m-r-10" aria-hidden="true"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
</form>
</div>
<div class="notes-container">
@if (entityNotes && entityNotes.length > 0) {
<div>
@for (entityNote of entityNotes; track entityNote; let i = $index) {
<div class="note-card">
<div class="note-content">
{{ entityNote.note }}
</div>
<div class="note-footer">
<div class="note-meta">
<div class="created-by">
{{ 'labels.inputs.Created By' | translate }} {{ entityNote.createdByUsername }}
</div>
<div class="created-date">
{{ entityNote.createdOn | dateFormat }}
</div>
</div>
<div class="note-actions">
<button
type="button"
mat-raised-button
color="primary"
(click)="editNote(entityNote.id, entityNote.note, i)"
[title]="'labels.heading.Edit Note' | translate"
>
<fa-icon icon="edit" class="m-r-10" aria-hidden="true"></fa-icon
>{{ 'labels.buttons.Edit' | translate }}
</button>
<button
type="button"
mat-raised-button
color="warn"
(click)="deleteNote(entityNote.id, i)"
[title]="('labels.inputs.Note' | translate) + ': ' + ('labels.buttons.Delete' | translate)"
>
<fa-icon icon="trash" class="m-r-10" aria-hidden="true"></fa-icon
>{{ 'labels.buttons.Delete' | translate }}
</button>
</div>
</div>
</div>
}
</div>
} @else {
<div class="empty-state">{{ 'labels.text.NoNotesAvailable' | translate }}</div>
}
</div>
</div>