Files
bible/Bible-Week/BibleCanon.swift
Matheus A Silveira 80185726af Adiciona Plano Bíblia em 180 Dias com lembrete diário e ícone do app
- Leitor bíblico consumindo a API NBV (bible.falehandix.com.br): lista de
  livros por testamento e leitura de capítulos
- Plano de 180 dias com três trilhas diárias (História, Sabedoria e
  Profetas, Novo Testamento) geradas deterministicamente sobre o cânon
  embutido (1.189 capítulos, cobertura testada)
- Lembrete diário via notificação local recorrente (UNCalendarNotificationTrigger,
  identificador fixo, sem duplicatas), com pedido de autorização em contexto,
  configurações de horário/som, e deep link da notificação para a Leitura de Hoje
- Estado do plano em SwiftData: progresso, pausa/retomada, reinício e
  conclusão preservando preferências do lembrete
- 15 testes unitários (Testing) e 2 testes de UI (XCUIAutomation)
- Ícone do app a partir do logo biblia.png

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 18:54:48 -03:00

87 lines
6.6 KiB
Swift

//
// BibleCanon.swift
// Bible-Week
//
// Cânon protestante embutido (66 livros, 1.189 capítulos), espelhando
// exatamente os códigos e nomes retornados por GET /v1/books da API.
// Mantido local para o Plano de 180 Dias funcionar offline e ser testável.
//
import Foundation
enum BibleCanon {
static let books: [Book] = [
Book(code: "GEN", name: "Gênesis", testament: "OT", bookOrder: 1, chapterCount: 50),
Book(code: "EXO", name: "Êxodo", testament: "OT", bookOrder: 2, chapterCount: 40),
Book(code: "LEV", name: "Levítico", testament: "OT", bookOrder: 3, chapterCount: 27),
Book(code: "NUM", name: "Números", testament: "OT", bookOrder: 4, chapterCount: 36),
Book(code: "DEU", name: "Deuteronômio", testament: "OT", bookOrder: 5, chapterCount: 34),
Book(code: "JOS", name: "Josué", testament: "OT", bookOrder: 6, chapterCount: 24),
Book(code: "JDG", name: "Juízes", testament: "OT", bookOrder: 7, chapterCount: 21),
Book(code: "RUT", name: "Rute", testament: "OT", bookOrder: 8, chapterCount: 4),
Book(code: "1SA", name: "1 Samuel", testament: "OT", bookOrder: 9, chapterCount: 31),
Book(code: "2SA", name: "2 Samuel", testament: "OT", bookOrder: 10, chapterCount: 24),
Book(code: "1KI", name: "1 Reis", testament: "OT", bookOrder: 11, chapterCount: 22),
Book(code: "2KI", name: "2 Reis", testament: "OT", bookOrder: 12, chapterCount: 25),
Book(code: "1CH", name: "1 Crônicas", testament: "OT", bookOrder: 13, chapterCount: 29),
Book(code: "2CH", name: "2 Crônicas", testament: "OT", bookOrder: 14, chapterCount: 36),
Book(code: "EZR", name: "Esdras", testament: "OT", bookOrder: 15, chapterCount: 10),
Book(code: "NEH", name: "Neemias", testament: "OT", bookOrder: 16, chapterCount: 13),
Book(code: "EST", name: "Ester", testament: "OT", bookOrder: 17, chapterCount: 10),
Book(code: "JOB", name: "", testament: "OT", bookOrder: 18, chapterCount: 42),
Book(code: "PSA", name: "Salmos", testament: "OT", bookOrder: 19, chapterCount: 150),
Book(code: "PRO", name: "Provérbios", testament: "OT", bookOrder: 20, chapterCount: 31),
Book(code: "ECC", name: "Eclesiastes", testament: "OT", bookOrder: 21, chapterCount: 12),
Book(code: "SNG", name: "Cânticos", testament: "OT", bookOrder: 22, chapterCount: 8),
Book(code: "ISA", name: "Isaías", testament: "OT", bookOrder: 23, chapterCount: 66),
Book(code: "JER", name: "Jeremias", testament: "OT", bookOrder: 24, chapterCount: 52),
Book(code: "LAM", name: "Lamentações", testament: "OT", bookOrder: 25, chapterCount: 5),
Book(code: "EZK", name: "Ezequiel", testament: "OT", bookOrder: 26, chapterCount: 48),
Book(code: "DAN", name: "Daniel", testament: "OT", bookOrder: 27, chapterCount: 12),
Book(code: "HOS", name: "Oséias", testament: "OT", bookOrder: 28, chapterCount: 14),
Book(code: "JOL", name: "Joel", testament: "OT", bookOrder: 29, chapterCount: 3),
Book(code: "AMO", name: "Amós", testament: "OT", bookOrder: 30, chapterCount: 9),
Book(code: "OBA", name: "Obadias", testament: "OT", bookOrder: 31, chapterCount: 1),
Book(code: "JON", name: "Jonas", testament: "OT", bookOrder: 32, chapterCount: 4),
Book(code: "MIC", name: "Miquéias", testament: "OT", bookOrder: 33, chapterCount: 7),
Book(code: "NAM", name: "Naum", testament: "OT", bookOrder: 34, chapterCount: 3),
Book(code: "HAB", name: "Habacuque", testament: "OT", bookOrder: 35, chapterCount: 3),
Book(code: "ZEP", name: "Sofonias", testament: "OT", bookOrder: 36, chapterCount: 3),
Book(code: "HAG", name: "Ageu", testament: "OT", bookOrder: 37, chapterCount: 2),
Book(code: "ZEC", name: "Zacarias", testament: "OT", bookOrder: 38, chapterCount: 14),
Book(code: "MAL", name: "Malaquias", testament: "OT", bookOrder: 39, chapterCount: 4),
Book(code: "MAT", name: "Mateus", testament: "NT", bookOrder: 40, chapterCount: 28),
Book(code: "MRK", name: "Marcos", testament: "NT", bookOrder: 41, chapterCount: 16),
Book(code: "LUK", name: "Lucas", testament: "NT", bookOrder: 42, chapterCount: 24),
Book(code: "JHN", name: "João", testament: "NT", bookOrder: 43, chapterCount: 21),
Book(code: "ACT", name: "Atos", testament: "NT", bookOrder: 44, chapterCount: 28),
Book(code: "ROM", name: "Romanos", testament: "NT", bookOrder: 45, chapterCount: 16),
Book(code: "1CO", name: "1 Coríntios", testament: "NT", bookOrder: 46, chapterCount: 16),
Book(code: "2CO", name: "2 Coríntios", testament: "NT", bookOrder: 47, chapterCount: 13),
Book(code: "GAL", name: "Gálatas", testament: "NT", bookOrder: 48, chapterCount: 6),
Book(code: "EPH", name: "Efésios", testament: "NT", bookOrder: 49, chapterCount: 6),
Book(code: "PHP", name: "Filipenses", testament: "NT", bookOrder: 50, chapterCount: 4),
Book(code: "COL", name: "Colossenses", testament: "NT", bookOrder: 51, chapterCount: 4),
Book(code: "1TH", name: "1 Tessalonicenses", testament: "NT", bookOrder: 52, chapterCount: 5),
Book(code: "2TH", name: "2 Tessalonicenses", testament: "NT", bookOrder: 53, chapterCount: 3),
Book(code: "1TI", name: "1 Timóteo", testament: "NT", bookOrder: 54, chapterCount: 6),
Book(code: "2TI", name: "2 Timóteo", testament: "NT", bookOrder: 55, chapterCount: 4),
Book(code: "TIT", name: "Tito", testament: "NT", bookOrder: 56, chapterCount: 3),
Book(code: "PHM", name: "Filemom", testament: "NT", bookOrder: 57, chapterCount: 1),
Book(code: "HEB", name: "Hebreus", testament: "NT", bookOrder: 58, chapterCount: 13),
Book(code: "JAS", name: "Tiago", testament: "NT", bookOrder: 59, chapterCount: 5),
Book(code: "1PE", name: "1 Pedro", testament: "NT", bookOrder: 60, chapterCount: 5),
Book(code: "2PE", name: "2 Pedro", testament: "NT", bookOrder: 61, chapterCount: 3),
Book(code: "1JN", name: "1 João", testament: "NT", bookOrder: 62, chapterCount: 5),
Book(code: "2JN", name: "2 João", testament: "NT", bookOrder: 63, chapterCount: 1),
Book(code: "3JN", name: "3 João", testament: "NT", bookOrder: 64, chapterCount: 1),
Book(code: "JUD", name: "Judas", testament: "NT", bookOrder: 65, chapterCount: 1),
Book(code: "REV", name: "Apocalipse", testament: "NT", bookOrder: 66, chapterCount: 22),
]
/// Livros cujo `bookOrder` está no intervalo dado, em ordem canônica.
static func books(in range: ClosedRange<Int>) -> [Book] {
books.filter { range.contains($0.bookOrder) }
}
}