agmission/Development/client/src/app/partners/models/partner.model.ts

68 lines
1.6 KiB
TypeScript

import { User } from '@app/accounts/models/user.model';
import { RoleIds } from '@app/shared/global';
export interface Partner extends User {
// Partner-specific fields (extending User base fields)
partnerCode?: string; // e.g., "SATLOC", "AGIDRONEX" - unique identifier
// User base fields are inherited:
// _id, username, password, name, email, phone, kind, active, createdAt, updatedAt, etc.
}
export function createNewPartner(): Partner {
return {
_id: '0', // Required from User interface
name: '',
partnerCode: '',
email: '',
phone: '',
username: '',
kind: RoleIds.PARTNER, // Set to PARTNER role by default
active: true
};
}
// Mock data for development and testing
export const mockPartners: Partner[] = [
{
_id: '1',
name: 'AgTech Solutions Inc.',
kind: RoleIds.PARTNER,
active: true,
createdAt: new Date('2024-01-15'),
updatedAt: new Date('2024-01-15')
},
{
_id: '2',
name: 'FarmData Analytics',
kind: RoleIds.PARTNER,
active: true,
createdAt: new Date('2024-02-01'),
updatedAt: new Date('2024-02-15')
},
{
_id: '3',
name: 'Crop Monitoring Systems',
kind: RoleIds.PARTNER,
active: false,
createdAt: new Date('2024-01-20'),
updatedAt: new Date('2024-03-01')
},
{
_id: '4',
name: 'Irrigation Tech Corp',
kind: RoleIds.PARTNER,
active: true,
createdAt: new Date('2024-03-10'),
updatedAt: new Date('2024-03-10')
},
{
_id: '5',
name: 'Soil Health Innovations',
kind: RoleIds.PARTNER,
active: true,
createdAt: new Date('2024-02-20'),
updatedAt: new Date('2024-03-05')
}
];