@floristcloud/api-lib 1.2.225 → 1.2.226

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.
@@ -35,3 +35,4 @@ __exportStar(require("./order-external-number.constant"), exports);
35
35
  __exportStar(require("./discount-rules-pricing-type-list.constant"), exports);
36
36
  __exportStar(require("./measure-unit-limits"), exports);
37
37
  __exportStar(require("./product-resolution.constant"), exports);
38
+ __exportStar(require("./write-off-image.constant"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WRITE_OFF_IMAGE_RETENTION_DAYS = void 0;
4
+ /**
5
+ * Retention policy for write-off photos (FC-632): 90 days from the record's creation. After that a photo counts as
6
+ * unavailable — clients show «фото удалено», the export gives no link, archives skip it.
7
+ *
8
+ * This is a policy, not a storage check. The lifecycle rule on `write-offs/` deletes new photos around this time
9
+ * (with up to a day of lag), while older photos under `images/` are not deleted by it and may still be in the bucket.
10
+ */
11
+ exports.WRITE_OFF_IMAGE_RETENTION_DAYS = 90;
@@ -8,4 +8,8 @@ exports.WriteOffImageSchema = zod_1.z.object({
8
8
  url: zod_1.z.string(),
9
9
  createdAt: zod_1.z.date(),
10
10
  deletedAt: zod_1.z.date().nullable(),
11
+ // Retention policy (WRITE_OFF_IMAGE_RETENTION_DAYS), not a storage check: once expired, treat the photo as
12
+ // unavailable whether or not the file is still in the bucket. The record itself stays.
13
+ fileExpiresAt: zod_1.z.date(),
14
+ isFileExpired: zod_1.z.boolean(),
11
15
  });
package/constant/index.ts CHANGED
@@ -19,3 +19,4 @@ export * from './order-external-number.constant';
19
19
  export * from './discount-rules-pricing-type-list.constant';
20
20
  export * from './measure-unit-limits';
21
21
  export * from './product-resolution.constant';
22
+ export * from './write-off-image.constant';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Retention policy for write-off photos (FC-632): 90 days from the record's creation. After that a photo counts as
3
+ * unavailable — clients show «фото удалено», the export gives no link, archives skip it.
4
+ *
5
+ * This is a policy, not a storage check. The lifecycle rule on `write-offs/` deletes new photos around this time
6
+ * (with up to a day of lag), while older photos under `images/` are not deleted by it and may still be in the bucket.
7
+ */
8
+ export const WRITE_OFF_IMAGE_RETENTION_DAYS = 90;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.225",
3
+ "version": "1.2.226",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -6,4 +6,8 @@ export const WriteOffImageSchema = z.object({
6
6
  url: z.string(),
7
7
  createdAt: z.date(),
8
8
  deletedAt: z.date().nullable(),
9
+ // Retention policy (WRITE_OFF_IMAGE_RETENTION_DAYS), not a storage check: once expired, treat the photo as
10
+ // unavailable whether or not the file is still in the bucket. The record itself stays.
11
+ fileExpiresAt: z.date(),
12
+ isFileExpired: z.boolean(),
9
13
  });