Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export * from './src/dbScheme/notificationsChannelSettings';
export * from './src/dbScheme/membership';
export * from './src/dbScheme/userProjectsLastVisit';
export * from './src/dbScheme/plan';
export * from './src/dbScheme/promoCode';
export * from './src/dbScheme/promoCodeUsage';
export * from './src/dbScheme/project';
export * from './src/dbScheme/projectNotificationsRule';
export * from './src/dbScheme/release';
Expand Down
2 changes: 2 additions & 0 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ __exportStar(require("./src/dbScheme/notificationsChannelSettings"), exports);
__exportStar(require("./src/dbScheme/membership"), exports);
__exportStar(require("./src/dbScheme/userProjectsLastVisit"), exports);
__exportStar(require("./src/dbScheme/plan"), exports);
__exportStar(require("./src/dbScheme/promoCode"), exports);
__exportStar(require("./src/dbScheme/promoCodeUsage"), exports);
__exportStar(require("./src/dbScheme/project"), exports);
__exportStar(require("./src/dbScheme/projectNotificationsRule"), exports);
__exportStar(require("./src/dbScheme/release"), exports);
Expand Down
44 changes: 44 additions & 0 deletions build/src/dbScheme/promoCode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import type { ObjectId } from 'bson';
/**
* Promo code representation in DataBase
*/
export interface PromoCodeDBScheme {
/**
* Promo code id
*/
_id: ObjectId;
/**
* Normalized promo code value
* @example HAWK-2026
*/
code: string;
/**
* Tariff plan assigned by this promo code
*/
planId: ObjectId;
/**
* Maximum total usages count
* @example 100
*/
limit?: number;
/**
* Date after which promo code cannot be used
* @example 2026-12-31T23:59:59.000Z
*/
expiresAt?: Date;
/**
* Date when promo code was created
* @example 2026-06-10T12:00:00.000Z
*/
createdAt: Date;
/**
* Date when promo code was updated
* @example 2026-06-10T12:00:00.000Z
*/
updatedAt: Date;
/**
* User or system id that created promo code
* @example 507f1f77bcf86cd799439013
*/
createdBy: string;
}
2 changes: 2 additions & 0 deletions build/src/dbScheme/promoCode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
52 changes: 52 additions & 0 deletions build/src/dbScheme/promoCodeUsage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import type { ObjectId } from 'bson';
/**
* Promo code usage representation in DataBase
*/
export interface PromoCodeUsageDBScheme {
/**
* Promo code usage id
*/
_id: ObjectId;
/**
* Applied promo code id
*/
promoCodeId: ObjectId;
/**
* User who applied promo code
*/
userId: string;
/**
* Workspace where promo code was applied
*/
workspaceId: ObjectId;
/**
* Date when promo code was applied
* @example 2026-06-10T12:30:00.000Z
*/
appliedAt: Date;
/**
* UTM parameters captured when promo code was applied. Used for analytics purposes
*/
utm?: {
/**
* UTM source - identifies which site sent the traffic
*/
source?: string;
/**
* UTM medium - identifies what type of link was used
*/
medium?: string;
/**
* UTM campaign - identifies a specific product promotion or strategic campaign
*/
campaign?: string;
/**
* UTM content - identifies what specifically was clicked to bring the user to the site
*/
content?: string;
/**
* UTM term - identifies search terms
*/
term?: string;
};
}
2 changes: 2 additions & 0 deletions build/src/dbScheme/promoCodeUsage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
2 changes: 2 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export * from './src/dbScheme/notificationsChannelSettings';
export * from './src/dbScheme/membership';
export * from './src/dbScheme/userProjectsLastVisit';
export * from './src/dbScheme/plan';
export * from './src/dbScheme/promoCode';
export * from './src/dbScheme/promoCodeUsage';
export * from './src/dbScheme/project';
export * from './src/dbScheme/projectNotificationsRule';
export * from './src/dbScheme/release';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hawk.so/types",
"version": "0.6.0-rc.2",
"version": "0.6.1",
"description": "TypeScript definitions for Hawk",
"types": "build/index.d.ts",
"main": "build/index.js",
Expand Down
52 changes: 52 additions & 0 deletions src/dbScheme/promoCode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import type { ObjectId } from 'bson';

/**
* Promo code representation in DataBase
*/
export interface PromoCodeDBScheme {
/**
* Promo code id
*/
_id: ObjectId;

/**
* Normalized promo code value
* @example HAWK-2026
*/
code: string;

/**
* Tariff plan assigned by this promo code
*/
planId: ObjectId;

/**
* Maximum total usages count
* @example 100
*/
limit?: number;

/**
* Date after which promo code cannot be used
* @example 2026-12-31T23:59:59.000Z
*/
expiresAt?: Date;

/**
* Date when promo code was created
* @example 2026-06-10T12:00:00.000Z
*/
createdAt: Date;

/**
* Date when promo code was updated
* @example 2026-06-10T12:00:00.000Z
*/
updatedAt: Date;

/**
* User or system id that created promo code
* @example 507f1f77bcf86cd799439013
*/
createdBy: string;
}
62 changes: 62 additions & 0 deletions src/dbScheme/promoCodeUsage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import type { ObjectId } from 'bson';

/**
* Promo code usage representation in DataBase
*/
export interface PromoCodeUsageDBScheme {
/**
* Promo code usage id
*/
_id: ObjectId;

/**
* Applied promo code id
*/
promoCodeId: ObjectId;

/**
* User who applied promo code
*/
userId: string;

/**
* Workspace where promo code was applied
*/
workspaceId: ObjectId;

/**
* Date when promo code was applied
* @example 2026-06-10T12:30:00.000Z
*/
appliedAt: Date;

/**
* UTM parameters captured when promo code was applied. Used for analytics purposes
*/
utm?: {
/**
* UTM source - identifies which site sent the traffic
*/
source?: string;

/**
* UTM medium - identifies what type of link was used
*/
medium?: string;

/**
* UTM campaign - identifies a specific product promotion or strategic campaign
*/
campaign?: string;

/**
* UTM content - identifies what specifically was clicked to bring the user to the site
*/
content?: string;

/**
* UTM term - identifies search terms
*/
term?: string;
};
}
Comment thread
neSpecc marked this conversation as resolved.
Loading