\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/DocProperties}[2025-07-09]

% Custom document properties.
\DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}}
\DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}}
\DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}}
\DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}}
\DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}}

% Macros to insert document properties.
\NewDocumentCommand{\sTitle}{}{\makeatletter{\@title}}
\NewDocumentCommand{\sAuthor}{}{\makeatletter{\@author}}
\NewDocumentCommand{\sDate}{}{\makeatletter{\@date}}
\NewDocumentCommand{\sCustomer}{}{\makeatletter{\@customer}}
\NewDocumentCommand{\sCustomerFull}{}{\makeatletter{\@customerFull}}
\NewDocumentCommand{\sProjectNumber}{}{\makeatletter{\@projectNumber}}
\NewDocumentCommand{\sProjectDesc}{}{\makeatletter{\@projectDesc}}
\NewDocumentCommand{\sProjectTitle}{}{\makeatletter{Project \@projectNumber : \@projectDesc}}
\NewDocumentCommand{\sVersion}{}{\makeatletter{\@version}}

\let\oldAuthor\author
\let\oldTitle\title
\renewcommand{\author}[1]{%
	\oldAuthor{#1}%
	\hypersetup{pdfauthor=#1}%
}
\renewcommand{\title}[1]{%
	\oldTitle{#1}%
	\hypersetup{pdftitle=#1}%
}