Default annual renewal to business created date.
Backfill null renewals from created_at and use now when create omits the date. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
92601ae729
commit
4db9c7709d
@@ -0,0 +1,5 @@
|
|||||||
|
-- Default annual renewal to business created date when unset.
|
||||||
|
|
||||||
|
UPDATE businesses
|
||||||
|
SET annual_renewal_at = created_at
|
||||||
|
WHERE annual_renewal_at IS NULL;
|
||||||
@@ -376,7 +376,7 @@ export class BusinessAdminService {
|
|||||||
slug,
|
slug,
|
||||||
annualRenewalAt: dto.annualRenewalAt
|
annualRenewalAt: dto.annualRenewalAt
|
||||||
? new Date(dto.annualRenewalAt)
|
? new Date(dto.annualRenewalAt)
|
||||||
: null,
|
: new Date(),
|
||||||
oldBusinessId:
|
oldBusinessId:
|
||||||
dto.oldBusinessId !== undefined ? BigInt(dto.oldBusinessId) : undefined,
|
dto.oldBusinessId !== undefined ? BigInt(dto.oldBusinessId) : undefined,
|
||||||
settings: toPrismaJson({
|
settings: toPrismaJson({
|
||||||
|
|||||||
Reference in New Issue
Block a user