Chuyển tới nội dung chính

SRS - Unified Agency Financial & Delivery System

Tổng quan tài liệu​

Đây là tài liệu Software Requirements Specification (SRS) đầy đủ cho hệ thống quản lý tài chính và vận hành tổng thể cho agency performance marketing.

Tên hệ thống: Unified Agency Financial & Delivery System (Agency ERP)

Phiên bản: 1.0 Ngày cập nhật: 2026-01-15


Cấu trúc tài liệu​

Tài liệu được chia thành 8 phần chính, mỗi phần một file riêng để dễ đọc và quản lý:

00-overview.md​

Tổng quan hệ thống

  • Giới thiệu và mục đích
  • Vấn đề cần giải quyết
  • Triết lý thiết kế
  • Phạm vi hệ thống
  • Kiến trúc tổng quan
  • Lợi ích kinh doanh
  • Tính năng nổi bật
  • Công nghệ và tích hợp
  • Roadmap phát triển

Đối tượng: CEO, Director, Product Owner - để hiểu tổng quan hệ thống


01-data-architecture.md​

Kiến trúc dữ liệu

  • Entity Relationship Diagram (ERD)
  • Database Schema chi tiết cho tất cả entities:
    • Contract
    • Scope
    • Campaign Plan
    • Campaign Execution
    • Payment Milestone
    • Vendor
    • Vendor Assignment
    • Vendor Payment
  • Computed Views & Reports
  • Indexes và Performance optimization
  • Data Integrity Rules
  • Audit Trail
  • Backup & Recovery

Đối tượng: Technical Lead, Database Administrator, Backend Developer


02-contract-management.md​

Quản lý Hợp đồng

  • Cấu trúc 3 tầng: Contract → Scope → Milestone
  • Contract Management
    • Use cases: Tạo, Kích hoạt, Xem, Sửa, Đóng hợp đồng
  • Scope Management
    • Tại sao cần Scope?
    • Các loại Scope (ads, web, app, seo, hosting, kol, etc.)
    • Attributes linh hoạt
    • Use cases: Tạo, Phân bổ ngân sách, Tracking, Alerts
    • Scope Lifecycle
  • Multi-Channel Contract Example
  • Business Rules
  • Reporting
  • Integration Points
  • Security & Permissions

Đối tượng: PM, Accountant, Business Analyst


03-budget-campaign.md​

Quản lý Ngân sách và Campaign

  • Campaign Planning
    • Nguyên tắc phân bổ ngân sách
    • Campaign Plan schema
    • Use cases: Import budget allocation, Tạo campaign plan, Tính break-even & profit
  • Campaign Naming Convention (CỰC KỲ QUAN TRỌNG)
    • Format chuẩn
    • Naming rules chi tiết
    • Parsing logic
    • Validation tool
  • Auto Budget Guard
    • Monitoring rules
    • Use cases: Warning, Critical alert, Auto-pause
  • KPI Pace Monitoring
    • Pace calculation
    • KPI alert rules
  • Profit Protection Engine
    • Real-time profit calculation
    • Protection rules
    • Block budget increase khi lỗ
  • Campaign Performance Dashboard
  • Batch Operations
  • Integration với Ads Platform (Meta, TikTok, Google)

Đối tượng: PM, Ads Team Lead, Technical Lead


04-data-integration.md​

Tích hợp dữ liệu BigQuery

  • Data Sources
    • Meta Ads (Facebook & Instagram)
    • TikTok Ads
    • Google Ads
  • BigQuery Architecture
    • Table structure (Raw, Normalized)
    • ETL Process (Extract, Transform, Load)
  • Campaign Name Parsing
  • Mapping Engine
    • Join với Campaign Plan
    • Aggregate to Scope Level
  • Sync Schedule
    • Data freshness requirements
    • Sync jobs
  • Real-time Event Processing (Webhooks)
  • Data Quality & Validation
    • Validation rules
    • Anomaly detection
  • Performance Optimization
    • Partitioning, Clustering
    • Materialized Views
    • Caching strategy
  • Error Handling & Retry Logic
  • Monitoring & Alerting
  • Security & Access Control

Đối tượng: Data Engineer, Backend Developer, DevOps


05-cashflow-management.md​

Quản lý Dòng tiền

  • Tại sao Cashflow quan trọng?
  • Payment Milestone
    • Schema
    • Milestone status flow
    • Use cases: Tạo, Auto-check, Xuất hóa đơn, Ghi nhận thanh toán
  • Cashflow Forecasting
    • Dòng tiền RA (Ads spend, Vendor payments, Infrastructure)
    • Dòng tiền VÀO (Milestones, Expected revenue)
    • Net Cashflow
  • Cashflow Alerts
    • Alert types (Negative cashflow, Overdue invoice, etc.)
    • Use cases
  • Scenario Planning
    • Best case, Realistic, Worst case
  • Integration với Accounting System
  • Reports & Dashboards
    • Cashflow summary
    • Aging report
    • Cash position chart
  • Best Practices
  • KPIs for Cashflow Management
  • Emergency Procedures

Đối tượng: Finance Manager, Accountant, Director


06-vendor-management.md​

Quản lý Nhà thầu

  • Tại sao cần quản lý Vendor?
  • Vendor Master Data
    • Schema
    • Vendor types
    • Use cases: Tạo vendor, Đánh giá vendor
  • Vendor Assignment
    • Schema
    • Use cases: Assign vendor, Track deliverable, Complete assignment
  • Vendor Payment Management
    • Payment schema
    • Payment workflow
    • Use cases: Create payment schedule, Approve payment, Process payment, Overdue alert
  • Cost Tracking & Profit Calculation
    • Scope total cost
    • Scope profit/loss
  • Vendor Performance Tracking
    • Vendor scorecard
    • Vendor comparison
  • Vendor Onboarding
  • Vendor Contract Management
  • Integrations
  • Reports
  • Best Practices

Đối tượng: PM, Accountant, Finance Manager


07-reporting-permissions.md​

Báo cáo và Phân quyền

  • Role-Based Access Control (RBAC)
    • Roles: Accountant, PM, Ads Team, Finance, Director, Admin
    • Permission Matrix đầy đủ
    • Data Access Rules
  • Dashboard theo Role
    • Accountant Dashboard
    • PM Dashboard
    • Finance Dashboard
    • Director Dashboard
  • Standard Reports
    • Contract Performance Report
    • P&L Report by Scope
    • Cashflow Report
    • Budget Utilization Report
    • Vendor Performance Report
  • Alert System
    • Alert types & priorities
    • Alert channels
    • Alert settings
  • Export & Integration
    • Export formats
    • Scheduled reports
    • API for external systems
  • Audit Trail
    • What to audit
    • Audit log schema
    • Audit report
  • Data Privacy & Security
    • Sensitive data
    • Data retention
    • Compliance (GDPR, Vietnam Data Protection)
  • Best Practices
  • Future Enhancements

Đối tượng: All roles, System Admin, Compliance Officer


Cách sử dụng tài liệu này​

Đối với CEO / Director​

  1. Đọc 00-overview.md để hiểu tổng quan
  2. Xem 02-contract-management.md - phần Multi-Channel Contract Example
  3. Xem 05-cashflow-management.md để hiểu về quản lý dòng tiền
  4. Xem 07-reporting-permissions.md - Director Dashboard

Đối với PM​

  1. Đọc 00-overview.md
  2. Chi tiết 02-contract-management.md - Scope Management
  3. Chi tiết 03-budget-campaign.md - toàn bộ
  4. Xem 06-vendor-management.md
  5. Xem 07-reporting-permissions.md - PM Dashboard

Đối với Accountant​

  1. Đọc 00-overview.md
  2. Chi tiết 02-contract-management.md
  3. Chi tiết 05-cashflow-management.md
  4. Xem 06-vendor-management.md - Vendor Payment
  5. Xem 07-reporting-permissions.md - Accountant Dashboard

Đối với Finance Manager​

  1. Đọc 00-overview.md
  2. Chi tiết 05-cashflow-management.md
  3. Xem 07-reporting-permissions.md - Finance Dashboard & Reports

Đối với Technical Team​

  1. Đọc 00-overview.md
  2. Chi tiết 01-data-architecture.md
  3. Chi tiết 04-data-integration.md
  4. Xem các phần Integration trong tất cả files

Đối với Ads Team​

  1. Đọc 00-overview.md
  2. Xem 03-budget-campaign.md - Campaign Naming Convention
  3. Xem 07-reporting-permissions.md - hiểu quyền hạn của mình

Key Concepts​

Contract-driven Architecture​

Mọi thứ xuất phát từ hợp đồng:

Contract → Scope → Campaign/Project → Milestone → Payment

Scope là đơn vị cốt lõi​

Scope là đơn vị:

  • Tính ngân sách
  • Tính KPI
  • Nghiệm thu
  • Thu tiền
  • Tính lời/lỗ

Một contract có nhiều scope, mỗi scope độc lập về tài chính.

Campaign Naming Convention​

Naming là chìa khóa để mapping data:

\<Client\>-\<Contract\>-\<Scope\>-\<Channel\>-\<Objective\>-\<Segment\>-\<Phase\>

Example: Kewpie-KWP2026-FB01-FB-Lead-Office-P1

Cashflow > Profit​

Agency không chết vì lỗ, mà chết vì thiếu cashflow. Hệ thống dự báo cashflow 3 tháng trước để tránh bị động.

Auto Budget Guard​

Hệ thống tự động:

  • Cảnh báo khi spend >= 95%
  • Pause khi spend >= 100%
  • Bảo vệ lợi nhuận

Technical Stack (Đề xuất)​

Backend​

  • Framework: MangoREST / Express.js / NestJS
  • Database: MongoDB (document) + PostgreSQL (relational)
  • Data Warehouse: Google BigQuery
  • API: RESTful API + GraphQL (optional)

Frontend​

  • Framework: React / Next.js
  • UI Library: Ant Design / Material-UI
  • Charts: Recharts / Chart.js / D3.js
  • State Management: Redux / Zustand

Data Integration​

  • ETL: Apache Airflow / Cloud Functions
  • Ads APIs: Meta Marketing API, TikTok Ads API, Google Ads API
  • Scheduling: Cron jobs / Cloud Scheduler

Infrastructure​

  • Cloud: Google Cloud Platform / AWS
  • Container: Docker
  • Orchestration: Kubernetes (optional for scale)
  • CI/CD: GitHub Actions / GitLab CI

Monitoring & Logging​

  • APM: New Relic / DataDog
  • Logging: Cloud Logging / ELK Stack
  • Alerts: Slack / Email / SMS

Implementation Roadmap​

Phase 1: MVP (2-3 months)​

  • Contract & Scope management
  • Basic budget allocation
  • Manual data entry
  • Simple reports Goal: Replace Excel tracking

Phase 2: Ads Integration (2 months)​

  • BigQuery integration
  • Campaign naming & parsing
  • Auto budget tracking
  • Real-time dashboards Goal: Auto-tracking ads performance

Phase 3: Cashflow & Payments (1.5 months)​

  • Payment milestones
  • Cashflow forecasting
  • Invoice management
  • Payment tracking Goal: Predict cashflow accurately

Phase 4: Vendor Management (1.5 months)​

  • Vendor master data
  • Vendor assignments
  • Vendor payments
  • Complete cost tracking Goal: Track full project cost

Phase 5: Advanced Features (2 months)​

  • Auto budget guard with API integration
  • Advanced analytics
  • Mobile app
  • AI-powered insights Goal: Fully automated financial management

Total: ~9-10 months to full system


Success Metrics​

Business Metrics​

  • Profit Margin Improvement: +5% trong 6 tháng
  • Cashflow Predictability: 90% accuracy trong forecast
  • Budget Overrun Reduction: <5% campaigns vượt budget
  • On-time Payment Rate: >95% invoices paid on time
  • Time Saved: -20 hours/week trên manual tracking

System Metrics​

  • Data Freshness: <4 hours lag
  • Report Generation: <5 seconds
  • System Uptime: 99.9%
  • API Response Time: <500ms p95

Support & Maintenance​

Documentation Updates​

  • Update SRS khi có major changes
  • Maintain changelog
  • Version control

Training​

  • User training cho từng role
  • Video tutorials
  • FAQ & Knowledge base

Support Channels​


Contributors​

Product Owner: [Tên] Technical Lead: [Tên] Business Analyst: [Tên] Document Author: Claude Sonnet 4.5 Last Updated: 2026-01-15


Change Log​

VersionDateChangesAuthor
1.02026-01-15Initial releaseClaude Sonnet 4.5

License & Confidentiality​

⚠️ CONFIDENTIAL

Tài liệu này chứa thông tin độc quyền của công ty. Không được chia sẻ ra bên ngoài mà không có sự cho phép.



Lưu ý quan trọng: Đây là SRS, không phải technical specification chi tiết. Khi implement, cần có thêm:

  • Technical Design Document (TDD)
  • API Specification
  • Database Schema Details
  • UI/UX Design
  • Test Plan
  • Deployment Plan

Tất cả sẽ được tạo dựa trên SRS này.