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>
This commit is contained in:
Aditya
2026-05-20 12:40:58 +05:30
co-authored by Claude Opus 4.7
parent 325228c514
commit 83ea57ccf0
84 changed files with 10281 additions and 1194 deletions
+526 -11
View File
@@ -6,22 +6,537 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
@use '../shared/styles/list-layout' as *;
@use 'sass:color';
.status-active {
background: #ecfdf5 !important;
color: #059669 !important;
$navy: #0d1b2a;
$blue: #1e88e5;
$blue-d: #1e40af;
$green: #10b981;
$amber: #f59e0b;
$red: #ef4444;
$purple: #7c3aed;
&::before {
background: #059669;
.usr-container {
padding: 20px 24px;
max-width: 1440px;
margin: 0 auto;
background: #f0f2f5;
min-height: 100vh;
}
// ─── Header ───
.usr-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
gap: 12px;
flex-wrap: wrap;
&__left {
display: flex;
align-items: center;
gap: 12px;
}
&__icon {
width: 44px;
height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 12px;
background: linear-gradient(135deg, $blue 0%, $purple 100%);
color: #fff;
font-size: 18px;
box-shadow: 0 2px 8px rgb(29 78 216 / 25%);
}
&__title {
margin: 0;
font-size: 20px;
font-weight: 800;
color: $navy;
line-height: 1.1;
}
&__sub {
margin-top: 2px;
font-size: 12.5px;
color: #64748b;
}
&__right {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
}
.status-inactive {
background: #fef2f2 !important;
color: #dc2626 !important;
.usr-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
border-radius: 9px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.15s;
white-space: nowrap;
border: 1px solid transparent;
&::before {
background: #dc2626;
fa-icon {
font-size: 12px;
}
&.ghost {
background: #fff;
border-color: #d0d5dd;
color: #475569;
&:hover {
background: #f8fafc;
border-color: #94a3b8;
color: $navy;
}
}
&.primary {
background: linear-gradient(135deg, $blue 0%, $blue-d 100%);
border-color: $blue-d;
color: #fff;
box-shadow: 0 2px 6px -2px rgb(30 64 175 / 35%);
&:hover {
box-shadow: 0 4px 12px -3px rgb(30 64 175 / 45%);
transform: translateY(-1px);
}
}
&.small {
padding: 6px 12px;
font-size: 12px;
}
}
// ─── KPI strip ───
.usr-stats {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
margin-bottom: 16px;
}
.usr-stat {
display: flex;
align-items: center;
gap: 12px;
background: #fff;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 12px 16px;
box-shadow: 0 1px 3px rgb(15 23 42 / 4%);
&__ic {
width: 38px;
height: 38px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 10px;
font-size: 15px;
color: #fff;
flex-shrink: 0;
}
&__val {
font-size: 22px;
font-weight: 800;
color: $navy;
line-height: 1;
}
&__lbl {
margin-top: 4px;
font-size: 11.5px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #64748b;
font-weight: 600;
}
&.total .usr-stat__ic {
background: linear-gradient(135deg, $blue 0%, $blue-d 100%);
}
&.staff .usr-stat__ic {
background: linear-gradient(135deg, $purple 0%, #4338ca 100%);
}
&.self .usr-stat__ic {
background: linear-gradient(135deg, $green 0%, #047857 100%);
}
&.office .usr-stat__ic {
background: linear-gradient(135deg, $amber 0%, #c2410c 100%);
}
}
// ─── Toolbar ───
.usr-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
margin-bottom: 12px;
&__search {
position: relative;
flex: 1;
min-width: 260px;
max-width: 520px;
input {
width: 100%;
padding: 9px 36px;
border: 1px solid #d0d5dd;
border-radius: 9px;
font-size: 13px;
background: #fff;
color: $navy;
transition: all 0.15s;
&:focus {
outline: none;
border-color: $blue;
box-shadow: 0 0 0 3px rgb(30 136 229 / 12%);
}
}
&-ic {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: #94a3b8;
font-size: 12px;
pointer-events: none;
}
}
&__clear {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
width: 22px;
height: 22px;
border-radius: 50%;
border: 1px solid #e2e8f0;
background: #fff;
color: #94a3b8;
font-size: 10px;
cursor: pointer;
&:hover {
background: #fef2f2;
color: $red;
border-color: #fecaca;
}
}
&__filters {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
}
.usr-select {
padding: 8px 12px;
border: 1px solid #d0d5dd;
border-radius: 9px;
background: #fff;
color: $navy;
font-size: 12.5px;
cursor: pointer;
transition: all 0.15s;
&:focus {
outline: none;
border-color: $blue;
box-shadow: 0 0 0 3px rgb(30 136 229 / 12%);
}
}
// ─── Card wrapper ───
.usr-card {
background: #fff;
border: 1px solid #e2e8f0;
border-radius: 12px;
box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
overflow: hidden;
&__head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 18px;
border-bottom: 1px solid #e2e8f0;
background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
&__title {
display: flex;
align-items: center;
gap: 8px;
font-size: 15px;
font-weight: 700;
color: $navy;
&-ic {
color: $blue;
}
}
&__count {
margin-left: 8px;
padding: 2px 10px;
background: #eff6ff;
color: $blue-d;
border-radius: 999px;
font-size: 11px;
font-weight: 700;
}
}
// ─── Table ───
.usr-table-wrap {
overflow: auto;
max-height: 620px;
}
.usr-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
thead th {
position: sticky;
top: 0;
z-index: 1;
background: #f1f5f9;
color: #475569;
text-align: left;
padding: 11px 14px;
font-size: 10.5px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 1px solid #e2e8f0;
&.num {
width: 48px;
text-align: center;
}
&.actions {
width: 150px;
text-align: center;
}
}
tbody td {
padding: 10px 14px;
border-bottom: 1px solid #f1f5f9;
vertical-align: middle;
color: $navy;
&.num {
text-align: center;
color: #94a3b8;
font-weight: 600;
}
&.mono {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
color: #475569;
}
&.actions {
text-align: center;
white-space: nowrap;
}
}
tbody tr {
transition: background 0.12s;
&:hover {
background: #f8fafc;
}
}
}
.usr-id {
display: inline-flex;
align-items: center;
gap: 10px;
&__txt {
line-height: 1.15;
}
&__name {
font-weight: 600;
color: $navy;
}
&__staff {
font-size: 10.5px;
color: #64748b;
margin-top: 1px;
}
}
.usr-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, $blue 0%, $purple 100%);
color: #fff;
font-weight: 700;
font-size: 11px;
flex-shrink: 0;
box-shadow: 0 2px 4px -1px rgb(29 78 216 / 30%);
&.self {
background: linear-gradient(135deg, $green 0%, #047857 100%);
box-shadow: 0 2px 4px -1px rgb(16 185 129 / 30%);
}
}
.usr-pill {
display: inline-block;
padding: 2px 9px;
border-radius: 999px;
font-size: 10.5px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
&.staff {
background: #ede9fe;
color: $purple;
}
&.self {
background: #ecfdf5;
color: $green;
}
}
.usr-act {
width: 30px;
height: 30px;
margin: 0 2px;
border: 1px solid #e2e8f0;
background: #fff;
border-radius: 7px;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
color: #64748b;
font-size: 12px;
transition: all 0.12s;
&:hover:not(:disabled) {
transform: translateY(-1px);
}
&.view:hover:not(:disabled) {
background: #f0f9ff;
border-color: #bae6fd;
color: $blue;
}
&.edit:hover:not(:disabled) {
background: #eff6ff;
border-color: #bfdbfe;
color: $blue-d;
}
&.more:hover:not(:disabled) {
background: #f5f3ff;
border-color: #ddd6fe;
color: $purple;
}
&:disabled {
opacity: 0.4;
cursor: not-allowed;
}
}
.usr-menu__ic {
width: 18px;
margin-right: 10px;
color: #64748b;
font-size: 13px;
text-align: center;
&.warn {
color: $red;
}
}
.usr-empty {
text-align: center;
padding: 32px 16px;
color: #94a3b8;
font-size: 13px;
}
// ─── Responsive ───
@media (width <= 900px) {
.usr-stats {
grid-template-columns: repeat(2, 1fr);
}
.usr-header {
flex-direction: column;
align-items: flex-start;
}
.usr-toolbar {
flex-direction: column;
align-items: stretch;
&__search {
max-width: none;
}
}
}
@media (width <= 600px) {
.usr-stats {
grid-template-columns: 1fr;
}
.usr-table thead th {
font-size: 9.5px;
padding: 8px 10px;
}
.usr-table tbody td {
padding: 8px 10px;
}
}