npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

highcourt-affidavit

v1.0.5

Published

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![npm version](https://img.shields.io/npm/v/highcourt-affidavit.svg)](https://www.npmjs.com/package/highcourt-affidavit) [![Angular](https://img.shields.

Readme

Federal High Court Affidavit Library for Angular

License npm version Angular

Introduction

This library simplifies the integration of the Federal High Court's Affidavit Library into your Angular applications. It provides a user-friendly Angular component (highcourt-affidavit) that can be easily customized and integrated to manage the creation of affidavits.

Features

  • Effortless Integration: Seamlessly integrate affidavit creation into your Angular application with minimal setup
  • Customizable Component: Tailor the highcourt-affidavit component to match your specific requirements and workflows
  • Bulk Operations: Create multiple affidavits at once using the bulk creation component
  • Service-based API: Use the service directly for programmatic affidavit creation
  • Clear Documentation: Comprehensive documentation and examples to guide you through the library's usage
  • Error Handling: Built-in error handling mechanisms to address potential issues during affidavit creation
  • TypeScript Support: Full TypeScript support with type definitions

Prerequisites

  • Angular 16 or higher
  • Node.js 18 or higher
  • npm or yarn package manager

Installation

  1. Install using npm:

    npm install highcourt-affidavit

    Or using yarn:

    yarn add highcourt-affidavit

2. Import the Module

In your Angular app, import the HighcourtAffidavitModule in your app module or any other relevant module where you want to use the affidavit functionality. Pass your API keys from the environment configuration:

import { NgModule } from "@angular/core";
import { HighcourtAffidavitModule } from "highcourt-affidavit";
import { environment } from "../environments/environment";

@NgModule({
  imports: [
    HighcourtAffidavitModule.forRoot(environment.affidavit_api_secret_key, environment.mode), // Both token and mode arguments are optional
  ],
  // ...
})
export class AppModule {}

Note: Make sure to set the affidavit_api_secret_key and affidavit_api_public_key in your environment files.

3. Integration Methods

You can integrate the affidavit functionality using either the component-based approach or the service-based approach.

Option 1: Component-based Integration

Single Affidavit Creation

Integrate the highcourt-affidavit component into your HTML template, optionally configuring it with token and mode properties. Capture its output using the event callback for further processing.

<highcourt-affidavit (callBack)="getApp($event)" [token]="'FHC_sk_xxxxxxxx-xxxxxx'" [mode]="'production'"> </highcourt-affidavit>
export class MyComponent {
  getApp(data: any) {
    console.log("Application", data);
    // Handle the affidavit creation response
  }
}

Bulk Affidavit Creation

To create multiple affidavits at once, use the e-affidavit-bulk-create-applications component. Provide a payload, affidavitTemplateId, and a unique client_ref.

<e-affidavit-bulk-create-applications [payload]="affidavitPayload" [affidavitTemplateId]="55" [client_ref]="'POSSAP-0023-2343243212211'" (callBack)="getApp($event)"> </e-affidavit-bulk-create-applications>
export class MyComponent {
  affidavitPayload = [
    {
      deponent_name: "John Doe",
      deponent_nin: 12345678912,
      // ... other required fields
    },
  ];

  getApp(data: any) {
    console.log("Bulk Application", data);
    // Handle the bulk affidavit creation response
  }
}

View Application Details

You can also navigate directly to the details of an affidavit application using the client_ref and page parameters:

<e-affidavit-bulk-create-applications [page]="'details'" [client_ref]="'POSSAP-0023-2343243212211'"> </e-affidavit-bulk-create-applications>

Option 2: Service-based Integration

If you prefer a programmatic approach, use the HighcourtAffidavitLibraryService to create affidavits via a service call:

import { Component } from "@angular/core";
import { HighcourtAffidavitLibraryService } from "highcourt-affidavit";

@Component({
  selector: "app-create-affidavit",
  templateUrl: "./create-affidavit.component.html",
})
export class CreateAffidavitComponent {
  constructor(private affidavitService: HighcourtAffidavitLibraryService) {}

  createAffidavit() {
    const affidavitData = {
      affidavit_type_name: "Affidavit of Ownership",
      deponent_name: "Ahmad Ibrahim",
      deponent_nin: 12345678912,
      town_native: "Gusau",
      town_resident: "Gusau",
      occupation: "Software Developer",
      gender: "Male",
      religion: "Islam",
      signature_file: "signature.png", // Should be provided in binary format
      passport_photo_file: "passport.jpg", // Should be provided in binary format
      identity_photo_file: "id-card.jpeg", // Should be provided in binary format
      applicant_email: "[email protected]",
      applicant_phone: "07066666666",
      adult_minor: "adult",
      affidavit_template_id: 1,
      lga_id: 1,
      court_id: 1,
      formEntries: [
        {
          placeholder: "fullName",
          label: "Full Name",
          provided_value: "Ahmad Ibrahim",
        },
      ],
      clauseEntries: [{ entry: "Affidavit Clause" }],
    };

    this.affidavitService.create(affidavitData).subscribe({
      next: (response) => {
        console.log("Affidavit Created:", response);
        // Handle successful creation
      },
      error: (error) => {
        console.error("Affidavit Creation Failed:", error);
        // Handle error
      },
    });
  }

  createBulkAffidavit() {
    const affidavitData = {
      affidavit_type_name: "Affidavit of Ownership",
      affidavit_template_id: 1,
      applicant_email: "[email protected]",
      applicant_phone: "07066666666",
      court_id: 1,
      applications: [
        {
          deponent_name: "Ahmad Ibrahim",
          deponent_nin: 12345678912,
          town_native: "Gusau",
          town_resident: "Gusau",
          occupation: "Software Developer",
          gender: "Male",
          religion: "Islam",
          signature_file: "signature.png", // Should be provided in binary format
          passport_photo_file: "passport.jpg", // Should be provided in binary format
          identity_photo_file: "id-card.jpeg", // Should be provided in binary format
          lga_id: 1,
          court_id: 1,
          formEntries: [
            {
              placeholder: "fullName",
              label: "Full Name",
              provided_value: "Ahmad Ibrahim",
            },
          ],
          clauseEntries: [{ entry: "Affidavit Clause" }],
        },
      ],
    };

    this.affidavitService.createBulk(affidavitData).subscribe({
      next: (response) => {
        console.log("Affidavits Created:", response);
        // Handle successful bulk creation
      },
      error: (error) => {
        console.error("Affidavits Creation Failed:", error);
        // Handle error
      },
    });
  }
}

Note: Make sure to set the affidavit_api_secret_key and affidavit_api_public_key in your environment files.

4. Add Styles

To ensure your application uses the correct styles for PrimeNG components and the affidavit library, import the following styles in your global styles.scss file:

@import "~primeng/resources/primeng.min.css";
@import "~primeflex/primeflex.scss";
@import "~primeicons/primeicons.css";
@import "~highcourt-affidavit/src/lib/styles.scss";
@import url("https://fonts.googleapis.com/css?family=Comfortaa");

5. Environment Configuration

Ensure you have set your API keys in the environment files. These keys are required for the affidavit service to function correctly:

export const environment = {
  production: false,
  affidavit_api_secret_key: "your_secret_key",
  affidavit_api_public_key: "your_public_key",
  mode: "test", // Can be either 'production' or 'test'
};

6. API Reference

Components

highcourt-affidavit

The main component for creating single affidavits.

Properties:

  • token (optional): Your API secret key
  • mode (optional): Environment mode ('production' or 'test')

Events:

  • callBack: Emitted when affidavit creation is completed

e-affidavit-bulk-create-applications

Component for creating multiple affidavits at once.

Properties:

  • payload: Array of affidavit data objects
  • affidavitTemplateId: Template ID for the affidavits
  • client_ref: Unique reference for the bulk operation
  • page (optional): Set to 'details' to view application details
  • token (optional): Your API secret key
  • mode (optional): Environment mode

Events:

  • callBack: Emitted when bulk affidavit creation is completed

Services

HighcourtAffidavitLibraryService

Service for programmatic affidavit creation.

Methods:

  • create(affidavitData): Create a single affidavit
  • createBulk(affidavitData): Create multiple affidavits

7. Data Models

Affidavit Data Structure

interface AffidavitData {
  affidavit_type_name: string;
  deponent_name: string;
  deponent_nin: number;
  town_native: string;
  town_resident: string;
  occupation: string;
  gender: string;
  religion: string;
  signature_file: string; // Binary format
  passport_photo_file: string; // Binary format
  identity_photo_file: string; // Binary format
  applicant_email: string;
  applicant_phone: string;
  adult_minor: "adult" | "minor";
  affidavit_template_id: number;
  lga_id: number;
  court_id: number;
  formEntries: FormEntry[];
  clauseEntries: ClauseEntry[];
}

interface FormEntry {
  placeholder: string;
  label: string;
  provided_value: string;
}

interface ClauseEntry {
  entry: string;
}

8. Troubleshooting

Common Issues

  1. Module not found error: Ensure you have installed the package correctly using npm or yarn.

  2. API key errors: Verify that your API keys are correctly set in the environment files.

  3. Styling issues: Make sure you have imported all required styles in your global styles file.

  4. File upload issues: Ensure that file uploads are in binary format as required by the API.

Getting Help

If you encounter any issues or need assistance:

  1. Check the NPM page
  2. Review the API documentation
  3. Contact support at [email protected] or visit Century Information Systems Contact

9. Contributing

We welcome contributions! For more information about contributing to this project, please contact us at [email protected] or visit Century Information Systems.

11. Changelog

Version 1.0.0

  • Initial release
  • Single affidavit creation
  • Bulk affidavit creation
  • Service-based integration
  • Component-based integration