@adonoustech/bacon-core 6.0.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonoustech/bacon-core",
3
- "version": "6.0.0",
3
+ "version": "6.2.0",
4
4
  "scripts": {
5
5
  "build:cjs": "tsc -p tsconfig.cjs.json",
6
6
  "build:es": "tsc -p tsconfig.es.json",
@@ -39,5 +39,5 @@
39
39
  "bugs": {
40
40
  "url": "https://github.com/AdonousTech/bacon-core/issues"
41
41
  },
42
- "gitHead": "0d6214f54623568a0a08fb67625c432639a40a87"
42
+ "gitHead": "f5f1355daddae0fffb6b4fb3a6b2cba593b06150"
43
43
  }
@@ -0,0 +1,155 @@
1
+ import { IBaconClientChecklistItem } from "./i-bacon-client-checklist-item";
2
+ import { IClientAcctBusinessOwner } from "./i-client-acct-business-owner";
3
+ import { IAdminClientActionItem, IAdminClientService } from "./i-admin-client";
4
+
5
+ /**
6
+ * Business information structure for client detail view
7
+ */
8
+ export interface IAdminClientDetailBusinessInfo {
9
+ /** Legal business name */
10
+ legalBusinessName?: string;
11
+ /** IRS Tax ID / EIN */
12
+ irsTaxIdEIN?: string;
13
+ /** Business entity type (S-Corporation, LLC, etc.) */
14
+ businessEntityType?: string;
15
+ /** Date of incorporation - ISO date string */
16
+ dateOfIncorporation?: string;
17
+ /** Date of S-Corp election - ISO date string (S-Corps only) */
18
+ dateOfSCorpElection?: string;
19
+ /** State of incorporation (2-letter code) */
20
+ stateOfIncorporation?: string;
21
+ /** State tax ID */
22
+ stateTaxId?: string;
23
+ /** Client acquisition date - ISO date string */
24
+ clientAcquisitionDate?: string;
25
+ }
26
+
27
+ /**
28
+ * Employee information structure for client detail view
29
+ */
30
+ export interface IAdminClientDetailEmployeeInfo {
31
+ /** Number of shareholders on payroll (S-Corp/C-Corp only) */
32
+ shareholdersOnPayroll?: number;
33
+ /** Number of non-shareholder employees */
34
+ nonShareholderEmployees?: number;
35
+ /** B&O tax filing frequency */
36
+ boTaxFilingFrequency?: string;
37
+ }
38
+
39
+ /**
40
+ * Admin configuration flags for client detail view
41
+ */
42
+ export interface IAdminClientDetailAdminConfig {
43
+ /** Whether LHA provides payroll services for this client */
44
+ providesPayroll: boolean;
45
+ /** Whether LHA provides state tax filings (B&O) for this client */
46
+ providesStateTaxFilingsBnO: boolean;
47
+ /** Whether this is a business tax client */
48
+ isBusinessTaxClient: boolean;
49
+ /** Whether this is a personal tax client */
50
+ isPersonalTaxClient: boolean;
51
+ }
52
+
53
+ /**
54
+ * Action items categorized by status for detail view
55
+ */
56
+ export interface IAdminClientDetailActionItems {
57
+ /** Action items with lifeCycle !== 'Completed' */
58
+ pending: IAdminClientActionItem[];
59
+ /** Action items with lifeCycle === 'Completed' */
60
+ completed: IAdminClientActionItem[];
61
+ /** Total count of all action items */
62
+ total: number;
63
+ }
64
+
65
+ /**
66
+ * Checklist summary for client detail view
67
+ */
68
+ export interface IAdminClientDetailChecklist {
69
+ /** All checklist items */
70
+ items: IBaconClientChecklistItem[];
71
+ /** Count of completed items */
72
+ completedCount: number;
73
+ /** Total count of items */
74
+ totalCount: number;
75
+ /** Completion percentage (0-100) */
76
+ progressPercent: number;
77
+ }
78
+
79
+ /**
80
+ * File sharing configuration for client detail view
81
+ */
82
+ export interface IAdminClientDetailFileSharing {
83
+ /** Whether file sharing is enabled */
84
+ enabled: boolean;
85
+ }
86
+
87
+ /**
88
+ * Intake form status for client detail view
89
+ */
90
+ export interface IAdminClientDetailIntakeStatus {
91
+ /** Whether the intake form is complete */
92
+ isComplete: boolean;
93
+ /** ISO timestamp of when intake was submitted */
94
+ submittedAt?: string;
95
+ /** ISO timestamp of last modification */
96
+ lastModified?: string;
97
+ }
98
+
99
+ /**
100
+ * Structured detail view model for individual client
101
+ * Used in the client detail panel/modal
102
+ *
103
+ * @description This interface provides a structured, organized view
104
+ * of all client data for the detail panel. Data is transformed from
105
+ * the raw IAdminClient format into logical groups for display.
106
+ */
107
+ export interface IAdminClientDetail {
108
+ /** User unique identifier (Cognito sub) */
109
+ sub: string;
110
+
111
+ /** Client display name */
112
+ name: string;
113
+
114
+ /** Client email address */
115
+ email: string;
116
+
117
+ /** Client phone number */
118
+ phone?: string;
119
+
120
+ /** Account status */
121
+ status: "active" | "inactive";
122
+
123
+ /** Business information from intake form */
124
+ businessInfo: IAdminClientDetailBusinessInfo;
125
+
126
+ /** Array of business owners from intake form */
127
+ businessOwners: IClientAcctBusinessOwner[];
128
+
129
+ /** Employee information from intake form */
130
+ employeeInfo: IAdminClientDetailEmployeeInfo;
131
+
132
+ /** Admin configuration flags */
133
+ adminConfig: IAdminClientDetailAdminConfig;
134
+
135
+ /** Client's subscribed services */
136
+ services: IAdminClientService[];
137
+
138
+ /** Total value of all subscribed services */
139
+ totalServiceValue: number;
140
+
141
+ /** Whether client has private pricing (service ID 'EXT00') */
142
+ hasPrivatePricing: boolean;
143
+
144
+ /** Action items organized by status */
145
+ actionItems: IAdminClientDetailActionItems;
146
+
147
+ /** Onboarding checklist summary */
148
+ checklist: IAdminClientDetailChecklist;
149
+
150
+ /** File sharing configuration */
151
+ fileSharing: IAdminClientDetailFileSharing;
152
+
153
+ /** Intake form submission status */
154
+ intakeStatus: IAdminClientDetailIntakeStatus;
155
+ }
@@ -0,0 +1,77 @@
1
+ import { IAdminClient } from "./i-admin-client";
2
+
3
+ /**
4
+ * Flattened model for admin client table display
5
+ * Pre-calculated metrics for efficient rendering in MatTable
6
+ *
7
+ * @description This interface represents a single row in the admin
8
+ * client management table. All calculated fields are pre-computed
9
+ * during data transformation to optimize rendering performance.
10
+ */
11
+ export interface IAdminClientTableRow {
12
+ /** User unique identifier (Cognito sub) */
13
+ sub: string;
14
+
15
+ /** Display name from general.name */
16
+ clientName: string;
17
+
18
+ /** Email address from general.email */
19
+ email: string;
20
+
21
+ /** Phone number from general.phone_number */
22
+ phoneNumber?: string;
23
+
24
+ /** Legal business name from intake form */
25
+ legalBusinessName?: string;
26
+
27
+ /** Business entity type from intake form (e.g., S-Corporation, LLC) */
28
+ businessEntityType?: string;
29
+
30
+ /** State of incorporation from intake form */
31
+ stateOfIncorporation?: string;
32
+
33
+ /** Count of subscribed services */
34
+ serviceCount: number;
35
+
36
+ /** Total value of all subscribed services */
37
+ serviceValue: number;
38
+
39
+ /** Count of action items with lifeCycle === 'Created' */
40
+ pendingActionCount: number;
41
+
42
+ /** Count of action items with lifeCycle === 'Completed' */
43
+ completedActionCount: number;
44
+
45
+ /** Checklist completion percentage (0-100) */
46
+ checklistProgress: number;
47
+
48
+ /** Account status */
49
+ status: "active" | "inactive";
50
+
51
+ /** Whether client has private pricing (service ID 'EXT00') */
52
+ isPrivatePricing: boolean;
53
+
54
+ /** Whether client has completed the intake form */
55
+ hasIntakeData: boolean;
56
+
57
+ /** Whether file sharing is enabled for this client */
58
+ fileShareEnabled: boolean;
59
+
60
+ /** Admin flag: Provides payroll services */
61
+ providesPayroll?: boolean;
62
+
63
+ /** Admin flag: Is a business tax client */
64
+ isBusinessTaxClient?: boolean;
65
+
66
+ /** Admin flag: Is a personal tax client */
67
+ isPersonalTaxClient?: boolean;
68
+
69
+ /** Client acquisition date from intake form */
70
+ clientAcquisitionDate?: string;
71
+
72
+ /** Last modified timestamp */
73
+ lastModified?: string;
74
+
75
+ /** Reference to the original full client data */
76
+ _raw?: IAdminClient;
77
+ }
@@ -0,0 +1,117 @@
1
+ import { IBaconClientChecklistItem } from "./i-bacon-client-checklist-item";
2
+ import { IClientAcctIntakeData } from "./i-client-acct-intake";
3
+
4
+ /**
5
+ * General user information from Cognito
6
+ */
7
+ export interface IAdminClientGeneral {
8
+ "cognito:user_status"?: string;
9
+ email: string;
10
+ email_verified?: string;
11
+ name: string;
12
+ phone_number?: string;
13
+ phone_number_verified?: string;
14
+ sub: string;
15
+ [key: string]: any;
16
+ }
17
+
18
+ /**
19
+ * Service interface for client subscriptions
20
+ * NOTE: Use IBaconService from @adonoustech/bacon-data for full service details
21
+ */
22
+ export interface IAdminClientService {
23
+ active: boolean;
24
+ category: string;
25
+ description: string;
26
+ frequency: string;
27
+ id: string;
28
+ instanceId?: string;
29
+ lastActivationDate?: string;
30
+ lastDeactivationDate?: string;
31
+ maxAccounts?: number;
32
+ name: string;
33
+ pencePrice?: number;
34
+ price: number;
35
+ terms?: string;
36
+ type: string;
37
+ [key: string]: any;
38
+ }
39
+
40
+ /**
41
+ * Stripe object containing selected services
42
+ */
43
+ export interface IAdminClientStripeObject {
44
+ selected: {
45
+ services: IAdminClientService[];
46
+ };
47
+ customerId?: string;
48
+ [key: string]: any;
49
+ }
50
+
51
+ /**
52
+ * Action item structure for client tasks
53
+ */
54
+ export interface IAdminClientActionItem {
55
+ actionId?: string;
56
+ actionInstanceId?: string;
57
+ actionName?: string;
58
+ actionExplanation?: string;
59
+ actionInstruction?: string;
60
+ lifeCycle?: "Draft" | "Created" | "Acknowledged" | "Submitted" | "Completed";
61
+ severity?: "Low" | "Normal" | "High" | "Critical";
62
+ serviceId?: string;
63
+ serviceName?: string;
64
+ createdEntryTime?: string;
65
+ completedEntryTime?: string;
66
+ FromDate?: string;
67
+ ToDate?: string;
68
+ TransactionAmount?: number;
69
+ correspondence?: any[];
70
+ [key: string]: any;
71
+ }
72
+
73
+ /**
74
+ * Consolidated client data model for admin dashboard
75
+ * Aggregates data from multiple DynamoDB attributes
76
+ *
77
+ * @description This interface represents the complete client record
78
+ * as stored in DynamoDB, combining data from:
79
+ * - federated-identity: Auth provider information
80
+ * - general: Cognito user attributes
81
+ * - stripeobject: Billing and service subscriptions
82
+ * - action-items: Client tasks and action items
83
+ * - status: Active/inactive state
84
+ * - client-acct-intake: Accounting intake form data
85
+ * - new_client_checklist_items: Onboarding checklist
86
+ */
87
+ export interface IAdminClient {
88
+ /** User unique identifier (Cognito sub) */
89
+ sub: string;
90
+
91
+ /** Federated identity provider string */
92
+ "federated-identity"?: string;
93
+
94
+ /** General user information from Cognito */
95
+ general: IAdminClientGeneral;
96
+
97
+ /** Stripe billing and services information */
98
+ stripeobject?: IAdminClientStripeObject;
99
+
100
+ /** Client action items and tasks */
101
+ "action-items"?: IAdminClientActionItem[];
102
+
103
+ /** Account status */
104
+ status: "active" | "inactive";
105
+
106
+ /** Client accounting intake form data */
107
+ "client-acct-intake"?: IClientAcctIntakeData;
108
+
109
+ /** New client onboarding checklist items */
110
+ new_client_checklist_items?: IBaconClientChecklistItem[];
111
+
112
+ /** File sharing enabled flag */
113
+ fileShareEnabled?: boolean;
114
+
115
+ /** Allow additional dynamic properties */
116
+ [key: string]: any;
117
+ }
@@ -5,6 +5,9 @@ export * from './i-actor-init-trig-resp';
5
5
  export * from './i-actor-init-trig-user-attr';
6
6
  export * from './i-actor-init-trigger-evt';
7
7
  export * from './i-actor-status';
8
+ export * from './i-admin-client';
9
+ export * from './i-admin-client-detail';
10
+ export * from './i-admin-client-table-row';
8
11
  export * from './i-bacon-action-item-settings';
9
12
  export * from './i-client-acct-admin-fields';
10
13
  export * from './i-client-acct-business-info';