Skip to content

Commit c0eea88

Browse files
authored
refactor: soft delete subjects (#3373)
1 parent b802378 commit c0eea88

File tree

29 files changed

+2241
-1364
lines changed

29 files changed

+2241
-1364
lines changed

api/api.gen.go

Lines changed: 482 additions & 473 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/go/client.gen.go

Lines changed: 389 additions & 379 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/javascript/src/client/schemas.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9627,6 +9627,9 @@ export interface components {
96279627
* Subjects are useful when you are reporting usage events with your own database ID but want to enrich the subject with a human-readable name or metadata.
96289628
* For most use cases, a subject is equivalent to a customer.
96299629
* @example {
9630+
* "createdAt": "2025-01-01T01:01:01.001Z",
9631+
* "updatedAt": "2025-02-01T01:01:01.001Z",
9632+
* "deletedAt": "2025-03-01T01:01:01.001Z",
96309633
* "id": "01G65Z755AFWAKHE12NY0CQ9FH",
96319634
* "key": "customer-id",
96329635
* "displayName": "Customer Name",
@@ -9637,6 +9640,27 @@ export interface components {
96379640
* }
96389641
*/
96399642
Subject: {
9643+
/**
9644+
* Creation Time
9645+
* Format: date-time
9646+
* @description Timestamp of when the resource was created.
9647+
* @example 2024-01-01T01:01:01.001Z
9648+
*/
9649+
readonly createdAt: Date
9650+
/**
9651+
* Last Update Time
9652+
* Format: date-time
9653+
* @description Timestamp of when the resource was last updated.
9654+
* @example 2024-01-01T01:01:01.001Z
9655+
*/
9656+
readonly updatedAt: Date
9657+
/**
9658+
* Deletion Time
9659+
* Format: date-time
9660+
* @description Timestamp of when the resource was permanently deleted.
9661+
* @example 2024-01-01T01:01:01.001Z
9662+
*/
9663+
readonly deletedAt?: Date
96409664
/**
96419665
* @description A unique identifier for the subject.
96429666
* @example 01G65Z755AFWAKHE12NY0CQ9FH

api/openapi.cloud.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22362,9 +22362,32 @@ components:
2236222362
Subject:
2236322363
type: object
2236422364
required:
22365+
- createdAt
22366+
- updatedAt
2236522367
- id
2236622368
- key
2236722369
properties:
22370+
createdAt:
22371+
type: string
22372+
format: date-time
22373+
description: Timestamp of when the resource was created.
22374+
example: '2024-01-01T01:01:01.001Z'
22375+
title: Creation Time
22376+
readOnly: true
22377+
updatedAt:
22378+
type: string
22379+
format: date-time
22380+
description: Timestamp of when the resource was last updated.
22381+
example: '2024-01-01T01:01:01.001Z'
22382+
title: Last Update Time
22383+
readOnly: true
22384+
deletedAt:
22385+
type: string
22386+
format: date-time
22387+
description: Timestamp of when the resource was permanently deleted.
22388+
example: '2024-01-01T01:01:01.001Z'
22389+
title: Deletion Time
22390+
readOnly: true
2236822391
id:
2236922392
type: string
2237022393
pattern: ^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
@@ -22414,6 +22437,9 @@ components:
2241422437
Subjects are useful when you are reporting usage events with your own database ID but want to enrich the subject with a human-readable name or metadata.
2241522438
For most use cases, a subject is equivalent to a customer.
2241622439
example:
22440+
createdAt: '2025-01-01T01:01:01.001Z'
22441+
updatedAt: '2025-02-01T01:01:01.001Z'
22442+
deletedAt: '2025-03-01T01:01:01.001Z'
2241722443
id: 01G65Z755AFWAKHE12NY0CQ9FH
2241822444
key: customer-id
2241922445
displayName: Customer Name

api/openapi.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23285,9 +23285,32 @@ components:
2328523285
Subject:
2328623286
type: object
2328723287
required:
23288+
- createdAt
23289+
- updatedAt
2328823290
- id
2328923291
- key
2329023292
properties:
23293+
createdAt:
23294+
type: string
23295+
format: date-time
23296+
description: Timestamp of when the resource was created.
23297+
example: '2024-01-01T01:01:01.001Z'
23298+
title: Creation Time
23299+
readOnly: true
23300+
updatedAt:
23301+
type: string
23302+
format: date-time
23303+
description: Timestamp of when the resource was last updated.
23304+
example: '2024-01-01T01:01:01.001Z'
23305+
title: Last Update Time
23306+
readOnly: true
23307+
deletedAt:
23308+
type: string
23309+
format: date-time
23310+
description: Timestamp of when the resource was permanently deleted.
23311+
example: '2024-01-01T01:01:01.001Z'
23312+
title: Deletion Time
23313+
readOnly: true
2329123314
id:
2329223315
type: string
2329323316
pattern: ^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
@@ -23337,6 +23360,9 @@ components:
2333723360
Subjects are useful when you are reporting usage events with your own database ID but want to enrich the subject with a human-readable name or metadata.
2333823361
For most use cases, a subject is equivalent to a customer.
2333923362
example:
23363+
createdAt: '2025-01-01T01:01:01.001Z'
23364+
updatedAt: '2025-02-01T01:01:01.001Z'
23365+
deletedAt: '2025-03-01T01:01:01.001Z'
2334023366
id: 01G65Z755AFWAKHE12NY0CQ9FH
2334123367
key: customer-id
2334223368
displayName: Customer Name

api/spec/src/subjects.tsp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,18 @@ interface Subjects {
5959
*/
6060
@friendlyName("Subject")
6161
@example(#{
62+
createdAt: DateTime.fromISO("2025-01-01T01:01:01.001Z"),
63+
updatedAt: DateTime.fromISO("2025-02-01T01:01:01.001Z"),
64+
deletedAt: DateTime.fromISO("2025-03-01T01:01:01.001Z"),
6265
id: "01G65Z755AFWAKHE12NY0CQ9FH",
6366
key: "customer-id",
6467
displayName: "Customer Name",
6568
metadata: #{ hubspotId: "123456" },
6669
stripeCustomerId: "cus_JMOlctsKV8",
6770
})
6871
model Subject {
72+
...ResourceTimestamps;
73+
6974
// Validator doesn't obey required for readOnly properties
7075
// See: https://github.com/stoplightio/spectral/issues/1274
7176

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,8 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
19991999
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
20002000
github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s=
20012001
github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ=
2002+
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
2003+
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
20022004
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI=
20032005
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4=
20042006
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=

openmeter/ent/db/migrate/schema.go

Lines changed: 10 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)