const loyalty=require("../../app/services/loyalty/loyalty.service"),referrals=require("../../app/services/loyalty/referral.service");describe("Phase 9 loyalty policies",()=>{test("money-to-points floors incomplete units without float arithmetic",()=>expect(loyalty.calculatePurchasePoints("2499.99","1000.00",10)).toBe(20));test("purchase points respect configured maximum",()=>expect(loyalty.calculatePurchasePoints("99999.00","100.00",10,500)).toBe(500));test("referral codes are opaque and normalized",()=>{const code=referrals.code();expect(code).toMatch(/^[A-Z0-9_-]+$/);expect(code.length).toBeGreaterThanOrEqual(8);});});