Skip to content

Add referral code support to submit_invoice() #118

@Nursca

Description

@Nursca

Description
A referral system rewards users who onboard new freelancers to the platform. Adding an optional referral code field to submit_invoice() enables tracking and reward distribution without requiring a separate contract.

Requirements and context

  • submit_invoice() accepts optional referral_code: Option<BytesN<32>>
  • Store referral code on invoice struct
  • Emit referral_code in InvoiceSubmitted event (if provided)
  • Track referral counts per code in storage
  • get_referral_stats(code: BytesN<32>) -> u64 returns total invoices submitted with that code
  • Write tests for with and without referral code

Suggested execution

git checkout -b feat/referral-codes
  • Add optional field to submit_invoice()
  • Track in storage
  • Implement stats view
  • Write tests

Example commit message
feat: add optional referral code tracking to submit_invoice

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions