@bytebrand/export-cars 1.22.24 → 1.22.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/export-cars",
3
- "version": "1.22.24",
3
+ "version": "1.22.25",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -540,12 +540,14 @@ export class GoogleTransformer {
540
540
  }
541
541
 
542
542
  private getYear(car: DataSchemes.Car): number {
543
- // mainData.firstModelsProductionDate/constructionYear are already 4-digit years
544
- // (mobile.de "vintage"); firstRegistration/metaData.creationDate are unix timestamps
545
- // in seconds. Not every car has firstModelsProductionDate (e.g. dealer FTP imports),
546
- // so fall through to other date sources — `year` is a mandatory Google feed field.
543
+ // mainData.firstModelsProductionDate is already a 4-digit year (mobile.de "vintage").
544
+ // constructionYear/firstRegistration/metaData.creationDate are unix timestamps in
545
+ // seconds (constructionYear is stored via legacy dateToUnix, not a bare year — see
546
+ // services/scrapper/src/ai/car-bridge.ts:174). Not every car has firstModelsProductionDate
547
+ // (e.g. dealer FTP imports), so fall through to other date sources — `year` is a
548
+ // mandatory Google feed field.
547
549
  const firstModelsProductionYear = toSafeInteger(get(car, 'mainData.firstModelsProductionDate', 0));
548
- const constructionYear = toSafeInteger(get(car, 'mainData.constructionYear', 0));
550
+ const constructionYear = new Date(+get(car, 'mainData.constructionYear', 0) * 1000).getUTCFullYear();
549
551
  const firstRegistrationYear = new Date(+get(car, 'mainData.firstRegistration', 0) * 1000).getUTCFullYear();
550
552
  const metaCreationYear = new Date(+get(car, 'metaData.creationDate', 0) * 1000).getUTCFullYear();
551
553
  const currentYear = new Date().getUTCFullYear();