infoalloggi-monorepo/apps/infoalloggi/src/schemas/public/Ordini.ts
Marco Pedone 1307f352a4 feat: enhance payment preparation logic and add rinnovo handling
- Refactor `preparePayment` function to handle multiple order types including Rinnovo.
- Introduce new `RinnovoSolver` function to calculate renewal packs based on duration.
- Add `createRinnovo` service to manage the creation of renewal orders.
- Update `whIntentSucceededHandler` to handle payment confirmations for Rinnovo and other order types.
- Introduce default conditions for packs in `prezziario.service.ts`.
- Add new utility functions for managing renewal durations and permanenza.
- Update database interactions to ensure proper handling of orders and renewals.
- Enhance error handling and logging throughout the payment and renewal processes.
2026-03-17 18:46:43 +01:00

50 lines
1.9 KiB
TypeScript

// @generated
// This file is automatically generated by Kanel. Do not modify manually.
import type { UsersId } from './Users';
import type { PrezziarioIdprezziario } from './Prezziario';
import type { ServizioServizioId } from './Servizio';
import type { default as OrderTypeEnum } from './OrderTypeEnum';
import type { default as PaymentStatusEnum } from './PaymentStatusEnum';
import type { RinnoviId } from './Rinnovi';
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
/** Identifier type for public.ordini */
export type OrdiniOrdineId = string & { __brand: 'public.ordini' };
/** Represents the table public.ordini */
export default interface OrdiniTable {
ordine_id: ColumnType<OrdiniOrdineId, OrdiniOrdineId | undefined, OrdiniOrdineId>;
userid: ColumnType<UsersId, UsersId, UsersId>;
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
packid: ColumnType<PrezziarioIdprezziario, PrezziarioIdprezziario, PrezziarioIdprezziario>;
servizio_id: ColumnType<ServizioServizioId | null, ServizioServizioId | null, ServizioServizioId | null>;
type: ColumnType<OrderTypeEnum, OrderTypeEnum, OrderTypeEnum>;
isActive: ColumnType<boolean, boolean | undefined, boolean>;
amount_cent: ColumnType<number, number, number>;
paymentmethod: ColumnType<string | null, string | null, string | null>;
paid_at: ColumnType<Date | null, Date | string | null, Date | string | null>;
intent_id: ColumnType<string | null, string | null, string | null>;
paymentstatus: ColumnType<PaymentStatusEnum | null, PaymentStatusEnum | null, PaymentStatusEnum | null>;
sconto: ColumnType<number, number | undefined, number>;
rinnovo_id: ColumnType<RinnoviId | null, RinnoviId | null, RinnoviId | null>;
}
export type Ordini = Selectable<OrdiniTable>;
export type NewOrdini = Insertable<OrdiniTable>;
export type OrdiniUpdate = Updateable<OrdiniTable>;