import assert from 'node:assert/strict'
import test from 'node:test'

import {
  isApplicationDocumentNo,
  isApplicationRequestLike
} from '../src/utils/documentClassification.js'

test('application document number detection supports short and legacy formats', () => {
  assert.equal(isApplicationDocumentNo('A7K3M9Q2P'), true)
  assert.equal(isApplicationDocumentNo('AP-20260525103045-ABCDEFGH'), true)
  assert.equal(isApplicationDocumentNo('APP-20260525-ABC123'), true)
  assert.equal(isApplicationDocumentNo('R7K3M9Q2P'), false)
  assert.equal(isApplicationDocumentNo('RE-20260525103045-HGFEDCBA'), false)
})

test('application request classification can rely on a short document number', () => {
  assert.equal(isApplicationRequestLike({ claim_no: 'A7K3M9Q2P' }), true)
  assert.equal(isApplicationRequestLike({ claim_no: 'R7K3M9Q2P' }), false)
})
