Files
rar-autopass/rar_automate.prg
Marius Mutu 78d21d5a38 Initial commit: baza VFP ROAAUTO + planuri migrare Web API
Arhiva clasei RarAutoPass (VFP) care declara prestatiile la RAR AUTOPASS,
ca baza pentru rescrierea ca gateway central Python/FastAPI.

Include:
- sursa VFP (.prg) + datele necesare migrarii (mapare_prestatii, prestatii_rar)
- spec-ul oficial RAR (txt)
- docs/plans/: plan-design-review + plan-eng-review
- docs/CONTEXT.md: handoff pentru continuarea in alta sesiune
- .gitignore specific Visual FoxPro (ignora artefacte compilate + credentiale)

settings.xml (cu parola de test in clar) EXCLUS; vezi settings.xml.example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 23:10:28 +03:00

55 lines
1.4 KiB
Plaintext

#DEFINE XML_PATH "C:\RAR\comenzi.xml"
#DEFINE LOG_PATH "C:\RAR\auto_log.txt"
PROCEDURE AutomateProcesare
LOCAL lcDate, llSuccess, llTestMode
llSuccess = .F.
llTestMode = .F. && Productie
lcDate = DTOC(DATE())
Try
* Export comenzi in XML
DO export_comenzi WITH XML_PATH, DATE()
* Procesare prin RAR AutoPass
loRar = CREATEOBJECT("RarAutoPass")
IF !loRar.SetCredentials(m.llTestMode) && .F. pentru productie
THIS.WriteLog("EROARE: " + loRar.ErrorMsg)
llSuccess = .F.
RETURN llSuccess
ENDIF
IF loRar.ProcessXMLComenzi(XML_PATH)
THIS.WriteLog("Procesare reu?ita pentru " + lcDate)
llSuccess = .T.
ELSE
THIS.WriteLog("EROARE: " + loRar.ErrorMsg)
llSuccess = .F.
ENDIF
Catch To loError
THIS.WriteLog("EROARE: " + loError.Message)
llSuccess = .F.
Endtry
Return llSuccess
PROCEDURE WriteLog
PARAMETERS tcMessage
LOCAL llSuccess
llSuccess = .F.
Try
STRTOFILE(;
TTOC(DATETIME()) + ": " + tcMessage + CHR(13) + CHR(10),;
LOG_PATH,;
1)
llSuccess = .T.
Catch To loError
? "Eroare scriere log: " + loError.Message
llSuccess = .F.
Endtry
Return llSuccess