merging code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Nitesh Yadav
2026-04-20 14:26:25 +05:30
co-authored by Claude Sonnet 4.6
322 changed files with 28779 additions and 4976 deletions
@@ -1,18 +1,48 @@
/**
* 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/.
*/
/**
* Entity Classification — Scheme & Sector Classification
*/
.ec-page { padding: 0; }
.ec-page {
padding: 0;
}
.step-header {
background: #0f172a;
padding: 16px 24px;
border-radius: 10px 10px 0 0;
margin-bottom: 20px;
&__left { display: flex; align-items: center; gap: 12px; }
&__icon { font-size: 18px; color: #60a5fa; }
&__title { font-size: 16px; font-weight: 600; color: #fff; margin: 0; }
&__sub { font-size: 11px; color: rgba(255,255,255,0.5); margin: 2px 0 0; }
&__left {
display: flex;
align-items: center;
gap: 12px;
}
&__icon {
font-size: 18px;
color: #60a5fa;
}
&__title {
font-size: 16px;
font-weight: 600;
color: #fff;
margin: 0;
}
&__sub {
font-size: 11px;
color: rgb(255 255 255 / 50%);
margin: 2px 0 0;
}
}
.ec-chips-label {
@@ -32,7 +62,11 @@
min-height: 28px;
}
.ec-no-chip { font-size: 12px; color: #94a3b8; padding: 4px 0; }
.ec-no-chip {
font-size: 12px;
color: #94a3b8;
padding: 4px 0;
}
.ec-chip {
padding: 4px 10px;
@@ -50,7 +84,10 @@
height: 14px !important;
cursor: pointer;
opacity: 0.6;
&:hover { opacity: 1; }
&:hover {
opacity: 1;
}
}
.ec-card {
@@ -60,7 +97,10 @@
margin-bottom: 12px;
overflow: hidden;
transition: border-color 0.2s;
&--open { border-color: #93c5fd; }
&--open {
border-color: #93c5fd;
}
}
.ec-card-head {
@@ -71,10 +111,17 @@
cursor: pointer;
user-select: none;
transition: background 0.15s;
&:hover { background: #f8fafc; }
&:hover {
background: #f8fafc;
}
}
.ec-card-head-left { display: flex; align-items: center; gap: 12px; }
.ec-card-head-left {
display: flex;
align-items: center;
gap: 12px;
}
.ec-tag {
padding: 3px 10px;
@@ -85,14 +132,31 @@
white-space: nowrap;
}
.ec-card-title { font-size: 14px; font-weight: 600; color: #1e293b; }
.ec-card-desc { font-size: 12px; color: #64748b; margin-top: 2px; }
.ec-card-toggle { display: flex; align-items: center; gap: 10px; }
.ec-card-title {
font-size: 14px;
font-weight: 600;
color: #1e293b;
}
.ec-card-desc {
font-size: 12px;
color: #64748b;
margin-top: 2px;
}
.ec-card-toggle {
display: flex;
align-items: center;
gap: 10px;
}
.ec-chevron {
transition: transform 0.25s;
color: #94a3b8;
&.open { transform: rotate(180deg); }
&.open {
transform: rotate(180deg);
}
}
.ec-card-body {
@@ -105,7 +169,10 @@
grid-template-columns: repeat(3, 1fr);
gap: 4px 16px;
margin-bottom: 8px;
mat-form-field { width: 100%; }
mat-form-field {
width: 100%;
}
}
.ec-grid-2 {
@@ -113,7 +180,10 @@
grid-template-columns: repeat(2, 1fr);
gap: 4px 16px;
margin-bottom: 8px;
mat-form-field { width: 100%; }
mat-form-field {
width: 100%;
}
}
.ec-sub-title {
@@ -125,7 +195,12 @@
margin: 16px 0 12px;
padding-top: 12px;
border-top: 1px dashed #e2e8f0;
&:first-child { margin-top: 0; padding-top: 0; border-top: none; }
&:first-child {
margin-top: 0;
padding-top: 0;
border-top: none;
}
}
.ec-check-grid {
@@ -133,13 +208,20 @@
grid-template-columns: repeat(2, 1fr);
gap: 8px;
margin-bottom: 8px;
mat-checkbox {
padding: 8px 12px;
border: 1px solid #e2e8f0;
border-radius: 6px;
font-size: 12px;
transition: background 0.12s, border-color 0.12s;
&:hover { background: #f8fafc; border-color: #93c5fd; }
transition:
background 0.12s,
border-color 0.12s;
&:hover {
background: #f8fafc;
border-color: #93c5fd;
}
}
}
@@ -160,8 +242,19 @@
border-radius: 6px;
}
.ec-flag-label { font-size: 13px; font-weight: 500; color: #1e293b; display: block; }
.ec-flag-sub { font-size: 11px; color: #94a3b8; display: block; margin-top: 1px; }
.ec-flag-label {
font-size: 13px;
font-weight: 500;
color: #1e293b;
display: block;
}
.ec-flag-sub {
font-size: 11px;
color: #94a3b8;
display: block;
margin-top: 1px;
}
.ec-reg-note {
margin-top: 16px;
@@ -172,7 +265,10 @@
font-size: 12px;
color: #0c4a6e;
line-height: 1.6;
strong { font-weight: 600; }
strong {
font-weight: 600;
}
}
.ec-card-actions {
@@ -181,7 +277,12 @@
margin-top: 16px;
padding-top: 12px;
border-top: 1px solid #f1f5f9;
button { display: flex; align-items: center; gap: 6px; }
button {
display: flex;
align-items: center;
gap: 6px;
}
}
.ec-info-banner {
@@ -197,10 +298,27 @@
margin-top: 12px;
}
@media (max-width: 900px) { .ec-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
.ec-grid-3, .ec-grid-2 { grid-template-columns: 1fr; }
.ec-check-grid { grid-template-columns: 1fr; }
.ec-card-head { padding: 12px 14px; }
.ec-card-body { padding: 14px; }
@media (width <= 900px) {
.ec-grid-3 {
grid-template-columns: repeat(2, 1fr);
}
}
@media (width <= 600px) {
.ec-grid-3,
.ec-grid-2 {
grid-template-columns: 1fr;
}
.ec-check-grid {
grid-template-columns: 1fr;
}
.ec-card-head {
padding: 12px 14px;
}
.ec-card-body {
padding: 14px;
}
}
@@ -1,5 +1,9 @@
/**
* 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/.
*/
import { Component, Input, OnInit, OnChanges, SimpleChanges, inject } from '@angular/core';
@@ -54,13 +58,69 @@ export class ClientEntityKycStepComponent implements OnInit, OnChanges {
/** Category metadata */
categories: CategoryMeta[] = [
{ id: 'msme', label: 'MSME', tag: 'Udyam / MSME', tagColor: '#0A5C6B', tagBg: '#E6F4F6', desc: 'Micro, Small & Medium Enterprise — Ministry of MSME / Udyam Registration', icon: 'cogs' },
{ id: 'startup', label: 'Startup India Registered', tag: 'DPIIT', tagColor: '#1A5FAB', tagBg: '#EAF2FB', desc: 'DPIIT recognition under Startup India initiative', icon: 'rocket' },
{ id: 'mudra', label: 'Mudra Borrower', tag: 'PMMY', tagColor: '#8A5A00', tagBg: '#FEF3DC', desc: 'Pradhan Mantri Mudra Yojana — SIDBI / Mudra scheme', icon: 'hand-holding-usd' },
{ id: 'eou', label: 'Export Oriented Unit', tag: 'EOU', tagColor: '#1B7A4A', tagBg: '#E8F5EE', desc: 'Customs-registered EOU under DGFT / Ministry of Commerce', icon: 'ship' },
{ id: 'importexport', label: 'Import Export Business', tag: 'DGFT / IEC', tagColor: '#5B3A8A', tagBg: '#F0EBF8', desc: 'Entity with valid DGFT Importer Exporter Code', icon: 'exchange-alt' },
{ id: 'psl', label: 'Priority Sector Borrower', tag: 'RBI PSL', tagColor: '#7B1F1F', tagBg: '#FCEAEA', desc: 'Eligible under RBI Priority Sector Lending guidelines', icon: 'bullseye' },
{ id: 'nps', label: 'Non-Priority Sector', tag: 'General', tagColor: '#444441', tagBg: '#F1EFE8', desc: 'Standard corporate — no special priority sector classification', icon: 'building' }
{
id: 'msme',
label: 'MSME',
tag: 'Udyam / MSME',
tagColor: '#0A5C6B',
tagBg: '#E6F4F6',
desc: 'Micro, Small & Medium Enterprise — Ministry of MSME / Udyam Registration',
icon: 'cogs'
},
{
id: 'startup',
label: 'Startup India Registered',
tag: 'DPIIT',
tagColor: '#1A5FAB',
tagBg: '#EAF2FB',
desc: 'DPIIT recognition under Startup India initiative',
icon: 'rocket'
},
{
id: 'mudra',
label: 'Mudra Borrower',
tag: 'PMMY',
tagColor: '#8A5A00',
tagBg: '#FEF3DC',
desc: 'Pradhan Mantri Mudra Yojana — SIDBI / Mudra scheme',
icon: 'hand-holding-usd'
},
{
id: 'eou',
label: 'Export Oriented Unit',
tag: 'EOU',
tagColor: '#1B7A4A',
tagBg: '#E8F5EE',
desc: 'Customs-registered EOU under DGFT / Ministry of Commerce',
icon: 'ship'
},
{
id: 'importexport',
label: 'Import Export Business',
tag: 'DGFT / IEC',
tagColor: '#5B3A8A',
tagBg: '#F0EBF8',
desc: 'Entity with valid DGFT Importer Exporter Code',
icon: 'exchange-alt'
},
{
id: 'psl',
label: 'Priority Sector Borrower',
tag: 'RBI PSL',
tagColor: '#7B1F1F',
tagBg: '#FCEAEA',
desc: 'Eligible under RBI Priority Sector Lending guidelines',
icon: 'bullseye'
},
{
id: 'nps',
label: 'Non-Priority Sector',
tag: 'General',
tagColor: '#444441',
tagBg: '#F1EFE8',
desc: 'Standard corporate — no special priority sector classification',
icon: 'building'
}
];
/** Toggle & expand state per category */
@@ -89,7 +149,15 @@ export class ClientEntityKycStepComponent implements OnInit, OnChanges {
ngOnChanges(changes: SimpleChanges): void {
if (changes['readOnly']) {
const forms = [this.msmeForm, this.startupForm, this.mudraForm, this.eouForm, this.importexportForm, this.pslForm, this.npsForm];
const forms = [
this.msmeForm,
this.startupForm,
this.mudraForm,
this.eouForm,
this.importexportForm,
this.pslForm,
this.npsForm
];
for (const form of forms) {
if (!form) continue;
if (this.readOnly) {
@@ -213,14 +281,22 @@ export class ClientEntityKycStepComponent implements OnInit, OnChanges {
getForm(categoryId: string): UntypedFormGroup {
switch (categoryId) {
case 'msme': return this.msmeForm;
case 'startup': return this.startupForm;
case 'mudra': return this.mudraForm;
case 'eou': return this.eouForm;
case 'importexport': return this.importexportForm;
case 'psl': return this.pslForm;
case 'nps': return this.npsForm;
default: return this.fb.group({});
case 'msme':
return this.msmeForm;
case 'startup':
return this.startupForm;
case 'mudra':
return this.mudraForm;
case 'eou':
return this.eouForm;
case 'importexport':
return this.importexportForm;
case 'psl':
return this.pslForm;
case 'nps':
return this.npsForm;
default:
return this.fb.group({});
}
}
@@ -236,7 +312,7 @@ export class ClientEntityKycStepComponent implements OnInit, OnChanges {
}
get enabledCategories(): CategoryMeta[] {
return this.categories.filter(c => this.enabled[c.id]);
return this.categories.filter((c) => this.enabled[c.id]);
}
get enabledCount(): number {
@@ -266,7 +342,7 @@ export class ClientEntityKycStepComponent implements OnInit, OnChanges {
next: () => {
this.saving[categoryId] = false;
this.saved[categoryId] = true;
setTimeout(() => this.saved[categoryId] = false, 3000);
setTimeout(() => (this.saved[categoryId] = false), 3000);
},
error: () => {
this.saving[categoryId] = false;
@@ -306,6 +382,10 @@ export class ClientEntityKycStepComponent implements OnInit, OnChanges {
}
// Keep old getter for backward compatibility
get entityKycData(): any { return this.classificationData; }
get hasEntityKycData(): boolean { return this.hasClassificationData; }
get entityKycData(): any {
return this.classificationData;
}
get hasEntityKycData(): boolean {
return this.hasClassificationData;
}
}