"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExifResponseSchema = void 0;
exports.mapExif = mapExif;
const openapi = require("@nestjs/swagger");
const nestjs_zod_1 = require("nestjs-zod");
const date_1 = require("../utils/date");
const zod_1 = __importDefault(require("zod"));
exports.ExifResponseSchema = zod_1.default
    .object({
    make: zod_1.default.string().nullish().default(null).describe('Camera make'),
    model: zod_1.default.string().nullish().default(null).describe('Camera model'),
    exifImageWidth: zod_1.default.int().min(0).nullish().default(null).describe('Image width in pixels'),
    exifImageHeight: zod_1.default.int().min(0).nullish().default(null).describe('Image height in pixels'),
    fileSizeInByte: zod_1.default.int().min(0).nullish().default(null).describe('File size in bytes'),
    orientation: zod_1.default.string().nullish().default(null).describe('Image orientation'),
    dateTimeOriginal: zod_1.default.string().meta({ format: 'date-time' }).nullish().default(null).describe('Original date/time'),
    modifyDate: zod_1.default.string().meta({ format: 'date-time' }).nullish().default(null).describe('Modification date/time'),
    timeZone: zod_1.default.string().nullish().default(null).describe('Time zone'),
    lensModel: zod_1.default.string().nullish().default(null).describe('Lens model'),
    fNumber: zod_1.default.number().nullish().default(null).describe('F-number (aperture)'),
    focalLength: zod_1.default.number().nullish().default(null).describe('Focal length in mm'),
    iso: zod_1.default.int().nullish().default(null).describe('ISO sensitivity'),
    exposureTime: zod_1.default.string().nullish().default(null).describe('Exposure time'),
    latitude: zod_1.default.number().nullish().default(null).describe('GPS latitude'),
    longitude: zod_1.default.number().nullish().default(null).describe('GPS longitude'),
    city: zod_1.default.string().nullish().default(null).describe('City name'),
    state: zod_1.default.string().nullish().default(null).describe('State/province name'),
    country: zod_1.default.string().nullish().default(null).describe('Country name'),
    description: zod_1.default.string().nullish().default(null).describe('Image description'),
    projectionType: zod_1.default.string().nullish().default(null).describe('Projection type'),
    rating: zod_1.default.int().min(1).max(5).nullish().default(null).describe('Rating'),
})
    .describe('EXIF response')
    .meta({ id: 'ExifResponseDto' });
class ExifResponseDto extends (0, nestjs_zod_1.createZodDto)(exports.ExifResponseSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
function mapExif(entity) {
    return {
        make: entity.make,
        model: entity.model,
        exifImageWidth: entity.exifImageWidth,
        exifImageHeight: entity.exifImageHeight,
        fileSizeInByte: entity.fileSizeInByte ? Number.parseInt(entity.fileSizeInByte.toString()) : null,
        orientation: entity.orientation,
        dateTimeOriginal: (0, date_1.asDateTimeString)(entity.dateTimeOriginal),
        modifyDate: (0, date_1.asDateTimeString)(entity.modifyDate),
        timeZone: entity.timeZone,
        lensModel: entity.lensModel,
        fNumber: entity.fNumber,
        focalLength: entity.focalLength,
        iso: entity.iso,
        exposureTime: entity.exposureTime,
        latitude: entity.latitude,
        longitude: entity.longitude,
        city: entity.city,
        state: entity.state,
        country: entity.country,
        description: entity.description,
        projectionType: entity.projectionType,
        rating: entity.rating,
    };
}
//# sourceMappingURL=exif.dto.js.map