spring.application.name=car-rental

# PostgreSQL — override via env vars or edit here
spring.datasource.url=${DB_URL:jdbc:postgresql://localhost:5432/mv_rent}
spring.datasource.username=${DB_USER:postgres}
spring.datasource.password=${DB_PASSWORD:postgres}
spring.datasource.driver-class-name=org.postgresql.Driver

spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.defer-datasource-initialization=true

# Run data.sql after Hibernate creates schema
spring.sql.init.mode=always
spring.sql.init.continue-on-error=true

# Google OAuth2 login — set real values via env vars to activate.
# Placeholders keep the app booting; Google will reject 'not-configured' until set.
spring.security.oauth2.client.registration.google.client-id=${GOOGLE_CLIENT_ID:not-configured}
spring.security.oauth2.client.registration.google.client-secret=${GOOGLE_CLIENT_SECRET:not-configured}
spring.security.oauth2.client.registration.google.scope=openid,profile,email

# Thymeleaf
spring.thymeleaf.cache=false

# File uploads (car/driver documents & photos) — configurable storage dir + limits
app.storage.location=${STORAGE_DIR:./uploads}
app.storage.url-prefix=/uploads
spring.servlet.multipart.max-file-size=${MAX_UPLOAD_SIZE:10MB}
spring.servlet.multipart.max-request-size=${MAX_UPLOAD_SIZE:10MB}

# Currency shown across the UI and PDFs. The default symbol uses a \uXXXX escape
# so the file stays ASCII-safe (₹ = the rupee sign). Override via env var.
app.currency.symbol=${CURRENCY_SYMBOL:\u20B9}
app.currency.code=${CURRENCY_CODE:INR}

# PDF currency font — a TTF that contains the rupee glyph (U+20B9). Blank disables embedding.
app.pdf.font=${PDF_FONT:classpath:fonts/DejaVuSans.ttf}

# Telematics ingest API key (GPS devices send it as the X-API-KEY header). Blank = accept all (dev only).
app.telematics.api-key=${TELEMATICS_API_KEY:}

# Email notifications — set spring.mail.host + credentials to activate. Blank host = notifications log only.
spring.mail.host=${MAIL_HOST:}
spring.mail.port=${MAIL_PORT:587}
spring.mail.username=${MAIL_USERNAME:}
spring.mail.password=${MAIL_PASSWORD:}
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
app.mail.enabled=${MAIL_ENABLED:false}
app.mail.from=${MAIL_FROM:no-reply@mvrent.local}
app.mail.admin=${MAIL_ADMIN:admin@mvrent.local}
# SMS notifications — pluggable; logs only until a provider is wired in.
app.sms.enabled=${SMS_ENABLED:false}

server.port=8080

logging.level.org.springframework.security=INFO
