@npm-zenwork/tax-remittance-ui 0.1.11 → 0.1.13

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.
@@ -1,5 +1,11 @@
1
1
  import { BankAccountResponse } from '../types/bankAccount';
2
2
  import { CreateBankAccountRequest, UpdateBankAccountRequest } from '../types/createBankAccount';
3
- export declare function getBankAccounts(entityId: number): Promise<BankAccountResponse[]>;
3
+ import { PagedResult } from '../types/pagination';
4
+ export interface GetBankAccountsQuery {
5
+ entityId: number;
6
+ pageNumber?: number;
7
+ pageSize?: number;
8
+ }
9
+ export declare function getBankAccounts({ entityId, pageNumber, pageSize, }: GetBankAccountsQuery): Promise<PagedResult<BankAccountResponse>>;
4
10
  export declare function createBankAccount(request: CreateBankAccountRequest): Promise<BankAccountResponse>;
5
11
  export declare function updateBankAccount(bankAccountDetailId: number, request: UpdateBankAccountRequest): Promise<BankAccountResponse>;
@@ -1,11 +1,17 @@
1
1
  import { CreateEntityDetailsRequest, EntityDetailsResponse, UpdateEntityDetailsRequest } from '../types/entity';
2
+ import { PagedResult } from '../types/pagination';
2
3
  interface CreateEntityDetailsResponse {
3
4
  entityId: number;
4
5
  userId: number | null;
5
6
  apiClientId: number | null;
6
7
  status: string;
7
8
  }
8
- export declare function getMyEntities(): Promise<EntityDetailsResponse[]>;
9
+ export interface GetMyEntitiesQuery {
10
+ search?: string;
11
+ pageNumber?: number;
12
+ pageSize?: number;
13
+ }
14
+ export declare function getMyEntities({ search, pageNumber, pageSize, }?: GetMyEntitiesQuery): Promise<PagedResult<EntityDetailsResponse>>;
9
15
  export declare function createEntity(request: CreateEntityDetailsRequest): Promise<CreateEntityDetailsResponse>;
10
16
  export declare function updateEntity(entityId: number, request: UpdateEntityDetailsRequest): Promise<EntityDetailsResponse>;
11
17
  export {};
@@ -1,5 +1,21 @@
1
1
  import { CreateFederalPaymentRequest, FederalPaymentResponse, FederalTaxFormOption, FederalTaxTypeCodeOption, UpdateFederalPaymentRequest } from '../types/federalPayment';
2
- export declare function getFederalPayments(entityId: number): Promise<FederalPaymentResponse[]>;
2
+ import { PagedResult } from '../types/pagination';
3
+ import { PaymentStatus } from '../components/payments/paymentsTableConfig';
4
+ export interface FederalPaymentStatusCounts {
5
+ drafts: number;
6
+ scheduled: number;
7
+ submitted: number;
8
+ rejected: number;
9
+ paid: number;
10
+ }
11
+ export interface GetFederalPaymentsQuery {
12
+ entityId: number;
13
+ status?: PaymentStatus | string;
14
+ pageNumber?: number;
15
+ pageSize?: number;
16
+ }
17
+ export declare function getFederalPayments({ entityId, status, pageNumber, pageSize, }: GetFederalPaymentsQuery): Promise<PagedResult<FederalPaymentResponse>>;
18
+ export declare function getFederalPaymentStatusCounts(entityId: number): Promise<FederalPaymentStatusCounts>;
3
19
  export declare function getFederalPaymentById(federalPaymentId: number): Promise<FederalPaymentResponse>;
4
20
  export declare function getFederalFormTypes(entityId: number): Promise<FederalTaxFormOption[]>;
5
21
  export declare function getFederalTaxTypeCodes(formType: string): Promise<FederalTaxTypeCodeOption[]>;
@@ -1,2 +1,7 @@
1
1
  import { GovPayTransaction } from '../types/paymentHistory';
2
- export declare function getPaymentTransactions(): Promise<GovPayTransaction[]>;
2
+ import { PagedResult } from '../types/pagination';
3
+ export interface GetPaymentTransactionsQuery {
4
+ pageNumber?: number;
5
+ pageSize?: number;
6
+ }
7
+ export declare function getPaymentTransactions({ pageNumber, pageSize, }?: GetPaymentTransactionsQuery): Promise<PagedResult<GovPayTransaction>>;
@@ -0,0 +1,30 @@
1
+ import { PaymentStatus } from '../components/payments/paymentsTableConfig';
2
+ import { PagedResult } from '../types/pagination';
3
+ export type RemittancePaymentCategory = 'all' | 'federal' | 'state';
4
+ export interface RemittancePaymentResponse {
5
+ id: number;
6
+ category: 'federal' | 'state';
7
+ referenceNumber: string | null;
8
+ jurisdiction: string;
9
+ taxPeriod: string;
10
+ amount: number;
11
+ paymentDate: string;
12
+ status: string | null;
13
+ reason: string | null;
14
+ }
15
+ export interface RemittancePaymentStatusCounts {
16
+ drafts: number;
17
+ scheduled: number;
18
+ submitted: number;
19
+ rejected: number;
20
+ paid: number;
21
+ }
22
+ export interface GetRemittancePaymentsQuery {
23
+ entityId: number;
24
+ status?: PaymentStatus | string;
25
+ category?: RemittancePaymentCategory;
26
+ pageNumber?: number;
27
+ pageSize?: number;
28
+ }
29
+ export declare function getRemittancePayments({ entityId, status, category, pageNumber, pageSize, }: GetRemittancePaymentsQuery): Promise<PagedResult<RemittancePaymentResponse>>;
30
+ export declare function getRemittancePaymentStatusCounts(entityId: number, category?: RemittancePaymentCategory): Promise<RemittancePaymentStatusCounts>;
@@ -1,8 +1,24 @@
1
1
  import { CreateStatePaymentRequest, StatePaymentFormMetadata, StatePaymentReasonOption, StatePaymentResponse, StatePaymentStateOption, UpdateStatePaymentRequest } from '../types/statePayment';
2
+ import { PagedResult } from '../types/pagination';
3
+ import { PaymentStatus } from '../components/payments/paymentsTableConfig';
4
+ export interface StatePaymentStatusCounts {
5
+ drafts: number;
6
+ scheduled: number;
7
+ submitted: number;
8
+ rejected: number;
9
+ paid: number;
10
+ }
11
+ export interface GetStatePaymentsQuery {
12
+ entityId: number;
13
+ status?: PaymentStatus | string;
14
+ pageNumber?: number;
15
+ pageSize?: number;
16
+ }
2
17
  export declare function getStatePaymentStates(signal?: AbortSignal): Promise<StatePaymentStateOption[]>;
3
18
  export declare function getStatePaymentReasons(entityId: number, state: string, signal?: AbortSignal): Promise<StatePaymentReasonOption[]>;
4
19
  export declare function getStatePaymentValidationMetadata(entityId: number, state: string, reason: string, signal?: AbortSignal): Promise<StatePaymentFormMetadata>;
5
- export declare function getStatePayments(entityId: number): Promise<StatePaymentResponse[]>;
20
+ export declare function getStatePayments({ entityId, status, pageNumber, pageSize, }: GetStatePaymentsQuery): Promise<PagedResult<StatePaymentResponse>>;
21
+ export declare function getStatePaymentStatusCounts(entityId: number): Promise<StatePaymentStatusCounts>;
6
22
  export declare function getStatePaymentById(statePaymentDetailId: number): Promise<StatePaymentResponse>;
7
23
  export declare function createStatePayment(request: CreateStatePaymentRequest): Promise<StatePaymentResponse>;
8
24
  export declare function updateStatePayment(statePaymentDetailId: number, request: UpdateStatePaymentRequest): Promise<StatePaymentResponse>;
@@ -0,0 +1,7 @@
1
+ import { EntityDetailsResponse } from '../../types/entity';
2
+ interface EntityActionsMenuProps {
3
+ entity: EntityDetailsResponse;
4
+ onEdit: (entity: EntityDetailsResponse) => void;
5
+ }
6
+ export declare function EntityActionsMenu({ entity, onEdit }: EntityActionsMenuProps): import("react").JSX.Element;
7
+ export {};
@@ -1,5 +1,13 @@
1
1
  import { EntityDetailsResponse } from '../../types/entity';
2
2
  export declare function formatEin(idNumber: string): string;
3
+ export declare function formatSsn(idNumber: string): string;
4
+ /** Format a stored 9-digit id for display: SSN for Individual, EIN otherwise. */
5
+ export declare function formatIdNumber(idNumber: string, accountType: string): string;
6
+ /**
7
+ * Format an id as the user types — strips non-digits, caps at 9 digits, and
8
+ * inserts dashes for the appropriate mask (SSN `XXX-XX-XXXX`, EIN `XX-XXXXXXX`).
9
+ */
10
+ export declare function formatIdNumberInput(value: string, accountType: string): string;
3
11
  export declare function formatPhone(phoneNumber: string): string;
4
12
  export declare function formatJoinedDate(date: string): string;
5
13
  export declare function getJoinedYear(date: string): string;
@@ -0,0 +1,20 @@
1
+ export interface StateOption {
2
+ code: string;
3
+ name: string;
4
+ }
5
+ interface StateSearchSelectProps {
6
+ label: string;
7
+ value: string;
8
+ onChange: (code: string) => void;
9
+ options: StateOption[];
10
+ required?: boolean;
11
+ disabled?: boolean;
12
+ error?: string;
13
+ placeholder?: string;
14
+ }
15
+ /**
16
+ * Searchable state dropdown — the same search-and-filter behavior as the state
17
+ * payment "Choose a State" picker, styled to sit inside a form as a field.
18
+ */
19
+ export declare function StateSearchSelect({ label, value, onChange, options, required, disabled, error, placeholder, }: StateSearchSelectProps): import("react").JSX.Element;
20
+ export {};
@@ -13,6 +13,18 @@ export interface RemittancePaymentRow {
13
13
  reason: string | null;
14
14
  tab: PaymentStatus;
15
15
  }
16
+ export declare function formatTaxPeriod(taxPeriod: string): string;
17
+ export declare function mapRemittancePaymentToRow(payment: {
18
+ id: number;
19
+ category: 'federal' | 'state';
20
+ referenceNumber: string | null;
21
+ jurisdiction: string;
22
+ taxPeriod: string;
23
+ amount: number;
24
+ paymentDate: string;
25
+ status: string | null;
26
+ reason: string | null;
27
+ }): RemittancePaymentRow;
16
28
  export declare function mapFederalPaymentToRemittanceRow(payment: FederalPaymentResponse): RemittancePaymentRow;
17
29
  export declare function mapStatePaymentToRemittanceRow(payment: StatePaymentResponse): RemittancePaymentRow;
18
30
  export declare function filterRemittanceRows(rows: RemittancePaymentRow[], tab: PaymentStatus, paymentTypeFilter: string): RemittancePaymentRow[];
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Live input restrictions for the State ID field, derived from the backend
3
+ * validation-metadata regex (`stateId.pattern`). Mirrors the SSN/EIN entry
4
+ * restrictions on the entity form: strip characters that can never be valid,
5
+ * normalize case, and cap the length — without ever blocking a valid value.
6
+ *
7
+ * The catalog patterns only use digit runs (`\d{n}` / `\d{n,m}`), literal
8
+ * uppercase letters, letter classes (`[A-Z]`), and the separators `-`, ` `,
9
+ * and `/`. The helpers below understand exactly that subset.
10
+ */
11
+ /**
12
+ * Sanitize a State ID as the user types: uppercase (validation uppercases
13
+ * anyway), then drop any character the selected state's format can't contain.
14
+ */
15
+ export declare function sanitizeStateId(value: string, pattern: string | null | undefined): string;
16
+ export type StateIdSlotKind = 'digit' | 'letter';
17
+ export type StateIdMaskToken = {
18
+ type: 'slot';
19
+ kind: StateIdSlotKind;
20
+ } | {
21
+ type: 'separator';
22
+ char: string;
23
+ };
24
+ /**
25
+ * Turn a linear metadata pattern into an ordered mask so separators (`-`, ` `,
26
+ * `/`) can be auto-inserted as the user types — e.g. `\d{2}-\d{7}` yields two
27
+ * digit slots, a `-`, then seven digit slots, so `121234567` displays as
28
+ * `12-1234567`.
29
+ *
30
+ * Returns `null` when the pattern isn't a single fixed layout — alternations
31
+ * (`(?:…|…)`) or variable runs (`{n,m}`) have no unambiguous mask, so the
32
+ * caller keeps the plain sanitize behavior instead.
33
+ */
34
+ export declare function buildStateIdMask(pattern: string | null | undefined): StateIdMaskToken[] | null;
35
+ /**
36
+ * Format a State ID against its mask as the user types: uppercase, keep only
37
+ * characters that fit each slot (in order), and auto-insert separators. A
38
+ * trailing separator isn't shown until the following slot has a character.
39
+ */
40
+ export declare function formatStateId(value: string, tokens: StateIdMaskToken[]): string;
41
+ /**
42
+ * Longest string the `pattern` can match — used as the input `maxLength` so the
43
+ * field can't accept more characters than any accepted format. Returns
44
+ * `undefined` when the pattern uses a construct these helpers don't model, so
45
+ * the caller simply omits the cap rather than risk blocking a valid value.
46
+ */
47
+ export declare function maxStateIdLength(pattern: string | null | undefined): number | undefined;
@@ -1,9 +1,5 @@
1
- import { PaymentHistoryResponse } from '../../types/paymentHistory';
2
1
  interface PaymentHistorySectionProps {
3
2
  entityId: number | null;
4
- transactions?: PaymentHistoryResponse[];
5
- isLoading?: boolean;
6
- isError?: boolean;
7
3
  }
8
- export declare function PaymentHistorySection({ entityId, transactions, isLoading, isError, }: PaymentHistorySectionProps): import("react").JSX.Element;
4
+ export declare function PaymentHistorySection({ entityId }: PaymentHistorySectionProps): import("react").JSX.Element;
9
5
  export {};
@@ -0,0 +1,11 @@
1
+ export interface PaginationProps {
2
+ page: number;
3
+ pageSize: number;
4
+ totalCount: number;
5
+ onPageChange: (page: number) => void;
6
+ onPageSizeChange?: (pageSize: number) => void;
7
+ pageSizeOptions?: number[];
8
+ disabled?: boolean;
9
+ className?: string;
10
+ }
11
+ export declare function Pagination({ page, pageSize, totalCount, onPageChange, onPageSizeChange, pageSizeOptions, disabled, className, }: PaginationProps): import("react").JSX.Element | null;