Skip to content

Implement Allergy Tracking #104

@llinsss

Description

@llinsss

What needs to be done:
Track pet allergies so vets know what to avoid when treating pets.

Why this matters:
Allergies can be life-threatening - this info must be easily accessible in emergencies.

Technical Details:

  • File to modify: stellar-contracts/src/lib.rs
  • What to add:
    • Enum: AllergySeverity (Mild, Moderate, Severe, LifeThreatening)
    • Struct: Allergy
    • Function: add_allergy()
    • Function: get_allergies(pet_id: u64) -> Vec<Allergy>
    • Function: remove_allergy(allergy_id: u64)

Structure:

#[contracttype]
pub enum AllergySeverity {
    Mild,
    Moderate,
    Severe,
    LifeThreatening,
}

#[contracttype]
#[derive(Clone)]
pub struct Allergy {
    pub id: u64,
    pub pet_id: u64,
    pub allergen: String,
    pub severity: AllergySeverity,
    pub symptoms: String,
    pub diagnosed_date: u64,
    pub diagnosed_by: Address,
}

**Tests to add:**
- Test adding allergy
- Test severity levels
- Test emergency access

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions