Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Company Agency CLI

A command-line application for managing company agencies across different regions of Iran.

📋 Description

This CLI application allows users to manage company agencies. Data is stored persistently in a JSON file.

🏢 Entities

Agency

Property Type Description
Id string Unique identifier
Name string Agency name
Address string Physical address
PhoneNumber string Contact number
DateOfMembership string Registration date
CountOfEmployee uint16 Number of employees
Region string Province/City

📖 User Stories (Use Cases)

  • ✅ Write data to JSON file
  • ✅ Read data from JSON file
  • ✅ Find agency by ID in a region
  • ✅ List all agencies in a region
  • ✅ Get complete agency information by ID
  • ✅ Create new agency
  • ✅ Edit agency by ID
  • ✅ Show status (count) of agencies in a region

🎯 Available Commands

Command Shortcut Description
list l List all agencies in a region
get g Get agency details by ID
create c Create a new agency
edit e Edit an existing agency
status s Show statistics for a region
exit 0 Exit the program

🌍 Supported Regions

tehran, isfahan, shiraz, mashhad, tabriz, kish, rasht, ahvaz, kerman, yazd, hamedan, qom, karaj, urmia, zanjan, sari, gorgan, ardabil, kermanshah, ilam, khorramabad, sanandaj, qazvin, semnan, birjand, bojnord, zahedan, bandarabbas, bushehr, yasuj, shahrekord, arak

📁 Project Structure

company-agency-cli/
├── go.mod                 # Module management
├── main.go                # Main application file
├── entities/
│   └── agency.go          # Agency data model
├── storage/
│   └── json_storage.go    # JSON storage operations
├── utils/
│   └── helpers.go         # Helper functions
└── README.md              # Documentation

🚀 Installation & Usage

# Clone the repository
git clone https://github.com/Sinabehboodi/company-agency-cli.git

# Enter the project directory
cd company-agency-cli

# Build the application
go build -o agency-cli main.go

# Run the application
./agency-cli --command list --region tehran
./agency-cli --command create --region isfahan
./agency-cli --command get --region shiraz
./agency-cli --command status --region mashhad

📝 Examples

# List agencies in Tehran
./agency-cli --command list --region tehran

# Create a new agency in Isfahan
./agency-cli --command create --region isfahan

# Get agency details (will prompt for ID)
./agency-cli --command get --region shiraz

# Show statistics for Mashhad
./agency-cli --command status --region mashhad

👤 Author

Sina Behboodi

📄 License

MIT

About

This is my first project with Golang.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages